You are on page 1of 14

AC Induction Motor (ACIM) Control

Using PIC18Fxx31

AC Induction Motor (ACIM)


Control
Using
PIC18Fxx31

© 2003 Microchip Technology Incorporated. All Rights Reserved. AC induction Motor Control Using PIC18Fxx31 Slide 1

Welcome to the Microchip Web Seminar on AC Induction Motor Control using the
PIC18Fxx31. My name is Jon Burroughs, I am the AMAD applications engineer for
the PIC18Fxx31.

This Web Seminar is a summary of the application note “VF Motor Control of AC
Induction Motors Using the PIC18F4431”, which will soon be available on the
Microchip website.

© 2004 Microchip Technology Inc. Page 1


AC Induction Motor (ACIM) Control
Using PIC18Fxx31

Agenda
● Overview of motor control solutions from Microchip
● PIC18Fxx31 peripherals for motor control
● ACIM motor control using PIC18Fxx31
● Open V/F loop control
● Closed loop control using Quadrature encoder
● Comparison to other PICmicro® microcontroller
solutions
● Recommended resources

© 2003 Microchip Technology Incorporated. All Rights Reserved. AC induction Motor Control Using PIC18Fxx31 Slide 2

This presentation is divided into the following topics:

•First, a brief overview of motor control solutions from Microchip,

•Second, a summary of the PIC18F4431 peripherals for motor control.

•Next, the main body of the presentation will be a discussion of ACIM control using
the PIC18Fxx31 in standard open loop V/F control and in closed loop with an optical
encoder for speed feedback.

•Finally, we will compare ACIM control solutions implemented with several other
PIC® microcontrollers.

•Because this presentation is relatively short, additional resources for learning more are
recommended at the end of the presentation.

© 2004 Microchip Technology Inc. Page 2


AC Induction Motor (ACIM) Control
Using PIC18Fxx31

Motor Control from Microchip


● Complete solutions for Stepper, Brushed DC,
BLDC, ACIM & SR motors utilizing PIC16, PIC18 &
dsPIC devices
● Microchip Opamps & International Rectifier drivers
● Provide everything a design engineer needs:
● Low-risk product development
● Lower total system cost
● Faster time to market
● Outstanding technical support
● Dependable delivery & quality
● Visit us at www.microchip.com/motor
© 2003 Microchip Technology Incorporated. All Rights Reserved. AC induction Motor Control Using PIC18Fxx31 Slide 3

Microchip Technology offers a broad product portfolio that provides a complete


system solution for your brushed DC motor, variable speed brushless DC motor, AC
induction motor, switched reluctance motor and stepper motor applications. This
includes the microcontroller with firmware to drive the motor, analog op amps and
comparators for sensors or feedback and power electronics from Microchip and
International Rectifier. With our sophisticated development systems and technical
documentation, Microchip makes it easy for designers of all experience levels to
complete a high performance electronic motor control design quickly and cost
effectively. Microchip provides everything a motor control design engineer needs:
low-risk product development, lower total system cost, faster time to market,
outstanding technical support and dependable delivery and quality. For access to
Microchip’s complete motor control design resources, visit the Motor Control
Design Center at www.microchip.com/motor.

© 2004 Microchip Technology Inc. Page 3


AC Induction Motor (ACIM) Control
Using PIC18Fxx31

PIC18Fxx31 Overview
Timer0 Timer1 Timer2 Timer5

Data Flash 14-Bit Power


EEPROM Program Memory Control PWM
256 Bytes (16KB)

CCP RAM Motion Feedback


(2K) (768B) - 3 input captures
- Quadrature Encoder

PBOR 200 Ksps


SSP Fault Interface
LVD 10-Bit ADC

© 2003 Microchip Technology Incorporated. All Rights Reserved. AC induction Motor Control Using PIC18Fxx31 Slide 4

