You are on page 1of 16

Variable frequency drive - AC motor speed

control

AC and DC motors

AC-motors are mostly used in the industry, but also in home appliances requiring
mechanical power of about 50 Watts and above (fans, dishwashers, fridges etc). Its
counterpart is the well known DC-motors found inside toys, CD-players and other
consumer products. Technically, DC-motors are more complex than AC-motors, but
in smaller applications the DC-motors are considered to be cheaper and more
practical, for instance because they run directly on batteries and are easier to control.
Washing machines, food processors and electric tools are examples of speed
controlled home appliances. DC-motors with brushes and the copper commutator is a
classic, mature electric motor design and is still preferred in some bigger precision
machinery because of the outstanding torque characteristics.

DC-motors

• Run on direct current. Batteries or electronic rectifiers/drives.


• Speed is proportional to voltage.
• Current is proportional to load (torque).
• Small motors in consumer products is the most common.
• Sizes ranging from milli to some Mega Watts.
• Various standards.
• Consumer = cheap, industrial = costy.
• Needs maintenance.
• Environmentally vulnerable. Cooling air passes through internal parts.
• High efficiency (industrial)
• Overload capabilities.
• Smooth and stable torque (industrial)
• Speed control is simpler than with AC-motors

AC-Motors

• Run on alternating current, usually one to four phases.


• Speed is proportional to frequency.
• Current (active) is proportional to load (torque).
• Asynchronous "squirrel cage" induction motor is the most common.
• Sizes ranging from 50 W to several Mega Watts.
• Well-established industry standard fitting/mounting (iec).
• Low price (asynchronous).
• High reliability, simple design, no brushes.
• Environmentally rugged, "hermetic".
• High efficiency.
• Motor may "stall" at overload.
• A bit jerky torque (asyncronous).
• Needs electronics (VFD) for speed control.

There is an important difference between syncronous and asyncronous AC-motors


although they seem very similar. The syncronous AC-motor has permanent magnets
or DC-windings in the rotor (the rotating part) in addition to the AC-windings in the
stator (the fixed part). The speed of such motors is exactly proportional to the
electrical frequency. Actually also the rotor position is proportional to the phase, so
syncronous AC-motors are widely used as precision servo motors. Stepper motors are
small synchronous four phase AC-motors. Also power generators usually are
syncronous because by using DC-windings in the rotor, the output voltage can be
controlled by changig a small current in the rotor-windings. Also the frequency is
proportional to the rotational speed, making it easier to maintain the right output
frequency.

The more common "squirrel cage" induction motor has a rotor with no magnetic field.
In order for the motor to work, the magnetic field is "transmitted" from the stator AC-
windings. One consequence of this transmission is that she speed of the motor vill lag
some percent compared to the electrical frequency. This lag is bigger the smaller the
motor is, and as load increase. The positive side of this design is that there is no need
for electrical connection to the moving parts, and the "squirrel cage" rotor is less
expensive to manufacture than permanent magnet or wire wound rotors. Actually the
only "mechanical interface" between the fixed and moving parts in asyncronous
induction motors are the two ball bearings. As long as the bearings sounds OK, there
is most certainly no need for maintenance.

Electric motors work with magnetic fields, and the magnetic field must move in a
rotating pattern in order for the motor shaft to follow. Because of this, the electric
power also must change according to that pattern, it cannot be DC-currents inside the
motor windings. AC-motors are running on three phase "rotating" current. Single
phase motors use a capasitor to generate a second phase pointing out the rotation
direction. The DC-motors create AC-currents in the rotor windings when the copper
commutator rotate relative to the brushes carrying direct current. So actually DC-
motors are AC-motors with a built-in mechanical inverter. It may be three or more
phase windings.

Three phase

One of the reasons for using three-phase systems instead of single phase is that by
adding a third wire it is possible to distribute electric power more effectively. In a
single phase AC circuit there is one "feeding" and one returning path. The two wires
making the paths have the same loss of energy due to resistance because they carry
exactly the same current. In a three phase AC-circuit the currents are out of phase, so
when one wire is "feeding" current to a motor winding, the other two wires make the
returning path at the same time as they are feeding current to the other two motor
windings. The sum of the three currents is alway zero, and then actually one can say
that three returning wires have been omitted.

Another reason for using three phase electrical power is that it makes a very simple
and efficient connection between a generator and a motor, ie transmitting mechanical
energy from one place to another at low cost without losing too much energy. The
"rotating magnetic field" in the generator is converted to AC-current, and the exact
opposite happens in the motor. The principle is simple, and it is possible to connect
several motors as well as generators to the same power line. But the motors and
generators must run at the same frequency, therefore AC-motors connected to mais
run at constant speed.

