Professional Documents
Culture Documents
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.
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
•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.
PIC18Fxx31 Overview
Timer0 Timer1 Timer2 Timer5
© 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.
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.
3 Phase Action
R Y B
+ΦY
-ΦB
120°
120°
+ΦR 120°
-ΦR
-ΦY +ΦB
© 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..
/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
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.
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
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
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.
© 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.
Comparison
© 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.
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.
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.