4
\$\begingroup\$

If I'm controlling multiple hobby PWM servo motors, is there an advantage to staggering the pulses sent to each servo?

By which I mean, each servo needs to see a pulse of width ~1ms every 20ms. Let's say I have 20 servos. If I send a 1ms pulse each ms to a different servo, then will that change the spikiness of the current draw, or otherwise improve the circuit?

Intuitively it seems that sending the 1ms pulse to 20 servos all on the same 1ms tick could cause a synchronized current spike, thus maximizing the chances of tripping a fuse in my power supply.

Is this a real concern?

(I ask because the Adafruit PWM python library has the capability to specify rise and fall times for pulses to a given servo, rather than just specifying the frequency. I can see no reason to build the API this way unless you'd want to stagger the signals for some reason).

\$\endgroup\$
  • \$\begingroup\$ I don't know about 20 at a time, but if you had say ten, I know that radio transceivers do that internally. Then the radio circuitry demultiplexes that signal and sends each on its own channel. If you monitor the signals at the receiver they are all offset from each other. Doesn't really answer your question about the current, but that's one reason for the staggering. \$\endgroup\$ – Octopus Mar 28 '15 at 1:13
  • \$\begingroup\$ Old analog transmitters / receivers would send the servo pulses sequentially. First servo #1 would get its' pulse, then servo #2, and so on. This was an artifact of how the pulses were generated and decoded but it had the side effect of not allowing the servos to receive their commands at exactly the same time. \$\endgroup\$ – Dwayne Reid Mar 28 '15 at 3:10
  • \$\begingroup\$ As people say below, staggering the pulses probably makes very little difference. But if you can afford to start motion at a different time on each servo, at the 500 ms timescale, that would reduce the peak power. For example, when closing all of my car windows, I trigger them one by one, to limit the voltage dip. \$\endgroup\$ – tomnexus Mar 28 '15 at 15:12
2
\$\begingroup\$

First, I'll assume by "servo" you are really referring to hobby servo motors that are controlled by 1-2 ms pulses, not the general meaning of "servo" in electronics and control systems. You really should properly define this term in your question.

These hobby servos only use the 1-2 ms pulse as a way of communicating a analog level. The old all-analog hobby servos would integrate the pulse, hold it, and then use that as the control signal to compare the position feedback signal to. Newer digital types measure the pulse width digitally, then use that value to compare the position feedback to.

Either way, the driving of the motor is not synchronized to the pulse. The motor's drive signal is constantly updated internally to the saved control value derived from the last pulse. A new pulse only changes this control input.

That said, a sudden step in the control signal will likely cause a short term error, which the control mechanism will react to by driving the motor harder until it settles to the new position. Therefore, while the motor is always driven, it will usually be driven harder after a step change in the input, which can only happen immediately after a pulse.

Overall, I'd say it is good to stagger the pulses to multiple hobby servos if it's not much burden to do so. Note that this comes automatically if using a off the shelf radio link. These will send the pulses for each of the hobby servos it controls sequentially anyway. If you are controlling multiple hobby servos from a single microcontroller, then multiplexing might dictate sequential pulses too.

If it works out more simply to generate all the pulses at the same time, then go ahead and not worry about it. 20 ms is a short time, and the extra current from a sudden control input change will take longer than that in most cases. In the case of slow changes, the steps are small anyway, so the current should be relatively even. Put a bigger cap on the power supply if you're worried about it.

\$\endgroup\$
  • \$\begingroup\$ Do they really integrate the control pulse? I was under the impression that the feedback potentiometer was used to control a multivibrator that generated a feedback pulse, and that simple gates were used to send pulses to the motor H-bridge whenever the two pulse widths were not equal. \$\endgroup\$ – Dave Tweed Mar 28 '15 at 21:10
  • \$\begingroup\$ @DaveTweed: Exactly right. IIRC - Signetics made the first chip for this purpose: the NE544. There is still a wealth of information readily available for that chip in particular as well as radio control of hobby servos in general. \$\endgroup\$ – Dwayne Reid Mar 28 '15 at 21:41
  • \$\begingroup\$ @Dave: That's how someone described it to me a while back. However, I've not personally seen a schematic. Probably there are various different implementations out there. \$\endgroup\$ – Olin Lathrop Mar 29 '15 at 0:14
  • \$\begingroup\$ I think that person was just guessing. Such a system would be impractical because it would be too sensitive to both signal levels and supply voltage levels. \$\endgroup\$ – Dave Tweed Mar 29 '15 at 0:36
1
\$\begingroup\$

With older "analog" servos, it's very likely that any current spike in the motor driver would correspond with the pulse on the control signal, so your concern would be a valid one. Although such pulses tend to be very narrow, and can be handled by adequate decoupling capacitance on your power rail, with little likelihood of actually blowing a fuse.

With newer "digital" servos, the motor drive pulses are essentially independent of the control signal pulses, so there's no benefit to playing with the timing of the latter. But the motor PWM frequency is usually much higher, with correspondingly lower ripple on the power supply, as compared to analog servos.

\$\endgroup\$
1
\$\begingroup\$

In an analog servo the motor PWM pulses are created by subtracting the servo pulse from the internal feedback pulse, then stretching the difference to produce a wider PWM range. Therefore the start of each motor pulse is loosely synchronized to the end of each servo pulse, and staggering servo pulses may reduce peak power supply current when multiple servos are moving.

Most Digital servos generate high frequency PWM pulses which are easier to smooth out.

Servo Current Waveforms

HS-125MG Analog Servo Current (50Hz PWM)
HS-125MG servo current waveform
(horizontal 5mS/div, vertical 500mA/div)

HS-5475HB Digital Servo Current (~1kHz PWM)
HS-5475HB servo current waveform

\$\endgroup\$
0
\$\begingroup\$

At a 20 ms period, maybe there would be problems with current supply. You may find a snubber or freewheel diode useful. Instead, though, what if you sent digital pwm signals (.4mA per line) into a voltage controlled current source?

\$\endgroup\$
0
\$\begingroup\$

Traditionally the servo pulses were staggered anyway, because they were transmitted one at a time down a radio link.

If a worst case servo movement takes more than 20ms (which it does) then several servos will be running simultaneously, so staggering the servo pulses won't help (much) in eliminating current pulses, during high activity periods.

To guarantee that (say) six servos would never run simultaneously at a 20ms update rate, not only would you have to stagger the servo pulses but each servo movement would have to last less than 3ms - very light activity.

So perhaps the API limiting the rate of movement is about controlling mechanical momentum? I can't see it having much impact on the power supply.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.