go staight using BS2px
I am using BS2px, and I want it to go straight. I found a strange problem.
My program is as below:
' {$STAMP BS2px}
' {$PBASIC 2.0}
counter VAR Word
FOR counter = 1 TO 244
PULSOUT 12,650
PULSOUT 13,850
NEXT
It turns right, but I think it must be straight in BS2. I also tried 650,750,850 for each wheel, and none of them works, always rotates. I am confused .
Thanks.
My program is as below:
' {$STAMP BS2px}
' {$PBASIC 2.0}
counter VAR Word
FOR counter = 1 TO 244
PULSOUT 12,650
PULSOUT 13,850
NEXT
It turns right, but I think it must be straight in BS2. I also tried 650,750,850 for each wheel, and none of them works, always rotates. I am confused .
Thanks.
Comments
Did you adjust both of your servos to stop at 750? That's the first step. Then you have to realize that it will never go perfectly straight since the servos are slightly different. You can adjust by manually slowing one down like 660,850. The BoeBot wheel encoder kit can help make it go straighter, FYI.
Please clarify what you have/haven't done and what you do/don't understand for us to help you best.
Welcome to the Parallax Forum!
The pulse duration for each PULSOUT increment in the BS2px is 0.8 us, compared with 2 us for the BS2. Therefore, to get the same pulse width from the BS2px as the BS2, the duration argument to PULSOUT has to be multiplied by 2 / 0.8 = 2.5. So try
PULSOUT 13,2375
instead of what you're currently using.
-Phil