BS2PX causing motors to run after program finishes
ptruini
Posts: 9
in BASIC Stamp
Hello,
I have an interesting problem with my BS2PX; what seems to be happening is no matter what motor driven program I code, for my robot, even Parallax example code, when the code is done running and performing it's programmed tasks; it stops for a few seconds and then the left wheel stays still and the right wheel drives forward; the speed starts slow and then gradually increases to full speed until I turn it off. All of the PULSOUT values are updated as required: 1625 to replaced 650, 2125 to replace 850 and 1875 to replace 750. This happens even on a purely basic program to just turn 90 degrees as shown below.
' {$STAMP BS2px}
' {$PBASIC 2.5}
HB25 pin 12
pulseCount VAR Word
FOR pulseCount = 1 TO 24
PULSOUT HB25,650
PULSOUT HB25,650
NEXT
My robot uses two HB25 motor controllers linked together to both run from one pin, pin 12. The reason I know the issue stems from the BS2px is because once I removed the BS2px and installed a BS2 and then modified the values for the BS2 everything thing works as expected and no extra unprogrammed spins as a result.
I know there is that issue with the BS2px where the "No BASIC Stamps found." occurs when uploading a program and I have been using the workaround to re-upload within 2 seconds, which is annoying sometimes considering my robot is over 3 feet tall and hard to hold it while trying to re-upload within the 2 seconds.
Am I missing something with the configuration or did I find another bug?
Any help would be greatly appreciated.
Paul
I have an interesting problem with my BS2PX; what seems to be happening is no matter what motor driven program I code, for my robot, even Parallax example code, when the code is done running and performing it's programmed tasks; it stops for a few seconds and then the left wheel stays still and the right wheel drives forward; the speed starts slow and then gradually increases to full speed until I turn it off. All of the PULSOUT values are updated as required: 1625 to replaced 650, 2125 to replace 850 and 1875 to replace 750. This happens even on a purely basic program to just turn 90 degrees as shown below.
' {$STAMP BS2px}
' {$PBASIC 2.5}
HB25 pin 12
pulseCount VAR Word
FOR pulseCount = 1 TO 24
PULSOUT HB25,650
PULSOUT HB25,650
NEXT
My robot uses two HB25 motor controllers linked together to both run from one pin, pin 12. The reason I know the issue stems from the BS2px is because once I removed the BS2px and installed a BS2 and then modified the values for the BS2 everything thing works as expected and no extra unprogrammed spins as a result.
I know there is that issue with the BS2px where the "No BASIC Stamps found." occurs when uploading a program and I have been using the workaround to re-upload within 2 seconds, which is annoying sometimes considering my robot is over 3 feet tall and hard to hold it while trying to re-upload within the 2 seconds.
Am I missing something with the configuration or did I find another bug?
Any help would be greatly appreciated.
Paul
Comments
When in doubt check the manual.
https://www.parallax.com/downloads/hb-25-motor-controller-product-documentation
Notice the timing diagram on page 3 and the note at the bottom of the page.
You need to add PAUSEs or delay loops to your program so you meet the timing requirements.
-Phil
https://www.parallax.com/sites/default/files/downloads/570-00080-Motor-Bracket-Wheel-Kit-Guide-v1.2.pdf