Can someone explain, very simply please (I asked a question here one
time about ONE single RAM chip and basically got a college thesus about
the history and development of RAM, to which I appreciated the
response, yet it basically failed to actually answer the question) ...
Controlling a motor ... a continuous DC (NON-stepper) with PWM ... is
it the FREQUENCY or the PULSE WIDTH (duty cycle) that controls the
speed of the motor?
Actually, what matters is the duty cycle - the percentage of the
time power is on.
Most drives use a constant frequency and vary the pulse width.
But that's not universal. There are other approaches. Some
of the newer drive amps generate a psuedorandom bit stream
with the desired duty cycle, like the one-bit D/A scheme
used in newer audio gear. This spreads out the noise spectrum,
and tends to eliminate that annoying whine some servomotors
Oooh -- that's an interesting idea. Do you have any web references on
exactly what they're doing? One of my robots is using dual h-bridges
with (unfortunately) major limitations on usable PWM frequency -- thus I
get some noticable noise (especially at low speeds). Rather than replace
the h-bridges -- which otherwise work well -- changing the programming
on my motion control board would be an easy option.
TIA -- tAfkaks
The "pseudorandom bit stream with a desired duty cycle" seems almost self
contradictory. I'm not sure I see any meaningful purpose in such a
The servo whine you hear can be easily be eliminated by switching at higher
than 20khz. You can virtually eliminate the whine of a lower frequncy PWM
amplifier by adding an LC circuit between the PWM amplifier and the motor.
The LC will smooth out the PWM spikes, and supply the motor with virtually
In general, however, a higher frequency means smaller inductors and
compacitors. The only issue is transistor switching time. If the transistor
has a slower saturation time, it will tend to be less efficient at higher
frequencies -- and that means gets hotter and uses more power. These days,
MOSFETs switch fast enough, and with enough current, that you can easily
switch above audio range.
There are some applications where that high a pulse frequency is not
desirable e.g. r/c cars where the lower the frequency the greater the punch
available from the motor, within limits. Usually we use anything between
1.5Khz and 8Khz depending on the motor and track condition. This helps in
tuning the motor power to match the available grip levels on the race track
The PWM frequency should have NO affect on the amount of power or "punch" to
motors. Most sealed DC to DC converters, which can supply great current,
often run much higher than audio range, often as high as 100KHZ. If you are
seeing frequency affecting the result of your output, it is likely you need
to put an LC circuit between the amplifier and the motor. A DC electric
motor works as an inductor, lowering the frequecy simply means you are
saturating the inductor and basically driving the motor directly, you are
losing a lot of the advantage of a PWM circit.
Idealy, a PWM circuit acts like a pure current source. Using a resistive
load, the voltage output is directly related to the PWM. Increase the
duration of the PWM, the voltage goes up along with current. Reduce the
PWM, the voltage goes down.
Motors, unfortantely are inductive loads which are harder to characterize,
but the theory is the same, you want the PWM amplifier to be pumping power
into the system at a very controled rate based on the PWM. You have to
either tune the PWM to the motor inductance or put an LC filter between the
amp and the motor.
You could do PWM with a pause on a "stamp":
x= 10 (rate)
port1 = on
I don't think the Stamp is fast enough to do PWM at
a reasonable frequency though,
and you would certainly need to amplify ttl levels with a
You would probably get the motor turning ON and OFF
with a stamp+stampcode, or jitters, because the frequency isn't
I know what you're saying and I do understand how PWM varies the power
applied to the motor. You really should try it out for yourself before
dismissing it offhand and please realise that we use permanent magnet DC
motors NOT brushless motors with 5 or more poles and rare earth magnets. Yes
brushless motors are starting to be used but at present they are comparable
with brushed motor/speedo technology of about 8 years ago they are a let
down mainly in the transient responses i.e. mid range responses.
There are reasons for the way the speed controllers are constructed and work
the way they do, there are quite a few constraints:
Size and weight, about 40 x 30 x 20 mm weight as light as it can be usually
Motor specifications: 3 pole (540 size cans, 35mm dia x 50mm long including
endbell) 25-45K rpm producing between 90 and 150W depending on the armature
winding, running from 6 x 3300mAh sub C cells for a 5 minute race.
Currents experienced: average 30-45A and peaking at well over 100A at
startup if full throttle is applied.
The variable audio range PWM drive frequency has been tested and used over
many years, and is proven to work. There has never been any commercial r/c
speed control equipment that uses supersonic PWM frequencies, that is used
in the DC/DC converters you are on about because having that whine in your
ear all day will get on your nerves.
Most of the PWM circuits used in the cars are a bank of MOSFETS (running as
a switch not sine wave generator) inserted between the motors neg terminal
and the battery negative terminal, the battery positive is wired directly to
the motors positive terminal (giving forwards and brake control only, the
brake FET is between the battery + ve and motor -ve terminals ), so no fancy
H bridge circuits (only on reverse capable speed controllers). These devices
are all about compactness and minimal losses in the power path giving max
power to the motor at full throttle and minimal things to go wrong such as
LC networks. The only other components near the power path are snubber
capacitors and a shottkey diode across the motor terminals.
So in conclusion, yes it would be nice to have an electrically clean and
efficient designed H bridge, LC filter and so on but at the end of the day
the space constraints, cost and robustness nothing beats what's there at the
moment. If you can design and build something superior for the same cost as
a decent unit today but just as robust or more so then I'll be the first to
buy you a pint and your first commercial unit.
I don't think you're correct about this, especially when you're talking
about a voltage range where the losses in the flywheel diode are so
significant. At very low resistance and voltage, the inductive kick will
be discharged and lost - with no further loss - entirely within a single
low frequency PWM off cycle. At a high frequency, the loss is basically
continuous throughout the off cycle, and higher on average.
A higher switching frequency could yield better results than either way,
if the braking mosfets were used to provide active commutation, reducing
the losses in the flywheel action.
Make that an L - you don't want or need any C. But without active
commutation, the L will increase the flywheel losses at low frequencies
to match those at high ones.
I've never head it called a "flywheel" diode, we've always called it a
flyback. Technically speaking, I think "flywheel" is probably a bad name
considering what it does.
Anyway, there should be little loss in the diode, the energy should be
stored in the LC circuit.
This is the bahavior of an LC circuit poorly matched to the frequency.
The thing about LC circuits is that, if properly tuned to the frequency of
the PWM, there is very little loss. The theoretical loss should be zero,
but there is always core saturation, coil resistence, capacitor leak, etc.
If you are losing power in an LC circuit, it has only one place to go, and
that's heat and that's waste, and potentially smoke.
You should put a capacitor across the motor terminals, and feed the motors
with two inductors, and diode protect your h-bridge. The LC should be tuned
so that you see very little ripple at half load/duty cycle at the PWM
frequency. Depending on your current, you may need a big core and
capacitor, if you increase the PWM freqency you can make them smaller.
If tuned correctly, the flyback voltage from the LC circuit will forward
bias the diodes, effectively shorting out one end of the LC circuit,
forcing the current back to the motors. This is how a switch mode system
gets its efficiency. The only loss in the system should be the voltage drop
of the semiconductors, coil resistence, and capacitor leak. You should
never be dumping power to a heat sink.
"Flywheel diode" is a fairly common term. If I had to guess, I'd say it
originally comes from the action of the diode when the motor is
freewheeling. During this time the motor acts like a mechanical
flywheel. I've seen the term used for anything that uses a coil, not
just motors. I note the term is used more in the UK and Austrilia --
just as they call an electron tube a "valve." Clifford hails from
I am curious: have you ever built a PWM controller or circuit like the
one you describe? Not that I doubt you, but even manufacturers of motor
control chips, like Analog or STMicro, often state an "ideal" PWM
frequency of 16-22 kHz for the kind of small motors commonly used in
robotics. It would be great if you had a URL to a circuit of your design
that demonstrated the principles that you mention. That way more people
could try it out.
In a couple jobs I've had yes.
A PWM motor amplifier is very similar to a PWM switching power supply as
I don't know how they can say anything about frequency without knowing
anything about the motors. For instance, (assuming no LC filter) you would
use a MUCH higher frequency with a low inductance pancake motor than you
would with a very high inductance wound coil motor.
I'm not sure I'd be qualified to teach electronics theory, but I would
strongly suggest people study a bit of theory. Horowitz and Hill "The Art
Of Electronics" is a great book.
I don't think there's much on PWM motor control in Art of Electronics,
and besides, I would think most people who are designing PWM controls
for motor speed, in or out of the audio frequency range, have read the
I'm not a motor control designer, but I've purchased (for my work)
several ready-made commercial servomotor driver/amplifiers, costing from
$100 on up. I think one had a PWM frequency of over 25 kHz. All the
others offered more in the range of 100 Hz to 25 kHz. This is fairly
typical I found.
Again, if you think your design has the benefit of avoiding audio
frequencies for PWM, and improves efficiency while not sacrificing
torque, I'd like to see a design. I know a couple of guys at work who'd
love it! Maybe you have a Web page for posting a quick schematic?