Presentation is loading. Please wait.

Presentation is loading. Please wait.

Controlling the Outside World

Similar presentations


Presentation on theme: "Controlling the Outside World"— Presentation transcript:

1 Controlling the Outside World
Servo Motor

2 Servo motor A feedback controlled motor
The Parallax standard servo motor has built in feedback Range of motion is limited Parallax also supplies continuous servo motors for robotic applications but… This is not a continuous servo! That is, it will not go 360º It will hit “stops” at either direction around

3 The servo motor

4 Wiring the servo motor You can wire up the servo on the proto board as shown in the schematic… …but, there’s an easier way

5 Wiring the servo motor

6 Wiring the servo motor The X4 and X5 connectors are designed to control the servo motors But, the power source must be set via the jumper connector

7 Power Check your power source!
If using a DC power blocks, it may be 9V or it may be 6V Set the Vdd/Vin jumper as specified Vdd if using a 9V source (or 9V battery) Vin if using a 6V source Power switch must be in position 2 to send power to the X4/X5 (servo) connectors

8 How it works To light up an LED we send a continuous, level signal (DC voltage) 5v HIGH pin voltage 0v time

9 Controlling the servo To move the servo horn we send a pulse train
1.5ms 1.5ms 5v voltage 0v 20ms Time (in milli-seconds)

10 Controlling the servo The pulse width will control the location of the servo The time between pulses should be 20 milli-seconds

11 From PBASIC PULSOUT command PULSOUT pin, duration
pin is the pin number to which your servo is wired (12, 13, 14, or 15 if you are using the servo ports on the RevC board) duration is the pulse width

12 PULSOUT command details
The duration parameter is in units of 2μS (2 micro-seconds) The servo prefers values in units of milli-seconds The time between pulses is under software control (PAUSE command – units of milli-seconds)

13 Activity – in class Test the servo
Test all 4 servo ports Find the values of the duration parameter (in the PULSOUT command) that cause the servo to hit the stops in both the clockwise and counter-clockwise directions

14 Homework Design a system that continually moves the servo from one stop to the other That is, it goes from full counter-clockwise to full clockwise and back again, continuously Add two buttons to the board (B1 and B2) B1 is the emergency stop (EStop) When it is pressed all servo motion stops B2 is the reset button When it is pressed the servo motion begins again Add two LEDs The red LED lights when the servo is all the way clockwise The green LED lights when the servo is all the way counterclockwise Both LEDs are off (not lit) when the servo is somewhere between clockwise and counterclockwise The servo should not “slam” into the stops

15 Deliverables A state-machine diagram depicting the operation of the system Source code A schematic diagram of the circuit A working demonstration on the Basic Stamp development board (in class)


Download ppt "Controlling the Outside World"

Similar presentations


Ads by Google