AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Explainer

Why a hobby servo moves briefly then stops on a fixed pulse command

Servo and stepper motion Published 8 min read By AutomateDirectUSA engineering team

Short answer

A fixed pulse width is a position command, not a run command: repeating one width asks a hobby servo for one angle and holds it there, so the stop you see is the servo working correctly. Identify whether the unit is positional or continuous rotation, measure the frame your controller really sends, and move the commanded width — or pick a continuous-rotation type — to get five seconds of travel.

On this page
  1. Why does a hobby servo move once and then stop instead of running forward?
  2. What pulse widths does a hobby servo expect?
  3. Is my servo positional or continuous rotation?
  4. Why did it rotate for almost two seconds and then quit?
  5. How do I check the pulse my controller actually sends?
  6. Why does the second servo never move at all?
  7. How do I get five seconds of forward motion out of it?
  8. What does the 100 cm, 180-degree, three-loop task really need?
  9. Questions asked

A hobby servo that moves once and then stops is almost always obeying its command: pulse width sets a target position, so a constant stream of identical pulses requests exactly one angle, and the servo reaches it and holds. This program sends a fixed width on one pin and a stuck-high level on another, so neither servo is being asked to run for five seconds — the motion and the stop are both the command working as designed. The sections below cover what the pulse stream actually tells the servo, why the observed motion lasted a couple of seconds, how to verify the waveform at the connector, and what the full task — 100 cm forward, a 180-degree turn, three times — needs beyond a fixed pulse.

Why does a hobby servo move once and then stop instead of running forward? #

Because a positional hobby servo reads each pulse width as a target angle, not as a run command: a constant stream of identical pulses asks for one fixed position, the shaft slews there once, and then the servo holds that position — which is correct behavior, not a failure.

A positional hobby servo closes its own position loop inside the case. The width is a position request: the servo compares it against its internal feedback sensor, drives the motor until the error reaches zero, and then holds. Sending the same frame again requests the same angle. Repetition count, stream duration and pin choice carry no instruction — nothing in a fixed pulse stream asks for seconds of shaft rotation, so a timed forward run cannot be expressed in what the program sends. The stop is the servo completing the only instruction it was ever given.

What pulse widths does a hobby servo expect? #

The hobby-servo convention is a high pulse somewhere between about 1000 and 2000 µs, repeated roughly every 20 ms (50 Hz), with 1500 µs asking for the middle of travel; the exact span, center and frame rate for your part come from its own datasheet.

The frame has to keep arriving: a servo positions and holds only while the stream continues, and the width is the message while the period is only the envelope. Worked example, for these inputs only: a 1500 µs high time inside a 20000 µs frame gives 1500 ÷ 20000 = 0.075, a 7.5 percent duty cycle — the servo reads the width, not the count of frames behind it. Treat the 1000–2000 µs span and the 20 ms period as the hobby convention, and take the actual span, center width and frame rate for your part from its own documentation.

Is my servo positional or continuous rotation? #

Read the part label and its documentation first, then confirm with a center pulse: a positional servo stops at that angle, while a continuous-rotation servo uses the same center width as its neutral stop and widths on either side of it as speed and direction commands.

The two types look identical from the outside, and the difference decides everything downstream. Parallax's documentation for its Continuous Rotation Servo (part number 900-00008), for example, states that pulse width controls that shaft's rotation speed and direction — the same signal property a positional servo spends on angle. The mapping is set per part family, so take the neutral width and the full-speed widths from your servo's own document and confirm them on the bench with the mechanism restrained before anything is allowed to spin freely. A unit that keeps creeping at what should be its stop width shows the neutral-offset behavior covered in stopping continuous rotation servo creep at zero command. And keep the trade-off in mind: can continuous rotation servos position an XY drawing gantry explains what is lost — speed control replaces angle information, so that shaft cannot be commanded to a position at all.

Why did it rotate for almost two seconds and then quit? #

A typical small hobby servo slews 0.1 to 0.2 s per sixty degrees — a rule of thumb, not a rating — so two seconds of motion is more than one slew: the start was far away, the width kept changing, or the stream stopped.

Scope the signal line at the servo connector at the moment motion stops, and let the waveform pick the branch. Identical frames still arriving: the servo reached the requested angle and is holding — correct positional behavior — and the two seconds were the one-time slew from wherever the shaft started, long because the starting offset was large or the load is heavy. Frames missing, or the line stuck at one level: the program stopped commanding, so chase execution and pin configuration instead of the servo. Frames present but malformed — widths that wander or a period that is not steady: the time base is lying, which the clock check in the next sections confirms. Supply voltage sagging during the move: power and mechanics are the suspects; the program sets NOBROWNOUT, which suppresses the brownout reset without making a weak supply acceptable, so measure the rail directly under load. Rising current and heat with a stalled shaft point at the mechanism, not the command.

How do I check the pulse my controller actually sends? #

Put an oscilloscope or a logic analyzer on the servo's signal pin and read the high time and the period there: the program drives PIN_D2 from delay_us(1500) inside its loop and leaves PIN_D3 high permanently, so PIN_D3 is a DC level, not a servo frame.

Four checks cover the usual faults. First, pin direction: on this PIC a cleared data-direction bit drives the pin as an output, and a compiler output function may set it for you, so confirm the generated configuration rather than assuming it. Second, waveform content: the loop is hard-wired to delay_us(1500) and the variable pulse_width, initialized to 1000, is never used, so editing that variable changes nothing until the loop reads it. Third, the time base: widths are computed from the 20 MHz declared in #use delay(clock=20000000), and if the oscillator hardware or its fuses differ, every software delay scales by the same ratio — the mechanism behind why a timer-driven stepper pulse train delivers the wrong step count. Fourth, the pin's ability to switch at all: a plain output bit toggled between long software delays is not a pulse generator, the same trap as why a PLC digital output cannot make a stepper pulse train. Close the loop electrically: tie the controller ground to the servo supply ground, or the signal has no defined reference at the receiver.

