servo moving when it isn't suppose to ??!?!
trend
Posts: 112
I am having a weird issue with my parallax servo motor.
good:
1) I can position the servo motor anywhere I want.. (so I know the servo is
good)
bad
2) but, if I only have + and - plugged in, the servo goes all the way
clockwise until it hits the limit/stop and starts twitching and holding· /edit/--- We fixed this issue.. it was a wiring issue /edit/
3) and another weird issue is, I have a couple relays on my board, and when
I open up one of the relays (or maybe any of them) the servo moves to a
different position.. I close the relay, the servo moves to another position,
and on and on (each position is ~10degrees appart).························/edit/--this is still an issue /edit/
My code is VERY clean
/start of code
mtr pin 12
high mtr··············· (servo moves) (this should only close the relay that is connected to pin12)
pause 450
low mtr··············· (servo moves·20percent of the time) (this should only open the relay connected to pin12)
/end of code
/edit/ I deleted some of my posts below that related to servo twitching.. because it was just confusing to soooo many peolpe/edit/
thanks-Lee
Post Edited (trend) : 1/6/2005 11:39:52 PM GMT
good:
1) I can position the servo motor anywhere I want.. (so I know the servo is
good)
bad
2) but, if I only have + and - plugged in, the servo goes all the way
clockwise until it hits the limit/stop and starts twitching and holding· /edit/--- We fixed this issue.. it was a wiring issue /edit/
3) and another weird issue is, I have a couple relays on my board, and when
I open up one of the relays (or maybe any of them) the servo moves to a
different position.. I close the relay, the servo moves to another position,
and on and on (each position is ~10degrees appart).························/edit/--this is still an issue /edit/
My code is VERY clean
/start of code
mtr pin 12
high mtr··············· (servo moves) (this should only close the relay that is connected to pin12)
pause 450
low mtr··············· (servo moves·20percent of the time) (this should only open the relay connected to pin12)
/end of code
/edit/ I deleted some of my posts below that related to servo twitching.. because it was just confusing to soooo many peolpe/edit/
thanks-Lee
Post Edited (trend) : 1/6/2005 11:39:52 PM GMT
Comments
The code you supplied is not servo control code. Download What's a Microcontroller·and review the servo chapter. Or, take a look at the servo control in Understanding Signals.
Servos need a 1-2 ms pulse with a 15-40 ms pause (low), sent repeatedly. Try this code for starters, varying the PULSOUT value between 500 and 1000 to see how the servo responds.
Start:
· PULSOUT mtr, 750
· PAUSE 20
· GOTO Start
What you are sending is a single HIGH for·450 ms followed by a low with nothing else.
But you mention that you can "position the servo anywhere you want" which has me confused. With the code you provided? Manually, without power connected by turning the horn? Please explain.
Take a look at the What's a Microcontroller chapter on servo control. It will help a bunch.
Ken Gracey
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
The servo is hooked to pin 9. The program controlls pin 12. Huh?
Perhaps it was only a typo, or perhaps you need to review your connections.
Jim
Post Edited (Jim McCorison) : 1/4/2005 4:01:15 PM GMT
By default stamp pins are inputs and the servo will pick up interference from the relay and/or motor.
' {$STAMP BS2p}
' {$PBASIC 2.5}
mtr pin 12··············· 'pin 12 is hooked up to a relay
low 9
high mtr
pause 450
low mtr
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Knight Designs
324 West Main Street
P.O. Box 97
Montour Falls, NY 14865
(607) 535-6777
Business Page:·· http://www.knightdesigns.com
Personal Page:··· http://www.lightlink.com/dream/chris
Designs Page:··· http://www.lightlink.com/dream/designs
·
The dc motors are rated at 6v ~4amps.. my power supply is rated at 6v 6amps.
Would this cause a problem because of power supply variance? and would Bean's idea of setting the pin low for the servo still work?
thanks! Lee
didn't know parallax made big motor servos
So I think Jon was right with the power supply variance beecause of the powerful motors...hmm..
Could it be easy to fix this? with caps I assume.
Would I be right about assuming the twitching from these lines?
side note..
I·am using·a parallax standard servo:
http://www.parallax.com/detail.asp?product_id=900-00005
I cannot find anywhere in the documents how many mA this servo requires.. Do you'll have any idea what the max is?
thanks-Lee
Post Edited (trend) : 1/4/2005 10:44:15 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
my code:
top:
pulsout 9, 800
pause 27
goto top
and the servo works great.
The issue I was dealing with was interference dealing with running my big DC motor (off the relays).
That or the issue was dealing with wiring interference.. Hopefully I will know tomorrow.
thanks for all the support guys
Lee
Yes it is normal for a servo to twitch when you only have + & - attached. -bugg
So now I am just left with...
My servo moves to a different position 95percent of the time when my relays (the relays for a very hihg power DC motor 6v 4or so amps).· The servo always moves atleast once when I close the relay.. Sometimes 2 times (once when I close the relay and once when I open the relay).
This is only the case when I have +, -, and signal hooked up.. When I disconnect signal connection, the servo is steady as a rock no matter what else is going on.. So this leads me to believe that the bs2 is outputting voltage on the servo line (even thought it isn't suppose to do anything to that pin.. besides bring it low).· I verified this with a voltage meter.· I saw spikes of electricity when I·close the relays.
Also, all of this only happens when the DC motor is hooked up to my board.
Do you'll have any ideas?
All I am doing is closing the relay for 450ms.. and this causes the issue.
thanks! Lee
Bean.
thanks Bean!
Lee
Also, my designer mentioned a .1uf cap on the signal line, then going to ground (close as I can to the servo).. I have never heard of this before.. but have seen similiar on dc motors, why doesn't this smooth out the pulsouts, so the servo will not receive signals from the bs2?
thanks guys! Lee
When you de-energize a coil the magnetic field callapses which generates voltage in the coil (because it's a magnetic field moving through a coil of wire = generator).
The cap is just treating the symptom not the disease.
Bean.