Вы находитесь на странице: 1из 9

Introduction

Pulse Width Modulation (or PWM) is a popular and efficient method for driving DC
motors because we can control the motors with significantly fewer power losses than
continuous linear regulation.
Using PWM enables control of the current in the windings and in turn the output torque,
as the torque is proportional to average winding current. It follows that current will be
proportional to PWM because of the torques linear response.
In a circuit, resistive loads will have a current that is proportional to PWM. However DC
motors are more complex than resistive loads, they contain an inductance and when
rotating they produce back EMF.
These factors usually mean PWM control isnt strictly linear, the PWM frequency (not
just the duty cycle) is actually quite significant for output parameters.

Basic Brushed DC Motor Equivalent Circuit


When the motor is at rest (or is rotating at a very low speed) then there is no back EMF
(or its extremely small) and the circuit becomes simpler. In this situation the current is
limited by the resistance of the windings and the coils inductance.
As a side note, if the motor was operating from a regulated DC source, not PWM, then the
current will be determined only by resistance as the inductance does not have an
impedance with a constant source.
Weve updated the equivalent circuit below to reflect the motor at low speed or no speed,
consisting of only a series RL circuit.
DC motor equivalent circuit at rest (or low speed)
The input voltage V is equal to the sum of voltage drop across the inductor and the
voltage drop across the resistor:
R
t
L
V L (t )=V e

R
t
L
V R ( t )=V (1e )

The voltage across the inductor tends towards 0 as time passes, while the voltage across
the resistor tends towards V. This is in keeping with the intuitive point that the inductor
will only have a voltage across as long as the current in the circuit is changing as the
circuit reaches its steady-state, there is no further current change and ultimately no
inductor voltage.
L
All series RL circuit have a time constant, usually denoted = R , which is the time it
1
takes the voltage across the component to reach e of its final value. V L will rest at

0V, so is the time it takes for V L =V e ( 1 ) . Similarly VR will rest at input voltage

1
V, so is the time takes for V =V (1 ) .
R
e

When a voltage is applied to the circuit the inductance of L slows down the rate at which
the current rises. This happens because the inductor produces a back EMF which resists
the current flowing through it. This prevents the current (and hence the voltage across the
resistor) from rising or falling much faster than the time-constant of the circuit.
As a result, when the power supply is switched on, the current does not instantaneously
V
reach its steady-state value, R . The rise instead takes several time-constants to

complete.

Current in RL Circuit
When using PWM for DC motor control this situation repeats on every period of PWM. If
the load is only resistive, the PWM frequency has no effect, but in this RL circuit the
current rise is limited by inductance.
Therefore PWM signals using higher frequencies give less time for the current to rise.
Motor current at two different PWM frequencies, both 50% duty
This means to simulate a linear response, the on pulse time for the PWM should be
L
greater than 5 , i.e. 5 R .

For example, if our motor has a time constant =10 s , the minimum pulse width
should be longer than 50 s .
If our minimal usable PWM duty cycle is 5%, then we should pick a frequency to ensure
it is longer than 50 s . This gives a minimal PWM period of 20 50 s=1ms . A
period 1ms means our maximum frequency for linear response is 1 kHz, any lower and at
low duty cycles the current does not have enough time to reach close to its steady state
value.
Calculations For Precision Microdrives 110-003 Motor
Lets try to calculate maximum PWM frequency which gives a linear torque response with
1% PWM resolution. For this example we are using the 110-003 Micro Core DC motor,
you can find its technical details in the datasheet (downloadable from the product page).
Rated voltage = 1.5V
Resistance = 3.4
Inductance = 19 H
Time constant for this motor is:
L
=
R
0.000019 H
= =0.0000056 s=5.6 s
3.4

Therefore the minimal pulse width should be longer than:


5.6 s 5=28 s

With a minimum PWM resolution of 1%, the minimum pulse width is:
28 s 100=2800 s

This determine maximum frequency for linear response:


1
=358 Hz
0.0028 s

Testing With The Precision Microdrives 110-003 Motor

Testing Circuit for 110-003 Motor


In the above testing circuit the motor was controlled from a PWM source on an
ATmega168 which was output through a MOSFET. An LDO voltage regulator (LD1086)
made 1.5V available for the motor.
The current was measured between the voltage regulator and motor, and also between the
transistor source and ground. The motor shaft was stopped, to simulate normal conditions
where motor works with load.
The three screenshots below are for three different PWM frequencies: 200 Hz, 2kHz and
31.25 kHz, but our minimum duty cycle is actually 10%. This means we should see linear
behaviour at frequencies below 3.571 kHz (10 times the calculated minimum frequency at
1% duty cycle). Were expecting that both the 200 Hz and 2 kHz signals to be similar and
reach close to the expected DC current, but the 31.25 kHz signal will reach a significantly
lower current.
The current value in the screenshots is the average current.

Current in 110-003 with 200 Hz PWM @ 10% Duty


Current in 110-003 with 2 kHz PWM @ 10% Duty

Current in 110-003 with 31.25 kHz PWM @ 10% Duty


As we can see with 31.25 kHz, the current reaches close to 50% of the value for 2kHz. If
the average current is less, this means the output torque is also less and is not a linear
response.
At 2kHz the current reaches close to the maximum value (as with true DC control), so we
can expect frequency of 2 kHz to give a linear response above 10%. Similarly with a
200Hz frequency the peak current again reaches full value, as we expected with with our
calculations before hand.
An important note is to analyse how the motor performs at lower frequencies. During our
tests we experienced some vibration and shaking on the motor shaft when powering at
200 Hz, so for a smoother drive system we would select a higher frequency.
The data and graph below makes it easier to see the non-linear response at high
frequencies. Weve varied the duty cycle for the same 3 frequencies, a linear response
should show a nice straight line between duty cycle and current draw. This means a
change between 75% and 80% duty should yield the same change in torque (current draw)
as 5% to 10%.

PWM duty Current for 31.25kHz Current for 2kHz Current for 200Hz
[%] [mA] [mA] [mA]

0 0 0 0

5 7.5 16.1 18.8

10 18.8 35 37.6
15 30.7 54 56.4

20 44.3 73.5 74.8

25 59 92.8 93.4

30 74.7 111.5 112.1

35 89.8 129.8 130

40 106.7 147.7 148.7

45 124.1 165 167.2

50 142 184.4 185.4

55 159 202.6 202.5

60 178.1 220.5 220.5

70 217.8 256.4 257.4

80 268.9 292.1 292.5

100 380 380 380


Motor current vs PWM Duty at different frequencies
We can see that whilst the 200 Hz and 2 kHz frequencies dont perfectly follow the
theoretical ideal (it looks like there is a slight change in gradient above ~83%), the non-
linearity is much more pronounced at 31.25 kHz.
It is important to find an acceptable balance between linear behaviour, noise, and
unwanted vibration. For many applications the non-linearity at higher frequencies will not
be an issue, or the benefits of the higher frequency outweigh the drawbacks.
However if your application does require a high degree of linearity from a high frequency
PWM drive signal, you could consider the following to improve performance:
1. Switching the PWM frequency when motor is starting, reducing the frequency can give
a higher output torque. It can be done with most microcontrollers which have hardware
PWM generator, usually with phase-correct mode of operation.
2. Increasing PWM resolution and making a lookup table in code for motor response. We
can vary the PWM to compensate for the motors non linear response.
3. Adding a current sensor and making a PWM closed loop regulator to vary the
frequency or duty cycle for linear response.
All of these options require additional resources or coding, if possible using a lower
frequency PWM makes the design simpler.

Вам также может понравиться