PIC18Fxx31 family of microcontrollers features 4 parts, having 28 pin and 40 pin packages with
8Kbytes and 16Kbytes of program memory. The major peripherals that are useful in motor
control are indicated above in the darker blue blocks. Power Control PWM, Motion Feedback
Module, Fault Inputs, and High speed Analog-to-Digital Converter, make the family well-suited
to a variety of motor control tasks.
Main features of PCPWM include:
• Up to 8 channels output or 4 pairs complimentary outputs
• Up to 14 bits PWM of resolution
• Center aligned or edge aligned PWM operation.
•Programmable dead band control for complementary outputs
• Hardware Fault interface pins for fast PWM shut down in the event of fault.
Main features of High speed ADC include:
• Up to 9 channels input, with 2 Sample and Hold circuits
• Simultaneous and sequential conversion capabilities
• 4 word deep FIFO with flexible interrupt settings
Main features of Motion Feedback Module include:
•QEI for measuring, position velocity and direction of rotation
•3 Input Capture pins with multiple modes for pulse width and frequency measurements.

In this presentation we’ll examine how to use the PCPWM, Fault Inputs, and Motion Feedback
Module to control a 3-phase induction motor.

© 2004 Microchip Technology Inc. Page 4


AC Induction Motor (ACIM) Control
Using PIC18Fxx31

Drive Topology
VDC+

H1 H2 H3
Phase B

Phase A Phase C

L1 L2 L3
VDC-

© 2003 Microchip Technology Incorporated. All Rights Reserved. AC induction Motor Control Using PIC18Fxx31 Slide 5

As you may already know, control of a 3-phase AC induction motor requires pulse-
width modulated control of the six switches of a 3-phase inverter bridge connected to
the 3 legs of the motor’s windings. The six switches form 3 pairs of “half-bridges”,
which can be used to connect each leg to the positive or the negative high-voltage DC
bus. As can be seen from the figure, two switches on the same “half-bridge” must
never be on simultaneously, otherwise the positive and negative buses will be shorted
together. When one switch is on, the other must be off; thus they are driven as
complementary pairs. It should also be noted that the switching devices used in the
half-bridge (in this case, IGBT’s) often require more time to turn off than to turn on.
For this reason, a minimum dead-time must be inserted between the off and on time of
complimentary channels.

The PCPWM is well-suited for this application because it can provide up to four pairs
of complimentary outputs with programmable dead-time.

© 2004 Microchip Technology Inc. Page


AC Induction Motor (ACIM) Control
Using PIC18Fxx31

3 Phase Action
R Y B

+ΦY
-ΦB
120°

120°
+ΦR 120°
-ΦR

-ΦY +ΦB

0 60 120 180 240 300 360

© 2003 Microchip Technology Incorporated. All Rights Reserved. AC induction Motor Control Using PIC18Fxx31 Slide 6

To drive the AC induction motor, the duty cycles of the PWM outputs to the 3-
phase bridge are modulated to synthesize sinusoidal waveforms (three-phase AC)
across the 3 motor windings, as depicted in this slide.

When 3-phase AC is applied to the three stator windings (sinusoidal currents, equal
in amplitude and frequency, but offset from each other by 120 degrees) the current
in the stator windings generates a rotating magnetic field (shown here as the rotating
vectors on the x-axis.)

This rotating field induces electromotive force in the rotor, which in turn produces a
magnetic field in the rotor that attempts to align with the rotating magnetic field in
the stator. This causes the rotor to rotate. See the ap notes listed in the resource
section at the end of this presentation, for a more detailed discussion of motor
construction which makes this happen..

© 2004 Microchip Technology Inc. Page 6


AC Induction Motor (ACIM) Control
Using PIC18Fxx31

Open Loop Control


AC in

/MCLR 1 28 RB7/PGD
+ - DC bus
AN0 RB6/PGC
2 27
Potentiometer AN1 PWM4 B-Low
3 26
AN2 PWM5 B-High
4 25
AN3 PWM3 Y-High
5 24

