Servo and BS2P
Newzed
Posts: 2,503
I'm having a bit of a problem running my servo from a BS2P.· I remember the duration of the pulsout has to be increased because of the .8us unit of duration.· Is there anything else?
Sid
Sid
Comments
Shawn Lowe
That will force the pin low so that later PULSOUT instructions will go low-high-low as required by the servo.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
When I send a command to run the servo, it just moves a tiny bit.· By putting in a bunch of debugs I was able to determine that it is acting as if it were resetting the Stamp.· I put a 470uf cap across the servo power leads but that didn't help.· I can try to run the servo in either direction but it always moves that tiny bit, and always in the same direction.
I commented out the servo instructions, hooked an LED from the servo command line to ground, removed the servo, took the servo line high for 2 secs, then low, and everything worked perfectly.
Here is a snippet of code from the bank that runs the servo:
pos = 750······ 'same as 600 on a BS2
SEROUT lcd, baud1,10, [noparse][[/noparse]"A", "Running 1",13]
low serv1
FOR com = 1 TO 101
PULSOUT serv1, pos····· ·'Goes beserk right here
STOP
PAUSE 20
pos = pos + 2
NEXT
SEROUT lcd, baud1, 10, [noparse][[/noparse]"C", "Enter command",13]
PAUSE 100
com = 1
RUN 0
I inserted the STOP after the PULSOUT command but it had no effect.
The program just jumped back to the very beginning of Bank 0 as soon as the servo twitched.
Hope you see something - if nothing else I can go back to the BSE and see if·everything still works.· I'll have to switch the clock bank back to a [url=mailto:D@1302]DS1302[/url].
Sid
Is your power supply OK ?? Do you have too many 'consumers' in your system ??
Regards,
Klaus
Sid
Just as a test, try pulling the servo power lead off of the Stamp carrier board (presuming that's where it's getting its power) and run it from a battery instead. Make sure to add a common ground path. I think it will work with a dual power set-up.
If it still fails, the servo may be mechanically jamming and comsuming large amounts of current. Something as simple as bound up gears can cause that kind of thing to happen.
The old trick of putting DEBUG "Starting" at the head of the program is always helpful. If you see it displayed more than once you know the Stamp is being reset.
Regards,
Bruce
Sid