Home

AN3301, Design of a PMSM Servo System Using the 56F8357 Device

image

Contents

1. 00 ee eee ee eee 27 4 1 System CONCEP vic cctagr eases cae veraeenas 27 4 2 Servo Control Drive Concept 28 4 3 Servo Control Process 2 000 29 System Hardware Design 00 00 30 5 1 Hardware SQucture 22 2 20cce deeaende nas 30 52 56FSso7 EVM BOA cc2h2hsccaes domdaees 30 5 3 Main Power Circuit 00 000s 31 5 4 PWM Driver Circuits ssc cs cece e eee ae ee eed 32 5 5 DC Voltage and Phase Current Sample Circuit 33 5 6 Position and Speed Sensing 34 5 7 Overcurrent Protection Circuit 35 58 ECD Display CUCU ce dcetetaandagedeaxund 4 36 5 9 Manual Operating Circuit 37 5 10 Power Supply Citlits sss oc ceecanceadeaeeene 38 System Software Organization 38 6 1 Main Module Description i0 565 cnades deuce 39 6 2 ADC Interrupt Module Description 40 6 3 Position Interrupt Module Description 41 6 4 Button Interrupt Module Description 42 Software Modules lt ce cacccugiacee deep rnise Help lasers 43 TA Core Modules ccs cacxeacstne arhetegna se 4 43 7 2 Interface Modules 24 0 5 200 020002 cee enews 50 User Interface a cciceccanaeeeaddnnaete cence 51 Zz SH 2 freescale semiconductor 56F8357 DSC Advantages and Features The concept of the application includes a position closed loop PM synchronous drive with a speed closed loop using a Vector Co
2. e Serial Peripheral Interface SPI with configurable four pin port or four additional GPIO lines e Computer Operating Properly COP timer e Two dedicated external interrupt pins e Up to 76 GPIO lines e External reset pin for hardware reset e JTAG On Chip Emulation OnCE e Software programmable Phase Lock Loop based frequency synthesizer for the core clock e Large capacity memory 256KB Program Flash 4KB Program RAM 8KB Data Flash 16KB Data RAM 16KB Boot Flash combined with the on board 128KB external Program Data SRAM In addition to the fast Analog to Digital converter and the 16 bit quadrature timers the most interesting peripheral from the PM synchronous motor control point of view is the Pulse Width Modulation PWM module The PWM module offers a high degree of freedom in its configuration allowing efficient control of the PM synchronous motor Design of a PMSM Servo System Using the 56F8357 Device Rev 0 2 Freescale Semiconductor 56F8357 DSC Advantages and Features The PWM has the following features Three complementary PWM signal pairs or six independent PWM signals Complementary channel operation Dead time insertion Separate top and bottom pulse width correction via current status inputs or software Separate top and bottom polarity control Edge aligned or center aligned PWM signals 15 bits of resolution Half cycle reload capability Integral reload rates from 1 to 16 Individual software control
3. K b Eqn 49 A 9 3 _N3 Sa gt ae e 2 2 In most cases the 3 phase system is symmetrical which means that the sum of the phase quantities is always zero 1 1 3 a K a b c a b c 0 K a Eqn 50 a 2 Le a a7 The constant K can be freely chosen and equalizing the quantity and a phase quantity is recommended Then a a gt K 2 Eqn 51 The Clarke Park transformation can be fully defined 2 81 1 jfa 100 O aces eee a le B3 B 7 1 2 Transformation from a B to d q Coordinates and Backwards Vector control is performed entirely in the d q coordinate system to make the control of PM synchronous motors elegant and easy Of course this requires transformation in both directions and the control action must be transformed back to the motor side First establish the d q coordinate system Yy y Pia t Yup Eqn 53 Vu s p sin Opia Eqn 54 Yu Y COS pie Eqn 55 Vy Design of a PMSM Servo System Using the 56F8357 Device Rev 0 44 Freescale Semiconductor Software Modules Then transform from a B to d q coordinates d aj eee Fria SIN Orica pe Eqn 56 q SIN Frigg COS Orica LA Figure 35 illustrates this transformation i a Figure 35 Establishing the d q Coordinate System Park Transformation The backward Inverse Park transformation from d q to a B is a COSPrigg TSIN Oria a B sin Prieta COS Prieta q id In the PE library th
4. R93 AHISV 2K CHK REF 43V R89 2K 33 V R80 3K UIA 129 J IPRE ICLK 1D gt ICLR J 2PRE 2CLK 2D C 2CLR a l BOA Bi TALSTAX2 TALSO8 UIB TALSO8 3 3V Figure 25 Overcurrent Protection Circuit Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 35 System Hardware Design 5 8 LCD Display Circuit The LCD Display circuit is shown in Figure 26 In this system an 8 bit LCD displays the set actual speed position value An octal bus transceiver IC 741s245 changes the bus voltage from 3 3V to 5V An 8 bit Parallel Out Serial In Shift Register 74F164 saves the I O port 16PINLCD Lal C66 0 01luF T4F164 P 10K resistor bank a LCD Display Figure 26 LDC Display Circuit Design of a PMSM Servo System Using the 56F8357 Device Rev 0 36 Freescale Semiconductor System Hardware Design 5 9 Manual Operating Circuit In the manual operating mode the position speed setting can be operated by pressing the UP or DOWN push button The RUN STOP switch starts or stops operation a red LED is lighted when the system is running During operation the LCD can display the actual value or the set value The selection is carried out by the LCD select switch Another switch also selects position speed When the related LED is lighted the system operates in servo control otherwise it ope
5. B T ial Eqn 40 T 7 Uo 4 8 With the help of these equations and also considering normalized magnitudes of basic space vectors to be IU jl IU6ol 2 V3 the equations expressed for the unknown duty cycle ratios of basic space vectors T120 T and T 0 T can be written Tia 1 u 4 3 u Eqn 41 T 2 Up a To 1 u 43 u Eqn 42 T 2 Us a The duty cycle ratios in remaining sectors can be derived using the same approach The resulting equations will be similar to those derived for Sector I and Sector IL Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 21 Target Motor Theory These definitions depict duty cycle ratios of basic space vectors for all sectors e Three auxiliary variables X u B Y 1 2 ug V3 oug Z 1 2 ug V3 o ug e Two expressions tl t2 which generally represent duty cycle ratios of basic space vectors in the respective sector For example t_ and t_2 represent duty cycle ratios of basic space vectors Usg and Up for the first sector t_ and t_2 represent duty cycle ratios of basic space vectors Uj79 and Ugg for the second sector and so on For each sector the expressions t_ and t_2 are listed in Table 3 in terms of auxiliary variables X Y and Z Table 3 Determination of the Expressions _1 and t_2 for All Sectors Sectors Uo Uso U60 U120 U120 U180 U180 U240 U240 U300 U300 Uo t1 X Z Y X Z Y t2 Z X Z
6. Maximum speed of 600rpm at input power line 36V DC Manual interface includes Start Stop switch Position speed switch Set value actual value display switch Up Down push button control LED indicator Power supply Alarm Position speed Run stop PC master software control interface includes Motor start stop Speed set up PC master software remote monitor Overvoltage undervoltage overcurrent fault protection Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 27 Servo Control System The PM synchronous drive introduced here is designed to power a PMSM with a quadrature encoder Its specifications are detailed in Table 5 Table 5 System Specifications roooR Drive Characteristics Speed Range lt 1000rpm 4 2 Servo Control Drive Concept A standard system concept is used with this drive The system incorporates the following hardware e 3 phase PMSM development platform e Feedback sensors for Position Quadrature Encoder DCBus voltage Phase currents e 56F8357EVM The drive can be controlled in two different operating modes e Inthe Manual operating mode the required position or speed is set by the Start Stop switch and the Up Down push buttons Position Speed control is selected by the Position Speed switch e Inthe PC master software operating mode the required position or speed and Start Stop switch are set
7. UP e Decrease setting value DOWN e PC master software control e Selection of position control speed control e Position alignment Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 51 User Interface The setting values include e Absolute position setting e Increment position setting e Mechanical speed setting e Real time speed value display e Real time position value display The variables which the waveform could display are listed on the left part of the interface These variables could be defined in software Real time waveforms are illustrated in Figure 42 Figure 43 Figure 44 and Figure 45 D ores Aima ee Yea pae pe Den ke aS Sa a awe per is anrr ai ETF PEAR sine ae Bir Die ween See ties Pre see ame SOR ie Figure 42 Speed Response Waveform from 210rpm to 1000rpm Design of a PMSM Servo System Using the 56F8357 Device Rev 0 52 Freescale Semiconductor User Interface 1 aba i Zn B a 3 3 pE eeaeee PTE E E ees we en CSE en Figure 43 Position Control Response Waveform Speed Limitation is 800rpm Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 53 User Interface ee E AS I tec zI Lond ce It coc a Gc J EE a oc a Coa peo cope Bun
8. Y X For the determination of auxiliary variables X Y and Z the sector number is required This information can be obtained by several methods One approach requires the use of a modified Inverse Clark Transformation to transform the direct a and quadrature components into a balanced 3 phase quantity Urefi gt Uref2 ANd U ef3 uSed for straightforward calculation of the sector number to be shown in Figure 13 and Figure 14 Ure Zup Eqn 43 u v3 u c Eqn 44 ref 2 2 u vV3 u u 2 a Eqn 45 ref 3 2 The modified Inverse Clark Transformation projects the quadrature ug component into U ef as shown in Figure 12 and Figure 13 voltages generated by the conventional Inverse Clark Transformation project the direct u component into Uefi Design of a PMSM Servo System Using the 56F8357 Device Rev 0 22 Freescale Semiconductor Target Motor Theory Figure 12 depicts the direct u and quadrature ug components of the stator reference voltage vector Us that were calculated by equations uy cos 3 and ug sin 9 respectively Components of the Stator Reference Voltage Vector es ccs ED E A a amplitude 6455 opoo TTT Figure 12 Direct u and Quadrature u Components of the Stator Reference Voltage The Sector Identification Tree shown in Figure 14 can be a numerical solution of the approach shown in Figure 13 Sinusoidal Three P hase Reference Voltage 2 SS Sect
9. complementary device is turned on Output voltage is created by either a Pulse Width Modulation PWM using a look up table or Space Vector Pulse Width Modulation SVPWM technique Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 13 Target Motor Theory 3 2 1 PWM Technique The PWM technique is shown in Figure 5 where an isosceles triangle carrier wave is compared with a fundamental frequency sine modulating wave and the natural points of intersection determine the switching points of the power devices of a half bridge inverter The 3 phase voltage waves are shifted 120 to each other and thus a 3 phase motor can be supplied Generated PWM Carrier Sine Wave Wave yh i 1 Pam ouwats V1 LL a mouse To LLL JLILE LO ot ot Figure 5 Pulse Width Modulation Design of a PMSM Servo System Using the 56F8357 Device Rev 0 14 Freescale Semiconductor Target Motor Theory 3 2 2 SVPWM Technique The basic principle of the standard Space Vector Modulation Technique can be explained with the help of the power stage schematic diagram shown in Figure 6 Figure 6 Power Stage Schematic Diagram The top and bottom switches are working in a complementary mode i e if the top switch SAt is ON then the corresponding bottom switch SAb is OFF and vice versa Because value is assigned to the ON state of the top switch and value
10. cycle ratios In this system the svmElimDCBusRip bean is adopted to compensate for DC voltage ripple 7 1 6 Speed Regulation Current Regulation Position Regulation PI control is applied in speed current and position control The expression of PI control is 1 u t Keo tT f cnt Eqn 60 Where u t is the controller s output signal e t is the controller s input error signal KP is proportional factor T is the integral time constant If the sampling period T is small enough the discrete PI expression can be written k u k Ky ee K Zao Eqn 61 j 0 Where k is the sampling order number u k is the controller s output at the sampling time k e k and e k are input errors at time k and k respectively Integral factor Ky T T The proportional term and the integral term respectively are responsible for error sensibility and for the steady state error The incremental form of the PI algorithm is expressed as Au k u k u k 1 K e k e k 1 K e k Eqn 62 Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 47 Software Modules One limit of the PI algorithm is that during normal operation a large reference variation or disturbance may occur resulting in saturation and overflow of the regulator variables and output If uncontrolled this kind of nonlinearity damages the system s dynamic performance One solution is to add a correction of
11. detection circuit Figure 24 are shown in Figure 40 These signals are sent to the quadrature decoder port of the controller The Quadrature Decoder bean converts the 1024p c signal to 4096p c GetCounters retrieves the real time position and count difference With these values mechanical speed is calculated by the T method The Index signal also defines the zero position per rotation to count the position pulse D D S807 S807 ES EG phase AT LILI LILI LILI UL UL L mast Oe nL __ Ve Lr Figure 40 Quatrature Encoder Signals Design of a PMSM Servo System Using the 56F8357 Device Rev 0 50 Freescale Semiconductor User Interface 8 User Interface PC master software is programmed as the user interface to control motor and display variables VBScript programs the HTML control interface Figure 41 illustrates the PC master software interface ea servo PCMaster Bie Edt Wow Explorer fren Eyoject Heb SIMO Haa aea HA seelaa fin sis be servo contrat treescale A MCS6PS8357 Based Permanent Magnet Synchronous VMiotor PRISM Serve Syvtem starta Stop N Motor Motor Project Tree i Reman amj BY ie Eea Amei ys t08e Bironas few ee ees ESMMOWSARw ce Figure 41 PC Master Software Control Interface Possible user commands setting values and actual values are displayed on the right half of the interface window The commands include e Start motor e Stop motor e Increase setting value
12. processing Speed PI controller calculation which outputs a desired current In this application the speed and position sampling period is 2ms the interrupt priority is high A flowchart is shown in Figure 31 C Position Time Interrupt i Position Measure Processing t Speed Calculation Processing Servo Control y Sin Cos Generation i Y Position Control Anti Hunt Processing Position PI Regulator O y Speed Control Speec PI Regulator Speed Ramp Control lt lt Figure 31 Position Interrupt Flowchart Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 41 System Software Organization 6 4 Button Interrupt Module Description UP and DOWN buttons increase or decrease the speed position setting value in the Manual Operating Mode The two Ex nts interrupts respond to the operation the interrupt priority is medium The interrupt flowchart is shown in Figure 32 C Button Interrupt N Servo Control y Increasing Position Increasing Speed Setting Setting a Return Figure 32 Button Interrupt Flowchart 6 4 1 LCD Interrupt Module A Processor Expert PE bean TimelInt is used for LCD display The interrupt period is 10ms and the interrupt priority is low The LCD Interrupt flowchart is shown in Figure 33 C LCD Interrup
13. 0 is assigned to the ON state of the bottom switch the switching vector a b c f can be defined Creating such a vector allows numerical definition of all possible switching states Phase to phase voltages can then be expressed in terms of these states U 43 1 1 Ola Usc Upceu 0 1 1b Eqn 30 Uca 1 0 lille where UDCBus is the instantaneous voltage measured on the DCBus Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 15 Target Motor Theory Assuming that the motor is ideally symmetrical it s possible to write a matrix equation that expresses the motor phase voltages U 2 1 Ifa U U besus f 2 1 b Eqn 31 U 1 1 2 ic c In a 3 Phase power stage configuration shown in Figure 6 eight switching states vectors which are detailed in Figure 7 are possible These states together with the resulting instantaneous output line to line and phase voltages are listed in Table 1 Table 1 Switching Patterns and Resulting Instantaneous Line to Line and Phase Voltages a b c Ua Ub Uc Uag Use Uca Vector 0 0 0 0 0 0 0 0 0 Oooo 1 0 0 2UpcBus 3 Upcsus 3 Upcsus 3 Upcsus 0 UpcBus Uo 1 1 0 UpcBus 3 Upcsus 3 2UpcBus 3 0 Upcsus UpcBus Uso 0 1 0 Upcgus 3 2UpcBus 3 Upcsus 3 UpcBus Upcsus 0 Uy20 0 1 1 2UpcBus 3 Upcsus 3 Upceus 3 UpcBus 0 UpcBus U240 0 0 1 Upcsus 3 Upcsus 3 2UpcBus 3 0 UDCBus Upcsu
14. 20 d 3 A B PCYsaisg Y spisa Tz Eqn 21 where ap the stator orthogonal coordinate system USap the stator voltage isgg the stator current Ysap the stator magnetic flux Ym the rotor magnetic flux Rs the stator phase resistance Ls the stator phase inductance pF theelectrical rotor speed fields speed p the number of poles per phase J the inertia Tu the load torque the rotor position in a b coordinate system Equation 17 through Equation 21 represent the model of PMSM in the stationary frame a B fixed to the stator Design of a PMSM Servo System Using the 56F8357 Device Rev 0 10 Freescale Semiconductor Target Motor Theory Besides the stationary reference frame attached to the stator motor model voltage space vector equations can be formulated in a general reference frame which rotates at a general speed wg If a general reference frame is used with direct and quadrature axes x y rotating at a general instantaneous speed d0 dr as shown in Figure 3 where 9 is the angle between the direct axis of the stationary reference frame a attached to the stator and the real axis x of the general reference frame then Equation 22 defines the stator current space vector in general reference frame isg s igx j iy Eqn 22 l SO Figure 3 Application of the General Reference Frame The stator voltage and flux linkage space vectors can be similarly obtained in the general
15. 56F8357 Device Rev 0 24 Freescale Semiconductor Target Motor Theory 3 2 3 Vector Control of PMSM Vector control is an elegant method to control a Permanent Magnet Synchronous Motor PMSM in which a field oriented theory controls space vectors of magnetic flux current and voltage It is possible to set up the coordinate system to decompose the vectors into a magnetic field generating function and a torque generating function The structure of the motor controller vector control controller is then almost the same as for a separately excited DC motor which simplifies the control of PMSM This vector control technique was developed specifically to achieve a similarly dynamic performance in PMSMs In this method the stator current s field generating and torque generating functions must be broken down to able to separately control the magnetic flux and the torque In order to do so the rotary coordinate system must be connected to the rotor magnetic field this system is generally called a d q coordinate system The transformation from rotary to stationary coordinate systems demands very high CPU performance The Freescale 56F8357 device is well suited for use in a vector control algorithm 3 2 4 Block Diagram of Vector Control Figure 15 shows the application s software modules and hardware A detailed description of both aspects follows i and i are measured with a current sensor The Clarke transformation is applied to d
16. Calculate the position error of the required position and the actual position returned by the position interrupt program After Anti Hunt processing the position PI controller generates a required speed by the position error Calculate the speed error of the desired speed and the actual speed as the input of the speed PI controller The output of the speed PI controller is the desired current component Calculate the actual currents in the d q coordinate system The current s PI controllelr compares the required currents to generate the desired output voltages Incorporated with the DCBus voltage ripple elimination algorithm the SVPWM then generates the PWM signal to drive the servo motor Design of a PMSM Servo System Using the 56F8357 Device Rev 0 26 Freescale Semiconductor 4 4 1 Servo Control System Servo Control System System Concept The motor servo control system is designed to drive a 3 phase Permanent Magnet Synchronous Motor PMSM in a servo system The application meets the following performance specifications Vector control of a PMSM using the quadrature encoder as a position and speed sensor Targeted for the 56F8357EVM Runs on a 3 phase PMSM control development platform at 36V DC The control technique incorporates Vector Control with position closed loop and speed closed loop Rotation in both directions Starts from any motor position with rotor alignment Minimum speed of Srpm
17. F8357EVM board a power electronics board and one PMSM servo motor with an optical encoder The power electronics board integrates with the Intelligent Power Module IPM and PWM power drivers voltage current sensing and protection circuits position detection circuits LCD LED display circuits and power supply circuit SERVO CONTROL oD PC Master SVPWM PIM Control lt gt Generator Drive Display Module NON Voltage 12 Current bit A D LCD LED Display Run Stop gt Up speed gt p 56F8357EVM Figure 18 PMSM Servo System Control Structure oOo ymooomoj DMZ 5 2 56F8357EVM Board see the EVM Reference Manual Freescale s 56F8357EVM board has been used in this application for details see the 56F8357 Evaluation Module User Manual Design of a PMSM Servo System Using the 56F8357 Device Rev 0 30 Freescale Semiconductor System Hardware Design 5 3 Main Power Circuit A PIM P549 A PM is the chosen power stage One PIM includes one 3 phase input rectifier one brake chopper and one 3 phase inverter IGBT FRED with open emitter The structure is shown in Figure 19 When the system is supplied with DC power it s connected as shown in Figure 20 In this structure the 36V DC power supply is connected between pins 18 and 5 Pin 4 is connected to the brake circuit A brake resistor is connected between pins 18 and 20 Six PWM drive signals come from the
18. Freescale Semiconductor Application Note Document Number AN3301 Rev 0 08 2006 Design of a PMSM Servo System Using the 56F8357 by Charlie Wu Freescale Semiconductor Inc Tempe Arizona 1 Introduction A servo system is commonly used in a positioning application which requires high instantaneous torque response lower torque ripple a wide adjustable speed range and excellent speed regulation such as NC machine tools industrial robots and other automated printing packaging food and textile equipment In many types of AC motors a Permanent Magnet Synchronous Motor PMSM has been considered a better fit for a servo application because the PMSM offers the advantage of low rotor inertia high efficiency efficient heat dissipation structure and reduced motor size Moreover the elimination of brushes reduces noise and suppresses the need for brush maintenance This application includes a digital servo system with a Permanent Magnet AC Synchronous Motor and is based on Freescale s 56F8357 device The software design Incorporates the Processor Expert PE system Freescale Semiconductor Inc 2006 All rights reserved Device Contents INWOGUCHON s ccccc ena teceeeadewteeeaeeebdaeenen 1 56F8357 DSC Advantages and Features 2 Target Motor THOON sciri lak aes eared En E 5 3 1 Permanent Magnet Synchronous Motor PMSM 5 3 2 Digital Control of PMSM 362 268 24aeeeee ce ees 13 Servo Control System
19. PWM drive circuit The DC voltage and two output phase currents are sampled and sent to the 56F8357 ae Pet Figure 19 PIM Structure Figure 20 Main Circuit Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 31 System Hardware Design 5 4 PWM Driver Circuit A simple and reliable gate drive circuit based on a high and low side driver an IC IR2110 is used In this circuit only one 15V power supply is needed to control the six IGBT inverters Once the system is reset or if a hardware error occurs an error protection signal is produced The error signal will block all PWM signal outputs in hardware The driver circuit for one side is shown in Figure 21 1N4148 One Phase Driver Figure 21 One Phase PWM Driver Circuit Design of a PMSM Servo System Using the 56F8357 Device Rev 0 32 Freescale Semiconductor System Hardware Design 5 5 DC Voltage and Phase Current Sample Circuit A DC voltage sample circuit is shown in Figure 22 DC voltage is sensed by a voltage transducer LEM LV28 P supplied with 15V Through a voltage follower circuit and a simple voltage divider circuit the voltage signal is sent to the 56F8357 s A D port In this system the LEM s power resistor is 3 6K the LEM s primary side current is 10mA the secondary output current is 25mA and the sampling resistor is 1000 creating a maximum input volta
20. Software Organization 6 2 ADC Interrupt Module Description The ADC Interrupt module performs the entire FOC algorithm The tasks are In this application a PWM frequency of 8kHz has been chosen The current sampling period is 125us and the interrupt priority is high A flowchart of the ADC Interrupt module is shown in Figure 30 Sensing DC voltage and 2 phase currents Calculatin g the sine and cosine value of the present rotor position Clarke Park transformation Calculating PI Inverse Park transformation Compensating for DCBus ripple Realizing SVPWM Outputting PWM ADC Interrupt Analog Sensing Processing Currents Sensing ia ib Voltage Sensing DCBus Sin Cos Generation y Current Control Currents Transformation a b c to d q Current d PI Regulator Current q PI Regulator Voltage Transformation d q to a B DCBus Ripple Compensation SVPWM Module Sets Duty Circle Fault Control Undervoltage Overvoltage Overcurrent PWM Output j a Figure 30 ADC Interrupt Module Flowchart Design of a PMSM Servo System Using the 56F8357 Device Rev 0 40 Freescale Semiconductor System Software Organization 6 3 Position Interrupt Module Description The position interrupt module detects speed and position The main tasks are Measuring Position and speed Position PI controller calculation which outputs a desired speed Anti hunt
21. ame is the reference frame attached to the rotor flux linkage space vector with direct axis d and quadrature axis q After transformation into d g coordinates the motor model as follows d Usa Rsisa dit sd OFF 5 2 d Usg Reis 7Y Ji 54 OrYsa Ysa Lsisa t Yu Ysa Lsisg do Below base speed i 0 so Equation 28 can be reduced to the following form do 3 l BISP Y niso T As Equation 29 shows torque is dependent and can only be controlled directly by the current i Design of a PMSM Servo System Using the 56F8357 Device Rev 0 3 Ti BISP sais z YF saisa 7 Eqn Eqn Eqn Eqn Eqn Eqn 24 25 26 27 28 29 Freescale Semiconductor Target Motor Theory 3 2 Digital Control of PMSM In adjustable speed applications Permanent Magnet Synchronous Motors PMSMs are powered by inverters The inverter converts DC power to AC power at the required frequency and amplitude A typical 3 phase inverter is illustrated in Figure 4 Figure 4 3 Phase Inverter The inverter consists of three half bridge units where the upper and lower switches are controlled complementarily meaning when the upper one is turned on the lower one must be turned off and vice versa Because the power device s turn off time is longer than its turn on time some dead time must be inserted between the time when one transistor of the half bridge is turned off and its
22. by the PC Design of a PMSM Servo System Using the 56F8357 Device Rev 0 28 Freescale Semiconductor Servo Control System Permanent Magnet AC Synchronous Motor Servo System 7 PIM Module Line AC Position Start PC Master Up Down Speed Stop St Real Clear 4 ii LED LCD l T i l a i oy 4 Ude 4 2 t Ae ch i ae yy y PWM ADC pain scl GPIO GPIO Hardware GPIO ima Faults PE Driver PE Driver PE Driver PE Driver PE Driver PE Driver PE Driver PE Driver pwm Phase pwm PhaseB Display pwm PhaseC _____ Application Control Gontol Fault Protection Break Control SVPWM Position required u_de_bus waveform 5 Speed_required EEE ES U_AlphaBeta Comp alpha Modulation Position i a aah U_AlphaBeta Comp beta 3 i Position required Positon Speed_required Speed Current q 7 a eo Pl re Pl ro P _DQ q_axis t i Speed 7 Controller 7 Controller Controller ensing U_AlphaBetaalpha L Inverse Park __ DC bus Transformation ripple g J pl daa Compensation i_dq_required d_axis Current d U_AlphaBetabeta aa z E gt x PI UDO axi 5 2 7 Controller U DQ d_axis SinCos sine theta_actual_el a q SinCos cosine 3 4 a vy a i_dq q_axi
23. d i g are rotational quadrature phase 2 phase current components which are converted from the actual 3 phase stator currents as follows isa Kia sis Li Eqn 12 isp Bigio Eqn 13 where k 2 3 is a constant The space vectors of other motor quantities voltages currents magnetic fluxes etc can be defined in the same way as the stator current space vector For a description of the PMSM the symmetrical 3 phase smooth air gap machine with sinusoidally distributed windings is considered The voltage equations of stator in the instantaneous form can then be expressed as d Us Rsisa 7 Vsa Eqn 14 d Usp Rsisg FV sp Eqn 15 d Usc Rsisc 7 Wai Eqn 16 where Usa Usp and usc are the instantaneous values of stator voltages isa Isp and isc are the instantaneous values of stator currents Ysa Ysp Ysc are instantaneous values of stator flux linkages y g relates to phase SA Wop relates to SB and yc relates to SC Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 9 Target Motor Theory Due to the large number of equations in the instantaneous form Equation 14 Equation 15 and Equation 16 it is more practical to rewrite the instantaneous equations using a two axis theory Clarke transformation The PMSM can be expressed as U a Risa EY sa Eqn 17 d usp Rsisp TY sp Eqn 18 Ysa Lsisa ycos O Eqn 19 Ysp Leisg ysin Eqn
24. dex pulse per mechanical revolution Through the quadruple differential line receiver IC 26LS32 the differential signals of A and A B and B Z and Z are converted to signal A B and Z These signals are connected to the controller s quadrature decoder port with optical coupler isolation The position speed detection circuit is shown in Figure 24 JP1 12 HEAD u JPS iO x E E i IPA O ay 3 A E as J1 6 5 6b 7 q2 1 J BL 6 g3 Mf 9 10 gt 5 4 13 ji 12 p 4p o 12 g3 146 3 lt 6 Ti e ee as 26 7 10 E HUEN 1p 8 9 3 3 V z CoOIDEWNHeE J Figure 24 Position Speed Detection Circuit Design of a PMSM Servo System Using the 56F8357 Device Rev 0 34 Freescale Semiconductor System Hardware Design 5 7 Overcurrent Protection Circuit To protect the system an overcurrent signal is produced when an overcurrent fault is detected and the related LED is lighted An ERROR signal created with the signals of BR and RESET is used to block the PWM signals The circuit is shown in Figure 25 In this circuit TL431 provides a comparison of benchmark voltage A dual d type positive edge triggered flip flop IC 74LS74 locks the error signal This signal will be cleared when the clear button is pressed 15V SK 2 R95 R94 D3 C63 C64 C61 0 1uF D3 L431 3 R91 10K 10K 0 1uF 10uF 10 10K
25. e cptrfmPark cptrfmClarke cptrfmClarkeInv and cptrfmParkInv functions of the MC_ClarkePark bean can calculate the Clarke Park and Inverse Park transformations The cptrfmClarke function transforms a 3 phase rotating coordinate system into a 2 phase rotating coordinate system The cptrfmPark function transforms a 2 phase rotating coordinate system into a 2 phase stationary coordinate system The cptrfmClarke and cptrfmPark functions inverse functions cptrfmClarkeInv and cptrfmParkInv respectively perform inverse transformations Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 45 Software Modules 7 1 3 Generation of Sine Cosine with a Look up Table The Park and Park 1 transformation use the value of the rotor electrical position to handle the stator current vector projection in a rotating frame To obtain both sine and cosine from the electrical angle a sine look up table mcgenSineTable256 is used The table contains 256 words to represent sine values of electrical angles in the range 0D 360 As a result qe s resolution is limited to 360 256 40625 qe electrical angle 360 with ge in the range 0 FFFh ge varies from 0 to 4095 See Section 5 6 Position and Speed Sensing for additional information about position sensing As only 256 words are available to represent this range ge is divided by 16 and stored into the variable index that will be used to addr
26. ent PM motors 3 1 1 Electrical Equations Us V cos a t Usg V Cos a 1 5 Eqn 1 4 Usc V cos a 7 To create the rotating stator flux the commonly applied phase voltages present a phase shift of 120 electrical from one to another that takes into account the mechanical 120 angle between coils Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 5 Target Motor Theory A one phase electrical equation can be written M7 E Ae Eqn 2 dt dt where YY corresponds to the amplitude of the natural magnetic flux of the permanent magnets The term d Y 0 nin corresponds to the back EMF induced voltage and can also be written a 8 a ie Qo d0 where corresponds to the electrical speed If the machine is assumed to be sinusoidal the induced voltage has the following form E 6 sin E E 0 o nes a Y K0 3 Eqn 3 E 0 An sin 0 3 A part of the electrical power delivered to the motor is transformed in Joule losses another part is going to the energy stored in the magnetic field and the last part is transformed into mechanical energy torque production In a PMSM torque is expressed by Te p I K Eqn 4 m where p is the number of pole pairs Design of a PMSM Servo System Using the 56F8357 Device Rev 0 6 Freescale Semiconductor Target Motor Theory It can be proven that the best me
27. escale com For Literature Requests Only Freescale Semiconductor Literature Distribution Center P O Box 5405 Denver Colorado 80217 1 800 441 2447 or 303 675 2140 Fax 303 675 2150 LDCForFreescaleSemiconductor hibbertgroup com Document Number AN3301 Rev 0 08 2006 Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document Freescale Semiconductor reserves the right to make changes without further notice to any products herein Freescale Semiconductor makes no warranty representation or guarantee regarding the suitability of its products for any particular purpose nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit and specifically disclaims any and all liability including without limitation consequential or incidental damages Typical parameters that may be provided in Freescale Semiconductor data sheets and or specifications can and do vary in different applications and actual performance may vary over time All operating parameters including Typicals must be validated for each customer application by customer s technical experts Freescale Semiconductor does not convey any license under its patent rig
28. eset to zero This approach has effectively avoided the rotor oscillation at the stand still position P I Gains l Position gt Figure 38 Anti Hunt PI gain Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 49 Software Modules 7 2 Interface Modules Interface modules are lowlevel routines that convert real word data into suitable numerical counterparts The interface modules include 7 2 1 Current Voltage Sensing Sensing modules directly handle the hardware interface via the integrated peripherals see Figure 23 Two LEMs current voltage transducer sense the phase currents The LEM converts the current information from phase a and b into voltage information The voltage variety range is limited to 0 2 5V to meet the input range of the 56F8357 s ADC input voltage specification Figure 39 illustrates the Current Sensing Scale Translation Phase current Binary 5A 3102 OA 1551 5A 0 Figure 39 Current Sensing Scale Translation GetChanValue of the ADC bean calculates a 15 bit sampling value The sampling value subtracts the value corresponding to zero to find the actual value These values are stored separately in i_abc PhaseA i_abc PhaseB and u_dc_bus 7 2 2 Electrical Position and Mechanical Speed The embedded encoder of this application generates 1024 pulses per mechanical revolution The A B and Index quadrature signals from the position
29. ess the look up table NOTE To calculate the cosine value of the electrical angle add 90 to qe 7 1 4 Variable Stator Voltage Vector Generation Space Vector Modulation Algorithm The MC_SpaceVectorMod bean provides six usable PWM modes The svmAlt algorithm is used in this system A Space Vector Modulation is adopted with nulls that are formed from states O000 in even sectors and O111 in odd sectors The center aligned PWM output is used at same time The SetRatio15 of the PWMMC bean is adopted to output PWM 7 1 5 DC Ripple Compensation To eliminate the influence of DCBus voltage ripples on the generated PWM waveforms the DC ripple compensation algorithm is used to compensate for the amplitude of the a and B components of the stator reference voltage vector U These imperfections are eliminated as shown in the following equations Index U U u_dcbus signU 1 0 otherwise u_dcbus if Index U lt j Eqn 58 Where Index must be within a fractional range and positive 0 lt Index lt 1 The value depends on the modulation technique i e for Space Vector Modulation techniques and Injection of the Third Harmonic it is equal to 0 866025 Design of a PMSM Servo System Using the 56F8357 Device Rev 0 46 Freescale Semiconductor Software Modules The y sign x function is defined as follows iB if x gt 0 1 0 otherwise Ean 22 Where x U Ugare input duty cycle ratios U oU i pare output duty
30. etermine the stator current projection in a two coordinate non rotating frame The Park coordinate transformation is then applied to obtain this projection in the d q rotating frame The stator phase current s d q projections are then compared to their reference values P and i 4 set to 0 and corrected by mean of PI current controllers The outputs of the current controllers are passed through the inverse Park transformation and a new stator voltage vector is applied to the motor using the Space Vector Modulation technique Va Vb Ve Sa Sb Sc PWM Ee Generator me Inve ter TA dq a be Transformation PI PI Controller Controller Position Encoder abe dq Transformation Figure 15 Software Modules Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 25 Target Motor Theory 3 2 5 Servo Control of PM Synchronous Motor U U Inverse Park DC Bus Transformation Ripple d q a B Compensation PI PI U DCBus Controller Controller la Position la Clarke Park Transformation C F a b c a B d q h lg 0 e PI PI Controller i 0 la Controller Anti Hunt Os 7 0 n on Figure 16 PMSM Servo Control Scheme The PMSM servo control scheme is illustrated in Figure 16 The controller has an inner loop of current regulation using vector control and an outer loop of hybrid speed and position regulation The main idea of servo control is 1
31. for which the null vectors Ogg and O41 are applied These resultant duty cycle ratios are formed from the auxiliary components termed A and B The graphical representation of the auxiliary components is shown in Figure 11 Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 19 Target Motor Theory femoral phere vollage meagnilude 1 13 1 i1 Usa zi w01 101 Figure 10 Projection of the Reference Voltage Vector in Sector Il 30 degrees Tel Ten Sect Humber B u A WAS U a axis Figure 11 Detail of the Reference Voltage Vector Projection in Sector II Design of a PMSM Servo System Using the 56F8357 Device Rev 0 20 Freescale Semiconductor Target Motor Theory The equations describing those auxiliary time duration components are sin 30 _ A sin120 u Banear sin 60 _B E sin60 u qnas Equation 37 and Equation 38 have been formed using the Sinus Rule These equations can be rearranged for the calculation of the auxiliary time duration components A and B This is done simply by substituting the trigonometric terms sin30 sin120 and sin60 by their numerical representations 1 2 3 2 and 1 V3 respectively 1 A u V3 E B u qn 39 The resulting duty cycle ratios T 29 T and T T are then expressed in terms of the auxiliary time duration components defined by Equation 40 Ti U w 4
32. ge of 36V which is converted into a 2 5V output voltage to the A D port R52 10k C50 R50 0 024uF 2 2K Uw Figure 22 DCBus Voltage Detection Circuit The output phase current sample circuit is shown in Figure 23 The phase current is sensed by a current voltage transducer LEM LA28 NP The LEM scale is 5A the primary maximum input current is 1 65 5 10 3 3mA the secondary output current is 1 65 5 25 8 25mA and the sampling resistor is 300Q creating a maximum voltage of 2 475V Through a follower circuit and a simple divider circuit the maximum voltage to the A D port is 2 475 2 2 5 2 2 4875V and the minimum voltage is 2 475 2 2 5 2 0 01 25V JP25 LEM IA SA Ar owmrwMVsAwWNe LM358 R62 10K lI IA OverCurrent Detect gt Phase Current Detect Figure 23 Phase Current Detection Circuit The voltage signal obtained is sent to the 56F8357 s A D port The sensed voltage and current signals are also used as hardware and software protection signals such as undervoltage overvoltage and overcurrent Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 33 System Hardware Design 5 6 Position and Speed Sensing When the motor rotates each channel of the embedded optical encoder supplied with 5V DC generates 1024 pulses and one in
33. hts nor the rights of others Freescale Semiconductor products are not designed intended or authorized for use as components in systems intended for surgical implant into the body or other applications intended to support or sustain life or for any other application in which the failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application Buyer shall indemnify and hold Freescale Semiconductor and its officers employees subsidiaries affiliates and distributors harmless against all claims costs damages and expenses and reasonable attorney fees arising out of directly or indirectly any claim of personal injury or death associated with such unintended or unauthorized use even if such claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part Freescale and the Freescale logo are trademarks of Freescale Semiconductor Inc All other product or service names are the property of their respective owners Freescale Semiconductor Inc 2006 All rights reserved RoHS compliant and or Pb free versions of Freescale products have the functionality and electrical characteristics as their non RoHS compliant and or non Pb free counterparts For further information see http www freescale com or contact your Freescale sales representati
34. ifference counter e Maximum count frequency equals the peripheral clock rate e Position counter can be initialized by software or external events e Preloadable 16 bit revolution counter e Inputs can be connected to a general purpose timer to aid low speed velocity The PM Synchronous Motor vector control application utilizes the Quadrature Decoder connected to Quad Timer A It uses the decoder s digital input filter to filter the encoder s signals but does not make use of its decoding functions freeing the decoder s digital processing capabilities to be used by another application Design of a PMSM Servo System Using the 56F8357 Device Rev 0 4 Freescale Semiconductor Target Motor Theory 3 Target Motor Theory 3 1 Permanent Magnet Synchronous Motor PMSM The PMSM is a rotating electrical machine with a classic 3 phase stator like that of an induction motor the rotor has surface mounted permanent magnets see Figure 1 Stator Stator winding in slots Shaft Rotor Air gap Permanent magnets Figure 1 PMSM Cross Section In this respect the PMSM is equivalent to an induction motor in that the air gap magnetic field is produced by a permanent magnet so the rotor magnetic field is constant PM Synchronous Motors offer a number of advantages in designing modern motion control systems The use of a permanent magnet to generate substantial air gap magnetic flux makes it possible to design highly effici
35. ios of the basic switching states Ugg and Ug The principal equations concerning this vector location are T To T T T pun Eqn 33 T T Us e tae where T6o and To are the respective duty cycle ratios for which the basic space vectors Ugg and Ug should be applied within the time period T Thur 1S the course of time for which the null vectors Oooo and Oj 1 are applied Design of a PMSM Servo System Using the 56F8357 Device Rev 0 18 Freescale Semiconductor Target Motor Theory Duty cycle ratios can be calculated with Equation 34 Uy Te I17 sin 60 T Eqn 34 T Uy z Vol ug tan 60 Considering that normalized magnitudes of basic space vectors are U ol lUo 2 V3 and by substitution of the trigonometric expressions sin60 and tan60 by their quantities 2 V3 and V3 respectively Equation 33 and Equation 34 can be rearranged for the unknown duty cycle ratios T o T and To T Eqn 35 JANES 1 0 e V3 u u rg O a ug Sector II is depicted in Figure 10 In this particular case the reference stator voltage vector Ug is generated by the appropriate duty cycle ratios of the basic switching states Ugg and Uj29 The basic equations describing this sector are T T F T Eqn 36 U a r Va tr Va T T null where T120 and T6 are the respective duty cycle ratios for which basic space vectors Uj79 and U60 should be applied within the time period T Tnull is the course of time
36. l to the reference vector Waza Uy 010 110 is 1 fiyfa 1 Uso U oq 100 Eana RAZ 004 ina Piva Figure 7 Basic Space Vector of the Space Vector Modulation Technique Um U 010 pams 13 4 Maximal phase voltage magnitude 1 Uy a U att 100 meals paa o jana 0 1N3 1 AN3 1 U E ED 001 101 Figure 8 Projection of the Reference Voltage Vector in Sector Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 17 Target Motor Theory Referring to the theory of SVMPWM an objective of the Standard Space Vector Modulation is an approximation of the reference stator voltage vector Us with an appropriate combination of the switching patterns composed of basic space vectors This objective is shown in Figure 8 and Figure 9 The stator reference voltage vector Ug is phase advanced by 30 from the direct a and thus might be generated with an appropriate combination of the adjacent basic switching states Ug and Ugo Us 110 1 3 1 Sector Number TATU Z 1N3 u 30 degrees VI Figure 9 Detail of the Reference Voltage Vector Projection in Sector These figures also indicate the resulting direct o and quadrature components for basic space vectors Ug and U60 In this case the reference stator voltage vector Us is located in Sector I and as previously mentioned can be generated with the appropriate duty cycle rat
37. led PWM outputs Mask and swap of PWM outputs Programmable fault protection Polarity control 20mA current sink capability on PWM pins Write protectable registers The PM synchronous motor control utilizes the PWM block set in the complementary PWM mode permitting generation of control signals for all switches of the power stage with inserted dead time The PWM block generates three sinewave outputs mutually shifted by 120 The Analog to Digital Converter ADC consists of a digital control module and two analog sample and hold S H circuits ADC features include 12 bit resolution Maximum ADC clock frequency is 5MHz with 200ns period Single conversion time of 8 5 ADC clock cycles 8 5 x 200ns 1 7us Additional conversion time of 6 ADC clock cycles 6 x 200ns 1 2us Eight conversions in 26 5 ADC clock cycles 26 5 x 200ns 5 3us using simultaneous mode ADC can be synchronized to the PWM via the sync signal Simultaneous or sequential sampling Internal multiplexer to select two of eight inputs Ability to sequentially scan and store up to eight measurements Ability to simultaneously sample and hold two inputs Optional interrupts at end of scan if an out of range limit is exceeded or at zero crossing Optional sample correction by subtracting a preprogrammed offset value Signed or unsigned result Single ended or differential inputs Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Se
38. lues into the stationary reference frame and consecutively into the rotary reference frame d q Park Clarke transformation Based on the errors between the required and actual currents in the rotary reference frame the current controllers generate output voltages U_DQ q_axis and U_DQ d_axis in the rotary reference frame d q The voltages U_DQ q_axis and U_DQ d_axis are transformed back into the stationary reference frame After DCBus ripple elimination they are recalculated to the 3 phase voltage system which is applied to the motor Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 29 System Hardware Design Besides the main control loop the DCBus voltage and the motor phase current are measured during the control process They are used to protect the drive from overvoltage undervoltage and overcurrent If any of these faults occur the motor control PWM outputs are disabled in order to protect the drive and the fault state of the system is displayed by the on board LED This dual loop structure ensures a fast torque response by using vector control high position accuracy with the position controller and fast tracking performance with hybrid speed and position control The structure is also important to secure the stability of the system 5 System Hardware Design 5 1 Hardware Structure The 56F8357 based servo system hardware structure is shown in Figure 18 The hardware comprises a 56
39. miconductor 3 56F8357 DSC Advantages and Features The application utilizes the ADC block in simultaneous mode and sequential scan It is synchronized with PWM pulses This configuration allows the simultaneous conversion within the required time of required analog values all phase currents voltage and temperature The quadrature timer is an extremely flexible module providing all services relating to timed events It has the following features e Four 16 bit counters timers in each timer module e Ability to count up down e Cascadable counters e Programmable count modulo e Maximum count rate equals peripheral clock 2 when counting external events e Maximum count rate equals peripheral clock when using internal clocks e Count once or repeatedly e Counters are preloadable e Counters can share available input pins e Each counter has a separate prescaler e Each counter has capture and compare capability The PM Synchronous Motor vector control application utilizes four channels of the quadrature timer module for position and speed sensing A fifth channel of the quadrature timer module is set to generate a time base for speed sensing and a speed controller The Quadrature Decoder provides decoding of position signals from a Quadrature Encoder mounted on a motor shaft It has the following features e Includes logic to decode quadrature signals e Configurable digital filter for inputs e 32 bit position counter e 16 bit position d
40. ning CETL EFE ea ano 08 mj BBpscwia jroo Sie ieee a anf Figure 44 Id and Iq Waveform 200rpm Design of a PMSM Servo System Using the 56F8357 Device Rev 0 54 Freescale Semiconductor User Interface Eero Haver ger saron presea a Ejen a Eene eree rans pem e EAA a es Figure 45 Id and Iq Waveform speed from 200rpm to 1000rpm Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 55 How to Reach Us Home Page www freescale com E mail support freescale com USA Europe or Locations Not Listed Freescale Semiconductor Technical Information Center CH370 1300 N Alma School Road Chandler Arizona 85224 1 800 521 6274 or 1 480 768 2130 support freescale com Europe Middle East and Africa Freescale Halbleiter Deutschland GmbH Technical Information Center Schatzbogen 7 81829 Muenchen Germany 44 1296 380 456 English 46 8 52200080 English 49 89 92103 559 German 33 1 69 35 48 48 French support freescale com Japan Freescale Semiconductor Japan Ltd Headquarters ARCO Tower 15F 1 8 1 Shimo Meguro Meguro ku Tokyo 153 0064 Japan 0120 191014 or 81 3 5437 9125 support japan freescale com Asia Pacific Freescale Semiconductor Hong Kong Ltd Technical Information Center 2 Dai King Street Tai Po Industrial Estate Tai Po N T Hong Kong 800 2666 8080 support asia fre
41. nterrupt module e The Position Interrupt module Additionally the Button Response Interrupt executes the manual setting and the LCD interrupt performs the LCD display Design of a PMSM Servo System Using the 56F8357 Device Rev 0 38 Freescale Semiconductor System Software Organization 6 1 Main Module Description After a processor reset the main module performs the following tasks e 56F8357 set up Core Watchdog Clocks ADC SCI General Purpose IO Quadrature Decoder PWM e Variables initialization Default values e Interrupt source selection and enable e Rotor position alignment e LCD and LED displays e Waiting loop During the waiting loop communication is performed between the 56F8357 and the PC master software The 56F8357 communicates via its asynchronous serial port to the COM port of a PC The user can send commands and update variables via this RS 232 link with RXD and TXD interrupt The flowchart is shown in Figure 29 Start y Initialization y Enable Interrupt Application Control PC master Software Manual Control Run Stop Control Alignment Control Position Speed Loop Control Up Down Control LED Indication Control LCD Display Control i Brake Control t Figure 29 Main Module Flowchart Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 39 System
42. ntrol technique It serves as an example of a PM synchronous motor control design using a Freescale Digital Signal Controller DSC This document includes the system design concept hardware implementation and software design 2 56F8357 DSC Advantages and Features The 56F8357 is well suited for digital motor control combining the DSP s calculation capability with the MCU s controller features on a single chip This device offers such dedicated peripherals as Pulse Width Modulation PWM modules an Analog to Digital Converter ADC Timers communication peripherals SCI SPI CAN on board Flash and RAM The 56F8357 provides the following peripherals e Two Pulse Width Modulators PWMA amp PWMB each with six PWM outputs three Current Sense inputs and four Fault inputs fault tolerant design with dead time insertion supporting both center and edge aligned modes e 12 bit Analog to Digital Converters ADCs supporting two simultaneous conversions with dual four pin multiplexed inputs the ADC can be synchronized by PWM modules e Two Quadrature Decoders Quad Dec0 amp Quad Dec1 each with four inputs or two additional Quad Timers A amp B e Two dedicated general purpose Quad Timers totaling six pins Timer C with two pins and Timer D with four pins e CAN 2 0 A B module with two pin ports used to transmit and receive e Two Serial Communication Interfaces SCIO amp SCI1 each with two pins or four additional GPIO lines
43. oltage and current and adequately describes the performance of the machine under both steady state and transient operation The complex space vectors can be described using only two orthogonal axes so the motor can be considered a two phase machine Using a 2 phase motor model reduces the number of equations and simplifies the control design Assume i isp and i the line to neutral currents of the symmetrical machine are balanced at any instant lsa isp Ise 0 Eqn 9 Define the stator current space vector as follows i k i aip oil Eqn 10 Where amp and a are the spatial operators ee j2n 3 oe e413 k is the transformation constant chosen as k 2 3 Figure 2 shows the stator current space vector projection B a phase a phase c Figure 2 Stator Current Space Vector Projection Design of a PMSM Servo System Using the 56F8357 Device Rev 0 8 Freescale Semiconductor Target Motor Theory The space vector defined by Equation 10 can be expressed utilizing the two axis theory The real part of the space vector is equal to the instantaneous value of the direct axis stator current component i a its imaginary part is equal to the quadrature axis stator current component 7 g Thus the stator current space vector in the stationary reference frame attached to the stator can be expressed as by deg tjip Eqn 11 In symmetrical 3 phase machines the direct and quadrature axis stator currents i an
44. or 1 Sector 2 Sector3 Sector4 Sector 5 angle Figure 13 Reference Voltages Urer1 Uref2 ANA Uref3 Sector Identification Tree Uraf3 Uraf3 gt 0 Upaf2 gt 0 Uraf2 0 Upop2 gt 0 Uraf2 0 Uref1 0 Urafi gt 0 Ureft 0 Urgf1 gt 0 Sector VI Sector Sector l Sector V Sector V Sector III Figure 14 Identification of the Sector Number Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 23 Target Motor Theory It should be pointed out that in the worst case three simple comparisons are required to precisely identify the sector of the stator reference voltage vector For example if the stator reference voltage vector resides according to the one shown in Figure 8 the stator reference voltage vector is phase advanced by 30 from the direct axis which results in positive quantities of U and U f and a negative quantity of U ef3 refer to Figure 13 If these quantities are used as inputs to the Sector Identification Tree the product of those comparisons will be Sector I Using the same approach identifies Sector II if the stator reference voltage vector is located as shown in Figure 10 The variables t1 t2 and t3 representing switching duty cycle ratios of the respective 3 phase system are found by the following equations ti T t l 2 Eqn 46 2 t t t_l Eqn 47 t t t_2 Eqn 48 where T is the switching period t_I and t_2 are duty cycle ratios of ba
45. rates in speed control The manual operating circuit is Shown in Figure 27 D5857 33V S111 RUI JP6 3 3V 2 1 A P S select 2 o o ND 4 3 3 V Sp T RI 6 O Ik SI oT 4 Set Actual value ae 3 3 V 10K resistor bank AP TO D RI Figure 27 Manual Operating Circuit Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 37 System Software Organization 5 10 Power Supply Circuit In this system a multi group switch power supply provides one 36V DC one 24V DC one 5V DC and one 15V DC 15V also produces a 12V with via a linear voltage regulator for the EVM supply and 2 5V Max 6225 for the A D sample circuit Another 15V is obtained from 24V via a linear voltage regulator LM7815 which provides the power for the IR2110 The power supply circuit is shown in Figure 28 JP9 L7812CV 12V JP oe ee 1 gt HEADER 4 30 4O 5 6 O i gt JP14 8 oir I C Lc 7 425V E i IN IC PowerSouse NR OUT GND TRM MAX6225 NIDAN JP90 JP16 15 V spx1117 L7815CV ei 26 gt 2 w w C15 7 C18 24 EARTH 22p0uF 50V C10 10uF 10V 0 luF Power Supply gt Figure 28 Power Supply 6 System Software Organization The program SERVOPMSM C contains three main modules e The Main module e The ADC I
46. reference frame Similar considerations hold for the space vectors of the rotor voltages currents and flux linkages The real axis ro of the reference frame attached to the rotor is displaced from the direct axis of the stator reference frame by the rotor angle 6 As shown the angle between the real axis x of the general reference frame and the real axis of the reference frame rotating with the rotor ra is 8 0 in the general reference frame so the space vector of the rotor currents can be expressed as ao OO Leg 1 7x ji y Eqn 23 where i is the space vector of the rotor current in the rotor reference frame Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 11 Target Motor Theory The space vectors of the rotor voltages and rotor flux linkages in the general reference frame can be similarly expressed The motor model voltage equations in the general reference frame can be expressed by transformations of the motor quantities from one reference frame to the general reference frame The PMSM model is often used in vector control algorithms The aim of vector control is to implement control schemes which produce high dynamic performance and are similar to those used to control DC machines To achieve this the reference frames may be aligned with the stator flux linkage space vector the rotor flux linkage space vector or the magnetizing space vector The most popular reference fr
47. s U300 1 0 1 Upcsus 3 2UpcBus 3 Upcsus 3 Upcsus UDCBus 0 U360 1 1 1 0 0 0 0 0 0 Gigs The quantities of direct a and quadrature B components of the 2 phase orthogonal coordinate system describing the 3 phase stator voltages are expressed by the Clarke Transformation arranged in a matrix form 1 fy Ss a 2 U ay 2 Eqn 32 0 Cc ee u 3 8 2 The 3 phase stator voltages U Up and U are transformed via Clarke Transformation into quantities of direct a and quadrature components of the 2 phase orthogonal coordinate system The transformation results are listed in Table 2 Table 2 Switching Patterns Space Vectors and a B Voltage Components a b c U Us Vector 0 0 0 0 0 Ons 1 0 0 2Upcgus 3 0 Uo 1 1 0 Upcsus 3 Upcgus v3 Uso 0 1 0 UpcBus 3 Upcsus v3 U120 0 1 1 2Upcgus 3 0 Usag 0 0 1 UpcBus 3 Upcsus v3 Usoo 1 0 1 Upcus 3 Upcgus v3 U360 1 1 1 0 0 om Design of a PMSM Servo System Using the 56F8357 Device Rev 0 16 Freescale Semiconductor Target Motor Theory Figure 7 graphically depicts possible basic switching states vectors It is clear that there are six non zero vectors Up Ugo Uj29 Ugo U249 U300 and two zero vectors O14111 O000 available for switching Therefore the principle of standard Space Vector Modulation resides in applying appropriate switching states for a certain time thus generating a voltage vector identica
48. s i_AlphaBeta alpha i_abe PhaseA FowadPak SJ Forward Clark J Current i_dg daxis Transformation _AlphaBeta beta Transformation j_abe PhaseB Sensing a B d q e abab Prosessing Figure 17 PMSM Servo System Control Scheme 4 3 Servo Control Process The servo control scheme of the PMSM is illustrated in Figure 17 The controller has an inner loop of current regulation using vector control and an outer loop of hybrid speed and position regulation When the Start command is accepted using the Start Stop Switch or the PC master software command the required position is calculated according to the Up Down push buttons or PC master software commands Proceeding through an acceleration deceleration ramp the reference speed is calculated according to the error between the required position and the actual measured position The reference speed is put to the speed controller The actual speed is calculated from the pulses of the Quadrature Encoder The comparison between the required speed command and the actual measured speed generates a speed error Based on the error the speed controller generates a current i_dq_required q_axis which corresponds to torque A second part of the stator current i_dg_required d_axis which corresponds to flux is given by the Field Weakening Controller Simultaneously the stator currents s_a and Is_b are measured and transformed from instantaneous va
49. sic space vectors given for the respective sector Table 3 and Equation 46 Equation 47 and Equation 48 are specific solely to the standard Space Vector Modulation technique consequently other Space Vector Modulation techniques will require deriving different equations The next step is to assign the correct duty cycle ratios t t2 and t3 to the respective motor phases This is a simple task accomplished in view of the position of the stator reference voltage vector see Table2 4 Table 4 Assignment of the Duty Cycle Ratios to the Corresponding Motor Phase Sectors Uo Uso Uso U120 U120 gt U180 U180 gt U240 Usa0 gt U300 Usoo gt Uo pwm_a t3 t2 ti t1 t2 t3 pwm_b t2 t3 t3 t2 t1 t1 pwm_c ti ti t2 t3 t3 t2 The most popular power devices for motor control applications are Power MOSFETs and IGBTs A Power MOSFET is a voltage controlled transistor It is designed for high frequency operation and has a low voltage drop so it has low power losses However the saturation temperature sensitivity limits the MOSFET application in high power applications An insulated gate bipolar transistor IGBT is a bipolar transistor controlled by a MOSFET on its base The IGBT requires low drive current has fast switching time and is suitable for high switching frequencies The disadvantage is the higher voltage drop of a bipolar transistor causing higher conduction losses Design of a PMSM Servo System Using the
50. t Display Position Setting Value i Store Actual Value Store Setting Value Store Setting Value Store Actual Value pi LCD Display y Figure 33 LCD Interrupt Flowchart Display Speed Setting Value Design of a PMSM Servo System Using the 56F8357 Device Rev 0 42 Freescale Semiconductor 7 Software Modules Software Modules Processor Expert PE offers a wide variety of beans In this system the core modules and interface modules also use beans 7 1 Core Modules The core modules execute the FOC s varied tasks and include 7 1 1 Co ordinate Transformations Clarke Park and Inverse Park Transformation from a B to d q coordinates and backwards Generation of sine and cosine with a look up table Variable stator voltage vector generation Space Vector Modulation SVM algorithm DC ripple compensation Speed regulation current regulation position regulation Speed ramp Position alignment Anti Hunt processing Clarke Transformation Figure 34 shows how the 3 phase system is transformed into a 2 phase system bi measured j hase a i Measured a P i calculated SC phase c Figure 34 Clarke Transformation Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 43 Software Modules To transfer the graphical representation into mathematical language fi ee pe a g 2 2
51. the integral component to the previous structure The improved PI algorithm is e k r k y k Eqn 63 u k x k 1 Kpe k Eqn 64 Uu UK Eqn 65 if U K gt U naxs Uon U max Eqn 66 if ulk lt U nins Uou U min Eqn 67 The integral term x k x k 1 K e k Ku ulk Eqn 68 Where Integral correction factor K K Kp The Plitypel_asmSc provided by the PE library is used to calculate the PI controller output for speed current and position 7 1 7 Speed Ramp To decrease speed vibration the speed ramp uses rampGetValue of the MC_Ramp bean to find the acceleration deceleration function The ramp generation chart is shown in Figure 36 If the Requested Value is greater than Actual Value rampGetValue returns Actual Value Increment Up until the maximum Requested Value is reached at which point it returns Requested Value If the Requested Value is less than Actual Value rampGetValue returns Actual Value Increment Down until the minimum Requested Value is reached at which point it returns Requested Value direction up direction down output output requested value requested value time time Figure 36 Ramp Generation Chart Design of a PMSM Servo System Using the 56F8357 Device Rev 0 48 Freescale Semiconductor Software Modules 7 1 8 Position Alignment After reset the rotor s position is unknown Vector control requires zero position where the rotor is aligned to the d a
52. thod to produce a constant torque is to drive a sinusoidal motor by sinusoidal currents Te p I K 0 1 K 0 1 K 8 Eqn 5 If is sin q t ip 1 sin a ya 3 isc I sin Je 3 yields Te p I sin t sin or tsino 5 ipy T Eqn 6 It shows that Field Oriented Control FOC enables continuous control of the torque demand without ripples if it is fed by 3 phase sinusoidal currents 3 1 2 Mechanical Equations The torque created by the energy conversion process is then used to drive mechanical loads Its expression is related to mechanical parameters via the fundamental law of dynamics as follows ST J oo Eqn 7 dt Giving J rotor inertia Kj viscosity coefficient T load torque Wm mechanical speed jas Kye 7 T Eqn 8 As the torque is composed of time and electrical position dependent parameters its efficient and accurate control is not easy with standard methods A real time implrmentation of the FOC algorithm with a 56F8357 device overcomes this issue Design of a PMSM Servo System Using the 56F8357 Device Rev 0 Freescale Semiconductor 7 Target Motor Theory 3 1 3 Space Vector Definition The model used for vector control design can be understood by using space vector theory The 3 phase motor quantities such as voltages currents magnetic flux etc are expressed in terms of complex space vectors Such a model is valid for any instantaneous variation of v
53. ve For information on Freescale s Environmental Products program go to http www freescale com epp ey 2 freescale semiconductor
54. xis of the d q coordinate system before a motor begins running so the rotor must be aligned The position is first set to zero independent of the actual rotor position the value of the Quadrature Encoder does not affect this setting The d current is then set to align rotor The rotor is now aligned to the required position After rotor stabilization the Quadrature Encoder is reset to the zero position the d current is set back to zero and alignment is complete The rotor position is shown in Figure 37 Alignment is executed only once during the first transition from the Stop to the Run state of the Run Stop switch q unknown rotor position not aligned zero rotor position aligned Figure 37 Rotor Alignment The TimeDate bean is used for rotor alignment The rotor alignment period setting is 5s and rotor alignment is accomplished during this period Once the time is reached the onAlarm function signals to denote the completion of rotor alignment 7 1 9 Anti Hunt Processing Special attention is required when the motor reaches the required position since the rotor will very likely oscillate hunt A variable gain anti hunt algorithm is developed As shown in Figure 38 the speed and position regulators PI gains are kept normal when the position error is large When the position error is small enough in region 1 or 3 the gains should be gradually reduced Once the rotor enters the anti hunt window region 2 the gains are r

Download Pdf Manuals

image

Related Search

Related Contents

    Leica iCON gps 60 User Manual - Surveying Technologies and  blue    Proxxon 38481 Use and Care Manual  Phoenix Gold Speaker R110 User's Manual    A-90  La cloche Vapo  

Copyright © All rights reserved.
Failed to retrieve file