Home

Application Note: Vector Control of a 3-Phase AC Induction

image

Contents

1. Figure 2 Washing Machine Motor with Tachogenerator Application Hardware The application electronic is controlled with a Vector Control Command Interface GUI to start and stop the motor control its speed and observe the PI loop The speed of the motor is plotted in user definable time intervals Figure 3 presents all application hard ware and connections Figure 3 Modular Controller and Vector Control GUI AN024703 1111 Page 5 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note Zilog Embedded in Life AnEITXYS Company Figure 4 offers a closer view of the Vector Control GUI seen in Figure 3 Motor Speed 250 225 200 175 150 Command File COM Part 50 v Speed Command Save Data 3 v 200 v Proportional Gain Update Target Tina Stale Wh Integral Gain 1 Sec Div Figure 4 Vector Control Command Interface ANO024703 1111 Page 6 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note Zilog Embedded in Life AnEIIXYS Company Figure 5 shows a block diagram of the application hardware design showing the logical position of each module in the controller HV Main Board 3 Phase AC Induction Motor AC Power FMC16100 Control Module User Interface Washing Machine Interface Module Figure 5 Hardware Block Diagram The following sections briefly describe each of the modules that comprise
2. Z8FMC16100 Series Flash Microcontrollers The Z8FMC16100 Series of Flash MCUs is based on Zilog s advanced 8 bit eZ8 CPU core and is optimized for motor control applications It supports control of single and multiphase variable speed motors Target applications are consumer appliances HVAC factory automation refrigeration and automotive applications among others To rotate a 3 phase motor three AC voltage signals must be supplied and phase shifted 120 degrees from each other To control a 3 phase motor the MCU must provide six Pulse Width Modulation PWM outputs The Z8FMC16100 Series Flash MCU features a flexi ble PWM module with three complementary pairs or six independent PWM outputs sup porting deadband operation and fault protection trip input These features provide multiphase control capability for various motor types and ensure safe operation of the motor by providing immediate shutdown of the PWM pins during a fault condition ANO024703 1111 Page 1 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note zilog Embedded in AnEITXYS Company Discussion An electric motor consists of a stator a stationary frame in which a rotating component or rotor is mounted on a shaft and bearings In a 3 phase AC induction motor the stator is laced with three sets of inductor windings energized by three AC voltage inputs that are phase offset 120 degrees from each other producing a rot
3. V_dr x cos Theta V qr x sin Theta V_qs V_dr x sin Theta V qr x cos Theta AN024703 1111 Page 19 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note zilog Embedded in Life AnEITXYS Company V qs V ds Figure 13 Inverse Park Transform I2C Send Stop Bit to DAC A stop bit is sent to terminate the PC communication Inverse Clarke Transform The Inverse Clarke Transform converts the two phase voltages of the rotated DQ reference frame to the ABC reference frame of the stator windings see Figure 14 on page 21 The equations for the Inverse Clarke Transform are V_a V_ds 1 2 V_b gt V_ds 3 V_qs 1 2 V_c 7 V_ds N3 V qs AN024703 1111 Page 20 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU ANO024703 1111 Application Note Zilog En AnEITXYS Company a zl d Figure 14 Inverse Clarke Transform PWM Space Vector Modulation Space vector modulation starts with the six states that represent the six voltage vectors VA VC VB VA VC and VB Table 2 shows the PWM duty cycle calculations used for each state States 6 and 7 represent the unmodulated phase OFF or ON Table 2 PWM Duty Cycle by State PWM Duty Cycle PWM State Phase A Phase B Phase C 0 10096 100 V b 10096 V c 1 Va V b 096 2 100 V a 10096 100 V c 3 096 Vb Vc 4 100 V a 100 V b 10096 5 Va 096 Vc 6 0 0
4. 3 C Send Control Byte 1 Park Transform vector rotation 28 PWM Period Test 1 I C Send MSB 1 d Regulator 13 q Regulator 13 Quadrant Test 5 Page 24 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Summary ANO024703 1111 Application Note Zilog En AnEITXYS Company Table 4 Main Loop ISR Execution Times Continued Routine Time ps I C Send LSB 1 Bus Voltage Sample 1 Bus Ripple Compensation 3 PWM Period Test 1 Inverse Park Transform Vector Rotation 28 PWM Period Test 1 I C Send Stop Bit 1 Inverse Clarke Transform 2 gt 3 Conversion 18 PWM Period Test 1 PWM Space Vector Modulation 33 PWM Period Test 1 WDT refresh 1 Sub Function stepped through list 26 Subtotal 224 End of PWM Period Test Variable Total 250 Table 5 lists the execution time for each subfunction routine executed every 2ms Table 5 Subfunction Execution Times Subroutine Time us Tachometer Update 1 of 3 7 Tachometer Update 2 of 3 26 Tachometer Update 3 of 3 2 Field Weakening Unused Slip Update Unused Speed Regulator 26 UART Communication 4 The purpose of this application is to demonstrate how a ZaFMCI16100 microcontroller is used for the efficient rotor flux field oriented vector control of a 3 phase AC induction motor The following features of the Z83FMC16100 MCU make it particularly suited to motor control application
5. I2C Send LS Byte to DAC The DAC offers only 8 bits of resolution therefore it is a don t care byte required by the DAC Read Bus Voltage The bus voltage is sampled through the microcontroller s ADC Currently it is used for ripple compensation however it could also be included in field weakening calculations or used for over voltage shutdown protection Bus Ripple Compensation This routine tracks changes in the bus voltage and looks up a precalculated ripple compen sation factor which is inversely proportional to the ADC sample of the bus voltage The PWM duty cycle is scaled by this factor to compensate for variations in the DC bus volt age so that a smaller factor value corresponds to a reduced PWM duty cycle which clamps the output waveform to a nominal voltage This application uses a nominal bus voltage of 225 VDC At this voltage the output factor is 255 full scale no compensation The factor scales down to 0 at 375 VDC or higher providing an overvoltage shutdown Between 225 VDC and 375 VDC the look up table values are calculated using the following equation ADC vbus nom pwm correction x255 ADC vbus Inverse Park Transform Vector Rotation The Inverse Park Transform rotates the two phase voltages referred to the rotating refer ence frame of the rotor flux to the stationary reference frame of the stator see Figure 13 on page 20 The equation for the Inverse Park Transform is V_ds
6. Sends the address byte used by the DAC to establish communication This action begins a side process of the PWM ISR I C related instructions are inserted at intervals to set up and transmit one test value per ISR loop to an external DAC Phase Current Reconstruction Phase current reconstruction is based on the two current samples previously obtained plus the PWM space vector State The State value is updated at the end of each ISR pass to reflect the stator flux vector angle arrived at in that pass State positions are shown in Figure 10 The State determines how each current sample is interpreted as shown in Table 1 on page 15 In this table the variables 1 a nI a I b nlI b I c and n1 c represent the positive and negative current variables for phases A B and C ANO024703 1111 Page 14 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note zilog mbedded in AnEITXYS Company 180 STATE 2 STATE 1 120 STATE 3 STATE 0 STATE 4 STATE 5 360 TT Figure 10 Space Vector PWM States Table 1 Sample Interpretation by PWM State Current Sample 1 Current Sample 2 PWM State Variable Variable 0 nl c nI b 1 Ib la 2 nI a nI c 3 Ic Ib 4 nI b nl a 5 Ia Ic 6 Not Used 7 Not Used Using Kirchoff s current Law and assuming no zero sequence currents zero sequence cur rents are only pos
7. 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 uN Warning 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 whose 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 2011 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 REPRESENTATI
8. every time the PWM ISR executes There are ten subroutine calls arranged in a round robin sequence so that only one call is executed per ISR loop Therefore each call is executed once every 2ms Not all round robin slots are required for the currently implemented subfunctions The remaining slots are available for future expansion Tachometer Update The tachometer update routine looks at the latest capture value from Timer 0 The routine checks for a rollover if it detects a roll over then the maximum counter value of 0xFFFF is used to calculate speed Additionally a rate limit is placed upon the Speed_step variable to ensure that noise does not cause erratic speed readings In the case of an optical encoder the user can potentially encounter edge jitter when an encoder line is on the edge of the optical pickup and the motor is at idle movement in the motor can cause fast edges that can be interpreted as sensing high speed This phenomenon is filtered out by disallowing any jump in speed The tachometer update function is divided into three subfunction calls to limit the execution time for each call Field Weakening Currently not developed for this application Slip Update Current Model Currently not developed for this application Speed Regulator The speed regulator is a standard Proportional Integral PI regulator The command arrives from the UART and the speed feedback arrives from the tachometer UART Communication The U
9. free up additional time for main loop calculations low priority subfunctions are called in a 10 position round robin schedule so that each subfunction is executed only once every 2 5ms The lengthy tachometer update operation is further divided into three subfunction calls to limit execution time per call Converting current measurements to a 2 phase vector for the rotation transform reduces calculation time compared to rotating a 3 phase vector All signed values are expressed as pairs of unsigned variables This pairing requires ex tra code to perform an if then else routine for each calculation however the eZ8 pro cessor s short range branch instructions are efficient enough so that the unsigned calculations can execute faster than the equivalent library routines which are written for general case signed arithmetic The example application and techniques described in this document should prove helpful for anyone who intends to develop motor control applications based on the Z3FMC16100 microcontroller AN024703 1111 Page 26 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note Zilog Embedded in Lit AnEITXYS Company Appendix A References For more information about the topic of controlling motors plus details about the Z8FMC16100 MCU and its core eZ8 CPU see the references listed in Table 6 Topic eZ8 CPU Table 6 List of References Document Name eZ8 CPU User Manual
10. overcurrent shutdown Op Amp For current sensing using a single current sense resistor The Op Amp is used to offset the ground referenced current sense signal to 1 V half of the 2V reference the voltage gain increases by a factor of 5 For a sense resistor value of 20mQ and a current of 4 A gained by 5 a 1 V signal can swing 0 4V ADC Used for sampling current and DC bus voltage Relay The main relay is normally open therefore the high voltage power supply is disabled while the microcontroller starts up The relay initialization pauses for three seconds before closing the relay to ensure that the high voltage bus capacitors can precharge through a resistor After closing the relay the program waits another second to allow the relay con tacts to settle AN024703 1111 Page 12 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note Zilog En AnEITXYS Company Current Calibration After the peripherals are enabled and have settled out 8 samples of the current sense chan nel are taken with zero current The average of these samples are used to zero out any off sets in the circuit UART The UART is configured for 9600 baud 1 start bit 8 data bits and 1 stop bit UART trans mit and receive are tied together for single wire communication The 3 wires are ground data and 5 V The UART service routine updates every 2ms A more elaborate communi cation link could be impleme
11. the application hardware The schematics are shown in Appendix C Schematic Diagrams on page 29 High Voltage Main Board and Power Stage The main board serves as the connector backplane for all the other controller modules It also provides the high voltage power stage that converts the single phase AC supply to the 3 phase motor control output under PWM control The schematic for the main board mod ule is illustrated in Figure 17 on page 29 The power stage section rectifies and filters the single phase AC supply to provide a high voltage DC bus supply This section also contains the six IGBTs used under PWM control to generate the 3 phase AC motor drive current The MCU is powered after the AC supply is connected but a normally open relay with holds DC power from the IGBTs until the MCU has started and the application software has completed its necessary startup functions The application then uses an I O port output to enable a simple transistor driver that closes the relay powering the IGBTs AN024703 1111 Page 7 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note zilog Embedded in Lii AnEITXYS Company Z8FMC16100 Control Module The schematic for the MCU module is shown in Figure 18 on page 30 This module contains the Z83FMC16100 MCU a 20MHz ceramic resonator a 6 pin DBG interface and the off chip components of the high voltage current sense and overcurrent detection circui
12. 0 7 10096 10096 10096 Page 21 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note Zilog Embedded in Life AnEITXYS Company Figure 15 illustrates an example of PWM space vector modulation ata PWM magnitude of 75 out of 125 referenced to DC Ground 250 HHHH HHHH 6909909000000000000 PWM a PWM b x PWM c 200 T T T b 150 6c E e Xa e o X box x o H oo X L some xm 100 9 x o7 x bo x a 50 4 I I 7 0 60 120 180 240 300 360 420 Figure 15 PWM Space Vector Modulation Ground Reference Figure 16 illustrates an example of PWM space vector modulation ata PWM magnitude of 75 out of 125 referenced to Neutral d PWM a n o PWM b n x PWM cn 75 pops EE 4 t 000ta OOOO t ope OD o9 6 rd 25 G E x JP T gt 4T 25 a X c oc o Ps fes yov OK re Ch dent oboe 75 4 RK OK KKK 4 t 00960606009 125 60 120 180 240 300 360 420 Figure 16 PWM Space Vector Modulation Neutral Reference ANO024703 1111 Page 22 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note Zilog En AnEITXYS Company Watchdog Timer Refresh Refreshes the Watchdog Timer once every loop update 250us A reset occurs if the oscillator or a fault in the code disrupts operation for more than 200ms Subfunctions Subfunctions are subroutines that are not required to be updated
13. 24703 1111 Page 30 of 37 ANO024703 1111 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU GATE DRIVE MODULE Applic gt i l O g Embedded in Life AnEiIXYS Company ax G Di N USIT 2 5 va GP oan Arr GUI GRI 499 G ps x i i RT 6c 6 c4 cA n oe 2 T 13 2 a oa i mm iwF16V oE GP3 2 JHN VB S au DEPAETE p eicinmeceons gt 2 Gan xs cH aima con 6 Gun s vss 4 5 com 1 10 1X21064S GR 499 GP 2 D G GATE AL 1 1 con 2 ow GD N usii uv G P6 G BH V m GU GR3 499 G ps GP LE tee oam Gc Ges i av Gcs GC6 con we O 1uF 1o 16v y a 2 pe VE 2 2 Se i 3 UWX1C2 DOMCLIGR poii Me S7 3 2 D nes UWXiCiloCMCL2GR con 2 1 GeL 3 UN HO 12 a 7 2 oem T vs L1 ajii Gom 1 vss ys agr 1 10 IX210648 GRI 499 GPs ato coama con 2 d mw S2 USiI aawa G P10 ach D aam GU GRS 499 ps 2 G C9 GCI cond 1 vee aam 1 L een eco 2 i 13 O 1uF 10uF 16V 1ouF 16v oi GP ENSE con TL enc eae ee S aquas x vs LH aime 2 con GGND a VSS com 7 1o 1X21064S G R6 499 G P2 src G GATE CL 1 con2 Figure 19 HV Gate Drive Module Schematic Page 31 of 37 Vector Contr
14. 8 SZ 2 X X W_R4 0 luF W DI W D2 0 luF 2 W_R7 W ANODE 2 1 WI SO ANODE2 7 gt 499K BASI6 BASI6 2 100 W_P3 m 3 Y 6 3 6 W_RXD W_TXD weno 2 x e 4 h 5 4 ha 5 WGND CONS 6N137 6N137 WPS WISO 5V i WISO DATA 3 3 con3 Figure 21 Washing Machine Interface Module Schematic AN024703 1111 Page 33 of 37 ANO024703 1111 Vector Control of a 3 Phase AC Induction Motor Using the ZaFMC16100 MCU Applic gt i l O g Embedded in Life AnDi IXYS Company n n 33 J4 J5 J6 CONI CONI CONI CONI CONI CONI 33V pee RI gt OR2 Ul 10K 10K 1 10 z VOUTA Al 5 3 VOUTB A0 7 GND VDD 7 VOUTC SDA 6 e L a VOUTD SCL e T luF V4 DACSS74IDGS NC ES 0 0 Yt J7 CON4 Figure 22 DAC Module Schematic Page 34 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note Zilog En AnEITXYS Company Appendix D Flowcharts Figure 23 illustrates the overall program flow After main initializes the application it drops into an infinite loop Meanwhile the PWM timer generates an event every 50us The PWM ISR is timed to execute on every fifth PWM event once every 250us The ISR calls one of ten low priority subfunctions on every loop cycle therefore each subfunction is called once every 2 5ms Initialization pee
15. ART communicates with the Vector Control GUI and simulates a washing machine control panel The GUI contains entry fields to enter speed PI loop values and to start or stop the motor A speed graph is plotted at user definable time intervals The GUI sends a single command byte that is read at each UART update Bits 7 1 of the command byte are the speed command MSB of the control module s ADC sample The Acknowledge byte from the motor controller is AAh the UART baud rate is 9600 baud ANO024703 1111 Page 23 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Software Metrics ANO024703 1111 Application Note Zilog Embedded in AnEITXYS Company Table 3 lists the execution time for each program initialization routine executed once at startup Table 3 Initialization Execution Times Routine Time init_osc 50ms init_out ius init comp ius init amp 2us init adc 2us init_relay 4s init_current 32us init_uart 2us init_i2c 3us init timerO 3us init pwm 5us init pwmint ius Table 4 lists the execution time for each routine in the PWM ISR executed every 250us 4kHz loop Table 4 Main Loop ISR Execution Times Routine Time us Current Sample 5 I C Send Address and Start Bit 1 Current Reconstruction 14 Clarke Transform 3222 conversion 18 PWM Period Test 1 Theta Update 6 Sine and Cosine Look Up Table
16. Application Note ZI l OQ Vector Control of a 3 Phase AC Embedded in Life AnLiIXYS Company Induction Motor Using the Z8FMC16100 MCU AN024703 1111 Abstract The 3 phase alternating current AC induction motors are mechanically simple rugged highly reliable lower in cost per horsepower than DC motors and capable of more torque and efficiency than single phase AC motors A 3 phase AC induction motor can be con trolled by varying its inputs according to a mathematical model of the rotor flux field in a complex vector space vector control Vector control provides efficient and accurate con trol of the motor s speed and torque Until now vector control has been the domain of digital signal processors DSPs digital signal controllers DSCs and a few 32 bit and 16 bit microcontrollers Constant cost pres sure and increased consumer expectations have driven design engineers to seek minimal hardware solutions that extract maximum performance from motors used in consumer goods This application note demonstrates how Zilog s ZaFMC16100 MCU can implement effi cient cost conscious vector control of an AC induction motor y Note The source code file associated with this application note AN0247 SCOI zip is available for download on zilog com This source code has been tested with version 5 0 0 of ZDSII for Z8 Encore XP powered MCUs Subsequent releases of ZDSII may require you to modify the code supplied with this application note
17. ON 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 Z8 Z8 Encore Z8 Encore MC and Z8 Encore XP are trademarks or registered trademarks of Zilog Inc All other product or service names are the property of their respective owners AN024703 1111 Page 37 of 37
18. PWM Timer Events 50 us AN024703 1111 Tach Update 1 Werat kerra eae Communication U nused Wait for Fifth Unused PWM Period 250 us Loop Unused i Return Figure 23 Flowchart for the Application Page 35 of 37 Vector Control of a 3 Phase AC Induction Motor Using the ZaFMC16100 MCU Application Note Figure 24 illustrates the PWM ISR main loop PWM Interrupt Service Routine Current Sample Bus Voltage Ripple Compensation l2C Send Address and Start Bit Inverse Park Transform Rotation Current Reconstruction I2C Send Stop Bit Clark Transform 8 to 2 Phase Inverse Clarke Transform 8 to 2 Phase Theta Update 12C Send PWM Space Control Byte Vector Modulation Park Transform Refresh Rotation WDT Timer 12C Send MSB Call Subfunction for Current Step PI Regulator 12C Send LSB Wait for 5th PWM Period 250 us Loop Figure 24 Flowchart for the PWM ISR AN024703 1111 Page 36 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note AnEITXYS Cor 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
19. RFACE cPis 1 2 13 4b d5 6b HEADER 3X2 C P amp C Vit aw 1 l con2 S lt CRI gt CR3 lt CR C P7 10 0K 10 0K 10 0K caD 2 e 3 4 E con2 C P6 cci gt cc 1 ca 0 luF DOR LL 2 S 124K 100pF con2 c E M i cao COND lola amp a5 oe Bc 5 con2 ololololo cul cp iia Z8FMC16_32LQFP 1 caD AmkEoggks amp 2 2aa85EEIE cm H 3 A 506 ZEE za cr ZZEE S I coa E BE 23 9 2E Ez amp con2 5 C BH 17 pwn z PAI OPINP CINN 8 OCS 4 CAL 18 bi 7 CS PWMOL E PAO OPINN CAH 19 6 C VREF PWMOH E VREF C CND 20 5 GND GND AGND C XOUT 21 4 C 3 3V C XN 2 SURF AVDD 8 C VA t t a XIN PBOANAOTOINO 35 cV Cte at VDD PBUANAUTOINI i i 24 PASITXDE SCK SCL PB2 ANA2 TOINO OVC cn ccs C c6 P 25 cca C cia 1 i 713 228 ZO cc ccs C c9 cco ccu O 1uF 0 01uF 295 oS 0 luF 10uF 6 3 V CCR20 OMCTT zz 35 0805 x Aseusain 2200pF UNUSED UNUSED oomr 0 1uF x zig 44444 SeOteatcst EDEN TEN e 20MHz REPETE i e i feao i c GND ZEEEREERE 4 C a c ci4 cp Z C ENABLE e foc 1 E TPI C_GND UNUSED a E i 2 S E S a CURRENT CON2 olooo i C R9 N e CPi 49 9K i c3 3V 2 caa E t Ser C PI7 100K S cre i c3 3V lt 100K csa 2 UR 7 COND t z C NRESET 4 m C DBG con4 Temp _ 6 019 Ly oe j caD C cis 2200pF cpio ccu UNUSED C RXD E 7 C TXD UNUSED 3 caD 3 joc ON Figure 18 Z8FMC16100 Control Module Schematic ANO0
20. UM0128 Z8FMC16100 MCU Z8FMC16100 Series Product Specification PS0246 Motor Control ANO024703 1111 Hsu P A Short Course on Vector Control San Jose State University pp 49 54 1996 Garcia G Stephan R amp Watanabe E Comparing the Indirect Field Oriented Control with a Scalar Method IEEE Trans Ind Electronics Vol 41 No 2 pp 201 207 April 1994 Trzynadlowski M Andrzej Control of Induction Motors Academic Press pp 102 105 2001 Ned Mohan Short Course on Electric Drives Understanding Basics to Advanced Control amp Encoder Less Operation University of Minnesota 2005 A recording of the Internet based short course presented on May 12 2005 by Professor Mohan and edited to fit on a DVD Page 27 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note Zilog Embedded in Life AnElIXYS Company Appendix B Glossary Definitions for terms and abbreviations used in this application note that are not com monly known are listed in Table 7 Table 7 Glossary Term Abbreviation Definition ADC Analog to Digital Converter DAC Digital to Analog Converter IGBT Insulated gate bipolar transistor ISR Interrupt Service Routine PI Proportional plus Integral PWM Pulse Width Modulation Rotor Rotating cage and windings of AC motor Stator Stationary windings of AC motor AN024703 1111 Page 28 of 37 Vector C
21. ating field of magnetic flux inside the motor This field creates an induced magnetic flux in short passive windings on the rotor The stator field exerts a magnetic force on the rotor 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 A bridge contains three complementary source drain transistor pairs which connect either ground or high voltage DC to each of its three outputs in response to digital control signals from the microcontroller The microcontroller uses PWM on the bridge control signals to generate three approximately sinusoidal AC waveforms on the bridge outputs with the required 120 degree phase offset The duty cycle of each microcontroller 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 The microcontroller senses the resulting AC current and motor speed and peri odically adjusts the AC signal waveform increasing or decreasing torque to maintain the appropriate motor speed For more information about motor control see documents listed in Appendix A References on page 27 Theory of Operation In this application the Z3FMC16100 microcontroller s PWM module is configured as three complementary output pairs Each output pair controls one complementary source drain transistor pair in the inverter bridge The PWM module is configur
22. ed to insert a 0 6us deadband between ON states to prevent leakage that could occur if one transistor in a pair turns on before the other is fully off Each PWM output pair produces 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 period of each PWM cycle is configured to be 50us and the PWM module generates an interrupt request at the end of each cycle The PWM interrupt service routine ISR leaves the PWM interrupt disabled while it executes and is tuned to execute within 200us to 250us Therefore the PWM ISR is executed every five PWM cycles or 250us The PWM ISR controls all of the ongoing application program functions after initializa tion The primary goal of the ISR is to update the duty cycle value for each PWM channel as required to produce the appropriate AC waveforms at the inverter bridge outputs The PWM duty cycle values are derived from a feedback loop based on rotor speed and rotor flux position The stator current waveform is determined by sampling two phases of the inverter output current and reconstructing the third phase ANO024703 1111 Page 2 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note Zilog En AnEITXYS Company The rotor speed is sampled by a counter timer configured to measure the period of a magnetic p
23. fter initializations are complete program control drops into an infinite do nothing loop All subsequent program functions are performed by the PWM interrupt service routine ISR so this ISR is in effect the main event loop The PWM ISR is executed upon every fifth PWM cycle AN024703 1111 Page 13 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note zilog Embedded in AnEITXYS Company Current Sample The PWM interrupt is configured to automatically start an ADC conversion that samples the high voltage current so the PWM ISR begins with an ADC conversion already in progress The PWM interrupt is edge aligned and the sample takes place before the PWM state change propagates to the inverter bridge gates Thus this first sample captures the current at the end of the just completed PWM cycle After reading the first sample the ISR immediately begins another ADC conversion This second sample captures the current at the beginning of the new PWM cycle see Figure 9 Phase currents are then reconstructed from these samples PWM PERIOD PWM PERIOD dh gt 1 A ee ee ee eee ene ee o eee eee ee a B CC V 0 gl re See a a a O OO ARRA RP P a RR E j 2x Current Sample 1 Current Sample 2 Figure 9 Sampling Space Vector PWM Current State 3 2C Send Address and Start Bit
24. g Machine Motor Z8FMC16100 Microcontroller This application employs the Z83FMC16100 MCU s external precision oscillator 10 bit analog to digital converter ADC I O and UART features to demonstrate the washing machine s Vector Control Command Interface GUI User commands are transmitted to the Z8FMC16100 MCU as serial data to in theory allow very complex control commands to be transmitted This user interface consists of a GUI for speed control a PI loop and start and stop motor commands The speed of the motor is plotted in user defined time intervals Additionally two 6N137 single channel optocouplers transmit UART command signals while electrically isolating the GUI from the high voltage modules For a discussion about this GUI please see the Application Hardware section on page 5 Insulated Gate Bipolar Transistors Six IXYS IGBTs part number IXGA30N60C3C1 are used under PWM control to gener ate the required 3 phase AC motor drive current from a high voltage DC supply Although these IGBTs are rated for momentary short circuit operation the Z3FMC16100 MCU s PWM deadband feature is used to reduce leakage when the IGBTs are switched AN024703 1111 Page 3 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note zilog Embedded in Li AnEITXYS Company Three IXYS high side and low side gate drivers part number IX2113 are used to convert the ZaFMC16100 MCU s CMOS PWM outputs in
25. lication Bus Ripple Bus Voltage Compensation Sample Park Clarke Current Transform Transform Sample und Reconstruction 3 2 Inversc Inverse Space Vector i Park Clarke Modulation THREE PHASE Transform Transform PWM INVERTER pda Update Weakening Tachometer Update AC INDUCTION MOTOR Figure 8 Functional Block Diagram Variables and Declarations Declarations set the PWM frequency the Timer 0 scaling for the tachogenerator and the modulation values All variables are declared as global for speed of execution and simplic ity of code All variables are unsigned All signed values have separate variables of the form Name for positive and nName for negative contents One of these variables is always zero Using unsigned math speeds up execution but makes the algorithms longer in code The ADC inputs are treated as 8 bits and the PWM output is 8 bits Internal computations generally have 4 extra bits of precision especially in the control loops that use PI Propor tional Integral compensators this prevents rounding from affecting integrator precision For Inverse Park Transform vector rotation the concept of a quadrant is used to deter mine calculations on the unsigned values The program uses a 128 value sine look up table Sine Table 128 This table repre sents sine values from 0 to 90 degrees or approximately 0 7 degree steps Stepping through the table in the forward direction yields sine values from 0 to 90 deg
26. lux This rotation is illus trated in Figure 12 on page 18 The equations for the Park Transform are I_dr I_ds x cos Theta I_qs x sin Theta I qr I ds x sin Theta I qs x cos Theta ANO024703 1111 Page 17 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note Zilog Embedded in Life AnEITXYS Company I qs AL UN Figure 12 Park Transform I C Send MSB to DAC Sends the 8 bit data used by the DAC This internal value is sent to the DAC board to allow the display of internal values as voltages on the oscilloscope The implemented rou tine sends data to one channel of the DAC updated at the loop rate to allow the real time display of reference or feedback values d Regulator A regulator that controls the direct component of the current vector it is regulated by a simple PI regulator q Regulator A regulator that controls the quadrature component of the current vector it is regulated by a simple PI regulator Quadrant Test A quadrant test is applied to the 1 dx and I qr reference currents to determine which quadrant the currents are in This result is used later in the Inverse Park Transform to AN024703 1111 Page 18 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note zilog imbedded in AnEITXYS Company rotate the 2 phase vector The 1 dr and I ar reference currents are calculated in the Speed reg subroutine
27. nted with this hardware PC IC is used for an external EEPROM for logging product data For testing purposes the PC interface is used to send data to a 4 channel DAC In this implementation a single channel of the DAC is updated every 250s so that one parameter can be monitored in real time to provide a method for troubleshooting and code development and for field orienta tion tuning using an oscilloscope To control the DAC the Z8FMC16100 MCU is set up as the I7C Master at 384 kbps 2 6us per bit All data is sent to DAC channel A TimerO Timer 0 is used in Capture Restart Mode the encoder input rising edge is used to trigger the Capture If the timer rolls over the maximum timer count of OxFFFF is used setting it to the minimum speed If an additional ADC input is required the same encoder signal can be routed via jumper J2 to PAO to generate a port interrupt which can capture the timer value PWM Module The 3 phase PWM module is set up in Edge Aligned PWM and the PWM polarity is controlled to Allow Space Vector Modulation and current sampling and reconstruction Each PWM pair is set up in complementary mode with 12 clock cycles of deadband 0 6 us The PWM reload event triggers an ADC conversion it is used for current reconstruc tion PWM Interrupt The PWM reload interrupt is enabled The PWM ISR constitutes the program control loop PWM interrupts are disabled during the ISR until the ISR is complete Main Event Loop A
28. ol of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU 15V POWER SUPPLY PR2 165k pars P2 our pul ple 2 PRI ucc am NT 3 3V POWER SUPPLY pa veus s ls m Pci 200k b pe ZS xs BP 3 impos 0 01uF 10uF PL a UA78M33CSCYR 2 Aes PPI i err a g 1 NES 2 TM ns Qoo pix 5 4 ww gd ImH P C4 A PDI 88247 7G8105M NH P2 9 PCS P C6 con2 HV INK304G J i O luF PUD a 0 2 Spaci ng Usi 100uF 16V a O 1uF 100uF 16V we 2 OPI ia cond 0 1 Spaci ng PD 4 Applic gt i l O g Embedded in Life AnEiIXYS Company REFERENCE DESI GNATORS AND NET NAMES P FOR POWER SUPPLY MODULE Figure 20 HV Power Module Schematic con2 0 1 Spacing ANO024703 1111 Page 32 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Applic gt i l O g Embedded in Life AnLiIXYS Company TACH TURN SENSOR w c3 WPI W GND w3 3V i W_GND 1 O luF 2 COND W_RS OPTOISOLATED UART 10 0K m Pa WP wci 200n spacing fromrest of circuitry n wove wap W3 3V WTZ won 5 0 luF con2 CON2 e l WRI w Q gt 220 w_c2 W BASE 1 MMBT2N2222A ake n Ar SERE Ww K 0 1uF Q WR2 5 390 w3 3V W R6 10 0K 499K iki wui W_U2 C EM TTER W C4 4 W CS 1 8 1
29. ontrol of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Applic gt i l O g Embedded in Life AnEILXYS Company Appendix C Schematic Diagrams Figures 17 through 22 present the schematic diagrams for the vector control application modules HEATSINK HIGH VOLTAGE POWER STAGE TEMP SENSOR n aM Q TKGA3ONGOCSCI La pty lod MR 20103 S M3 CENTER TAL ouo p 1000aE 00V oY ERVED HV GATE DRIVE MODULE an ana AA Mos MM wir Ch Mc Wc MC e FMC16 CONTROL MODULE OPTO UART M igo vec Mc X16 MONS MEJIA MCE MEN MCI pat gt 2 pad a2 2 d HV MAIN BOARD E TT wen Figure 17 High Voltage Main Board Schematic AN024703 1111 Page 29 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Applici gt O g Embedded in Life AnEiIXYS Company C P6 1 2 con 2 C PIS cam CRIS C VA UNUSED B 5 caD 2 con 2 C PIA c33v CRU C vB UNUSED caD 2 con 2 cus C P3 casy CRIS cvc i cap 7 con 2 C PI2 C RIO ME aK CTEM cap 2 con 2 vec UNTE
30. osition sensor on the motor The measured speed is periodically compared to the requested speed received through UART from an external controller The resulting speed command value is used to create a rotation reference frame expressed as a two phase direct quadrature DQ vector The resulting vector is regulated to produce the nec essary flux and torque amplitude in the output vector An inverse Park transform is used to rotate the reference frame relative to the rotor posi tion Then an inverse Clarke transform is used to convert the rotated two phase reference frame back into a 3 phase expression At the same time the vector s position is classified into one of six states each corresponding to one sixth of the vector circle When the ISR calculates duty cycles for the three PWM channels one phase is left unmodulated ON or OFF for the whole PWM cycle and the flux vector is encoded by modulating the other two phases This reduces switching losses by one third The two phases to be modulated depend on the flux vector s state position After the PWM space vector calculation is complete the corresponding PWM registers are updated For more details about the software implementation see Software Implementation on page 11 Description of Components This design uses the following major components e Z8FMCI6100 microcontroller nsulated gate bipolar transistors IGBTs PC interfaced 8 bit digital to analog converter DAC e Washin
31. quadrant test is applied to the reference currents I ds and I qs to determine which quadrant the currents are in This result is used later in the Park Transform to rotate the 2 phase vector The equation for the Clarke Transform is AN024703 1111 Page 16 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note zilog Embedded in Lii AnEITXYS Company La I p I i gt I 2 Lqs 4 1 B 1y Angle Update The angle Theta is updated by the following equation Theta Theta Speed Slip The elements in the above equation can be defined as Theta rotor flux angle relative to the stator phase A winding Speed speed frequency of the rotor in terms of the update rate of the control loop Slip slip speed frequency required to produce the proper rotor flux Sine and Cosine Look Up Table Sine and cosine values are generated from an unsigned table of sine values from 0 to 90 degrees contained in a 128 value table 90 degrees 128steps 0 7 degrees step Two values are taken from the table one at the angle stored in the variable Sin_1 and one at the 128 degree angle stored in the variable Sin_2 I2C Send Control Byte to DAC Sends the control byte used by the DAC to select the DAC output channel Park Transform Vector Rotation The Park Transform rotates the two phase currents referred to the stationary reference frame of the stator to the rotating reference frame of the rotor f
32. rees and step ping through the table in the reverse direction yields cosine values from 0 to 90 degrees This along with knowledge of the quadrant of the angle of interest Theta allows full reconstruction of sine and cosine values for any angle between 0 and 360 degrees ANO024703 1111 Page 11 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note zilog mbedded in AnEITXYS Company The polarity table Polarity table 8 contains bit masks used to set the polarity bits in the PWMCTLI register A 1 bit causes the corresponding channel to start the next PWM cycle in the ON state A 0 bit causes the channel to start in the OFF state The ripple compensation table ripple_table 256 contains precalculated bus voltage ripple compensation factors see the Bus Ripple Compensation section on page 19 Initialization The following initializations are performed when main is executed Option Bits The options bits set the PWM polarity and the WDT default mode Oscillator Oscillator initialization consists of sending an unlock sequence to the oscillator control register then enabling the external oscillator circuit After allowing a settling time of 50ms the oscillator control register is unlocked again Digital Output PB7 is used as a digital test pin for code development This allows testing of the speed of routines and to check out conditional branching of routines Comparator Used for
33. s The eZ8 processor core runs at up to 10MIPS with a 20MHz clock Page 25 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note zilog mbedded in AnEITXYS Company The integrated PWM interface module provides the necessary timing and logic outputs for synthesizing 3 phase voltage in motor control applications e The 2 5us successive approximation register SAR ADC can be triggered by PWM events for sampling and reconstructing phase currents The integrated Op Amp ampli fies and provides offset adjustment of a single ground referenced sense resistor cen tered to one half of the built in ADC reference The integrated comparator provides for fast overcurrent shutdown e The integrated communication peripherals UART PC and SPI provide for system level communication For example the UART in this application provides a highly ca pable Vector Control Command Interface yet is simple enough to be optically coupled for electrical isolation In addition to the Z8FMC16100 MCU s native advantages the software design in this application uses the following techniques to manage the processing task To make time for the waveform calculations the main loop operates at one fifth of the 20kHz PWM chop rate five 50us cycles 250ps per loop to preserve most of the ad vantages of a high frequency PWM rate while still producing a good approximation of the appropriate output waveform e To
34. sible in an imbalanced Delta wound motor not in a Wye winding the sum of three phase currents equals zero The third current can be derived from the other two samples using the following equation La ILb Ic 0 The oscillograph in Figure 11 compares a reconstructed waveform as output to the DAC at 1 A 330 mV top trace to the original waveform as read by a current probe at 1 A 10 mV AN024703 1111 Page 15 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note Zilog Embedded in Life AnEITXYS Company Tek Prevu WIE 33 mv s 6Jun 2006 082 200 18 03 29 Figure 11 Phase Current Reconstruction Test for End of PWM Period This action begins another side process of the PWM ISR PWM interrupts remain dis abled until the main loop ISR returns However at several times during the main loop the program polls the IRQO register to see if a PWM request is pending If so the program clears the request and increments a counter Near the end of the main loop this event counter is used to delay completion of the process until four PWM request events have occurred in addition to the one that began the loop This process ensures a five event main loop cycle 250s total without the requirement for precise timing of each main loop routine Clarke Transform A Clarke transform produces a 2 phase direct and quadrature representation of the reconstructed 3 phase stator flux vector Then a
35. to signals with the voltage required to drive the IGBT gate inputs Digital to Analog Converter The Z8FMC16100 MCU s C interface is used with a DAC5574 digital to analog con verter to generate up to four analog test outputs based on internal program values As a result the internal values are allowed to be directly compared to the motor controller s output waveform on an oscilloscope Motor The motor is a 3 phase AC induction motor used in washing machine applications as illustrated in Figure 1 Figure 1 Washing Machine Application The application motor is illustrated in Figure 2 The motor has the following specifica tions e Rated power 500 W RPM max 15 000rpm e Max current 2 8 Arms e Continuous current 1 5 Arms e DC Bus Voltage 350VDC The motor windings are connected in the Wye configuration for this application The back side of the motor has an integrated tachogenerator which consists of an 16 pole magnet mounted on the shaft and a single phase winding mounted on the housing This produces a sine wave signal whose voltage and frequency are proportional to the motor speed The interface to the Z3FMC16100 MCU is a simple transistor circuit that squares off the sine wave into 3 3 V digital pulses going to Timer 0 in Capture Restart mode This yields 8 pulses per revolution ANO024703 1111 Page 4 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note J
36. to take out the diode reverse recovery current spike in the current sense signal Because this spike usually occurs in the MHz frequency range a single pole LPF is sufficient set at approximately 300kHz Because the Operational Amplifier circuit already has an LPF this issue is more important for the following comparator circuit The cutoff frequency is calculated using the following equation 1 1 OMARIRRIXCI 7 ex SkQn100pe T 3 8KH fc Figure 7 illustrates the overall schematic for the overcurrent sense circuit It includes power stage components and components internal to the MCU Comparator and Vref are bl integrated Peripherals on the FMCI6100 Circuit Common to Op Amp and Comparator Rsense To PWM Module Figure 7 Overcurrent Sense Circuit AN024703 1111 Page 9 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note zilog mbedded in AnEITXYS Company R3 and R4 set the overcurrent trip threshold Because it is a DC value a bypass capacitor C3 of 0 1 uF is used For R4 10 R3 is selected as Vpgr 1 max x Rsense 2V 10A x 0 02 rcu Vege 1 max x Rsense dao 2V 104 x 0 020 12 2 kQ 12 4 kQ Washing Machine Interface Module This module provides the speed control interface between the modular controller and the washing machine It consists of the following parts Optoisolated UART command interface e Motor tachometer
37. ts High Voltage Gate Drive Module The schematic for the gate drive module is shown in Figure 19 on page 31 This module contains three IX2113 high side and low side gate drivers that convert the ZaFMC16100 MCU s PWM outputs into the voltage required to drive the IGBT gate inputs High Voltage Power Supply Module The schematic for the power supply module is shown in Figure 20 on page 32 This mod ule uses an LNK304G IC to convert rectified AC from the power stage to generate the application s 120mA 12V supply This 12V supply is then regulated by a UA78M33 IC to provide the 3 3 V supply Figure 6 illustrates the overall current sense circuit including some power stage compo nents and components internal to the MCU Vppr is the internal reference voltage of the MCU analog to digital converter and the full scale input range At zero current zero volt age across Rsense the output of the Op Amp is at 1 2 Vpgp which centers the current waveform at one half of the full input range of the ADC VBUS To ADC ANA3 C2 Op Amp and Vref are integrated Vref Peripherals on the FMC16100 Figure 6 Current Sense Circuit R1 10KQ R2 50KQ AN024703 1111 Page 8 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note Zilog Embedded in Life AnEITXYS Company Gain 5 C1 unused C2 100pF Rumes gCarn ma DRS IO ON The resistive divider also forms a Low Pass Filter LPF
38. turn sensor The optoisolator section ensures the electrical isolation of the user command interface from the high voltage module and also serves to multiplex the Z8FMC16100 MCU s RXD and TXD signals onto a single isolated DATA signal that connects to the remote Vector Control Command Interface GUI Power and ground for the user side of the optoisolator section are provided by the GUI The tachometer turn sensor section converts the analog rotor sense signal from the AC motor to a logic level DC pulse stream suitable for the Z3FMC16100 MCU s timer coun ter input DAC Test Output Module This module contains a DACS5741DGS DAC whose IC serial interface is driven by the Z8FMC16100 MCU The controller software transmits selected internal values to the DAC which converts those digital values to one of four analog outputs This allows for example the internal reconstructed waveform to be compared on an oscilloscope to the actual AC output from the power stage Vector Control Command Interface The external Vector Control GUI provides user control to modify the speed and PI loop settings The speed is plotted in user defined time intervals which can be seen in the GUI in Figure 4 on page 6 AN024703 1111 Page 10 of 37 Vector Control of a 3 Phase AC Induction Motor Using the Z8FMC16100 MCU Application Note Embedded in Life AnEITXYS Company Software Implementation Figure 8 shows a functional block diagram of the vector control app

Download Pdf Manuals

image

Related Search

Related Contents

be.ez 15.4" LE vertigo Lime Art    Purgador de boya cerrada FT14 ½" (DN15) a 1" (DN25)  よくある質問 覧  Cobra 29 LTD CHR  Owner`s Manual - Buy Two Way Radios    OPENCOCKPITS IOCard USBSERVOS MANUAL DE  IBM eServer System x3500  NF3A User`s Manual Revision 2.0  

Copyright © All rights reserved.
Failed to retrieve file