PIC18F2431
AN4
6 23 PWM2 Y-Low Motor
AVdd PWM1
7 22 R-High
AVss
8 21 PWM0 R-Low 3 phase
OSC1
OSC2
9 20 Vdd
Inverter
Vss
RC0
10
11
19
18 RC7/RX/DT
bridge
DC bus current /FLTA/CCP2 RC6/TX/CK
- 12 17
/FLTB/CCP1 13 16 RC5/INT2
Reference +
RC3/INT0 14 15 RC4/INT1 DC bus
current

© 2003 Microchip Technology Incorporated. All Rights Reserved. AC induction Motor Control Using PIC18Fxx31 Slide 7

Here’s a typical example of how the PIC18F4431 is configured to control a 3-phase


AC induction motor:
A speed reference is provided by a potentiometer connected to analog channel 0.
The PCPWM within the microcontroller is used in complimentary mode to generate
three pairs of complimentary outputs on PWM channels 0-6. A built-in dead-time
generator is used to insert the necessary deadtime between complimentary channels.
The PWM outputs drive a 3-phase inverter bridge, which can be an integrated gate
driver and 3-phase inverter, such as the IRAMS10UP60A from International Rectifier.
The 3 motor phases of the ACIM are connected to a three-phase inverter bridge.
DC bus current is monitored by measuring voltage across a shunt resistor and feeding
it to a comparator. The bus current signal is compared to a reference. The comparator
output is connected to the FLTA input of the PIC18F4431. When operated in
cycle-by-cycle mode, an overcurrent condition will result in shut-off the PWM
outputs in hardware for as long as the overcurrent condition exists. In addition,
a flag is set which enables firmware to take corrective action, such as reducing the
target speed.

© 2004 Microchip Technology Inc. Page 7


AC Induction Motor (ACIM) Control
Using PIC18Fxx31

Open Loop VF Control

● Vary Voltage and frequency at fixed ratio


● PCPWM used in complimentary mode with
dead-time to generate 3 output pairs.
● A sine table is used for calculating the PWM
duty cycle of each output pair.
● 120° phase shift between output pairs.
● Timer defines the frequency by determining
how often the duty cycle is updated.
● Scaling the maximum duty cycle determines
the voltage.
© 2003 Microchip Technology Incorporated. All Rights Reserved. AC induction Motor Control Using PIC18Fxx31 Slide 8

The algorithm for controlling the AC induction motor requires that the voltage
(amplitude of the sinuisodal inverter drive) and the frequency be varied in a fixed ratio.
Speed is controlled by varying the input frequency of the applied alternating current,
and torque is maintained constant by varying the voltage in direct proportion to the
frequency.

To accomplish this, the PCPWM is used in complimentary mode with programmable


deadtime to generate 3 complimentary output pairs. A sine table is used for varying
the duty cycle of each output pair. A 120 degree offset is maintained between phases
by using three offset pointers to the sine table. A timer is used to set frequency by
determining how often the duty cycle values are updated. Amplitude is determined by
scaling the maximum duty cycle based on the frequency.

© 2004 Microchip Technology Inc. Page 8


AC Induction Motor (ACIM) Control
Using PIC18Fxx31

Implementing VF Control
● Sine table PWM duty cycle
● 3 offset pointers, to give 120° phase shift
● Timer0 Motor frequency.
● Timer0 reload value depends up on
● the potentiometer setting(frequency)
● operating frequency
● number of Sine values in the table
● In Timer0 overflow ISR, new PWM duty cycles are
calculated based on the Frequency and phase
angle on the Sine table and loaded to the duty
cycle registers.
© 2003 Microchip Technology Incorporated. All Rights Reserved. AC induction Motor Control Using PIC18Fxx31 Slide 9

Let’s look at this a little more closely.


