Turn the robot for 180 degree
heavy-freelancer
Posts: 23
Hey,
I want to turn my Boe-Bot for 180 degree so if he was going ahead he will turn left and continue moving.
My problem here is I can't control the angle of rotation of my robot.
This is my code :
myVar VAR Word
Begin:
DEBUG "Ahead",CR
FOR myVar = 0 TO 500
PULSOUT 13,850
PULSOUT 12,650
PAUSE 1
NEXT
DEBUG "Return",CR
FOR myVar = 0 TO 500 ' The problem is here my friends (500)
PULSOUT 13,650
PULSOUT 12,650
PAUSE 1
NEXT
GOTO Begin
In this case the robot rotate for anonymous degree.
What do you suggest for this problem.
Thanks
I want to turn my Boe-Bot for 180 degree so if he was going ahead he will turn left and continue moving.
My problem here is I can't control the angle of rotation of my robot.
This is my code :
myVar VAR Word
Begin:
DEBUG "Ahead",CR
FOR myVar = 0 TO 500
PULSOUT 13,850
PULSOUT 12,650
PAUSE 1
NEXT
DEBUG "Return",CR
FOR myVar = 0 TO 500 ' The problem is here my friends (500)
PULSOUT 13,650
PULSOUT 12,650
PAUSE 1
NEXT
GOTO Begin
In this case the robot rotate for anonymous degree.
What do you suggest for this problem.
Thanks
Comments
The boe-bot's servos are not precision devices and each one is a bit different so there is no "right" value to put in.
Also the pause in your loop should be 20. There should be 20ms between pulses.
Jim
Anybody else care to chime in here?
Captain Obvious
A couple of things, if I may...
Your "PAUSE 1" needs to be "PAUSE 20 for the servos to operate correctly.
Then... to execute a turn, the value of 500 seems =awfully= high. While no two 'bots work exactly the same, I've found a value of ~22 works for a two wheel 90 degree turn and ~43 works for a 180 degree turn. To pivot with one wheel stationary, ie PULSOUT x, 750, just double those numbers.
HTH,
Amanda
Wow! That there's some fancy servos that need to be refreshed fifty thousand times a second!
Rich H