View Full Version : HS-55 Servo problematic movement.

03-24-2009, 10:26 AM
Hello All you Roboteers,
Hey there guys...I have an HS-55 question too big to fit in the title. I have background information then my questions.

I started with a NerdKit (http://www.nerdkits.com/). Atmel AVR 168 microcontroller.

I have written some control code that seems to work(to a point) for controlling the servo. I am VERY new at robotics but into learning fast. Computer Science by major.

I don't know if I am reading the spec sheet 100% correctly yet(http://www.rctoys.com/pdf/hitec-servos/HIT-HS55.pdf).

It seems like the servo has a range of 1.1-1.9 ms pulse. I interpret this because the spec sheet says 1500us(1.5ms) neutral and 40degree 400us one side pulse travelling. I read this to state that the servo has a total 80degree total movement.

I know,from general reading, that there's generally a window in which the pulse should be sent 10ms-20ms.

I plan to use a 15ms window and send my control pulse every 15ms when I get to implementing timers. I hear that hobby servos are pretty forgiving in terms of the window.

I created a test program.
I send 3 pulses 3 seconds apart just to test movement. One pulse at 1.1ms(left most). Wait 3 seconds. One pulse at 1.5ms(center). Wait 3 seconds. And One pulse at 1.9ms(right most). All of this assumes that my interpretation of the spec sheet was right.

What I noticed was that the overall movement of the servo is not matching what it should. The "left" movement moves much smaller than 40degrees. The "center" movement hardly moves the servo at all from the "left" movement. The "right" movement moves similar distance to the "left" but in the right direction. In total all the movements are much smaller than they should be.
My code: (http://pastebin.com/f132cfa09)

I dont know how the mechanics of the servo "window" work. Nor was I able to read anything about it for this specific servo from the spec sheet.

I currently dont conform my pulses to fit within a full "window" increment. I just wait 3 seconds. Do I need to send my pulses in perfect window increments? Or is the window simply the smallest amount of time the controller can recieve a new command(this is how I am treating it)?

Any other explanations or intuitions for the behavior? Am I reading the spec sheet wrong? Any advice or experience would be great:).

03-24-2009, 10:33 AM
What sort of servo was the person who posted that code using is my question, I might have missed it but I don't see a 20mS low pulse following each high, which would make me think he's using a digital servo, unless one of the includes handles that.

Analog servos require a 20mS low pulse after every single high pulse, and it must be constantly updated. Simply sending three high signals three seconds apart won't do it. Correct me if I'm reading what you're describing wrong.

03-24-2009, 11:12 AM
I wrote that code myself...:)....so "that guy" is me:).

But thankyou for the information. It is an analog servo. I have to drive the signal high myself for the time period I desire...and therefore the position I desire.

So what you've said, in my own words, is that I have to rebroadcast the position (1.1-1.9ms pulse) during every window if the servo is going to behave correctly?

So after I set the servo to "left"(1.1ms) I have to rebroadcast the 1.1ms pulse every 20ms to keep the servo happy?

Thankyou much Tyberious. I thought there might be something I don't know hurting me here:). Thanks a bunch.

03-24-2009, 11:16 AM

So after I set the servo to "left"(1.1ms) I have to rebroadcast the 1.1ms pulse every 20ms to keep the servo happy?

Yeah that is exactly right. You can write it a little faster if you need but you must write the pulse to the servo at least every 20mS.

03-25-2009, 03:57 PM
Thanks a bunch. Got it working mostly now. I'm just working out kinks in the microcontroller timers now:). Got movement working I believe.