The duty cycle of the three PWM channels are changed in a regular manner using a
Timer0 interrupt in order to synthesize the three-phase waveforms that drive the
motor.
•A sine table is stored in program memory. Three registers are used as offsets to the
table. Each of these offset values is used to point to one of the values in the table,
such that there is always a 120 degree phase shift between the phases.
•The preload value of Timer0 determines how quickly it will overflow, and
therefore how quickly new PWM values are loaded from the sine table.
•In this example, the potentiometer connected to AN1 determines the target motor
speed. The microcontroller uses the ADC measurement to calculate the maximum
PWM duty cycle and the update rate. These parameters determine the amplitude
and frequency of the synthesized sine waves that drive the ACIM.
•New PWM duty cycles are calculated within the Timer0 interrupt service routine,
and Timer0 is preloaded to determine the time until the next Timer0 interrupt.

© 2004 Microchip Technology Inc. Page 9


AC Induction Motor (ACIM) Control
Using PIC18Fxx31

Closed Loop Control - QEI


Potentiometer
AC in
/MCLR 1 RB7/PGD
4
AN0 2
INDX 3
0 RB6/PGC
39
+ - DC bus
PWM4 B-Low
QEA 38
QE interface QEB
4
PWM5 B-High
37
5 Y-High
AN4 6 36 PWM3
AN5 35 PWM2 Y-Low
Motor current

PIC18F4431
7
AN6 8 34 PWM1 R-High
Motor
Temp. sensor
AN7
AN8 9
10
33 PWM0
Vdd
R-Low 3 phase
32
Vdd 11 31 Vss Inverter
Vss RD7
OSC2
12
13
30
29 RD6 bridge QE
OSC1 28 RD5
14 RD4
RC0 27
DC Bus Current - 15 26 RC7/RX/DT
FLTA/CCP2 16
+ FLTB/CCP1 25 RC6/TX/CK DC
Reference RC5/INT2
INT0/RC3
17
18
24
23 RC4/INT1 Bus
RD0
19 22 RD3
RD2
current
RD1 21
20

© 2003 Microchip Technology Incorporated. All Rights Reserved. AC induction Motor Control Using PIC18Fxx31 Slide 10

ACIM motors are usually operated in open-loop with no velocity or position


feedback. The V/f ratio is maintained constant to provide a constant maximum
torque over the operating range. The rotor is assumed to follow the rotating
magnetic field created by the 3-phase AC input to the stator windings with the
slip frequency being the difference between the frequency of the applied AC
in the stator and the rotational frequency of the rotor. The actual torque generated
depends upon the degree of slip,

Velocity feedback can be used for more precisely controlling motor speed
by controlling the slip, and therefore the torque, or by altering the drive
frequency to make the rotor speed more closely match the reference speed.
To obtain velocity feedback from the rotor, a quadrature encoder mounted to
the rotor may be connected directly to the QEA and QEB pins of the
microcontroller. By using the Motion Feedback module as a quadrature encoder
interface in velocity measurement mode, measuring the the rotational velocity of
the motor is easy.

© 2004 Microchip Technology Inc. Page 10


AC Induction Motor (ACIM) Control
Using PIC18Fxx31

Closed Loop VF Control

● Variety of closed loop methods exist


● Speed error = Reference speed - actual speed
● Output frequency is increased if speed error is
positive.
● Output frequency is reduced if speed error is
negative
● PID algorithm can be implemented to modify
output frequency based on speed error.
● V/F ratio is maintained constant

© 2003 Microchip Technology Incorporated. All Rights Reserved. AC induction Motor Control Using PIC18Fxx31 Slide 11

A variety of closed-loop algorithms may be used, ranging from the relatively simple to
the very complex. A basic form of closed loop control is to calculate the speed error
by comparing the actual speed (as measured by the Quadrature Encode interface) with
the reference speed (the target speed as determined by the potentiometer). If the speed
error is positive (the target speed is greater than the actual speed) then the drive
frequency to the stator is increased. If the speed error is negative, then the drive
frequency to the stator is reduced. A PID algorithm can be used to adjust the drive
frequency based on the speed error. The voltage is maintained in a constant ratio with
the drive frequency as with normal V/F control.

As long as the the load does not exceed the maximum torque available, the speed of the
rotor can be controlled accurately using this method.

© 2004 Microchip Technology Inc. Page 11


AC Induction Motor (ACIM) Control
Using PIC18Fxx31

