Converting PULSOUT command to PWM for a PWMPAL output to BOE-BOT Servos.
JackDaniels
Posts: 4
Hi there,
I can make the BoeBot practically do the Macarana with the pulsout command, but now I want to be able to process other things while the bot runs around.
I have added a PWMPAL to the mix, but what I can gather from the manuals isn't working.
I read that the PULSOUT command for the BS2 sends a 2 microsecond pulse for every number entered, ala 750 (used for full stop) is a 1500 microsecond pulse.
Translating this timing to the ontime-offtime command for the PWMPAL produces movement, not a full stop.
I also read somewhere in these forums that the PULSOUT command has a set time period of 20 milliseconds. I then tried the 1.5 milliseconds on, 18.5 milliseconds off, but it also produced movement.
Has anyone done this transition before?
JD
I can make the BoeBot practically do the Macarana with the pulsout command, but now I want to be able to process other things while the bot runs around.
I have added a PWMPAL to the mix, but what I can gather from the manuals isn't working.
I read that the PULSOUT command for the BS2 sends a 2 microsecond pulse for every number entered, ala 750 (used for full stop) is a 1500 microsecond pulse.
Translating this timing to the ontime-offtime command for the PWMPAL produces movement, not a full stop.
I also read somewhere in these forums that the PULSOUT command has a set time period of 20 milliseconds. I then tried the 1.5 milliseconds on, 18.5 milliseconds off, but it also produced movement.
Has anyone done this transition before?
JD
Comments
Servos require a control pulse roughly every 20ms or they will shut themselves down. If you read the PWMpal documentation, you'll see that the units for the on/off time are 25us. For a 1.5ms on time, the value is 1500 / 25 = 60. The 18.5ms off time gives 18500 / 25 = 740.
If you're using continuous motion servos (as it looks), they may not be calibrated for a 1.5ms stop setting. The "Robotics with the BoeBot" tutorial discusses how to adjust the servo using a short test program. You can do the same thing using the PWMpal set for a 1.5ms pulse width.
Post Edited (Mike Green) : 9/26/2008 10:45:26 PM GMT
I was also having a resetting issue with the stamp because it was plugged into a 5v dc plug.. but when I let it run on batteries it worked fine.
Thanks again.
Your duplicate thread in the Robotics Forum was removed. Please follow up in this original thread on your PWMPAL questions.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
Attaching a copy of your program would be most helpful in determining the problem.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When all else fails, try inserting a new battery.
I serin the value I want to send to the motors and serout to the pwmpal. That's it.
I have found something interesting now, and am one step closer to getting it working.
Starting with the original conversion I made from the 2 microsecond on the Stamp Pulsout command to the 25 microsecond on the pwmpal, I setup a program that cycles through all possible combinations of bits sent to the pwmpal.
I have the OffTime byte set all the time to 255 and start the ontime bit at 0.
From 0-59, the servo runs full throttle backward.
At 60, the servo is at full stop. (This on time produces a full stop no matter what the off time is)
from 61-~120, full throttle forward is produced,
from 120-255, full throttle slows down incrementally.
I have played around with the upper byte (the pwmpal actually takes two bytes for on/off) for both the on an off times, but can't get the boe-bot servos to run more slowly in the backward direction.
Has anyone used the PWMPAL to control the Boe-Bot servos to free up the Stamp to do other things?
Thanks