Erratic Behaviour with Servo
Zackary
Posts: 10
Problem: (See title)
Description: Servo behaves irratically. Sometimes it moves step, step, step, step, but then it goes crazy. Step, step, dies. (Long wait) Step, craziness etc.
Equipment
- PIC16F877A
- Parallax continuous servo
- Coding in assembly (with MPLab)
- 5 V on everything (except the microcontroller)
Could it be a faulty servo? Umm, I was new with servos, so I tapped the signal wire to power (5 V), to see what would happen. Could that have killed it? I also turned the servo by hand. Could that damage the unit?
I should mention my pseudocode:
Initialize
For inifinity
_____For 4 times
_________Pulse servo for 1.25 ms
_________Wait 18 ms
_____Pause for a second
_____For 4 times
_________Pulse servo for 1.75 ms
_________Wait 18 ms
_____Pause for a second
Repeat
Sorry about "hijacking" the other thread. Newbie.
Thanks to Mr. Baker. I'll try it out when I get home.
So if I keep pulsing it at say 1.25 ms with 20ms width, will it move to a constant position or will it rotate·with a constant speed?
Description: Servo behaves irratically. Sometimes it moves step, step, step, step, but then it goes crazy. Step, step, dies. (Long wait) Step, craziness etc.
Equipment
- PIC16F877A
- Parallax continuous servo
- Coding in assembly (with MPLab)
- 5 V on everything (except the microcontroller)
Could it be a faulty servo? Umm, I was new with servos, so I tapped the signal wire to power (5 V), to see what would happen. Could that have killed it? I also turned the servo by hand. Could that damage the unit?
I should mention my pseudocode:
Initialize
For inifinity
_____For 4 times
_________Pulse servo for 1.25 ms
_________Wait 18 ms
_____Pause for a second
_____For 4 times
_________Pulse servo for 1.75 ms
_________Wait 18 ms
_____Pause for a second
Repeat
Sorry about "hijacking" the other thread. Newbie.
Thanks to Mr. Baker. I'll try it out when I get home.
So if I keep pulsing it at say 1.25 ms with 20ms width, will it move to a constant position or will it rotate·with a constant speed?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
With a modded servo (to continous rotation) then the speed of rotation is determined by the pulse width. A constant pulse width = constant speed. Larger PW = faster constant speed.
Turning it by hand shouldn't be a problem, if the power is off.
Rick
I've tried the suggestions. The pseudocode reads
Loop
____Set servo pin high
____Delay 1.25 ms
____Set servo pin low
____Delay 18.75 ms
____Repeat
It still behaves erratically. (See above)
I find it hard to debug, because
a) I have never had a working servo before, so I don't know what to look for
b) I can't see a pulse that's 20 ms long (and only high for a fraction of that) [noparse]:)[/noparse]
Debugging Attempts
1) I connect the servo pin to an LED
- I know its brightness when at a constant 5 V
- so I assumes it's pulsing when the LED is slightly less bright
2) I also have a counter IC so I can verify that it is pulsing
What I know
- how a servo works (from what I read from http://forums.parallax.com/forums/default.aspx?f=6&m=104381 )
- that the servo I have "works" (i.e. if I tap the signal wire to power, I can make the servo move)
I've tried the suggestions. The pseudocode reads
Loop
____Set servo pin high
____Delay 1.25 ms
____Set servo pin low
____Delay 18.75 ms
____Repeat
It still behaves erratically. (See above)
I find it hard to debug, because
a) I have never had a working servo before, so I don't know what to look for
b) I can't see a pulse that's 20 ms long (and only high for a fraction of that) [noparse]:)[/noparse]
Debugging Attempts
1) I connect the servo pin to an LED
- I know its brightness when at a constant 5 V
- so I assumes it's pulsing when the LED is slightly less bright
2) I also have a counter IC so I can verify that it is pulsing
What I know
- how a servo works (from what I read from http://forums.parallax.com/forums/default.aspx?f=6&m=104381 )
- that the servo I have "works" (i.e. if I tap the signal wire to power, I can make the servo move)
Thanks in advance!