Comparison

Microcontroller PWM outputs Deadtime Complimentary Velocity


Signal Feedback
Generation
PIC18F452 2 CCP Requires Requires None
1 generated in external external
firmware hardware hardware
PIC16F7X7 3 CCP Requires Requires None
external external
hardware hardware
PIC18F4431 8 PCPWM Built in to Built in to QEI/IC
PCPWM PCPWM

© 2003 Microchip Technology Incorporated. All Rights Reserved. AC induction Motor Control Using PIC18Fxx31 Slide 12

We’ll end this discussion by comparing several possible PICmicro MCU solutions for
3-phase AC induction motor control.

•A standard PIC18 part, such as the PIC18F452, may be used by using the PWM
feature of its 2 CCP modules and creating a third PWM in firmware. However,
complimentary signal generation and dead-time must be generated with external
hardware.
•The PIC16F7X7 may be used. With its 3 CCP modules, it is not necessary to simulate
a PWM in firmware. Complimentary signal generation and dead-time still must be
generated with external hardware.
•The PIC18F4431 features the power control PWM module, and can therefore provide
up to 4 pairs of complimentary outputs, with programmable deadtime. It also features
a motion feedback module with a Quadrature Encoder Interface that is well-suited to
closed loop control.

Each of these devices can be viable for implementing 3-phase AC induction motor
control, depending upon a customer’s cost and performance requirements. Greatest
performance potential is provided by the PIC18F4431, due to its specifically designed
motor and power control peripherals.

© 2004 Microchip Technology Inc. Page


AC Induction Motor (ACIM) Control
Using PIC18Fxx31

Summary
● PIC18Fxx31 peripherals for motor control
● ACIM motor control using PIC18Fxx31
● Open V/F loop control
● Closed loop control using Quadrature encoder
● Comparison to other PICmicro MCU solutions

© 2003 Microchip Technology Incorporated. All Rights Reserved. AC induction Motor Control Using PIC18Fxx31 Slide 13

In summary, we’ve discussed the PIC18Fxx31 peripherals for motor control. We’ve
discussed the basics of open loop VF control for 3-phase induction motors, how to
utilize current feedback with hardware fault input to the PCPWM, and how to
implement closed loop control by using the Quadrature Encoder Interface of the
Motion Feedback Module. We’ve also briefly compared how AC induction motor
control can be implemented with other PICmicro MCUs.

© 2004 Microchip Technology Inc. Page 13


AC Induction Motor (ACIM) Control
Using PIC18Fxx31

Resources
● Application notes:
● AN887 : AC Induction Motor Fundamentals
● AN843 : Speed Control of 3-phase Induction Motor Using
PIC18 Microcontrollers
● AN889: VF Control of 3-Phase Induction Motors Using
PIC16F7X7 Microcontrollers
● AN627: 3-Phase AC Induction Motor Control Using the
PIC18F4431 Microcontroller
● Demo and development board
● PICDEMTM MC - Completely isolated, low cost design
● Microchip motor control web-page at:
www.microchip.com/motor
© 2003 Microchip Technology Incorporated. All Rights Reserved. AC induction Motor Control Using PIC18Fxx31 Slide 14

For more in-depth exploration of this topic, you are encouraged to examine the
following application notes:
AN887 gives an overview of the operating principals of AC Induction motors.
AN843 shows how to implement 3-phase AC induction motor control using a PIC18
using two CCP modules and a firmware PWM.
AN889 shows how to implement 3-phase AC induction motor control using the
PIC16F7X7, which has three CCP modules, obviating the need for a firmware PWM.
AN627 shows how to implement control of a 3-phase ACIM using the PIC18F4431
with the PCPWM and MFM. (Available at the end of January.)
An excellent development board for motor control applications is the PICDEM MC,
which provides a fully isolated platform that can be safely used with an ICD2 or
ICE2000 development tool.

For the latest updates, please refer to Microchip’s motor control page at
www.microchip.com/motor.

© 2004 Microchip Technology Inc. Page 14

You might also like