The poles in a three phase motor are located 1/3 turn or 120 degrees relative to each
other. "Real" windings to the right.
The electric current form three sinewaves. The phases are 120 degrees apart.
Rotor position can be found by adding the currents as vectors at any time instant.

AC-motor Speed control

Different kind of machines, ie conveyors, pumps and fans are usually designed to run
at constant speed provided by AC induction motors. Some machines like grinders and
saws work best by maintaining a steady constant speed, but in many applications it is
desirable to adjust the speed to different processing or energy needs. One typical
application is saving energy on fans and pumps by adapting to the required flow.
There is a quadratic relation between flow and speed, and if the flow requirement is
not contant there can be a lot of energy savings by controlling the motor speed. Also
the excess water or air flow usually means loss of energy in other parts of a system
like when heating a house (the balance point between heating and ventilating).
Another example is controlling the throughput in production lines by removing
"bottlenecks" and adapting to the pace of the production. Also it is useful to vary the
speed in stand alone machines such as lathes, drills and milling tools, however the
electronic drive cannot increase the torque like gearboxes and belt transmissions.
Earlier, the electronics necessary to build a variable frequency drive was expensive
and unreliable because of the high currents invoved with electric motors and the
relatively complex signal generation. Today, as faster and cheaper integrated circuits
as well as more efficient power transistors has emerged, VFD's are more often
preferred compared to other speed control methods. Especially, replacing a DC-motor
in some applications may lower the overall cost, increase reliability and lifetime of the
system. Examples of such factors are highlighted in the comparison list at the
beginning of the text.

The Variable frequency drive (VFD)

Among the electrical quantities, the sine wave frequency is probably the most
complicated to change. Today there are two usual ways to do this, either by rotary
motor-generators or by electronics. Rotary converters can convert between fixed
frequencies like 50 to 60 Hz, or DC (0Hz) to AC and the opposite, but if the
frequency need to change often/dynamically like in servo motors, it can only be done
by electronics.

Electronic VFD's rectifies the 50Hz current and make a smooth DC-voltage in
capacitors (working like small batteries). In other words the frequency is "eliminated"
from the system, or changed to zero. Then the VFD must create its own frequency by
alternating the DC-voltage through transistors at the desired frequency. Also (very
important) the voltage must be proportional to the frequency. You cannot output all
230 volts when the motor is near zero speed. The voltage is usually controlled by the
amplitude of the sine output. Another way is to control the voltage at the input
(rectifier) side.
The figure shows the power parts af an VFD. There are two "bridges" in the circuit,
one three phase rectifier and one three phase inverter bridge. The rectifier (left) is
working without any additional electronics. All electrical current is simply conducted
in the same direction as the arrows in the diode symbols. When the rectified current is
stored in the capacitors, the value of the voltage reach the peak value of
230VRMS (Root Mean Square) which is 230*1.41 = 325V. This is a DC-voltage like
what is coming from batteries, the frequency is zero. A VFD can run from batteries
(like in electric vehicles) or single phase.

The inverter bridge (the transistors) is kind of the opposite to the rectifier. The current
is conducted into the motor in the same direction as the arrows in the transistor-
symbols, BUT, the transistors are not conducting all the time like the diodes. Actually
if all transistors were conducting, it would short-circuit the whole system.

The transistor bridge is controlled by a switching pattern corresponding to the new


frequency that is to be generated. These signals are made by ordinary low power
electronics like analog signal generators and amplifiers, digital circuitry and/or
microprocessors. The signal pattern can be simple like square waves or more
sophisticated sine-like waves.
Sine wave VFD's have high transistor-losses. Square waves generate losses in the
motor.

The difference between "good" or "bad" control signals to the transistors is a tradeoff
between good efficiency, product cost and different requirements. For example a "true
sine" inverter might emit less electromagnetic noise, the motor is running smoother
(less noise, more stable torque), but the inverter is more expensive and usually less
efficient. If the transistors are controlled by square waves, the power loss in the
transistors reach its minimum (because voltage and current are not present in them at
the same time), but the motor has to filter the "bad shape" electrical current resulting
in jerky mechanical torque and power loss in the windings. Also the uneven torque
generate power loss as well as unnecessary wear on the mechanical parts the motor is
driving.

PWM - Pulse width modulation

