Upload
nguyenanh
View
218
Download
0
Embed Size (px)
Citation preview
Experiment 4.A
Speed and Position Control
ECEN 2270 Electronics Design Laboratory 1
Procedures 4.A.0 Turn in your Pre-Lab before doing anything else
4.A.1 Speed controller for second wheel
4.A.2 Test Arduino
4.A.3 Connect power systems
4.A.4 Robot Speed Control with Arduino
Electronics Design Laboratory 2 ECEN 2270
IMPORTANT! Supply 10VDC to the Vin Arduino pin only. DO NOT apply more than 5VDC to any other pin! Applying more than 12VDC to Vin or more than 5VDC to any other pin may cause your Arduino to fail!
Electronics Design Laboratory 3 ECEN 2270
Experiment 4
A.1 Speed controller for second wheel • Experiment 2.A and Experiment 3.A & 3.B must be duplicated for the second robot
wheel. You do not need to redo the past labs complete… simply build the circuitry and test to make sure that it works (as was done for the Experiment 3 demo)
• A recommended layout is shown on the next slide.
• As with all hardware builds, an incremental approach is recommended.
• You do not need to re-design the feedback controller or re-calculate motor parameters. Use the same motor parameters and feedback controller components.
• If you have not done so, ensure that ALL integrated circuits have decoupling capacitors.
• Clean up your circuits. The battery powered system that you are transitioning to will be noisier. Long loops of wire and loose connections will cause more trouble going forward than they have in the past.
• In the report include a copy of the complete LTspice schematic and summarize any modifications you made compared to your Experiment 2/3 circuit design
Note: you are not using the Arduino board yet.
Recommended Board Layout
Electronics Design Laboratory 4 ECEN 2270
GND GND GND GND 10V 10V 5V 5V
GND 10V
10V GND
5V Linear Regulator 5V Linear Regulator
Speed Control (2 per wheel) Speed Sensor
(1 per wheel)
Encoder 1 Encoder 2
PWM 1 Vref 1 PWM 2 Vref 2
CW CC
10V GND
10V GND
B1 - Left B2 - Left
B1 - Right B2 - Right
DC1 DC2
DC1 DC2
10V GND
5V GND 5V
Encoder 1 Power Encoder 2 Power
10V from power supply
5V Generated by Arduino
Electronics Design Laboratory 5 ECEN 2270
Experiment 4
A.2 Test Arduino • It is important to make sure that you can successfully build and download code to your
Arduino before connecting it to your robot.
• Plug your Arduino into a computer, and install the latest Arduino development environment from the web. Make sure to say yes when asked if you want to install USB drivers.
• Run the blink example.
• Modify the Blink example to have the LED on for 2 seconds, and off for 0.2 seconds
• Modify the Blink example to include an external switch: blinking should stop or start depending on the external switch
• Include a copy of your code in the report
Note: your Arduino should not be connected to your robot yet.
Electronics Design Laboratory 6 ECEN 2270
Experiment 4
A.3 Connect Power Systems • The Arduino power systems are reviewed below, along with the needed connections for
your robot. Make sure to include decoupling capacitors. You may use a DC power supply for now in place of a battery pack. Review Lecture #8 slides if needed.
• In your report, include a simple schematic detailing power connection.
Power Connections Internal Power System
Electronics Design Laboratory 7 ECEN 2270
Experiment 4
A.4 Robot Speed Control with Arduino • Use the Arduino to control your
robot speed
• Test using the example speed control code
• Modify the speed control code to perform the following: • Stop, wait for the switch to be in the ON position
• Wait 1 second
• 360o clockwise rotation of the robot
• Stop and wait 1 second
• 360o counter clockwise rotation of the robot
• In the report, include a copy of your code
• With robot on the bench use scope to capture the feedback controller output signals for a single wheel (two signals total) during one execution of the loop. Include this result in your report
Recommended Pin Connections
+
_+10 V
O1
RI
RICI
CI
vs
vref
vo
Feedback Controller
output signal to measure