electronics design¶
Group Assignment¶
- Use the test equipment in your lab to observe the operation of a microcontroller circuit board (as a minimum, you should demonstrate the use of a logic analyzer)
- Document your work on the group work page and reflect what you learned on your individual page
Group Assignment¶
- Use an EDA tool to design a development board that uses parts from the inventory to interact and communicate with an embedded microcontroller
Additional Personal Goals¶
| Goal | Resource | Notes |
|---|---|---|
| Learn Markdown | website | finding non-basic videos |
Added Unexpected Bonus¶
learned to make addddsdsd:¶
Claude results on Animated Gif creation From video:
- Online tools - Upload a video to sites like ezgif.com, giphy.com/create, or imgflip.com/gif-maker. Trim the clip, adjust speed, add text if you want, then download.
The Work¶
Stepper Motors¶
Website [Tutorial(https://howtomechatronics.com/tutorials/arduino/stepper-motors-and-arduino-the-ultimate-guide/#google_vignette)] from Tom Dubick
Key Learnings - Current Limiting: make sure your motor driver current rating is equal to or higher than your motor so that you dont burn up the driver. If it is lower, the motor will be limited on how fast it can go. - to protect the driver from current spikes. power suply 8-36V then use a decoupling capacitor atlest 47uF microFarads capacity - two phases on motor - one set goes to 1A ansd 2A pins. The other goes to 2A and 2B pins ( to find the phase pair use the multimeter and then check for continuity. If you find the phase, you will heere a beep becasue the two wires are connected.) - DRV8825 might be easier to use. has higher 1.5 A and can be measured easier (current limit = Vref x 2).
A4988 Motor Driver Pins (1 Amp Max):
- 1A ansd 2A pins. The other goes to 2A and 2B pins
- power for pins (3 to 5V) from controller
- power for motor (5V + external power supply)
- STEP and DIRECTION pins (each pulse we send to the Step pin, the motor will advance one step in the selected direction.)
- Sleep and the Reset pins (both of these pins are active low) Sleep pin by default is HIGH state, but the RST pin is floating. To have the driver enabled connect these two pins to each other, If not using these pins functions.
- Enable pin is also active low, so unless if not HIGH, the driver will be enabled.
- MS1,2,3 are for microstepping - energizing coils at intermediate locations to get more steps and smaller steps.
Current Limiting: - adjusting the trimmer potentiometer - Clockwise - limit rises. - Mathod One: - measuring the reference voltage across the potentiometer itself and GND using a multimeter (in ammeter mode), and use that value in the following formula to calculate the current limit of the driver: - Current Limit = Vref / (8 x Rcs) - The Rcs is the current sense resistance or the values of the current sensing resistors located right next to the chip. Depending on the manufacturer, these values are usually 0.05, 0.1 or 0.2 ohms. - Method Two: directly measure the current through the coils - connect the stepper motor and the driver, skip the controller connections (except for the 3.3/5v power and ground using here), but instead connect micro controller power/3.3V/5V to the Direction and the Step pins (the motor stays active and holds one position). - connect the - disconnect one line or coil from the motor, and connect it in series with an ammeter. - When the driver is powered with both the logic voltage, the 5V, and the power for the motor (maybe 12V depending - know your voltage) then read how much current is running through the coil.
Stepper Programming
Can be done with or without library.
// defines pins
#define stepPin 2
#define dirPin 5
void setup() {
// Sets the two pins as Outputs
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
AccelStepper library - install from library manager
Define your motors - Basic example code for controlling a stepper with the AccelStepper library by Dejan
#include <AccelStepper.h>
// Define the stepper motor and the pins that is connected to
AccelStepper stepper1(1, 2, 5); // (Typeof driver: with 2 pins, STEP, DIR)
AccelStepper stepper2(1, 3, 6);
void setup() {
// Set maximum speed value for the stepper
stepper1.setMaxSpeed(1000);
}
void loop() {
stepper1.setSpeed((analogRead(A0));
// Step the motor with a constant speed previously set by setSpeed();
stepper1.runSpeed();
}
Wifi Communication with ESP32-C6¶
Help from Adriann Torres in GLobal Help Saturday and a couple other people.. i was not fast enough to get the names i should have screen shotted the chat