Why does the second servo never move at all? #

PIN_D3 in this program is driven high and never returns low, so the second servo never receives a frame and is never commanded to anything: an unattached or floating servo signal can even pick up noise that makes the shaft appear to move on its own.

Drive that channel like the first: its own width inside a repeating frame — high for the command width, low for the remainder of the period — regenerated continuously, and scoped at the connector before the servo is connected. Twitching on a floating line is the classic sign of an open signal wire, not evidence the mechanism is at fault; trace the wire and give both grounds the common reference from the previous section.

How do I get five seconds of forward motion out of it? #

Change what the width commands instead of how long you hold it: on a continuous-rotation servo, command a width off neutral and keep the frames coming for the full five seconds, with pulse generation in a timer or interrupt so the motion interval is counted separately.

Separate the two clocks in the program. Pulse generation is the fast clock: a frame every 20 ms, indefinitely, produced by a timer interrupt or hardware compare so that no code path can starve it — how PIC16F877A timers control three servos at once works through one timer carrying separate widths for several channels. The motion plan is the slow clock: a state variable — forward, reverse, stopped — advanced by an elapsed-time counter, with the width written as each state's parameter. A blocking five-second delay that suspends frame generation is not commanded motion; command authority ends the moment the frames stop. On a continuous-rotation servo, a width held off neutral then produces rotation for exactly as long as the frames keep coming and the state says forward. On a positional servo the equivalent is a stepped sequence of widths traversing the angle — right for an arm or a steering linkage, not for driving a wheel indefinitely.

What does the 100 cm, 180-degree, three-loop task really need? #

Shaft motion is not ground distance: 65 mm wheels make a 100 cm run about 4.9 wheel revolutions (illustrative), and no pulse width measures that — you need odometry or encoders, a heading reference for the turns, and a loop counter.

Work the arithmetic openly. Example inputs, not measurements: wheel diameter 65 mm, so circumference = π × 65 mm ≈ 204 mm; the requested straight run is 100 cm = 1000 mm; 1000 mm ÷ 204 mm ≈ 4.9 wheel revolutions per segment. Commanding that with a continuous-rotation servo means holding the forward width for the time 4.9 revolutions actually takes under your load — a number only a measurement gives, because continuous-rotation speed is a per-part figure with no convention behind it. The 180-degree turn is a heading decision, not a width: with two driven wheels, command asymmetric widths and stop on a measured heading from a compass or gyroscope, or accept a calibrated turn time and the slip error that comes with it. Then let the state machine count three completed loops and finish at the documented stop width. Decision: for a bench or poster demonstration, timed open-loop motion with its calibration error accepted proves the sequencing; for the full distance-and-heading task, add odometry or wheel encoders, because a fixed pulse and a stopwatch cannot measure ground.

Questions asked

Do I have to keep sending pulses after the servo reaches its position?

Yes, if you want holding torque. Most hobby servos hold the commanded position only while valid frames keep arriving; when the stream stops, the output stage is left without a command and the shaft can sag or be turned by hand under load. Keep frame generation running continuously and treat any gap in the stream as time the load is free to move the mechanism.

What happens if I command a pulse width beyond the documented range?

Travel does not increase. Past the span in the datasheet the internal feedback sensor has reached its end, so extra width only drives the motor harder against the mechanical stop, raising current and heating the gearbox. Command inside the documented span, and get more travel by changing the linkage or gearing rather than the pulse width.

Can one timer serve two servos at the same time?

Yes. One 20 ms frame can carry a separate high time for each channel: the timer interrupt starts the frame and each pin turns off when its own compare value expires. That keeps every stream alive through all state changes in the program, which a sequential, delay-based main loop cannot guarantee.

Why does a stationary servo buzz and run warm?

A holding servo is still working: its internal loop keeps correcting the tiny error between the commanded width and the feedback sensor, so the motor receives short correcting pulses and the driver stays warm. Loud buzzing usually means the loop is fighting friction, load or supply ripple, so check the mechanism and the supply before suspecting the servo.

Keep reading

  • Troubleshooting

    Why a pulse-command servo axis loses position between moves

    A pulse-command servo that runs smoothly but lands at the wrong coordinate is losing, duplicating or mistiming step edges in the command path, not failing in the servo loop. Match step polarity, pulse width and direction prechange to the drive manual's input timing, then prove the fix with a dial indicator over 100 cycles of a repeated 100 mm move.

    Servo and stepper motion

  • Troubleshooting

    Stopping continuous rotation servo creep at zero command

    A continuous rotation servo creeps at zero command when the commanded pulse width sits outside that unit's true neutral stop band, so center a per-servo software trim in the measured band and make the reference stable - two matched resistors in place of the internal potentiometer, or no pulses at all when a passive stop is acceptable. Re-trimming the pot every few days treats the symptom, not the drift.

    Servo and stepper motion

  • Explainer

    Can Continuous Rotation Servos Position an XY Drawing Gantry

    No, not by themselves: a continuous rotation servo's pulse commands speed and direction, never angle, so drawn shapes do not close. Add feedback — an encoder on the axis, a servo reprogrammed to standard 300-degree mode on a rack (about 199 mm of travel with a 3 in pitch-diameter pinion), or a homed stepper — and the gantry positions.

    Servo and stepper motion