Download presentation
Presentation is loading. Please wait.
Published byVincent Lang Modified over 8 years ago
1
PROMGRAMING YOUR ROBOT How Servos Work: How to control your robot
2
Powering the Servo Pulses Electric Power Mechanical Power high low Low: 0 volts No power High: 0 volts Power Supplied
3
Width of High Pulse Direction of movement Range: 1ms – 2ms. Full Speed: 1ms: clockwise. Forward for right wheel and backwards for left wheel. 2ms: anticlockwise. Backwards for right wheel and forward for left wheel. Partial Speeds: 1.1ms – 1.4ms: clockwise. Forward for right wheel and backwards for left wheel. 1.6ms – 1.9ms: anticlockwise. Backwards for right wheel and forward for left wheel. Full Stop 1.5ms
4
Illustration Full Speed Right wheel High Pulse Width: 1.0ms Right wheel High Pulse Width: 2.0ms Left wheel High Pulse Width: 2.0ms Left wheel High Pulse Width: 1.0ms
5
Illustration Medium Speed Right wheel High Pulse Width: 1.25ms Right wheel High Pulse Width: 1.75ms Left wheel High Pulse Width: 1.75ms Left wheel High Pulse Width: 1.25ms
6
Illustration Low Speed Right wheel High Pulse Width: 1.1ms Right wheel High Pulse Width: 1.9ms Left wheel High Pulse Width: 1.9ms Left wheel High Pulse Width: 1.1ms
7
Width of Low Pulse Pause Duration Right Wheel High Pulse Width = 1.25ms Low Pulse Width = 2seconds
8
Commands Reset (to low pulse) ‘low port#’ Example: ‘low 12’ sets p12 to output low Compulsory at the beginning of every program Set high pulse width ‘pulsout port#, value’ Values range from 500 – 1000. 500 = 1ms, 1000 = 2ms Example: ‘pulsout 12, 500’ send 1ms pulses to p12
9
Commands Pause ‘pause time (ms)’ Example: ‘pause 20’ waits for 20ms after each full wheel spin Loops ‘goto loop name ’ Starts from the command line after loop Example: ‘goto loop’ looks for the ‘loop:’ in the program and repeats the commands from that point
10
Example Program
11
Running the Program Name the program descriptively and save it Click the file menu Select save (or save as) Type in the file name and make sure the file type is *.bs2 Run the Program Click ‘Run’ Select Run’ Make sure the wheel is turning as commanded
12
Now Your Turn Make both wheels turn
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.