Application Note: Space Vector Modulation of a 3-Phase AC ...Space Vector Modulation of a 3-Phase AC...
Transcript of Application Note: Space Vector Modulation of a 3-Phase AC ...Space Vector Modulation of a 3-Phase AC...
AN038201-0816MultiMotor
SeriesMultiMotor
Series
Abstract
Space Vector Modulation (SVM) techniques can be applied to AC induction motors (ACIM), permanent magnet synchronous motors, and BLDC motors. A 3-phase ACIM is controlled by creating a rotating voltage reference vector within a hexagon. The speed of rotation of this voltage reference vector determines the frequency of motor rotation. The Space Vector Modulation application discussed in this application note uses the Voltage per Hertz (V/F) control principle with or without a Hall sensor functioning as a tachometer for speed feedback to control an ACIM motor.
Continual cost pressures and increased consumer expectations have driven design engi-neers to seek minimal hardware solutions that extract maximum performance from motors used in consumer goods. This application note demonstrates how Zilog’s Z16FMC MCU can implement an efficient and cost-conscious V/F vector modulation of an AC induction motor.
The source code file associated with this application note, AN0382-SC01, is available free for download from the Zilog website. This source code was tested with version 5.18 of Keil MDK for Zilog’s Z32F138 ARM Cortex MCUs. Subsequent releases of this software may require you to modify the code supplied with this application.
Z32F128 Series Flash Microcontrollers
The Z32F128 Series of Flash MCUs is based on Zilog’s advanced 32-bit ZNEO32! CPU core allowing simultaneous operation of two inverter bridges. The MCUs in this series are optimized for motor control applications and support control of single- and multi-phase variable-speed motors. Target applications include consumer appliances, HVAC systems, factory automation, refrigeration, and automotive applications.
Figure 1 shows a block diagram of the Z32F128 MCU.
Note:
AN038201-0816
Application Note
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 Microcontroller
Page 1 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
To rotate a 3-phase motor, three AC voltage signals must be supplied and phase-shifted 120° from each other. To control a 3-phase motor, the MCU must provide six Pulse Width Modulation (PWM) outputs. The Z32F128 MCU features a flexible PWM module with three complementary pairs – or six independent PWM outputs – supporting deadband insertion and fault protection trip input. These features provide multiphase control capa-bility for multiple motor types and ensure that the motor operates safely by effecting an immediate shutdown of the PWM during a fault condition.
Discussion
An electric motor consists of a stator and a stationary frame in which a rotating compo-nent, or rotor, is mounted on a shaft and bearings. In a 3-phase ACIM motor, the stator is laced with three sets of inductor windings energized by three AC voltage inputs that are phase-offset 120° from each other to produce a rotating field of magnetic flux. This stator
Figure 1. Z32F128 MCU Block Diagram
AN038201-0816 Page 2 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
flux field induces a voltage onto the rotor which also generates a rotor flux field which then interacts with the stator flux field, resulting in torque on the output shaft.
In a 3-phase motor control application, the input to the motor is produced by a 3-phase inverter bridge consisting of six switching devices. This inverter bridge forms three legs, each operating in complementary PWM. Each leg or MOSFET pair connects to either the ground voltage or the bus voltage depending on the ON/OFF state of the MOSFETS, which are controlled by the PWM signals from the Z32F128 microcontroller. The micro-controller applies sinusoidal changing PWM signals to this inverter bridge to generate three approximately-sinusoidal AC waveforms on the bridge outputs to which the ACIM motor is connected, with the required 120° phase offset.
The duty cycle of each microcontroller’s PWM output is varied, to control the period and amplitude of the generated AC signal, which in turn determines the speed and torque of the motor.
Theory of Operation
When a constant ratio of applied frequency and voltage is maintained, a constant flux throughout a wide operating range is created in the air gap between the rotor and the sta-tor. This control method is referred to as Voltage per Frequency, or V/F control.
In this application, using the V/F method, space vector modulation is the means by which a rotating magnetic field is created in the stator, and via induction, ultimately in the rotor. Space vector modulation techniques utilize an additional fifteen percent of the available bus voltage, thereby increasing the efficiency of the motor. The space vector modulation scheme applied here is referred to as alternate-reverse switching. This technique mini-mizes inverter switching and therefore, linear switching power losses. Intrinsic to ACIM motors is the slip frequency, which is the difference between the synchronous speed of the stator and rotor flux fields. This slip frequency must be controlled with a V/F profiler as discussed later in this document.
Using ordinary sinusoidal PWM techniques, the neutral point of the phase voltages are confined to Vbus/2, as shown in Figure 2.
The advantage of space vector modulation is that the neutral point of the phase voltages is not constrained to one-half of the bus voltage, as illustrated in Figure 3.
Figure 2. Neutral Point Confinement of Sinusoidal PWM Phase Voltages
AN038201-0816 Page 3 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
Additionally, unlike sinusoidal PWM, which generates sinusoidal currents separately in each push/pull stage of the inverter, the Volt per Hertz (V/F) space vector modulation technique operates the entire inverter as a single unit to produce sinusoidal currents. In doing so, the inverter is operated in eight different states within the hexagon. Two of these states are referred to as zero vectors because they produce no voltages. The remaining six states produce non-zero voltages. The rotating reference voltage VS within this hexagon, shown in Figure 4, is represented by a space vector VS in Equation 1, which follows.
Equation 1
Figure 3. Space Vector Modulated Phase Voltages not Confined to a Neutral Point
Figure 4. The Rotating Reference Vector VREF Within The Hexagon
V4 (011) 180 degree
V3 (010) 120 degree
V2 (110) 60 degree
V5 (001) 240 degree
V6 (101) 300 degree
V1 (100) 0 degree V0 (000)
V7 (111)
r1
r2
Θ
Vs
VSVmagVbus---------------- e×
jθ=
AN038201-0816 Page 4 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
The ejθ part of Equation 1 can be represented by Euler’s identity in Equation 2, which states that the VS vector is comprised of a real component and an imaginary component.
Equation 2
This VS vector is formed, as shown in Equation 3, in which sinusoidal voltage changes present at each motor phase winding produce sinusoidal currents in each phase to generate magnetic flux fields, as shown in Equation 4.
Equation 3
Equation 4
In Equation 4, NS is the number of inductor turns, μ0 is the permeability of space, and Lg is the air gap.
The reference vector VS must be converted to the appropriate switching signals and applied to the inverter bridge using Equation 5.
Equation 5
As indicated in Equation 5, to generate this rotating vector VS, the angular position within any two base vectors, the base vectors themselves, and the scalar coefficients r1 and r2 must be known, as shown in Figure 4.
After obtaining the angle theta of rotation and the adjacent base vectors within the hexa-gon, the scalar coefficients for the adjacent base vector r1 and r2 must be calculated to time-modulate the base vectors V1 and V2 to generate the rotating voltage reference vector VS within the hexagon. This space vector can be located anywhere between any of the base vectors V1 to V6. This commutation scheme is different from the six-step commutation scheme which has six distinct commutation steps per electrical revolution.
Figure 5 shows the location of the reference vector VS, which is located between base vec-tors V1 and V2.
ejθ θ( ) j θ( )sin+cos=
VS t( ) Va t( )× ej0× Vb t( )× e× j120
Vc t( ) ej240×+ +=
BS t( )NS μ0×2 Lg×
--------------------- ia t( ) ej0× ib t( ) e
j120× ic t( ) ej240×+ +
=
VS r1 v1×( ) r2 v2×( )+=
AN038201-0816 Page 5 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
After the angular information is obtained, the scalar quantities r1 and r2 are calculated by equations 6 and 7.
Equation 6
Equation 7
In the above equations, m is the magnitude of the rotating space vector VS within the hexa-gon and θ is the angle of the reference vector VS with respect to the base vectors V1 and V2.
The time duration for which the adjacent base vectors are modulated to obtain the refer-ence vector is calculated by using equations 1, 2, and 3 to compute equations 8 through 10.
Equation 8
Equation 9
Figure 5. The Location of Reference Vector VS Between Base Vectors V1 and V2
r2V2
60 degree
Θ
Vs
r1V1 V1
V2
r2 m 3 Δθ( )sin×=
r1 m 3 60 Δθ–( )sin×=
T0 1 r1– r2–( ) T×=
T1 r1 T×=
AN038201-0816 Page 6 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
Equation 10
In these equations, T is the sum of T0, T1, and T2 and cannot be greater than the time period of the PWM. Next, T0 becomes the time period for which either or both zero vec-tors are applied in combination with T1 and T2, as shown in Figure 6.
To find the time values T0, T1, and T2, the angles are determined by using V1 as the refer-ence axis going counterclockwise to find the base vector angle to be subtracted from the angle of the reference vector.
For example, using Equation 1, if the bus voltage is 24 V and the desired reference vector magnitude is 12 V, then the reference vector VS is calculated using Equation 11.
Equation 11
In Equation 11, the angle is 190° and the adjacent base vector is V4, which is 180°. There-fore, r1 and r2 are calculated by using equations 6, 7, and 8 to compute equations 12 and 13.
Equation 12
Equation 13
If the PWM period is T = 50 μs, then the time duration for either zero vector V0, V7 is shown in equations 14 through 16.
Figure 6. The Switching Times for Base Vectors V1, V2, and Zero Vectors
T2 r2 T×=
VS
VmagVbus--------------- e
j190×=
r1 31224------× 60 190 180–( ) ]–[sin× 0.663= =
r2 31224------× 190 180–( )sin× 0.15= =
AN038201-0816 Page 7 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
Equation 14
The time duration for T1 is calculated using Equation 15.
Equation 15
The time duration for T2 is obtained from Equation 16.
Equation 16
Space vector modulation has an advantage over ordinary sinusoidal modulation because it allows for different switching combinations. For example, using T1 and T2 based on the choice of the null vectors which are applied for duration of time T0 and applying the zero vectors V0, V7, or both, results in different switching patterns to generate either less total harmonic distortion or to reduce linear switching power losses in the switching devices. V0, V7 zero vectors may be used to obtain the regenerative braking effect, especially when using ACIM.
For example, to reduce linear switching losses, either of the V0 or V7 zero vectors can be applied in sequence. V0 is applied as the zero vector in the sequence T1–T2–T0; the V7 zero vector is used in the same sequence. In either case, each of the three phases in the inverter does not switch for one third of the duration of a cycle.
Different combinations of switching sequences can be applied, but may have different, and perhaps undesirable effects on the inverter circuit, depending on the size of the boot-strap capacitors used for the high- and low-side drivers. However, space vector modula-tion allows for a variety of switching schemes to obtain the desirable effect and meet customer-specific requirements. This application note uses the alternate reverse switching mode, in which each column corresponds to vectors one through six, as shown in Figure 7.
In the reverse switching mode, only one inverter leg at a time switches to reduce linear power-switching losses. The null vectors are alternated upon each space vector modula-tion sequence in reversed order after each zero vector, as shown in Figure 8.
Figure 7. Example of PWM Timings Using an Alternate-Reverse Switching Mode
T0 1 r1– r2+( ) T 9.3μs=×=
T2 r1 T× 33.2μs= =
T2 r2 T 7.5μs=×=
AN038201-0816 Page 8 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
Application
To apply the space vector theory, the Z32F128 microcontroller’s PWM module is config-ured to operate in three complementary output pairs. Each output pair controls one com-plementary source/drain transistor pair in the inverter bridge. The PWM module is configured to insert a deadband between ON states to prevent leakage that might occur if one transistor in a pair turns on before the other is fully off. Each PWM output pair pro-duces a stream of complementary on/off pulses to activate the corresponding source or drain transistor in the inverter bridge. The voltage of each bridge output varies with the source/drain pulse duty cycle. The input to the space vector modulation software function is the angle and the magnitude.
The period of each PWM cycle is configured to be 50 μs and generates an interrupt request at the end of each cycle to process the speed integration to form the angle, the vector decomposition based on the angle, and the space vector modulation voltages based on the magnitude. This data is then loaded into the three PWM registers for Phase A, Phase B, and Phase C.
The simplest way to control an ACIM is via the V/F method without any sensing feedback of the rotor. The speed demand comes from a potentiometer to calculate the frequency demand with a constant proportional frequency to voltage ratio. However, if the Hall sens-ing feedback option is desired, then a single Hall sensor is used as a tachometer to deter-mine the speed of the motor. Additionally, the motor can be operated in either open loop or PI closed loop control. With the PI closed loop method, the Timer 0 ticks are captured at every rising edge of the Hall and compared to the requested speed received through a UART terminal or potentiometer, when in Standalone Mode. The frequency of the rotat-ing vector is calculated as shown in Equation 17.
Equation 17
In the above equation, the Look-Up Table (LUT) offset value is a 16-bit integer index of which only the upper byte is used to select the LUT entries. The synchronous speed of the rotor is calculated as shown in Equation 18.
Equation 18
The Timer 0 ticks captured for the PI loop are calculated as shown in Equation 19.
Figure 8. space Vector Modulation Sequence
Frequency Look-Up Table offsetPWM period Look-UpTable size×-------------------------------------------------------------------------------------------=
RPM 120Frequency
Poles-------------------------------×=
AN038201-0816 Page 9 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
Equation 19
To change the frequency of the motor, the upper byte of a 16-bit interpolating sine table index is used to fetch the next PWM sine value from the LUT. Assuming the sine fre-quency is 60 Hz, the offset value for the sine table pointer is calculated as shown in Equa-tion 20.
Equation 20
In the above equation, 20000 is the PWM frequency.
The (rounded) offset value represents the frequency demand, which is integrated to form the (theta) angle of the rotor. The upper byte of the theta value then becomes the index to the 256 sine value table.
Depending on the frequency demand, the values of the upper byte of the sine index can change with higher granularity, hitting each sine array value more or fewer times while the sine index continuously rolls over. Using this method, the lowest period using a16-bit pointer to a 256-element sine table is represented by Equation 21.
Equation 21
Because of the interpolating index method, the increment values in the upper byte of the sine table index will be small, changing only in fractions to achieve higher frequencies.
Speed Calculations
The angular time periods of the rotor are represented by elapsed timer ticks and are cap-tured upon each rising edge of the Hall interrupt as described in the previous section. These timer ticks are then compared with the demand speed coming from a potentiometer in Standalone Mode, or from the UART when in Terminal Mode. The captured timer ticks period represents the actual speed of the motor and is compared with the demand value for closed-loop operation.
The angular speed is represented by Equation 22.
Equation 22
TimerTicks
MCU clockTimer0 prescaler------------------------------------------------
LUToffsetPWM period LUTsize×--------------------------------------------------------------------------------------------------------------------------------=
SineIndexOffset 60 65536×20000
----------------------------- 196= =
65535 50μs 3.277 ondssec=×
ω ddt----- θ×=
AN038201-0816 Page 10 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
In the above equation, θ is
The RPM of the motor in this application is calculated using Equation 23.
Equation 23
In the above equation, N is the number of poles and F is the frequency. By substitution, use Equation 24 to obtain the RPM.
Equation 24
Voltage per Hertz ControlAs shown in Figure 9, the base frequency is at the maximum flux field with the speed at full armature current and voltage.
The software algorithm ensures that the ratio of voltage and frequency remains constant over the full speed range to maintain a constant flux field in the air gap of the motor. A boost voltage, or minimum voltage and frequency limit, is implemented to avoid high cur-rents through the motor windings at very low speeds in which the complex reactance of the motor windings is very low. In this application note, the total reactance of the motor is represented by Equation 25.
Figure 9. Voltage Per Hertz Control
2 π f××
RPM 120 F×N
-------------------=
RPM120
tableIndexValuePWMperiod SineTableSize×-----------------------------------------------------------------------------------×
N----------------------------------------------------------------------------------------------------=
AN038201-0816 Page 11 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
Equation 25
In the above equation, R is the real resistance and XL and XC are the inductor reactance and capacitive reactance, respectively.
V/F Profiler and Slip FrequencySlip frequency is intrinsic to AC induction motors. In an AC induction motor, the stator flux field is rotating at synchronous speed according to the sinusoidal frequencies of the currents that produce this stator flux field. The resulting induced flux field in the rotor interacts with the stator flux field and causes a torque to rotate the motor at the synchro-nous speed minus a frequency that is referred to as slip frequency. In effect, the rotor fre-quency is always less than the stator field frequency, which is necessary because only an alternating current field can induce a voltage in the rotor. If the rotor frequency and stator frequency were the same (from the perspective of either stator or rotor), there is no alter-nating field and therefore no voltage is induced to cause a torque from the interacting rotor and stator force field. This electromagnetic behavior is depicted in Equation 26.
Equation 26
In the above equation, the subscript S refers to the stator. This equation states that the rate of change of current through an inductor induces a voltage. This alternating stator voltage induces a voltage onto the rotor to cause an alternating current in the rotor, with a resulting rotating flux field in the rotor.
The interaction of rotor and stator flux fields must be controlled with a V/F profiler. If the Hall sensor option with closed loop feedback is enabled in the firmware, it is possible that the closed loop will adjust the stator frequency faster than the rotor frequency can respond, so that the stator frequency will run off, causing the slip frequency to become too large and subsequently stall the motor. Additionally, if the rate of deceleration is too high, the slip frequency becomes too large while the potentially damaging excessive Back-Electro-motive Force (BEMF) voltage is fed back to the supply, unless the generated BEMF volt-age is desired during deceleration for regenerative braking or battery-charging purposes. To control the slip frequency and its associated effects, a V/F profiler is implemented to control the rate of frequency changes.
If the option to operate the ACIM with Hall sensing feedback and no closed loop speed control is enabled, the slip frequency is dynamically calculated and optimized, based on the rotor frequency information which is provided by the Hall sensor.
The ACIM motor used for this application is a BOSCH 250 V, 2 A motor (500 W) shown in Figure 11 on page 15. However, for development purposes with Zilog’s MultiMotor Con-trol Development Kit, this software was designed to operate the motor at 30 V. Therefore,
Z R2
XL XC–( )2+=
VS LSddt-----× IS×=
Note:
AN038201-0816 Page 12 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
the V/F profiler may require adjusting for acceleration and deceleration rates when operat-ing a customer ACIM at higher voltages.
Equipment Used
The following equipment is used for the setup to demonstrate the space vector modulation technique. The first four items are included in the MultiMotor Development Kit (ZMULTIMC100ZCOG).
• MultiMotor Development Board (99C1358-0001G)
• 24V AC/DC power supply
• LINIX 3-phase 24VDC, 30W, 3200RPM BLDC motor (45ZWN24-30)
• Opto-Isolated UART-to-USB adapter (99C1359-001G)
• Z32F128 MultiMotor MCU Module (99C1461-001G) – Order separately
• Keil ULINK2 debugger – Order separately
• Digital oscilloscope
• PC with Internet access and at least two open USB ports
Hardware Setup
Figure 10 shows the application hardware connections required to operate the motor with the space vector modulation method.
AN038201-0816 Page 13 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
Figure 11 displays the BOSCH AC induction motor used for the development of the code for this application note.
Figure 10. MultiMotor Demo Kit and Linix BLDC Motor
AN038201-0816 Page 14 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
Testing Procedure
Observe the following procedure to test space vector modulation on the Z32F128 MCU Module.
1. Download and install Keil MDK–ARM µVision IDE version 5.20 (or newer) on your PC from the Keil website.
2. Download the AN0382-SC01.zip source code file from the Zilog website and unzip it to an appropriate location on your PC.
3. Connect the hardware as shown in Figure 10.
a. The cables from the Keil ULINK2 debugger and the UART-to-USB adapter must be connected to two of the PC’s USB ports.
b. Download and install the drivers for the Keil ULINK2 and the UART-to-USB adapter, if required.
4. Power up the MultiMotor Series Development Board using the 24 V DC adapter that is included in the Kit.
Figure 11. BOSCH AC Induction Motor
AN038201-0816 Page 15 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
The order of the phase wire connectivity affects the spin direction of the motor but is oth-erwise irrelevant. The 24 V power supply that is included in the kit may not suffice.
5. Using a serial terminal emulation program such as HyperTerminal, TeraTerm, or Real-Term, configure the serial port to 57600-8-N-1-N. A console screen should appear on the PC which will show the status of the motor and allow changes to the motor’s oper-ation.
6. Launch Keil µVision version 5.20 (or newer), select Open Project from the Project menu, browse to the directory on your PC to which the AN0382-SC01 source code was downloaded, locate the AN0382_SC01.zdsproj file, highlight it, and select Open.
7. Ensure that the RUN/STOP switch on the Z32F128 MCU Module is in the STOP position.
8. In Keil µVision, compile and flash the firmware to the Z32F128 MCU Module by selecting Rebuild All target files from the Project menu. Next, select Debug →
Start/Stop Debug Session, followed by Debug → Run.
Figure 12. Motor Phase Wire Connections
J1J5J4
Note:
AN038201-0816 Page 16 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
9. Set the RUN/STOP switch on the Z32F128 MCU Module to RUN. The motor should begin turning.
10. In the GUI terminal console, enter the letter U to switch to UART control; a menu similar to the example shown in Figure 7 should appear. As a result, commands can now be entered using the console to change the motor’s operation.
11. On the open terminal window, enter the letter U on your keyboard to enter UART Control Mode to control the motor by entering commands on the computer keyboard. Figure 14 shows the console display in UART Control Mode.
Figure 13. Console Display in Hardware Control Mode
AN038201-0816 Page 17 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
12. In the window that appears, enter the letter S to start the motor operation, and enter any of the available operation options.
13. A data logger is used to report vital motor control data, as shown in Figure 14. The data displayed includes:
– Operating temperature
– Speed
– Operating current
– Total run time
– Spin direction
14. Upon entering D, recorded data is displayed in a continuous fashion. To stop this data display from continuing, enter a Ctrl + C command, as shown in Figure 15.
Figure 14. Console Display in UART Control Mode
AN038201-0816 Page 18 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
You can now add your application software to the main program to experiment with addi-tional functions.
Results
Three oscilloscope probes were connected to the MultiMotor Series Development Kit to Phase A, Phase B, and Phase C to show three alternate reverse switching patterns. Scope probes were connected to the BEMF voltage dividers to monitor the generated BEMF voltages and to view the associated switching pattern waveforms.
Figures 16 through 18 show the alternate-reverse space vector modulation pattern on Phase A, Phase B, and Phase C at three different time instances.
Figure 15. Enter a Ctrl + C Command to Stop the Display of Recorded Data
AN038201-0816 Page 19 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
Figure 16. Alternate Switching Pattern at Time 1
Figure 17. Alternate Switching Pattern at Time 2
AN038201-0816 Page 20 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
Figure 19 shows the three phase voltages and one of the three current wave forms (shown in green).
Alternate-reverse voltage wave forms have been measured with the oscilloscope at the BEMF voltage dividers consisting of R24, R29, C30 (BEMF_A), R25, R30, C31 (BEMF_B), and R26, R31, C32 (BEMF_C).
Code Execution Time of Relevant FunctionsThe time required for code execution of relevant functions is listed in this section. Execu-tion times are based on the external 80 MHz clock frequency.
PWM interrupt service code: ~2µs
Figure 18. Alternate Switching Pattern at Time 3
Figure 19. Three Phase Voltages and One Current Wave Form (Green)
AN038201-0816 Page 21 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
Tachometer interrupt service: ~1.2µs
SVM decomposition function call (SVM timing calculations): ~0.5µs
Compiler Optimization SettingsEnsure that the following Compiler Optimization options are set:
• Optimization: Level 1 and optimized for time
Summary
The purpose of this application note is to demonstrate the operation of an ACIM-type machine using the Space Vector Modulation technique with the Voltage per Hertz (V/F) principle. To obtain a constant flux in the air gap, the ratio of voltage and frequency is held constant throughout the speed range of the motor. To generate sinusoidal voltages and cur-rents, a voltage reference vector is rotated 360° within a hexagon. Each of the six sectors within this hexagon creates unique switching patterns for space vector modulation. Space vector modulation has the advantage of utilizing about fifteen percent more of the avail-able bus voltage and the freedom to implement multiple forms of SVM switching patterns to meet design-specific requirements. The space vector modulation scheme discussed here uses an alternate-reverse switching pattern.
Formulas are shown to calculate the space vector modulation timings and resulting motor frequency. Because the frequency calculations include the PWM period, all space vector sinusoidal wave constructions are executed in the PWM interrupt service routine. The exe-cution time for the sine wave reconstruction in the PWM interrupt service routine is approximately 2 μs. The execution time of the tachometer interrupt service routine is approximately 1.5 μs. Both of these execution times are based on a 80 MHz internal clock. The tachometer interrupt service routine captures the Timer 0 ticks upon each rising edge interrupt of the Hall for open- and closed-loop speed calculations. The calculated speed value from the timer ticks is integrated in the PWM interrupt service routine to form the interpolating 16-bit theta angle variable, of which only the high byte is used to fetch the next value from the sine LUT.
In essence, all speed calculation values are offset to the interpolating 16-bit sine LUT index. Depending on the demand speed, these values will increase or decrease the fre-quency of rotation of the reference vector. Space vector modulation has the advantage of commutating the ACIM with less acoustical and electrical noise and, depending on the switching scheme, fewer linear power switching losses. The effects of total harmonic dis-tortions and linear switching power losses can be further manipulated by applying differ-ent space vector modulation switching schemes. This technique allows for higher life expectancy of ripple current capacitors and ball bearings because the sinusoidal commuta-tion approach causes virtually no torque or current ripple in an ACIM motor.
A simple V/F profiler and slip frequency is also discussed, and a V/F profiler is imple-mented to account for the rates of frequency increase and decrease to control the slip fre-quency.
AN038201-0816 Page 22 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
The example application and techniques described in this document should prove helpful for anyone who intends to develop motor control applications based on the Z16FMC series of microcontrollers.
References
To learn more about this topic and the ZNEO32! Series of motor control products, refer to the documents listed in Table 1.
Table 1. List of References
Topic Document
Z32F128 Evaluation Kit Z32F128 Evaluation Kit User Manual (UM0277)
Z32F128 MCU Z32F128 MCU Product Specification (PS0345)
Motor Control Vector Control and Dynamics of AC Drives (Monographs in Electrical and Electronic Engineering); D.W. Novotny and T.A. Lipo.
Short Course on Electric Drives: Understanding Basics to Advanced Control & Encoderless Operation: a recording of the Internet-based short course presented on May 12, 2005 by Professor Mohan and edited to fit on a DVD; Ned Mohan, University of Minnesota, 2005.
Lehrstuhl fuer Elektrische Antriebssysteme und Leistungselectronik; Ralph Kennel, Technische Universitaet Muenchen.
Electric Machinery; Peter F. Ryff.
AN038201-0816 Page 23 of 29
AN0382 Page 24 of 29
on Motor with the Z32F128 MCUltiMotor Series Application Note
Appe
BOO se
.
ut
PWML0PWMH0
PWMH1BEMF_A
BEMF_BPWML1
PWMH2
HSBHSC
PWML2BEMF_C
HSA
PWML0U_LPWMH0U_H
V_H PWMH1BEMF_A
BEMF_BPWML1V_L
PWMH2W_HW_L PWML2
CS1+BEMF_C
CS1- CS_ACS2+ CS_BCS2- CS_C
TEMP
SCK
MOSI
VCC_3v3
MISO
SS-
VCC_3v3
C
0.
J4
HDR/PIN 1x16
12345678910111213141516
U2
S25FL032P
GND4
VCC8
CS1
WP3
SO2
HOLD7
SCK6
SI5
J2
DR/PIN 2x15
1357911131517192123252729 30
282624222018161412108642
J3
123
01-0816
Space Vector Modulation of a 3-Phase AC InductiMu
ndix A. Schematic Diagrams
Figures 20 and 21 show the schematic diagrams for the Z32F128 MCU Module.
Figure 20. Z32F128 MCU Module, #1 of 2
ONVBUS CTRL
MCU
T
SPEED CONTROL
Since this chip does not have an input for differential amplifier we have to ua single-ended current measurement So, on the main board R15 and R20 should be replaced with 0 Ohm resistorsNow CS- = GND, and CS+ is an input to AN3 - we can configure it with or withoAmplifier
PROTECTION
OVERVOLTAGE
RESET
NMI
R18 = Big Wheel or R28 = Small Wheel
ONLY ONE SET OF SHUNT 1&2, 4&5, 7&8 OR2&3, 5&6, 8&9SHOULD BE PRESENT
1 2 34 5 67 8 9
J13
XOUT
VBUS_M
ENABLE
HSBHSC
Vbus_MENABLE
HSA
ENABLEVbus_Ctrl
VCC_3v3
XIN
TxD0RxD0
nRESET
TCKTMS
TDO
PRTIN0OVIN0
PWMH0PWML0PWMH1PWML1
PWMH2PWML2
TDOnRESET
nTRSTTDITMSTCK
NMI
nRESET
NMI
TDI
nTR
ST
BEMF_ABEMF_BBEMF_C
MISOMOSISCK
SS-
CS1+
HSA
HSBHSC
Vbus_MTEMP
Vbus_Ctrl
OVIN0
PRTIN0
CREF1CREF0
CS_A
CS_CCS_B
PA2/AN2/CP2
PA1/AN1/CP1
PA0/AN0/CP0
VCC_3v3
VCC_5VM
VCC_3v3
VCC_3v3
VCC_3v3
VCC_3v3
VCC_3v3
VCC_3v3
RXD0TXD0
REDYELGRNDIRPC9
1
1uF
R1010K
SH4
shunt
Y1
8 MHZ
C6
0.1uF
C4680pF
C11
0.01uF
R3 10K
SH3
shunt
C13
1000pF/1nF
C9
0.01uF
J12
12
R285K 1
3
2
J5
123
C5
0.1uF
SW3B3U-1000P
1 2
R81K
R12 10K
R9 10K
R6 10K
SW1B3U-1000P
1 2
R210K
R16 10K
R5 10K
SW4B3U-1000P
1 2
SH2
shuntR17 0 ohm
R110K
C12
0.01uF
R7 10K
SW2B3U-1000P
1 2
C8
0.01uF
7
1
8
3
954 62
HDR/3x3
J13
1 2 34
5
67
8
9
H
R4 10K
C2680pF
C3680pF
R19 1KC10
0.01uF
J1
HDR/PIN 2x10
12345678910
11121314151617181920
R185K
13
2
R1110K
U1
AC33M6128L
GN
D1
PA
0/A
N0/
CP
02
PA
1/A
N1/
CP
13
PA
2/A
N2/
CP
24
PA
3/A
N3/
CP
35
PA
4/A
N4/
T0O
6
PA
5/A
N5/
T1O
7
PA
6/T2
O/A
N6/
CR
EF0
8
PA
7/T3
O/A
N7/
CR
EF3
9
AG
ND
10
AV
DD
11
PA
8/A
N8
12
PA
9/A
N9
13
PA
10/A
N10
14
PA
11/A
N11
15
PA
12/S
S0/
AN
1216
VDD17GND18PA13/SCK0/AN1319PA14/MOSI0/AN1420PA15/MISO0/AN1521PB0/MP0UH22PB1/MP0UL23PB2/MP0VH24PB3/MP0VL25TEST26SCANMD27PB4/MP0WH/T9C28PB5/MP0WL/T9O29PB6/PRTIN0/WDTO30PB7/OVIN0/STBYO31PB8/PRTIN1/RXD332
VD
D33
GN
D34
TXD
3/O
VIN
1/P
B9
35M
P1U
H/P
B10
36M
P1U
L/P
B11
37M
P1V
H/P
B12
38M
P1V
L/P
B13
39M
P1W
H/P
B14
40M
P1W
L/P
B15
41G
ND
42V
DD
43S
WC
LK/T
CK
/PC
044
SW
DIO
/TM
S/P
B1
45N
MI
46V
DD
47G
ND
48
SWO/TDO/PC249
TDI/PC350
nTRST/PHA0/T0C/PC451
PHB0/T1C/RXD1/PC552
PHZ0/T2C/TXD1/PC653
T3C/SCL0/PC754
SDA0/PC855
T8C/CLKO/PC956
nRESET/PC1057
T8C/BOOT/PC1158
TXD0/PC1559
RXD0/PC1460
XOUT/PC1361
XIN/PC1262
VDD63
GND64
AN0382 Page 25 of 29
on Motor with the Z32F128 MCUltiMotor Series Application Note
STOP/RUN
DIRECTION
EMOVE SHUNTHEN OBSERVINGCLKOUT
VCC_3v3
R24100K
SW6
EG1218
1
32
SW5
EG1218
1
32
J7
R25100K
01-0816
Space Vector Modulation of a 3-Phase AC InductiMu
Figure 21. Z32F128 MCU Module, #2 of 2
3.3 OK
SCLKOUT
RWS
VCC_5VVCC_5V
VCC_3v3
VCC_3v3
VCC_5V
VCC_5V
VCC_5VM
VCC_5VL RED
YEL
GRN
DIR
RXD0TXD0
PC9
D3
YELL
21
J10
1x6 RT-ANGL
123456
R22
330
D1
PMEG3020
32
1
C17
0.1uF
C14
0.1uF
R27
100 ohm
U3
NCP551SN33T1G
Vin1
Enable3
GND2
NC4
Vout5
C15
4.7uF
R26
100 ohm
R21330
J11
12
J6
1 2 3
D61N4448W
R20
330
1 2 3
R23
330
J9HDR/PIN 1x3
1 2 3
SH1
shunt
J8
123
D2
RED
21
D4GREEN
21
C16
4.7uF
D5
GREEN
21
AN0382 Page 26 of 29
on Motor with the Z32F128 MCUltiMotor Series Application Note
FOR USE WITH AC MOTOR
Phase_C
HSCHSBHSA
Phase_APhase_BPhase_C
GC_L
GC_H
VCC_3v3
ENABLE
R6150K
R2310K
R13150K
C110.1uf
C5
0.1uF, 50V
N055T
C8
0.1uF, 50V
N055T
Q3
IXTY64N055T
1
23
4
Q6
IXTY64N055T
1
23
4
J5
2 POS
12
R2110K
J3
5-POS
12345
J1
3-POS
123
D4
BAS16V
4
1
3
5
6
2
01-0816
Space Vector Modulation of a 3-Phase AC InductiMu
Figures 22 and 23 show the schematic diagrams for the MultiMotor Main Board.
Figure 22. MultiMotor Development Board, #1 of 2
J16 SETTINGS:1-2 AC MOTOR2-3 BLDC MOTOR
GA_H
GA_L
Phase_B
Phase_A
GA_H
GA_L
GB_L
GB_H
GC_L
GC_H
Phase_B
B_H
B_L
C_L
CS1+
CS1-
Vbus_M
Phase_CPhase_BPhase_A
BEMF_A
PD4HSC PD5
Vbus_M ANA4ENABLE PE7
A_LPC7_PWML0A_HPC6_PWMH0
B_HPD0_PWMH1BEMF_A
BEMF_BB_LPD1_PWML1
C_HPD2_PWMH2C_LPD7_PWML2
CS1+BEMF_C
CS1-CS2+CS2-TEMP
HSA PD3
TEMP
GB_L
GB_H
C_H
Phase_A
PD4HSB
BEMF_B BEMF_C
A_H
A_L
Phase_C
VCC_12V
VCC_3v3
VCC_5VM
VCC_3v3
VBUS_B
Q1
IXTY64N055T
1
23
4
C9
0.1uF
TR3210K
Q4
IXTY64N055T
1
23
4
R5150K
R28100 ohm
C4
0.1uF
J2
HDR/PIN 2x15
1357911131517192123252729 30
28262422201816141210
8642
R4150K
R10 22.1 ohm
C1
0.1uF
R35 10 ohm
1 2
Q2
IXTY64
1
23
4
Q5
IXTY64
1
23
4R9 22.1 ohm
C32
0.01uF
SH2
shunt
J6
12
C7
0.1uF, 50V
R24150K
R2 22.1 ohm
D3
BAV19WS
2 1
C31
0.01uF
R3 22.1 ohm
C30
0.01uF
R34 10 ohm
1 2
J4
1 2 3
R2910K
R2210K
D2
BAV19WS
2 1
D1
BAV19WS
2 1
R1 2.2 ohm
U3
NCP5106B
VCC1
IN_HI2
IN_LO3
GND4
DRV_LO5
BRIDGE6
DRV_HI7
VBOOT8
R15 10K
U2
NCP5106B
VCC1
IN_HI2
IN_LO3
GND4
DRV_LO5
BRIDGE6
DRV_HI7
VBOOT8
R20 10K
R19 22.1 ohm
R14 2.2 ohm
U1
NCP5106B
VCC1
IN_HI2
IN_LO3
GND4
DRV_LO5
BRIDGE6
DRV_HI7
VBOOT8
R1710K
R16 22.1 ohm
D9
BAV19WS
2 1
D8
BAV19WS
2 1
R180.100 ohm, 2W
D7
BAV19WS
2 1
C120.1uf
R2710KR26
150KR25150K
R7 2.2 ohm
R3110K
C10
0.1uF
C6
0.1uF
R3010K
+ C3220uF, 50V
R8150K
R12150KR11
150K
C2
0.1uF
R36 10 ohm
1 2
Q7MMBT3904
3
1
2
AN0382 Page 27 of 29
on Motor with the Z32F128 MCUltiMotor Series Application Note
5V
SHU1-22-3
USE HEATSINK VCC_5VM
VBUS_B
U5
150-5
OUT3
GN
D2
IN1
J12
123
C17
0.1uF+ C15
10uF
12
01-0816
Space Vector Modulation of a 3-Phase AC InductiMu
Figure 23. MultiMotor Development Board, #2 of 2
24VDC
GND
GND
12V
EXTERNAL VBUSUP TO 48VDC
holder
NT POSITION EXTERNAL VBUS INTERNAL VBUS
50V
USE HEATSINK
VBUS
VCC_24VVCC_12V
VCC_12V
VBUS
ENABLE
J14
123
J8
123
HS1
TO-220
11
22
D6BAS16
13
2
D51N4007
21
FH1
250V/5x20
12
F1
FUSE/250V/2A
+ C1410uF
12
Q8MMBT3904
31
2
J13
123
J11
123
MIC29
J9
HDR/PIN 1x3
123
J10
123
C16
0.1uF
P1
PJ-003A
1
23
R33
2K
+ C1310uF
12
RL1
JS1A-12V
13
52
U4
MIC29150-12
OUT3
GN
D2
IN1
J7
2 POS
12
SH1
shunt
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
Appendix B. Flow Charts
Figure 24 presents the flow of the space vector modulation routine.
The Hall sensor for Tacho feedback can be disabled for sensorless V/F control.
Figure 24. Space Vector Modulation Flow Chart
No
Theta <Vector2?
Theta <Vector3?
Theta <Vector4?
Theta <Vector5?
Theta <Vector6?
No
No
No
No
Decompositionroutine:
Calculate T1Calculate T2Calculate T0
Yes
Apply newreference vector
voltages tophaseAphaseBphaseC
NoNoMAIN
Check SpeedDemand
CalculateSetspeed
OrOpen loop speedV/F profiler with
slip controlcalculations
PWMinterrupt?
TachoInterrupt?
Yes
Integrate Speedto obtain rotor
theta
No
Yes
Calculate rotorperiod
Slipcontrol
SVM BLOCK
Note:
AN038201-0816 Page 28 of 29
Space Vector Modulation of a 3-Phase AC Induction Motor with the Z32F128 MCUMultiMotor Series Application Note
Customer Support
To share comments, get your technical questions answered, or report issues you may be experiencing with our products, please visit Zilog’s Technical Support page at http://support.zilog.com.
To learn more about this product, find additional documentation, or to discover other fac-ets about Zilog product offerings, please visit the Zilog Knowledge Base at http://zilog.com/kb or consider participating in the Zilog Forum at http://zilog.com/forum.
This publication is subject to replacement by a later edition. To determine whether a later edition exists, please visit the Zilog website at http://www.zilog.com.
DO NOT USE THIS PRODUCT IN LIFE SUPPORT SYSTEMS.
LIFE SUPPORT POLICY
ZILOG’S PRODUCTS ARE NOT AUTHORIZED FOR USE AS CRITICAL COMPONENTS IN LIFE SUPPORT DEVICES OR SYSTEMS WITHOUT THE EXPRESS PRIOR WRITTEN APPROVAL OF THE PRESIDENT AND GENERAL COUNSEL OF ZILOG CORPORATION.
As used herein
Life support devices or systems are devices which (a) are intended for surgical implant into the body, or (b) support or sustain life and failure to perform when properly used in accordance with instructions for use provided in the labeling can be reasonably expected to result in a significant injury to the user. A critical component is any component in a life support device or system whose failure to perform can be reasonably expected to cause the failure of the life support device or system or to affect its safety or effectiveness.
Document Disclaimer
©2016 Zilog, Inc. All rights reserved. Information in this publication concerning the devices, applications, or technology described is intended to suggest possible uses and may be superseded. ZILOG, INC. DOES NOT ASSUME LIABILITY FOR OR PROVIDE A REPRESENTATION OF ACCURACY OF THE INFORMATION, DEVICES, OR TECHNOLOGY DESCRIBED IN THIS DOCUMENT. ZILOG ALSO DOES NOT ASSUME LIABILITY FOR INTELLECTUAL PROPERTY INFRINGEMENT RELATED IN ANY MANNER TO USE OF INFORMATION, DEVICES, OR TECHNOLOGY DESCRIBED HEREIN OR OTHERWISE. The information contained within this document has been verified according to the general principles of electrical and mechanical engineering.
ZNEO32! and Z32F128 are trademarks or registered trademarks of Zilog, Inc. All other product or service names are the property of their respective owners.
Warning:
AN038201-0816 Page 29 of 29