servos w/ pwm
Jiggs
Posts: 26
I have two continuous rotation servos (the ones sold from Parallax). I've been going crazy trying to get them to run properly. All I want to do is have them off initially, than have them rotate (at this point, I've stopped caring which direction they turn) for three seconds, then stop again. I would be truly grateful if someone could show me how to achieve this seemingly simple task.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
~Jiggs
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
~Jiggs
Comments
Both servos are initialized with this line:
Of course the variable name and pin number are changed for the right servo.
Does anyone have any ideas?
Thanks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
~Jiggs
http://groups.yahoo.com/group/javelinstamp/files/Jon%20Williams%20Class%20Files/
and get file BOE-BOT line follow.
It has some code to control servos that may
be an example to you how to use pwm().
regards peter
·
I suppose I could hook an oscilliscope up to the PWM out pin on my javelin and see if it is sending correctly timed pulses.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
~Jiggs
While investigating my servo mystery, I made a rather unusual discover. See, after observing the behavior of the servo on a duty cycle of 220,2304 I though that perhaps the Javelin was constantly resetting itself, as if it were underpowered (ie. the servo drew more power than was available, which would cause the Javelin to reset). To test my theory, I wrote a very simple program to initialize the servo and print "hi" in the message window.
The result was very interesting. The servo exhibited the same behavior of intermittent on-off, and the Javelin failed to write anything to the message window. However, I unplugged the servo with the Javelin on, and, low and behold, "hi" popped onto the screen. So, it seems to me that the power supply on my Demo Board is failing. Does anyone else have an idea as to what might be going on here?
Thanks again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
~Jiggs
I dont know that I can help but I am having a similar experience!
I too have two servo's to run a small robot.· The wiring is ok as it works perfectly with a Basic Stamp2.
Using the ServoControl.java app which comes with the IDE, if I use "c" to center the servo, all is ok.· However when I use "r" or "l" to move forwards/backwards the javalin resets (the message window shows the help initial screen).
I am using a 9V battery to the VDD pin.
Only other bit of info is the javalin runs quite hot!
Any help would be appriatated!!!!!
james
Solved it (at leased for me!).··Run the Javalin off one powersupply, I am now using a 12V supply - and the servo's from another - Im using 4 * AA Nicads.· Found the voltage drop when running one psu and splitting via regulator to include a 5v feed.
Solves the problem.
James
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
~Jiggs