Pulse width modulation is a compromise between sine wave (or any arbitrary
waveform) and square wave signals. The idea is that transistors can switch the current
on and off (creating a square wave) at such a high frequency the motor would not
react to it. Of course this high swithing frequency is not the one controlling the speed
of the motor. The much lower motor frequency is embedded into the higher frequency
by changing the rate between the high and low states according to the low frequency.
This is called modulation and is similar to radio waves carrying lower frequency
music, although the modulation principle is different. The goal is to run square waves
in the transistors (remember less power loss) and sine-like current in the motor (also
less power loss).
The swiching frequency is usually ten to hundred times as high as the motor current
(modulating) frequency. The result from this frequency difference is that the motor is
acting like a low pass (averaging) filter to high frequencies, and it only "sees" the
lower frequency. One might think there is a power loss in such a filter, but reactive
loads like motors are storing the electrical energy into the magnetic field, and the
unused energy is fed back to the inverter bridge via reverse diodes in the transistors.

By switching the full voltage on and off there is minimal voltage drop and losses in
the transistors.
The motor is storing and filtering the current pulses into low frequency sine waves
(blue).

Sine wave PWM generation

In the above example the PWM frequency is constant (rising edge at fixed intervals)
and the pulse ratio (length divided by period) is varying according to the sine wave
values. The average value of the output voltage is proportional to the pulse ratio (the
sine wave). Another PWM mode is varying the period (intervals) while the pulse
length is constant, but this is not frequently used in VFC's anymore.
A simple PWM generator can be made by using a triangle wave generator together
with an analog comparator. The magnitude of the triangle wave is compared to an
arbitrary (modulating) waveform, for instance a sine wave:

Analog PWM generator. The output is high when the positive input is greater than the
negative.
This kind of circuit is commonly found in class-D audio amplifiers.

In an analog PWM generator like above, the linearity of the PWM generator depend
extensively on the quality of the triangle wave generator. Also the generation of sine
waves in analog circuits is difficult if one need to change the frequency continouosly
by some input control signal. This is because high quality analog sine generators use
capacitors and resistors, and the frequency is determined by fixed values of these
components (radios use variable air capacitors for tuning).

In digital circuitry the signal and generator states are calculated mathematically at
frequent (discrete) time intervals, therefore it is easy to change parameters and
maintain linearity in the system. A digital sine wave PWM generator can be
implemented in a similar way as the analog circuitry. The triangle wave generator
correspond to a a digital counter, and the analog comparator to a digital comparator.
The sine wave values can be stored in a precalculated lookup table in memory to
make the circuit simpler.
Digital PWM generator. The sine wave values are stored in a memory adressed by a
counter.
The sine values are compared to another counter counting to max during each sine
value.

The above circuit will generate a PWM modulated sine wave where both the
switching (PWM) and motor frequency is proportional to the input clock pulse. The
sawtooth generator (bottom counter) has 8 bit output, this correspond to 256
comparisons to the value present at the sine table (ROM) output. When the sawtooth-
counter finish, it increases the sine generator counter to the next value and a new sine
value is available for comparison with the next sawtooth slope. Since the sine
generator has 10 address-lines, there will be 1024 comparisons and PWM-pulses
generated each sine period. The input clock signal must have 256*1024=262144 times
as high frequency as the desired sine output.

This is just an example of a digital generator. In order to control a three phase motor,
there must be three sine tables (120 degree apart) and three comparators. A problem
with this circuit is that the PWM frequency is proportional to the motor frequency.
Varying the PWM frequency over the same range as the motor speed would probably
cause noise as well as unneccesary losses at the extremes. The PWM frequency
should be the same regardless of motor speed. Also the electric motor needs the
voltage to follow the frequency which means multiplying the output from each sine
table by a value proportional to the frequency. One soon figure such a circuit becomes
cumbersome if it is to be realized by discrete logic components as in the schematic
above. All the mentioned operations of course can be programmed into a single
microcontroller, saving both costs, space and development time.

VFD Firmware

Most of the available microcontrollers on the market (even the smaller ones) have
built-in peripherals such as AD-converters, timers and PWM generators. A built-in
PWM generator in a microcontroller correspond to the digital comparator and the
counter in the schematic above. The counter value is compared to a programmable
register value, thus by updating the register by sine values, a sine modulated PWM is
generated at the output pin. The PWM modules usually provide buffering of the
programmable registers as well as interrupt facilities so that the software can be
syncronized with the PWM-pulses. This way the software only need to calculate the
next sine value each PWM period, leaving the pulse generation to the hardware.

The AD converter can be used to control the program by an analog signal such as a
potentiometer. Also it is easy to measure different operating conditions such as
temperature and current by connecting analog sensors. Many microcontrollers have
built in serial uarts which makes communication with a host or remote unit
convenient. What peripherals to use depend on the application, however these units
have in common that they are implemented in hardware inside the microcontrollers
and run independently from the program itself. This saves CPU time and makes the
program easier to implement.

