Robot going backwards-help please
I purchase the Board of Education Development Board (USB), and
the 7.2V Motor, Bracket and Wheel Kit. I hook everything up added a
h-bridge and i still cannot get my robot to run backward. Here is the program I am using
' Robotics with the Boe-Bot - ForwardLeftRightBackward.bs2
' Move forward, left, right, then backward for testing and tuning.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running!"
counter VAR Word
FREQOUT 4, 2000, 3000 ' Signal program start/reset.
FOR counter = 1 TO 6 ' Forward
PULSOUT 11, 850
PULSOUT 13, 450
PULSOUT 5, 850
PULSOUT 6, 450
PAUSE 20
NEXT
'PAUSE 4000
FOR counter = 1 TO 6 ' Backward
PULSOUT 11, 450
PULSOUT 13, 850
PULSOUT 5, 450
PULSOUT 6, 850
PAUSE 20
NEXT
END
FOR counter = 1 TO 24 ' Rotate left - about 1/4 turn
PULSOUT 11, 450
PULSOUT 13, 450
PULSOUT 5, 450
PULSOUT 6, 450
PAUSE 20
NEXT
PAUSE 4000
FOR counter = 1 TO 24 ' Rotate right - about 1/4 turn
PULSOUT 11, 850
PULSOUT 13, 850
PULSOUT 5, 850
PULSOUT 6, 850
PAUSE 20
NEXT
PAUSE 4000
Please help
the 7.2V Motor, Bracket and Wheel Kit. I hook everything up added a
h-bridge and i still cannot get my robot to run backward. Here is the program I am using
' Robotics with the Boe-Bot - ForwardLeftRightBackward.bs2
' Move forward, left, right, then backward for testing and tuning.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running!"
counter VAR Word
FREQOUT 4, 2000, 3000 ' Signal program start/reset.
FOR counter = 1 TO 6 ' Forward
PULSOUT 11, 850
PULSOUT 13, 450
PULSOUT 5, 850
PULSOUT 6, 450
PAUSE 20
NEXT
'PAUSE 4000
FOR counter = 1 TO 6 ' Backward
PULSOUT 11, 450
PULSOUT 13, 850
PULSOUT 5, 450
PULSOUT 6, 850
PAUSE 20
NEXT
END
FOR counter = 1 TO 24 ' Rotate left - about 1/4 turn
PULSOUT 11, 450
PULSOUT 13, 450
PULSOUT 5, 450
PULSOUT 6, 450
PAUSE 20
NEXT
PAUSE 4000
FOR counter = 1 TO 24 ' Rotate right - about 1/4 turn
PULSOUT 11, 850
PULSOUT 13, 850
PULSOUT 5, 850
PULSOUT 6, 850
PAUSE 20
NEXT
PAUSE 4000
Please help
Comments
FOR counter = 1 TO 6 ' Forward
PULSOUT 11, 850
PULSOUT 13, 450
PULSOUT 5, 850
PULSOUT 6, 450
PAUSE 20
NEXT
PAUSE 4000
FOR counter = 1 TO 6 ' Backward
PULSOUT 11, 450
PULSOUT 13, 450
PULSOUT 5, 850
PULSOUT 6, 850
PAUSE 20
NEXT
PAUSE 4000
FOR counter = 1 TO 24 ' Rotate left - about 1/4 turn
PULSOUT 11, 450
PULSOUT 13, 450
PULSOUT 5, 450
PULSOUT 6, 450
PAUSE 20
NEXT
PAUSE 4000
FOR counter = 1 TO 24 ' Rotate right - about 1/4 turn
PULSOUT 11, 850
PULSOUT 13, 850
PULSOUT 5, 850
PULSOUT 6, 850
PAUSE 20
NEXT
PAUSE 4000
To help, we need info on how to switch your H-bridge. Do YOU know how?
Second, six times through a FOR..NEXT loop that takes only ~25 milliseconds to execute does not give enough time to do anything useful. You have the motors moving forward and backward for only 1/6th of a second.
Lastly, I don't think PULSOUT is what you need to drive your H Bridges. Look at the PWM command.
Rich H