Probably the first question that arises when selecting a microcontroller for the VFD
application is how many PWM-generators are available in it. The smallest
microcontrollers usually have two PWM channels, one less than required here. The
"mid-range" products may have three or more PWM-channels and even special motor-
control variants are available. On the other extreme, it is possible to write code that
generate the PWM pulses (no need for PWM units at all), but that makes both the
program itself and writing it a lot more time consuming, and it can only be done by
using a low level programming language like assembler.

Assuming we are using built-in PWM modules, the three phase voltages to be
generated can be described by the following functions:
The motor speed is determined by the frequency variable (omega). The constants in
the sine arguments correspond to the 120 degree phase difference between the
voltages. Also, as you can see, the amplitudes are not constant but a function of the
frequency. This is because the AC-motors needs the voltage to follow the frequency.
The amplitude function can be just a linear relationship between amplitude and
frequency, but in order to compensate for resistive losses in the windings and other
issues, most VFD's provide a programmable so called Volt/Hertz function. It is
programmed by parameters adapting to the motor and load, usually carried out once
when installing the drive.

The whole idea of the VFD is to vary the speed of the AC-motor. But the speed
cannot change too rapidly because the acceleration together with inertia and load of
the motor may exceed torque and current limitations of the system. This means
changing the value of the frequency (omega) must follow a function of a desired
acceleration. The acceleration in turn is controlled by the user settings and operation
of the VFD system:

The constants k are programmable parameters usually named "acceleration" and


"deceleration" in most VFD's. Some VFD's even provide special ramping functions
like cosine or exponential (used during start and stop), adapting to special motor
loads. The following block diagram shows an overview of the basic elements of an
VFD:
In the following, I will explain the firmware (yellow) functions, starting from the
control block and ending at the PWM-unit. The control function is monitoring the user
and the speed of the VFD. If the user press "start", the function should accelerate the
motor until the speed reach the desired setting. When the user hit "stop", the motor
should decelerate until zero speed. This algorithm can be implemented in software
like this pseudo code:

Control function

1. if (start_button) speed_cmd = speed_set;


2. if (stop_button) speed_cmd = 0;
3. if (inc_button) AND (speed_cmd > 0) AND (speed_cmd < speed_set)
speed_cmd++;
4. if (dec_button) AND (speed_cmd > 0) speed_cmd--;
5. astate = 0;
6. if (speed < speed_cmd) astate = k_acc;
7. if (speed > speed_cmd) astate = -k_dec;

Ramping function

In this example we use linear ramping and the code would simply be:
1. speed = speed + astate;
2. if (speed < 0) speed = 0; //avoid modulo errors
3. if (speed > speed_set) speed = speed_set; //avoid modulo errors

V/Hz function

We add some constant to the V/Hz function so the motor will not be weak at slow
speeds:

1. volt_amplitude = volt_constant + volt_slope * speed;

Sine generator

Now we have both amplitude and frequency (speed) for the sine generator:

1. x1 = volt_amplitude * sin(angle);
2. x2 = volt_amplitude * sin(angle + 120);
3. x3 = volt_amplitude * sin(angle + 240);
4. angle = angle + speed;

PWM module

The PWM module should be updated "simultaneously" at all channels:

1. PWM1 = x1;
2. PWM2 = x2;
3. PWM3 = x3;

All code lines in the functions can be executed in a row, I splitted it up only to make it
easier to understand. Those familiar with physics and numeric integration might have
noticed that acceleration is integrated into velocity, and the velocity is integrated into
position (angle). The angle keeps on running the motor when the velocity (speed) is
not zero. The velocity differ from a constant value only when the user changes it by
command, therefore the acceleration is integrated only during ramping of the motor to
the desired speed.

The "integration constant" depend on to the time for the whole program to run, and it
is recommended to syncronize this with the PWM module period as menitioned
earlier. This can be done by making the whole program an interrupt routine triggered
by the PWM timer. Also the PWM registers should be updated using buffer registers
or similar modes. This way the PWM module will not change its registers before each
period has completed. Of course, the three PWM channels must be synchronized to
eachother.

The parameters and constant values used in the program is to be calculated from
desired specifications, integration constant (PWM period) and other properties of the
application. Since the sine function is complicated to calculate in a small
microcontroller, it is recommended to use a precalculated table in program memory
for these values. This can be done using a spreadsheet program.

A prototype VFD power board. There are 12 transistors, but pairs are connected in
parallel to increase current capability.
Four of the "TO220's" are rectifier diodes. There is a connector for the processor and
driver board behind the capacitors.
All components are low cost types, and the PCB was ordered from Olimex for just
$33 including everything!
The control board, transistor driver board and the development board for 8 bit AVR
microcontrollers.
As you can see, the IR2136 driver IC does not require many external components.

You might also like