Home

AN1937 Application Note

image

Contents

1. ADC Interrupt Handlers Initialize DSP amp Application Background Tasks PWM Fault Interrupt Fault Detection Fault Interrupt Handler Application SCI Interrupt State Machine done CI amp PC master Timeout 1 software Interrupt Handler NO timeout done IRQO IRQ1 Interrupt Timeout 2 Push Buttons Interrupt Handlers TMRA1 Compare Interrupt a Commutation Interrupt Handler Figure 7 4 Software Design General Overview MOTOROLA 3 Phase SR Motor Control with Encoder 41 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design 7 3 1 Initialization 42 After Reset the initialization of the DSP is performed At the beginning of the initialization interrupts are disabled at the end of initialization they are enabled DSP Initialization Disable Interrupts Identify power stage board identify SR High Voltage H W set Initialize ADC on chip module ADC triggered simultaneously associate interrupt with ADC conversion completed event Ist sample of ADC_A Current Phase A 2nd sample of ADC_A DC Bus Voltage 3rd sample of ADC_A Temperature Ist sample of ADC_B Current Phase B 2nd sample of ADC_B Current Phase C 3rd sample of ADC_B void Initialize Quadrature Timer AO on chip module position measurement set Quad count mode cou
2. Step Active Phase Discharge Phase Reference Phase 1 C A B 2 B C A 3 A B C 1 C A B The efficiency of the current sensing noise reduction technique is illustrated in Figure 5 10 The figures illustrate the phase current as it is measured the active phase current is inverted compared to Figure 5 9 and the same current with the implemented noise reduction technique As can be seen the implemented technique improves current sensing significantly It eliminates not only the noise on the current sensors but also the noise induced on the sensing cables and the noise of the ADC reference power supply 5 2 5 2 Voltage Sensing 28 The DC Bus voltage sensor is represented by a simple voltage divider DC Bus voltage does not change rapidly It is nearly constant with the ripple given by the power supply structure If a bridge rectifier for rectification of AC line voltage is used the ripple frequency is two times the AC line frequency The ripple amplitude should not exceed 10 of the nominal DC Bus value if the power stage is designed correctly The measured DC Bus voltage needs to be filtered in order to eliminate noise One of the most useful techniques is at moving average filter that calculates an average value from the last N samples N DCBus DCBus EQ 5 1 n 1 In order to increase the precision of the voltage sensing the voltage drop on the power switches and on the diodes of the power
3. GLITCH FILTER Timer Input Capture ee AO A2 waren eal Timer gt eal A3 Timer A module Figure 5 4 Decoder and Timer Arrangement 5 2 3 Commutation Algorithm The SR motor commutation strategy uses rotor position feedback to drive the commutating signals for the inverter switches The core of the control algorithm includes the calculation of the commutation angle and phases commutation The calculation of the commutation angle is performed according to EQ 4 2 It is calculated regularly during motor operation The commutation algorithm is described in Figure 5 5 After the finish of the start up routine which includes the alignment procedure and initialization of the necessary commutation variables the rotor is sufficiently stabilized and is ready for run mode This is the point from which the commutation routine has to start The first procedure of the commutation routine is to turn on the corresponding phase Choosing the correct phase to switch on depends on the defined rotation of the rotor The turn on angle is at the unaligned position and the current rises linearly until the poles begin to overlap In a regular switched reluctance motor the angle of rising inductance is half of the pole pitch The pole pitch is the angle of rotation between two successive aligned positions Ideally the flux should be zero throughout the period of falling inductance because current flowing in that period produces a
4. Freescale Semiconductor Inc MOTOROLA 3 Phase Switched R eluctance Motor Control with Encoder Using D SP56F80x Design of a Motor Control Application Based on the Motorola Software Development Kit Peter Balazovic Radim Visinka l Introduction This Application Note describes the design of an advanced 3 Phase Switched Reluctance SR motor drive It is based on Motorola s DSP56F80x family for dedicated motor control devices The software design takes advantage of the SDK Software Development Kit developed by Motorola SR motors are gaining wider popularity among variable speed drives This is due to their simple low cost construction characterized by an absence of magnets and rotor winding high level of performance over a wide range of speeds and fault tolerant power stage design for numerous applications availability and the moderate cost of the necessary electronic components make SR drives a viable alternative to other commonly used motors like AC BLDC PM Synchronous or universal motors The concept of this application is an advance speed closed loop SR drive with encoder position sensor An inner current loop with PI controller is included The encoder position sensor provides an accurate measurement of the actual rotor position necessary for proper commutation This application serves as an example of an advanced SR motor control The entire system is designed using a Motorola DSP with SDK sup
5. The dedicated memory space is defined in the appconfig h file of the ExtRAM target Recorder samples are taken each 64 5 usec at the rate of the PWM frequency Current Controller Recorder captures e Desired phase current e Active phase current e Desired phase voltage Current Controller Recorder may be initiated any time during the motor run MOTOROLA 3 Phase SR Motor Control with Encoder 51 For More Information On This Product Go to www freescale com DSP Usage Freescale Semiconductor Inc 10 DSP Usage Table 10 1 shows how much memory is needed to run advanced 3 Phase SR drive with Encoder drive The recorder buffer of PC master software was set to zero A majority of the DSP memory is still available for other tasks RAM and FLASH Memory Usage for SDK2 4 and CW4 1 Table 10 1 Memory Available Available Used Used in 16 bit Words DSP56F803 DSP56F807 Application Stack Application without DSP56F805 PC master software SCI Program FLASH 32K 60K 11590 7508 Data FLASH 4k 8K 338 310 Program RAM 512 2K 42 18 Data RAM 2K 4K 701 352 stack 381 352 stack 52 3 Phase SR Motor Control with Encoder For More Information On This Product Go to www freescale com MOTOROLA Freescale Semiconductor Inc References 11 References The following materials were used to produce this paper 1 Chalupa L Pohon se spinanym reluktancnim motorem Master s Thesis FEI VUT BRNO
6. Detection Application State Machine and a scheduler routine The scheduler routine provides the timing sequence for two tasks called Timeout 1 and Timeout 2 The Timeout 1 and Timeout 2 flags are periodically set to predetermined intervals by the ADC Conversion Completed ISR The scheduler utilizes these flags and calls the required routines e The routine in Timeout 1 provides a user interface calculates the required speed the start up routines and the speed ramp acceleration deceleration e The routine in Timeout 2 calculates the Speed Controller The Timeout 1 and Timeout 2 tasks are performed in the run state instead of interrupt routines in order to reduce time and avoid software bottlenecks The following interrupt service routines are utilized e ADC Conversion Completed ISR services ADC and provides all the control tasks linked to the event the ADC is synchronized with the PWM pulses e Fault ISR services faults invoked by external hardware faults e SCI ISR services PC master software communication e Push Button Up ISR services the Up Push Button e Push Button Down ISR services the Down Push Button e Timer Al Compare ISR services Commutation Callback 40 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design Interrupt Service Routines ADC Conversion Completed Interrupt RESET
7. The compare interrupt handler takes care of commutation call This callback routine sets on the commutate flag to indicate that the commutation is required The commutation flag is regularly checked in the ADC conversion completed routine and upon a successful compare the commutation routine is called to perform commutation itself S Implementation Notes 8 1 Scaling of Quantities The SR motor control application uses a fractional representation for all real quantities except time The N bit signed fractional format is represented using 1 N 1 format 1 sign bit N 1 fractional bits Signed fractional numbers SF lie in the following range N 1 1 0 lt SF lt 1 0 2 EQ 8 1 For words and long word signed fractions the most negative number that can be represented is 1 0 whose internal representation is 8000 and 80000000 respectively The most positive word is 7FFF or 1 0 2 and the most positive long word is 7FFFFFFF or 1 0 ao The following equation shows the relationship between the real and the fractional representations Fractional Value Real Value __ EQ 8 2 Real quantity range where Fractional Value is the fractional representation of the real value Frac16 Real Value is the real value of the quantity V A rpm etc Real quantity range is the maximal range of the quantity defined in the application V A rpm etc 8 1 1 Voltage Scaling The application voltages are scaled to the ma
8. There is an influence of back EMF effect combined with a diminishing amount of time to perform the commutation Current Actual Inductance Estimated Inductance 0 lt SNPE IOANES EAE AAA NETANA gt A 60 O advance Oon edge i Oor Ubo e S aia Uapplied Position Time luesirea reached PWM Current Controller Output PWM 100 Ubpc Bus Figure 4 3 Commutation Strategy MOTOROLA 3 Phase SR Motor Control with Encoder 15 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Switched Reluctance Motor Control Techniques with Encoder Position Sensor The commutation itself can be performed in a number of ways The presented control technique utilizes the encoder sensor information to initiate the commutation routine which ensures turn off of the previous stator phase and consecutively the next stator phase is turned on depending on the direction of the rotor rotation The appropriate firing angle 0 is calculated through advance angle calculation see Section 4 2 The commutation software algorithm determines the necessary advance angle O dvance for turning on the correct stator phase The full DC Bus voltage is applied after switching on the correct phase in the gyance instant If the actual value of phase current exceeds the desired current value then the current controller with sufficient controller initialization is started to maintai
9. according to the conversion equation temp Temp_sense b EQ 5 2 a where temp is the power module temperature in degrees Celsius Temp_sense is the voltage drop on the diodes which is measured by ADC a is the diode dependent conversion constant a 0 0073738 b is the diode dependent conversion constant b 2 4596 3 3V_A R1 2 2k 1 D1 D2 gt gt ADC BAV99LT1 BAV99LT1 C1 Figure 5 11 Temperature Sensing Topology 6 Hardware Implementation 6 1 Hardware Setup As already stated the application runs on Motorola motor control DSPs using the DSP EVM boards and a dedicated 3 Phase SR high voltage platform The application can be controlled by the following Motorola motor control DSPs e DSP56F803 e DSP56F805 e DSP56F807 30 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Hardware Implementation Application hardware setup is shown in Figure 6 1 The system hardware setup for a particular DSP varies only by EVM Board used The application software is identical for all DSPs The EVM and chip differences are handled by the SDK off chip drivers for the particular DSP EVM board Detailed application HW setup can be found in the document Targeting_DSP5680x_Platform that is part of the SDK documentation 12 Dedicated user s manuals describe the individual boards in detail The User s Manuals incorporate a schem
10. Stage User s Manual MEMC3PSRLVPSUM D Motorola 2000 3 joer 16 Motorola SPS web page http e www motorola com 17 User s Manual for PC master software included in the SDK documentation Motorola 2001 MOTOROLA 3 Phase SR Motor Control with Encoder 53 For More Information On This Product Go to www freescale com References 54 Freescale Semiconductor Inc 3 Phase SR Motor Control with Encoder For More Information On This Product Go to www freescale com MOTOROLA Freescale Semiconductor Inc References MOTOROLA 3 Phase SR Motor Control with Encoder 55 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Motorola reserves the right to make changes without further notice to any products herein Motorola makes no warranty representation or guarantee regarding the suitability of its products for any particular purpose nor does Motorola 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 which may be provided in Motorola 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 Motorola d
11. UPVE 1994 2 aa Gallegos Lopez G A New Sensorless Low Cost Method for Switched Reluctance Motor Drives University of Glasgow SPEED Laboratory 1997 Miller T J E Switched Reluctance Motors and Their Control Magna Physics Publishing and Clarendon Press ISBN 0 19 859387 2 1993 4 3 Phase SR Motor Control with Hall Sensors using DSP56F80x ANJ9 2 D Motorola 2000 5 3 Phase SR Sensorless Motor Control using DSP56F80x AN1932 D Motorola 2001 6 CodeWarrior for Motorola DSP56800 Embedded Systems CWDSP56800 Metrowerks 2001 7 DSP56F800 16 bit Digital Signal Processor Family Manual DSP56F800FM D Motorola 2001 8 DSP56F80x 16 bit Digital Signal Processor User s Manual DSP56F801 7UM D Motorola 2001 9 DSP56F803 Evaluation Module Hardware User s Manual DSP56F803EVMUM D Motorola 2001 10 DSP56F805 Evaluation Module Hardware User s Manual DSP56F80S5EVMUM D Motorola 2001 11 DSP56F807 Evaluation Module Hardware User s Manual DSP56F807EVMUM D Motorola 2001 12 Embedded Software Development Kit for 56800 56800E MSW3SDKOOOAA available on Motorola SPS web page Motorola 2001 13 Motorola Embedded Motion Optoisolation Board User s Manual MEMCOBUM D Motorola 2000 14 Motorola Embedded Motion Control 3 Phase Switched Reluctance High Voltage Power Stage User s Manual MEMC3PSRHVPSUM D Motorola 2000 15 Motorola Embedded Motion Control 3 Phase Switched Reluctance Low Voltage Power
12. deceleration ramp using the desired speed setup LED is controlled according to the state of the drive It can indicate a STOP state RUN state or FAULT state MOTOROLA 3 Phase SR Motor Control with Encoder 43 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design 7 3 5 Scheduler Timeout 2 This state is accessible from the main scheduler in period of Timeout 2 2 5 msec The following tasks are then performed e Speed controller calculates the desired phase current according to the actual and the desired speed The speed controller constants are determined experimentally and set during the initialization of the chip 7 3 6 ADC Conversion Completed ISR The ADC Conversion Completed ISR is the most critical and the routine most demanding of the processor s time Most of the application control processes need to be linked with this ISR The Analog to Digital converter is initiated synchronously with a PWM reload pulse center of the PWM pulse It scans all three phase currents the DC Bus voltage and the temperature at once When the conversion is finalized the ADC Completed ISR is called The routine provides the following services and calculations e Reads the ADC conversion results phase currents noise DC Bus voltage temperature e Calculates the ADC offsets for phase currents e Current controller calculates the desired phase voltage according to the desired and the a
13. e Control algorithm data flow e State diagram e Software implementation 7 1 Data Flow The control algorithm of a closed loop SR drive is described in Figure 7 1 and Figure 7 2 It is based on the system description The individual processes are described in detail in the following sections 34 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design Speed Settting PC Master Position Sensor Software omega_required_mech omega_reqPCM_mech position_difference position_actual Acceleration Speed Calculation see 2 4 nage Ramp see 2 4 nage omega_desired omega_actual u_dc_bus _active Speed Controller _active Commutation Angle _desired Calculation Current Controller theta On theta Off u_desired DC Bus Ripple Elimination outputDutyCycle amp srmCmtData PWM Generation ge K Y 4 N Ts PWM Outputs Pwm_AT Pwm_AB Pwm_BT Pwm_BB Pwm_CT Pwm_CB Figure 7 1 System Data Flow I SR Motor Control MOTOROLA 3 Phase SR Motor Control with Encoder 35 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design DC Bus Volatge 3 Phase CURRENTS A D Converter A D Converter ADC Correction Current MUX u_dc_bus i_active see 1 page Figure 7 2 System Data Flow Il AD Co
14. one encoder cycle In the times 1 mode all counts are generated on the rising edges of channel A In the times 2 mode both the rising and falling edges of channel A are used to generate counts In the times 4 mode the rising and falling edges of channel A and channel B are used to generate counts This increases the resolution by a factor of four For encoders with sine wave output the channels may be interpolated for very high resolution 4 2 Commutation Angle Calculation In an SR motor the switched on and switched off angles are complex functions of many parameters and are variable for optimum operation Their fine tuning is necessary to maintain optimum performance at different motor speed and load conditions The control of firing angle can be accomplished a number of ways and strongly depends on position sensor If the position information is precisely acquired it is possible to suitably utilize a sophisticated algorithm MOTOROLA 3 Phase SR Motor Control with Encoder 13 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Switched Reluctance Motor Control Techniques with Encoder Position Sensor 14 This control technique varies the firing angle continuously with the fixed dwell angle The switched on angle is calculated in such a way that the excitation current should reach the maximum defined value at the beginning of the stator and rotor tooth overlap The phase current is built up in corr
15. to be started on first SYNC Initialize ADC Driver set ADC synchronization ON enable 8 sample conversion Initialize all variables for motor start up Set ADC according to start up phase Enable interrupts 7 3 2 Fault Detection The Fault Detection routine checks application faults If a fault occurs it disables the PWM outputs and sets the application FAULT status Note that in the case of DC Bus over current and DC Bus over voltage faults PWM outputs are disabled directly via internal PWM module fault protection see Section 7 3 7 Fault ISR 7 3 3 Application State Machine The Application State Machine provides transition between the individual states of the application INIT STOP RUN and FAULT For reference see Section 7 2 State Diagram 7 3 4 Scheduler Timeout 1 This routine is accessed from the main scheduler at a period of Timeout 1 10 msec The following tasks are then performed Push button filter debounces push button switching noise Start Stop switch filter debounces Start Stop switch noise According to the operational mode desired speed is calculated In manual mode according to the push buttons in PC master software control mode according to the PC master software command Start up routine is performed if required and start up switching pattern is generated For a detailed description refer to Section 5 2 1 Initialization and Start Up Speed command is calculated using the acceleration
16. 15 10 e The control technique incorporates current SRM control with speed closed loop motor starts from any motor position with rotor alignment one direction of rotation motoring mode minimal speed 600 rpm maximal speed 2600 rpm at input power line 230V AC maximal speed 1600 rpm at input power line 115V AC e Encoder position reference for commutation e Manual Interface Start Stop switch Up Down push button control LED indicator e PC master software control interface motor Start Stop speed set up e Power stage identification e DC Bus over voltage DC Bus under voltage DC Bus over current and over heating fault protection e PC master software Monitor graphical control page required speed actual motor speed operational mode PC manual start stop status drive fault status DC Bus voltage level identified power stage boards system status speed scope observes actual and desired speeds current controller observes actual and desired phase current applied phase voltage 5 2 Application Description For the drive a standard system concept was chosen see Figure 5 1 The system incorporates the following hardware parts e A 3 Phase SR high voltage development platform power stage with optoisolation board motor brake e Feedback sensors DC Bus voltage current Phase A current Phase B current Phase C temperature e A DSP56F80x controller MOTOROLA 3 Phase SR
17. AM ConfigExtRam directory and the second one is dedicated to FLASH memory ConfigFlash directory In the case of a SR motor control application both files are identical with the following exceptions e The appconfig h for ExtRAM target contains a PC master software recorder buffer of 25000 samples long while appconfig h for Flash target contains a PC master software recorder buffer of only 100 samples long This is due to the limited RAM memory size e The appconfig h for DSPS56F805EVM and DSPS56F807EVM contains the definition of a switch driver while the appconfig h for DSP56F803EVM does not The appconfig h file can be divided into two sections The first section defines which components of the SDK libraries are included in the application the second part overwrites the standard settings of components during their initialization 9 3 Initialization of Drivers Each peripheral on the DSP chip or on the EVM board is accessible through a driver The driver initialization of all used peripherals is described in this chapter For a detailed description of the drivers see the document Embedded SDK Targeting Motorola DSP5680x Platform The following steps are required to use a driver e Include the driver support in the appconfig h e Fill the configuration structure in the application code for the specific drivers depends on driver type e Initialize the configuration setting in appconfig h for the specific drivers depends on dr
18. Motor Control with Encoder 17 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Freescale Semiconductor Inc System Design 3 Phase SR Power Stage Line AC Voltage Current DSP56F80x Temperature Fault Protection Speed Controller PC Remote Control Commutation A ngle Calculation Speed Calculation Figure 5 1 System Concept The DSP runs the main control algorithm It generates 3 Phase PWM output signals for the SR motor power stage according to the user interface input and feedback signals The drive can be controlled in two different ways or operational modes e In Manual operational mode the required speed is set by a Start Stop switch and Up and Down push buttons e In PC master software operational mode the required speed is set by the PC master software After RESET the drive is initialized and it automatically enters MANUAL operational mode Note PC master software can only take over control when the motor is stopped When the Start command is detected using the Start Stop switch or the PC master software button Start and while no fault is pending the start up sequence with the rotor alignment is performed and the motor is started Rotor position is evaluated using an encoder position sensor The commutation angle is calculated according to the desired speed the desired current and the actual DC Bus voltage When the actua
19. OFF NO Controller OFF hase gt ldesired Controller ON Controller INIT Uapplied controller Figure 5 6 Controller Utilization U_dc_bus U applied 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Design 5 2 5 Current and Voltage Measurement Precise measurement of phase current and DC Bus voltage is a key factor for current control implementation 5 2 5 1 Current Sensing Current measurement needs to be investigated according to the current sensors used and the influence of the noise on the measurement The quality of current measurement depends heavily on the type of current sensors used The most useful are Hall effect sensors Unfortunately these sensors are expensive and thus not suitable for most cost sensitive applications Therefore current shunt resistors inserted into the current path of the phase are often implemented see Figure 5 7 The phase current is sensed as a voltage drop across the sense resistor DC Bus Voltage Ti PWM_T1 yh Vref gt esy ret Figure 5 7 Shunt Resistors Current Sensors When the power switches soft switching is used the lower switch is left ON during a complete commutation period while the upper switch is modulated by the PWM the current is not visible on the shunt resistor all the time The soft switching phase current measured at the sh
20. PWM frequency It is frequent enough to ensure the precise generation of commutation pulses 7 1 7 ADC Correction and Current MUX This process takes care of the Analog to Digital Converter The sampling of the ADC is synchronized to the PWM pulses The process selects the proper ADC channels to be converted and reads and processes the results of the ADC conversion The active and discharge phase currents are selected and corrected using the measured reference noise signal The DC Bus voltage and temperature are filtered using a moving average filter See Section 5 2 5 Current and Voltage Measurement for a detailed description 7 1 8 Commutation Angle Calculation This process calls the commutation angle calculation routine which calculates the advanced angle according to the actual speed the DC Bus voltage and the desired current see Section 4 2 The algorithm 3 Phase SR Motor Commutation Angle Calculation srmcac generates the required advance angle of commutation according to the principle described in Section 4 2 Before the calculation routine call the scaling constant must be properly determined scaling constant scale_const FRAC16 L_UN I_MAX OMEGA_MAX 4 U_MAX 60 The following functions of the algorithm need to be called in order to calculate the commutation angle routine call adv_angle srmcacAngleCalc i_ph u_ph w_actual scale_const u_ph gt voltage across phase winding i_ph gt ph
21. Setting or clearing the OUTx bit activates or deactivates the PWMx output The OUTCTLx and OUT bits are in the PWM output control register This control technique requires the preparation of the output control register For the calculation of the OUTCTLx and OUTx bits in the PWM output control register a dedicated commutation algorithm 3 Phase SR Motor Commutation Handler for H W Configuration 2 Switches per Phase srmemt3ph2spp was developed The algorithm generates an output control word according to the desired action and the desired direction of rotation For example when Phase A needs to be turned off the algorithm sets the corresponding OUTCTLx bits to enable the output control of the required PWMs and clears the OUTx bits to turn off the PWMs The other output control register bits are not affected A detailed description of the algorithm can be found in the SDK motor control library 7 2 State Diagram 38 The processes described above are implemented in a single state machine as illustrated in Figure 7 3 The state machine provides a transition amongst the application states INIT STOP RUN FAULT The following variables are used to invoke the transition between the individual states e switchState Stop Run state of the Start Stop switch e appFault NO_FAULT any fault fault occurrence e appOpMode change from Manual to PC and vice versa change operational mode 3 Phase SR Motor Control with Encoder MOTOROLA For More Inf
22. and detector to interrupt a light beam The electronic signals that are generated are then fed into the DSP controller where position and velocity information is calculated based upon the signals received Many incremental encoders also have a feature called the index pulse In rotary encoders an index pulse occurs once per encoder revolution It is used to establish an absolute mechanical reference position within one encoder count of the 360 encoder rotation The index signal can be used to do several tasks in the system It can be used to reset or preset the position counter and or generate an interrupt signal to the system controller Phase A_ Phase B_ Figure 4 1 Quadrature Encoder Signals Quadrature encoders are a particular kind of incremental encoder with at least two output signals generally called Phase A and Phase B As seen in Figure 4 1 channel B is offset 90 degrees from channel A The addition of a second channel provides direction information in the feedback signal This signal leading or lagging by 90 electrical degrees guarantees the exact determination of the direction of rotation at all times The ability to detect direction is critical if encoder rotation stops on a pulse edge Without the ability to decode direction the counter may count each transition through the rising edge of the signal and lose position Another benefit of the quadrature signal scheme is the ability to electronically multiply the counts during
23. are tuned experimentally according to the load profile and the speed limits 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design 7 1 4 Current Controller This process calculates the duty cycle of the PWM based on phase current error Phase current error is the difference between the actual phase current and desired phase current A PI type of controller is implemented The current controller constants are tuned experimentally according to the type of used motor used 7 1 5 DC Bus Ripple Elimination This process provides the elimination of the voltage ripple on the DC Bus It compensates an amplitude of the desired phase voltage generated by the PI current controller The output of the calculation is the duty cycle of the PWM that is applied to corresponding stator phase 7 1 6 PWM Generation This process sets the on chip PWM module for generation of the control pulses for the 3 Phase SR motor power stage Generation of these pulses is based on the software control register that is formulated by the process of the Commutation Calculation and is based on the required duty cycle generated by the Speed Controller process The calculated software control word is loaded into the proper PWM register and the PWM duty cycle is updated according to the required duty cycle The PWM Generation process is accessed regularly at a rate given by the
24. ase current w actual gt actual speed These functions are called in the Process Commutation A detailed description of the algorithm can be found in the SDK algorithm documentation MOTOROLA 3 Phase SR Motor Control with Encoder 37 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design 7 1 9 Commutation This process provides the comutation of the motor phases The DSP on chip PWM module is used in a mode for generation of independent output signals that can be controlled either by software or by the PWM module The commutation technique distinguishes the three following cases e When the PWM output needs to be modulated the PWM generator controls the channel directly e When the PWM output needs to be switched to an inactive state 0 the software output control of the corresponding PWM channel is handed over and the channel is turned off manually e When the PWM output needs to be switched to the active state 1 the software output control of the corresponding PWM channel is handed over and the channel is turned on manually The on chip PWM module enables control of the outputs from the PWM module either by the PWM generator or by using the software Setting the output control enable bit OUTCTLx enables software to drive the PWM outputs instead of the PWM generator In independent mode with OUTCTLx 1 the output bit OUTx controls the PWMx channel
25. ate fault protection If no fault is present and the start command is accepted the application transits to the RUN state and the motor is started 7 2 3 Application State RUN The RUN state can be entered from the STOP state In the RUN state the drive is enabled and the motor is running MOTOROLA 3 Phase SR Motor Control with Encoder 39 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design If any fault in the RUN state is detected the application enters the FAULT state fault protection If no fault is present and the STOP command is accepted the application transits to the STOP state and the motor is stopped 7 2 4 Application State FAULT The STOP state can be entered from any state In the FAULT state the drive is disabled and the application waits for the faults to be cleared When it is detected that the fault has been eliminated and the fault clear command is accepted the Start Stop switch is moved to the STOP position then the application transits to the INIT state 7 3 Software Design The general software diagram incorporates 1 the Main routine entered from Reset and 2 the Interrupt Service Routines ISR The diagram is illustrated in Figure 7 4 After Reset the Main routine provides board identification initialization of the DSP initialization of the application and then it enters an infinite background loop The background loop contains Fault
26. ated inductance profile The motor inductance profile as a function of mechanical position is shown in Figure 6 2 The mechanical angle 90 nech corresponds to one electrical period of the stroke The presented profile was used for the determination of the advanced commutation angle On the motor brake shaft a position encoder and position Hall sensor are attached They allow position sensing if it is required by the control algorithm The introduced drive uses the Encoder for the position determination Table 6 1 Motor Brake Specifications Set Manufacturer EM Brno Czech Republic SR40V Motor Type 3 Phase SR Motor Stator Rotor Poles 6 4 Motor Specification Speed Range lt 5000 rpm Nominal Voltage 3 x 300V Nominal Current 1 2A SG40N Brake Type 3 Phase BLDC Motor Brake Specification Nominal Voltage 3 x 27V Nominal Current 26A Type Baumer Electric Position Encoder BHK 16 05A 1024 12 5 Pulses per Revolution 1024 MOTOROLA 3 Phase SR Motor Control with Encoder 33 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design fz Z S S 5 3 oO oO O jo N m mechanical angle deg Figure 6 2 Inductance Characteristic T Software Design This section describes the design of the software blocks of the drive The software will be described in terms of
27. atic of the board description of individual function blocks and a bill of materials for the board The individual boards can be ordered from Motorola as standard products Descriptions of all the mentioned boards and documents can be found at http Avww motorola com All system parts are supplied and documented according to the following references e U1 Controller Board for DSP56F803 supplied as DSP56803EVM described in DSP56F803EVMUM D DSP Evaluation Module Hardware User s Manual see 9 or U1 Controller Board for DSP56F805 supplied as DSP56805EVM described in DSP56F805EVMUM D DSP Evaluation Module Hardware User s Manual see 10 or U1 Controller Board for DSP56F807 supplied as DSP56807EVM described in DSP56F807EVMUM D DSP Evaluation Module Hardware User s Manual see 11 e U2 3 Phase SR High Voltage Power Stage supplied as a kit with an Optoisolation Board as ECOPTHIVSR described in MEMC3PSRHVPSUM D Motorola Embedded Motion Control 3 Phase SR High Voltage Power Stage User s Manual see 14 e U3 Optoisolation Board not supposed to be in the final application supplied in 3 ph SR High Voltage Power Stage as ECOPTHIVSR or supplied separately as ECOPT optoisolation board described in MEMCOBUM D Optoisolation Board User s Manual see 13 e MBI Motor Brake SR40V SG40N supplied as ECMTRHIVSR Warning The use of optoisolation optocou
28. chnical Information Center 3 20 1 Minami Azabu Minato ku Tokyo 106 8573 Japan 81 3 3440 3569 ASIA PACIFIC Motorola Semiconductors H K Ltd Silicon Harbour Centre 2 Dai King Street Tai Po Industrial Estate Tai Po N T Hong Kong 852 26668334 Technical Information Center 1 800 521 6274 HOME PAGE http www motorola com semiconductors MOTOROLA AN1937 D For More Information On This Product Go to www freescale com
29. ction of the reference signal from the measured signal As described above the necessary condition is the simultaneous sampling of both signals ensuring that the noise on both signals is identical ActualSignal MeasuredSignal ReferenceSignal KnownSignal EQ 5 3 This technique has been implemented for phase current sensing The SR motor is controlled in a way in which the phases are commutated sequentially which means that when the working phase is turned off the following phase in the direction of rotation is turned on Thus one phase of the motor is never powered during a complete commutation interval This phase is considered as a reference Because the reference phase is not powered the reference phase current should be equal to zero The measured value of the reference current can be then considered as noise for a given commutation interval The actual phase current is equal to the difference between the measured current and the reference current I ph I sensed 1 reference EQ 5 4 The reference signal needs to be commutated together with the commutation of the phases Table 5 1 defines the active discharge and reference phases for the commutation sequence C B A C It is derived from Figure 5 9 MOTOROLA 3 Phase SR Motor Control with Encoder 27 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Design Table 5 1 Commutation Sequence of the Reference Phase
30. ctual phase current e Provides commutation when required e Records selected recorder variables PC master software e Loads PWM registers e Calculates the references for software timers Timer1 and Timer2 e Enables the next ADC synchronization trigger 7 3 7 Fault ISR The PWM Fault ISR is the highest priority interrupt implemented in the software In the case of a DC Bus over current or a DC Bus over voltage fault detection the external hardware circuit generates a fault signal that is detected on the Fault input pin of the DSP The signal disables the motor control PWM outputs in order to protect the power stage and generates a Fault interrupt where the fault condition is handled The routine records the corresponding fault source to the fault status register 7 3 8 SCI ISR This interrupt handler provides SCI communication and PC master software service routines These routines are fully independent of the motor control tasks 7 3 9 Push Button UP Down ISR The Push Button Interrupt Handlers take care of the push buttons service The Up Button Interrupt Handler sets the Up Button flag the Down Button Interrupt Handler sets the Down Button flag The desired speed is incremented decremented according to the debounced Up Down button flag 44 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Implementation Notes 7 3 10 TMRA1 Compare ISR
31. d timer module contains four identical counter timer groups Due to the wide variability of quad timer modules it is possible to use this module to decode quadrature encoder signals and to sense position and speed as well The presented application uses the configuration arranged for position sensing and commutation instance determination The quad timer AO and the quad timer A1 decode the primary and secondary external inputs as quad encoded signals generated by the rotary sensor to monitor movement of the motor shaft Quad signal decoding provides both count and direction information The timer AO is programmed to count up to a programmed value that corresponds to one electric revolution and then immediately to re initialize after the terminal count value is reached This timer AO is assigned as a master and broadcast compares signals to quad timer A1 The timer A1 is configured to be re initialized to a predetermined value when a master timer s compare event occurs This counter continues repeatedly counting past the compare value When the count matches the compare value an interrupt is enabled and the compare register 2 value is used for commutation instances generation MOTOROLA 3 Phase SR Motor Control with Encoder 21 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Design Not used WATCHDOG oo TIMER REV COUNTER Decoder 0 module DETECT DIFEERENG COUNTER
32. ed as i t dY low 95 e PP papa VA dipp ESTUT 0n A 5h EQ 3 2 a dt di dt 08 4 dt Then the phase voltage can be expressed as dP i 9 a ph p ph a Unp t Ton ipn t pm EQ 3 3 or dY ip 0 di IF Cip 0 x ph ph ph ph ph ph ph u t Tr tyt t e et Oe ee EQ 3 4 where o is the angular speed of the motor MOTOROLA 3 Phase SR Motor Control with Encoder 7 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory The torque M p generated by one phase can be expressed as Lyn OW Cip Oop M ion EQ 3 5 ph 0 The mathematical model of an SR motor is then represented by a system of equations describing the conversion of electromechanical energy For 3 Phase SR motors the equation EQ 3 4 can be expanded as follows S Ov is 0 di OV i 0 u t Taita a me EQ 3 6 a a OY ij 9 di OY ip 9 u t maem i a o EQ 3 7 2 OW i 0 di IP in 8 u t ena ea ag S EQ 3 8 where a b c index the individual phases As stated in the above equations the mutual effect between individual phases is not considered 3 3 Digital Control of an SR Motor The SR motor is driven by voltage strokes coupled with the given rotor position The profile of the phase current together with the magnetization characteristics define the generated torque and thus the speed of the motor Due to this fact
33. ed as a constant value and the phase current is preserved at a defined target value then EQ 3 4 can be rearranged as follows dL 8 1 ph ph O U tinge applied Yoh ipn t ipn t i d EQ 4 4 The applied phase voltage is roughly maintained near the value of EQ 4 4 where i is the desired phase current is the actual angular speed of the rotor Derivation over the position of the corresponding phase inductance is determined from motor parameter measurement Knowing these parameters the initial current controller is set up using EQ 4 4 in the time instance red point see Figure 4 4 when the controller is switched on luesiread Teached ee a Oe Upc pas u applied U applied Position Time PWM 100 PWM Current Controller Output U DC Bus Figure 4 4 Phase Voltage Generation 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Design 5 System Design 5 1 System Outline This system is designed to drive a 3 Phase SR motor The application meets the following performance specifications e Speed control of an SR motor with Encoder position sensor with an inner current closed loop e Targeted for DSPS56F803EVM DSPS56F805EVM DSP56F807EVM e Running on a 3 Phase SR HV Motor Control Development Platform at a variable line voltage of between 115V AC and 230V AC voltage range
34. ent Control Technique Voltage and Current Profiles 4 Switched Reluctance Motor Control Techniques with Encoder Position Sensor A single chip control system provides sufficient computational power for advanced algorithms permitting efficient motor control over wide speed ranges There are several ways to control an SR motor This control technique presents the current control method with shaft position information 12 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Switched Reluctance Motor Control Techniques with Encoder Position Sensor 4 1 Encoder Sensor Whenever mechanical rotary motions have to be monitored the encoder is the most important interface between the mechanics and the control unit Encoders transform rotary or linear movement into a sequence of electrical pulses A rotary encoder can differentiate a number of discrete positions per revolution The number of segments determines the resolution of the movement and hence the accuracy of the position and this number is called its points per revolution The speed of an encoder is in counts per second Although there are various kinds of digital encoders the most common one is the optical encoder Rotary and linear optical encoders are used frequently for motion and position sensing A disc or a plate containing opaque and transparent segments passes between a light source such an LED
35. esponding windings of the stator since the inductance is at a minimum level in an unaligned position and there is adequate time to increase it to the desired value before the motoring torque is being produced The conduction angle remains fixed through the entire run of the application to ensure the phase current is decreased before reaching the braking region following the aligned position The calculation neglects the stator winding resistance which simplifies the equation The resistance neglect can be recognized only at large values of resistance R which is the case of very small switched reluctance machines Figure 4 2 explains the proposed algorithm for advance angle calculation The computation method is derived from EQ 3 6 EQ 3 8 and is rearranged into the following expression as u n ig tigi aig Pe EQ 4 1 where Uph is the voltage applied to a phase ph is the phase resistance iph is the phase current Loh is the phase inductance 0 is the rotor position desired L unaligned gt Uapplied position time 100 PWM Figure 4 2 Commutation Angle Calculation The unaligned phase inductance is considered as constant near the turn on instant If voltage drop across phase resistance is neglected then the following expression is given as EQ 4 2 using a first order approximation l jesir d Oon E L unaligned Wactual EQ 4 2 ph 3 Phase SR Motor Control with Encoder MOTOROLA For M
36. ess The measurements are used for DC Bus over voltage DC Bus under voltage DC Bus over current and over temperature protection of the drive DC Bus under voltage and over temperature protection are performed by software while DC Bus over current and the DC Bus over voltage fault signals utilize the Fault inputs of the DSP on chip PWM module The line voltage is measured during initialization of the application According to the detected level the 115VAC or 230VAC mains are recognized If the line voltage is detected outside 15 10 of the nominal voltage the fault Out of the Mains Limit disables drive operation If any of the above mentioned faults occur the motor control PWM outputs are disabled in order to protect the drive The fault status can only be exited when the fault conditions have disappeared and the Start Stop switch is moved to the STOP position The fault state is indicated by the on board LED The SR power stage uses a unique configuration of power devices different than AC or BLDC configuration SR software would cause the destruction of AC or BLDC power stages due to the simultaneous switching of the power devices Since the application software could be accidentally loaded into an AC or BLDC drive the software incorporates a protection feature to prevent this Each power stage contains a simple module which generates a logic signal sequence that is unique for that type of power stage During the initialization of the chip
37. etting of the control signal to logical 0 or 1 Thus the state of the control signals can be changed instantly at a given rotor position phase commutation without changing the contents of the PWM value registers This change can be made asynchronously with the PWM duty cycle update The Analog to Digital Converter ADC consists of a digital control module and two analog sample and hold S H circuits It has the following features e 12 bit resolution e Maximum ADC clock frequency is 5MHz with 200ns period e Single conversion time of 8 5 ADC clock cycles 8 5 x 200 ns 1 7us e Additional conversion time of 6 ADC clock cycles 6 x 200 ns 1 2us e Eight conversions in 26 5 ADC clock cycles 26 5 x 200 ns 5 3us using simultaneous mode e ADC can be synchronized to the PWM via the sync signal e Simultaneous or sequential sampling e Internal multiplexer to select two of eight inputs e Ability to sequentially scan and store up to eight measurements e Ability to simultaneously sample and hold two inputs e Optional interrupts at end of scan at zero crossing or if an out of range limit is exceeded e Optional sample correction by subtracting a pre programmed offset value e Signed or unsigned result e Single ended or differential inputs MOTOROLA 3 Phase SR Motor Control with Encoder 3 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory The application utilizes the ADC
38. four available inputs as normal timer input capture channels This does not preclude the use of the quadrature decoder module Both timer and decoder take advantage of the digital filter incorporated in the quadrature decoder module al eN eae gs position counter values posed _ Ld PLE LI LU Index one revolution Phase B Figure 5 3 Quadrature Encoded Signals The presented application uses the quad decoder module approach for speed measurement using a 16 bit position difference counter The counter acts as a differentiator whose count value is proportional to the change in position since the last time the position counter was read The speed can be computed by calculating the change in the position counter per unit time or by reading the position difference counter register POSD and calculating speed The second method is employed in this application for rotor speed measurement and also as a feedback signal to the speed controller The position difference register POSD is regularly scanned at the pre defined time period and consecutively this value is used to compute the actual rotor speed In addition quadrature decoder module 0 shares pins with quadrature timer module A If the shared pins are not configured as timer outputs then the pins are available for use as inputs to the quad decoder modules The qua
39. ge is defined by a PWM duty cycle implemented at the DC Bus voltage of the SR inverter Thus the phase voltage is modulated at the rate of the current control loop This technique is illustrated in Figure 3 9 The processing of the current controller needs to be linked to the commutation of the phases When the phase is turned on commutated a duty cycle of 100 is applied to the phase The increasing actual phase current is regularly compared to the desired current As soon as the actual current slightly exceeds the desired current the current controller is turned on Current controller controls the output of the duty cycle until the phase is turned off following commutation The procedure is repeated for each commutation cycle of the motor The current and the voltage profiles can be seen in Figure 3 10 In ideal cases the phase current is controlled to follow the desired current MOTOROLA 3 Phase SR Motor Control with Encoder 11 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Switched Reluctance Motor Control Techniques with Encoder Position Sensor Power Stage Controller PWM Output ldesired terror Duty Cycle desired PWM Generator Current Controller phase current decays through the fly back diodes i ldesired i Bon Oof position time J position time Ubc Bus Current Controller Output PWM 100 PWM Figure 3 10 Curr
40. he following lines must be added to the appconfig h file define INCLUDE_SCI SCI support define INCLUDE_PCMASTER PC master software support It automatically includes the SCI driver and installs all necessary services The default baud rate of the SCI communication is 9600Bd It is set automatically by the PC master software driver and can be changed if needed A detailed description of PC master software is provided by the dedicated User s Manual 17 The 3 Phase SR Motor Control with Encoder utilizes PC master software for remote control from a PC It enables the user to e Take over control of the PC master software e Start stop control e Set the motor speed Variables read by the PC master software and displayed to the user are e Required and actual motor speeds e Application operational mode e Start stop status e Drive fault status e DC Bus voltage e Identified power stage boards e Identified voltage level e System status Profiles of required and actual speeds together with the desired phase current can be seen in the Speed Scope window The courses of quickly changing variables like the phase current profiles can be observed in the Recorder windows The Recorder can ONLY be used when the application is running from External RAM due to the limited on chip memory The length of the recorded window may be set in Recorder Properties gt bookmark Main gt Recorded Samples
41. hunt resistor is sensed and consecutively inverted by a differential amplifier Top Switch T1 Bottom Switch T2 Time N Time Actual Phase Current Oo Sensed Voltage Drop 4 ADC Synchronization Figure 5 8 Soft Switching Current Sensed on ADC 26 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Design Current Sensing Phase A Phase B 0 4 Phase C Phase Current A Time sec Figure 5 9 Phase Current Measured at Current Shunt Resistors The low cost shunt resistor sensors create one serious issue Due to the low voltage drop sensed across the shunt current resistors the measured signals are susceptible to noise A technique for noise elimination has been developed and successfully implemented The technique is based on the assumption that the same noise is induced simultaneously on all measured signals The method supposes the measurement of two signals simultaneously one known signal a reference and one signal to be measured Then the reference signal consists of a known signal and noise while the measured signal consists of an actual signal and the same noise MeasuredSignal ActualSignal Noise EQ 5 1 ReferenceSignal KnownSignal Noise EQ 5 2 If the noise is the same it can be eliminated by subtra
42. itching Hard Switching Figure 3 6 Soft Switching and Hard Switching MOTOROLA 3 Phase SR Motor Control with Encoder 9 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory 3 4 Voltage and Current Control for SR Motors A number of control techniques for SR motors exist They differ in the structure of the control algorithm and in position evaluation Two basic techniques for controlling SR motors can be distinguished according to the motor variables that are being controlled e Voltage control where phase voltage is a controlled variable e Current control where phase current is a controlled variable 3 4 1 Voltage Control of an SR Motor 10 In voltage control techniques the voltage applied to the motor phases is constant during the complete sampling period of the speed control loop The commutation of the phases is linked to the position of the rotor The voltage applied to the phase is directly controlled by a speed controller The speed controller processes the speed error the difference between the desired speed and the actual speed and generates the desired phase voltage The phase voltage is defined by a PWM duty cycle implemented at the DC Bus voltage of the SR inverter The phase voltage is constant during a complete dwell angle The technique is illustrated in Figure 3 7 The current and the voltage profiles can be seen in Figure 3 8 The phase current is at it
43. iver type e Call the open create function Access to individual driver functions is provided by the ioctl function call 9 4 Interrupts The SDK serves the interrupt routine calls and automatically clears interrupt flags The user defines the callback functions called during interrupts The callback functions are assigned during driver initialization open Callback function assignment is defined as one item of the initialization structure which is used as a parameter of the open function Some drivers define the callback function in the appconfig h file 9 5 PC Master Software 50 PC master software was designed to provide application debugging diagnostic and demonstration tools for development of algorithms and applications It runs on a PC connected with the DSP EVM via an RS232 serial cable A small program resident in the DSP communicates with PC master software to parse commands return status information to the PC and process control information from the PC PC master software executing on a PC uses part of Microsoft Internet Explorer as a user interface to the PC 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc SDK Implementation The PC master software is part of the Motorola Embedded SDK and may be selectively installed during SDK installation To enable PC master software operation on the DSP target board application t
44. l position of the rotor is equal to the reference position the commutation of the phases in the desired direction of rotation is done the actual phase is turned off and the following phase is turned on 18 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Design The actual motor speed is derived from the position information so an additional velocity sensor is unneeded The reference speed is calculated according to the control signals start stop switch up down push buttons and PC master software commands when controlled by the PC master software The acceleration deceleration ramp is implemented The comparison between the reference speed and the measured speed gives a speed error Based on the speed error the speed controller generates the desired phase current When the phase is commutated it is turned on with a duty cycle of 100 Then during each PWM cycle the actual phase current is compared with the desired current As soon as the actual current exceeds the desired current the current controller is turned on The current controller controls the output duty cycle until the phase is turned off following commutation Finally the 3 Phase PWM control signals are generated The procedure is repeated for each commutation cycle of the motor DC Bus voltage DC Bus current and power stage temperature are measured during the control proc
45. n of maximal stator inductance see Figure 3 1 If the interpolar axis of the rotor is in line with the stator poles of the selected phase the phase is said to be in an unaligned position the rotor is in a position of minimal stator inductance The inductance profile of SR motors is triangular shaped with maximum inductance when it is in an aligned position and minimum inductance when unaligned Figure 3 2 illustrates the idealized triangular like inductance profile of all three phases of an SR motor with phase A highlighted The individual Phases A B and C are shifted electrically by 120 relative to each other The interval when the respective phase is powered is called the dwell angle Ogwen It is defined by the turn on 6 and the turn off 6 4 angle 4 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory When the voltage is applied to the stator phase the motor creates torque in the direction of increasing inductance When the phase is energized in its minimum inductance position the rotor moves to the forthcoming position of maximal inductance The movement is defined by the magnetization characteristics of the motor A typical current profile for a constant phase voltage is shown in Figure 3 2 For a constant phase voltage the phase current has its maximum in the position when the inductance starts to increase This correspond
46. n the actual value of the phase current within the requested magnitude This is achieved by chopping the DC Bus voltage The simplest scheme is to leave the lower transistor on during current regulation and to switch the upper one on and off at a high fixed PWM frequency with a varying duty cycle This strategy is often called soft switching see Figure 3 6 The current waveform during soft switching is similar to that shown in Figure 4 3 4 4 The Current Controller 16 Basically there are three different modes of operation namely voltage control current control and single pulse control The current control method is normally used to control the torque efficiently while single pulse mode is entered for high speed operation The main difficulty when designing switched reluctance motor current controllers is that the winding back electromotive force back EMF and electrical time constant vary significantly within one electrical cycle and with the motor speed and phase current level The voltage equation of the SRM is given by EQ 3 4 This equation indicates a nonlinear model which is dependent on position current and speed The electrical time constant of a phase winding and the back EMF vary greatly with current and rotor position As Figure 4 3 implies the current controller is switched on when the desired stator phase current is reached At this point the slope of increasing inductance inductance derivation over position is consider
47. ncrement omega_increment_pb 8 1 5 Duty Cycle Scaling The duty cycle is scaled to the maximal duty cycle of the drive For the output duty cycle the scaling equation is the following duty_cycle zut si output_duty_cycle ee EQ 8 7 uty_cycle yax Where output_duty_cycle is the scaled variable of output duty cycle Frac16 duty_cucle output 18 the desired output duty cycle duty_cycleya y is the max applicable duty cycle MOTOROLA 3 Phase SR Motor Control with Encoder 47 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Implementation Notes In the application duty_cycley y 100 The other application duty cycles are scaled in the same way high and low duty cycle limits for speed controller start up output duty cycle outputDutyCycleStartup 8 2 Velocity Calculation The actual speed of the motor is calculated from the time TimeCaptured captured by the on chip Quadrature Timer between the two following edges of the position Hall sensors The actual speed OmegaActual is calculated according to the following equation SpeedCalcConst EQ 8 8 OmegaActual TimeCaptured where OmegaActual is the actual speed rpm TimeCaptured is the time in terms of number of timer pulses captured between two edges of the position sensor SpeedCalcConst is a constant defining the relationship between the actual speed and number of captured pulses between the two edge
48. negative or braking torque To avoid this the dwell angle 8 can be restricted In practice a dwell angle of 120 electrical degrees is usually used because the gain in torque impulse during the increasing inductance exceeds the small braking torque impulse This condition occurs when the current has a tail extending beyond the aligned position The torque is negative during this tail period but it is small The turn off angle 0 instant is determined 22 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Design O Omens C dwell on Figure 5 5 Commutation Algorithm Flowchart The next step of the proposed commutation algorithm is to calculate the advance turn on angle The entire calculation explanation is presented in Section 4 2 The firing angle is set up for the next commutation instant The presented commutation algorithm does not allow parallel current conduction of two phases at the same time The angle comparison of turn on 0 and turn off Op assures that the current phase is turned off before the following phase is turned on In the case of a 120 electrical degree dwell angle the switching on and switching off are performed simultaneously If the conduction dwell angle is restricted the turning off overtakes turning on as is clear in Figure 5 5 The comparison Oacrual gt Oop block waits for an appropriate p
49. nt repeatedly up to 1024 Initialize Quadrature Timer A1 on chip module commutation callback set Quad count mode count repeatedly the binary roll over Initialize Quadrature Decoder on chip module sets digital filter for input signals connects Quadrature Decoder signals to the Quadrature TimerA1 Initialize PWM on chip module center aligned independent PWM mode positive polarity set PWM modulus for PWM frequency 16kHz set PWM interrupt reload each PWM pulse set FAULT2 DC Bus over current fault in manual mode interrupt enabled set FAULT DC Bus over voltage fault in manual mode interrupt enabled associate interrupt with PWM Fault events Initialize brake driver Initialize LED driver Initialize push buttons push buttons on interrupts IRQO IRQ1 Initialize switch driver switch driver used for DSP56F805EVM and DSP56F807EVM 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design Application initialization Set individual parameters of the application to their initial values Start ADC conversion Measure offset of individual current sensors Measure DC Bus voltage and temperature Calculate application parameters according to DC Bus voltage Initialize Quadrature Timer C2 Driver ADC PWM Synchronization set ADC synchronization delay to 0 enable Quadrature Timer C2
50. nverter 7 1 1 Acceleration Ramp This process calculates the desired speed based on the required speed according to the acceleration deceleration ramp The required speed is set either manually using the push buttons when in manual operational mode or by PC master software when in PC master software operational mode 7 1 2 Speed Calculation The process calculates the actual speed of the motor The calculation is based on the evaluation of the position information The on chip Quadrature Decoder provides information on position difference through a 16 bit counter When the position register is read the position difference of the counter s contents are copied into the position difference hold register POSDH and position difference counter is cleared The register is regularly read and the captured value is used for speed calculation The speed is computed by reading the position difference counter register per pre defined time sample A software moving average filter applied to the speed measurement is incorporated into the process for greater noise immunity The actual motor speed is calculated as the average value of the last four measurements 7 1 3 Speed Controller 36 This process calculates the desired phase current according to the speed error Speed error is the difference between the actual speed and desired speed A Proportional Integrational PI type of controller is implemented The constants of the speed controller
51. o eee 50 9 3 Initialization of Drivers 50 9 4 IMterrupts sscsscsccsscssssssessentsavsssssnssneve 50 9 5 PC Master Software eee 50 10 DSP Usage ou eee ee eeeeeeeeee 52 11 References secesseesssesseeceees 53 MOTOROLA digitaldna For More Information On This Product Go to www freescale com 5 c O O ie e oc 09 2 oO Ka pm ap Freescale Semiconductor Inc Motorola DSP Advantages and Features This Application Note includes a description of Motorola DSP features basic SR motor theory system design concept hardware implementation and software design including the use of the software visualization tool 2 Motorola DSP Advantages and Features The Motorola DSP56F80x family is well suited for digital motor control combining a DSP s computational ability with an MCU s controller features on a single chip These DSPs offer many dedicated peripherals like a Pulse Width Modulation PWM unit Analog to Digital Converter ADC timers communications peripherals SCI SPI CAN on board Flash and RAM Generally all family members are well suited for Switched Reluctance motor control One typical member of the family the DSP56F805 provides the following peripheral blocks Two Pulse Width Modulator modules PWMA amp PWMB each with six PWM outputs three Current Sense inputs and four Fault inputs fault tolerant design with deadtime inserti
52. o basic switching techniques can be applied e Soft switching where one transistor is left turned on during the whole commutation period and PWM is applied to the other one e Hard switching where PWM is applied to both transistors simultaneously 8 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory DC Voltage Q1 D1 Q3 D1 Q5 D1 4 yN 4 A ne aes ee mS adel Phase A Phase B Phase C S Cap dr rr i rY D2 D2 y N Q2 yx Q4 4 4 rer Con aa ee a a S PWM_Qe6 gt Figure 3 5 3 Phase SR Power Stage Figure 3 6 illustrates both soft and hard switching PWM techniques The control signals for the upper and the lower switches of the above described power stage define the phase voltage and thus the phase current The soft switching technique generates lower current ripple compared to the hard switching technique Also it produces lower acoustic noise and less EMI Therefore soft switching techniques are often preferred for motoring operation For more details see 3 Unaligned Aligned Unaligned Aligned Stator Poles B B E E E LJ Rotor Poles m m M m Inductance PWM i i PWM Upper Switch n B B B 0 N B B B 0 i PWM Lower Switch N j l l Voc Phase Voltage Phase Current Tum On Turn Off Position Tum On Turn Off Position Soft Sw
53. ods etc As discussed above the disadvantage of the SR motor is the need for shaft position information for the proper switching of individual phases Also the motor structure causes noise and torque ripple The greater the number of poles the smoother the torque ripple but motor construction and control electronics become more expensive Torque ripple can also be reduced by advanced control techniques such as phase current profiling MOTOROLA 3 Phase SR Motor Control with Encoder 5 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory 3 2 Mathematical Description of an SR Motor An SR motor is a highly non linear system so a non linear theory describing the behavior of the motor was developed Based on this theory a mathematical model can be created On one hand it enables the simulation of SR motor systems and on the other hand it makes the development and implementation of sophisticated algorithms for controlling the SR motor easier The electromagnetic circuit of the SR motor is characterized by non linear magnetization Figure 3 3 illustrates a magnetization characteristic for a specific SR motor 1 It is a function between the magnetic flux w the phase current i and the motor position O The influence of the phase current is mostly apparent in the aligned position where saturation effects can be observed The magnetization characteristic curve defines the non lineari
54. oes not convey any license under its patent rights nor the rights of others Motorola 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 Motorola product could create a situation where personal injury or death may occur Should Buyer purchase or use Motorola products for any such unintended or unauthorized application Buyer shall indemnify and hold Motorola 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 Motorola was negligent regarding the design or manufacture of the part Motorola and the Stylized M Logo are registered trademarks of Motorola Inc Motorola Inc is an Equal Opportunity Affirmative Action Employer MOTOROLA and the Stylized M Logo are registered in the US Patent amp Trademark Office All other product or service names are the property of their respective owners Motorola Inc 2002 How to reach us USA EUROPE Locations Not Listed Motorola Literature Distribution P O Box 5405 Denver Colorado 80217 1 303 675 2140 or 1 800 441 2447 JAPAN Motorola Japan Ltd SPS Te
55. on supports both Center and Edge aligned modes Twelve bit Analog to Digital Converters ADCs supporting two simultaneous conversions with dual 4 pin multiplexed inputs the ADC can be synchronized by PWM Two Quadrature Decoders Quad DecO amp Quad Dec1 each with four inputs or two additional Quad Timers A amp B Two dedicated General Purpose Quad Timers totaling 6 pins Timer C with 2 pins and Timer D with 4 pins CAN 2 0 A B Module with 2 pin ports used to transmit and receive Two Serial Communication Interfaces SCIO amp SCI1 each with two pins or four additional GPIO lines Serial Peripheral Interface SPD with configurable 4 pin port or four additional GPIO lines Computer Operating Properly COP Watchdog Timer Two dedicated external interrupt pins Fourteen dedicated General Purpose I O GPIO pins 18 multiplexed GPIO pins External reset pin for hardware reset JTAG On Chip Emulation OnCE Software programmable Phase Lock Loop based frequency synthesizer for the DSP core clock Table 2 1 Memory Configuration DSP56F801 DSP56F803 DSP56F805 DSP56F807 Program Flash 8188 x 16 bit 32252 x 16 bit 32252 x 16 bit 61486 x 16 bit Data Flash 2K x 16 bit 4K x 16 bit 4K x 16 bit 8K x 16 bit Program RAM 1K x 16 bit 512 x 16 bit 512 x 16 bit 2K x 16 bit Data RAM 1K x 16 bit 2K x 16 bit 2K x 16 bit 4K x 16 bit Boot Flash 2K x 16 bit 2K x 16 bit 2K x 16 bit 2K x 16 bit 3 Phase SR Moto
56. on chip module in simultaneous mode and sequential scan The sampling is synchronized with the PWM pulses for precise sampling and reconstruction of phase currents Such a configuration allows instant conversion of the desired analog values of all phase currents voltages and temperatures 3 Target Motor Theory 3 1 Switched Reluctance Motor A Switched Reluctance SR motor is a rotating electric machine where both stator and rotor have salient poles The stator winding is comprised of a set of coils each of which is wound on one pole The rotor is created from lamination in order to minimize the eddy current losses SR motors differ in the number of phases wound on the stator Each of them has a certain number of suitable combinations of stator and rotor poles Figure 3 1 illustrates a typical 3 Phase SR motor with a 6 4 stator rotor pole configuration Phase C Phase A Phase B Stator 6 poles Stator Winding Rotor 4 poles Aligned position on Phase A Figure 3 1 3 Phase 6 4 SR Motor The motor is excited by a sequence of current pulses applied at each phase The individual phases are consequently excited forcing the motor to rotate The current pulses need to be applied to the respective phase at the exact rotor position relative to the excited phase When any pair of rotor poles is exactly in line with the stator poles of the selected phase the phase is said to be in an aligned position i e the rotor is in the positio
57. ore Information On This Product Go to www freescale com Freescale Semiconductor Inc Switched Reluctance Motor Control Techniques with Encoder Position Sensor where Oon is the advanced angle igesired 18 the desired current to be achieved unaligned 18 the unaligned inductance phase S the applied phase voltage actual 18 the actual rotor speed 4 3 Commutation Strategy In general the commutation strategy determines the performance of the SR motor The commutation method uses rotor position feedback to derive the commutating signals for the inverter switches The controlled parameters are the applied phase voltage and the turn on angle 0 The dwell angle is fixed prior to motor starts The number of commutations per mechanical revolution is proportional to the number of rotor poles and number of stator phases EQ 4 3 It arises from the mechanical construction of the SR motor The number of motor commutations is calculated as follows NumOfCommut N m EQ 4 3 where NumOfCommut is the number of commutations per one mechanical revolution N is the number of rotor poles m is the number of stator phases An SR motor is usually described in terms of low speed and high speed regions The low speed operating region is graphically depicted in Figure 4 3 In this low speed operating area the phase current can be arbitrarily controlled to any desired value Increasing the rotor speed makes it difficult to control the phase current
58. ormation On This Product Go to www freescale com Freescale Semiconductor Inc Software Design RESET appF ault NO_FAULT amp appF ault lt gt NO_FAULT appOpMode change switchState Stop switchState Stop STOP State appFault lt gt NO_FAULT P TSS ee switchState Stop amp appF ault lt gt NO_FAULT appFault NO_FAULT switchState Run amp appF ault NO_FAULT Figure 7 3 Application State Diagram 7 2 1 Application State INIT After RESET the application enters the INIT state In this state the drive is disabled and the motor cannot be started If any fault is detected the application transits to the FAULT state protection against faults If no fault is present and the Start Stop switch is detected in the STOP position the application transits to the STOP state protection against start after reset if the Start Stop switch is accidentally in START position 7 2 2 Application State STOP The STOP state can be entered either from the INIT state or from the RUN state In the STOP state the drive is enabled and the application waits for the START command When the application is in the STOP state the operational mode can be changed either from MANUAL mode to PC master software mode or vice versa When the operational mode is changed the application always transits to the INIT state If any fault in the STOP state is detected the application enters the FAULT st
59. osition to commutate off the corresponding stator phase and in the next comparison 9 4q gt 95 block the algorithm remains the same until the proper position occurs to switch on the following stator phase The algorithm loop is closed and ready for other commutation occurrences MOTOROLA 3 Phase SR Motor Control with Encoder 23 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Design 5 2 4 Current Controller Implementation 24 The current controller utilization flowchart reveals the algorithm process of the controller switching If the appropriate stator phase is turned on the DC Bus voltage is applied to the corresponding rotor phase The phase current rises almost linearly until a predefined target value is attained At this point by the processing of the proposed algorithm the current controller is switched on and maintains the actual current flowing within the desired value Before the current controller is switched on the necessary initialization is required It is mainly concerned with the integral portion in the k 1 step of the current PI controller This part of the controller structure is preset according to equation EQ 4 4 The following commutation instance turns the controller flag off so the corresponding rotor phase is fully voltage loaded until reaching the desired value of phase current Figure 5 6 clarifies the entire controller usage algorithm Controller
60. plers and optoisolation amplifiers is strongly recommended during development to avoid electric shock or any damage to the development equipment MOTOROLA 3 Phase SR Motor Control with Encoder 31 For More Information On This Product Go to www freescale com W0D d 2IS901y MMM 0 09 yonpojg SI L UO UOI EWUOJU 310W 104 oe JOPOOUF YIM ONJUOD JOJO YS eseud E VIOYOLON 1 9 nd uonen yuo wioyeld e6eyo yBIH YS eSseud N PE 100 _240VAC 49 61 Hz Motor Conn Table PhaseB Red Encoder tee saksi Motor Brake SEESE N aren 12VDC GND 40w flat ribbon 40w flat ribbon cable U3 cable U1 JP1 1 3ph SR TT C High Voltage A Optoisolation t _ Controller Board Power Stage pHi Board 2 _ DSP5680xEVM I ECOPT echvsr PS Y SAAD TETTEl ECOPTHIVSR 6 pin conn AMP A2510 ECMTRHIVSR Black BE KO z Hall Sensor Not Connected Connect Encoder Feedback uonejuswajdw aseMpseH ouj A0JONPUODIWIIS jLIS Freescale Semiconductor Inc Hardware Implementation 6 2 Motor Brake Specifications The SR Motor Brake set incorporates a 3 Phase SR Motor and attached BLDC motor brake The detailed specifications are listed in Table 6 1 The SR motor has six stator poles and four rotor poles This combination yields 12 strokes or pulses per single mechanical revolution The SR motor is characterized by a dedic
61. port It also illustrates the usage of dedicated motor control libraries that are included in the SDK The application helps start the development of the advanced SR drive dedicated to the targeted application Motorola Inc 2002 All rights reserved Order by AN1937 D Motorola Order Number Rev 0 9 02 Contents 1 Introduction ccccccceescceceessseeeees 1 2 Motorola DSP Advantages and Patines mentenie 2 3 Target Motor Theory 4 3 1 Switched Reluctance Motor 4 3 2 Mathematical Description of an SR 3 3 Digital Control of an SR Motor 8 3 4 Voltage and Current Control for SR 4 Switched Reluctance Motor Control Techniques with Encoder Position Sensor eee 12 4 1 Encoder Sensor cece 13 4 2 Commutation Angle Calculation 13 4 3 Commutation Strategy 0 0 15 4 4 The Current Controller 16 5 System Design eee 17 5 1 System Outline ee 17 5 2 Application Description 17 6 Hardware Implementation 30 6 1 Hardware Setup eee 30 6 2 Motor Brake Specifications 33 7 Software Designo eee 34 Pel Data POW tse catsiesd Setsevsecictevisvicness 34 7 2 State Diagram cece 38 7 3 Software Design cece 40 8 Implementation Notes 45 8 1 Scaling of Quantities 0 45 8 2 Velocity Calculation 48 9 SDK Implementation 0 0 0 0 49 9 1 Drivers and Library Function 49 9 2 Appconfig h File w
62. r Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Motorola DSP Advantages and Features The most interesting peripherals from the switched reluctance motor control point of view are the fast Analog to Digital Converter ADC and the Pulse Width Modulation PWM on chip modules They offer extensive freedom of configuration enabling efficient control of SR motors The PWM module incorporates a PWM generator enabling the generation of control signals for the motor power stage The module has the following features e Three complementary PWM signal pairs or six independent PWM signals e Complementary channel operation e Deadtime insertion e Separate top and bottom pulse width correction via current status inputs or software e Separate top and bottom polarity control e Edge aligned or center aligned PWM signals e 15 bits of resolution e Half cycle reload capability e Integral reload rates from one to 16 e Individual software controlled PWM output e Programmable fault protection e Polarity control e 20mA current sink capability on PWM pins e Write protectable registers The SR motor control application utilizes the PWM module set in independent PWM mode permitting fully independent generation of control signals for all switches of the power stage In addition to the PWM generators the PWM outputs can be controlled separately by software allowing the s
63. s of the position sensor The constant SpeedCalcConst is calculated as _ 415 SpeedMin SpeedCalcConst 2 coed Maa EQ 8 9 where SpeedMin is the minimal measured speed rpm SpeedMax is the maximal measured speed rpm Minimal measured speed SpeedMin is given by the configuration of the sensors and parameters of the DSP on chip timer used for speed measurement It is calculated as tise poets 8 x 60 NoPulsesPerRev EQ 8 10 215 BusClockFreq SpeedMin x Presc where NoPulsesPerRev is the number of sensed pulses of the position sensor per single revolution Presc is the prescaler of the Quadrature Timer used for speed measurements BusClockFreq is the DSP Bus Clock Frequency Hz Maximal measured speed SpeedMax is selected as SpeedMax kx SpeedMin EQ 8 11 where k is an integer constant greater than 1 48 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc SDK Implementation Then the speed calculation constant is determined as 60 I t B lockFreq x Spred Cole kons usClockived NoPulsesPerRev X Presc X SpeedMax EQ 8 12 In the application NoPulsesPerRev 12 Hall sensor pulses per 1 revolution of the motor Presc 128 BusClockFreq 36 10 Hz SpeedMax 3000 rpm Then SpeedCalcConst 468 rev 9 SDK Implementation The Motorola Embedded SDK is a collection of APIs libraries
64. s peak at the position when the inductance starts to increase stator and rotor poles start to overlap due to the change in the inductance profile Power Stage Controller PWM Output Speed PWM Controller Generator Ojesired Duty Cycle Oactual Figure 3 7 Voltage Control Technique 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory phase current decays through the fly back diodes position time ph position time Upc pus Speed PWM Controller Output Figure 3 8 Voltage Control Technique Voltage and Current Profiles 3 4 2 Current Control of an SR Motor In current control techniques the voltage applied to the motor phases is modulated to reach the desired current at the powered phase For most applications the desired current is constant during the complete sampling period of the speed control loop The commutation of the phases is linked to the position of the rotor The voltage applied to the phase is controlled by a current controller with an external speed control loop The speed controller processes the speed error the difference between the desired speed and the actual speed and generates the desired phase current The current controller evaluates the difference between actual and desired phase current and calculates the appropriate PWM duty cycle The phase volta
65. s scaled to the electrical angle in the aligned position see Figure 8 1 For the electrical commutation angle the scaling equation is the following ue el theta_on_el EQ 8 5 aligned_el Where theta_on_el is the scaled variable of the electrical commutation angle Frac16 on e118 the desired commutation angle on_e Valigned_el 1S the electrical angle in aligned position Pal In the application Datigned_el 360 1 The other application electrical angle variables are scaled in the same way angle where stator and rotor poles start to overlap thet a_edge 46 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Implementation Notes Ostart_to_overlap 8 aligned position 180 0 180 Figure 8 1 Electrical Angle Definition 8 1 4 Speed Scaling Speed is scaled to the maximal speed of the drive For the desired start up speed the scaling equation is the following A omega_desired_startup IOTEEUE EQ 8 6 OMAX Where omega_desired_startup is the scaled variable of the desired start up speed Frac16 Ostart up 18 the desired start up speed rpm yax Maximal speed of the drive rpm In the application y y 3000 rpm The other application speed variables are scaled in the same way actual speed omega_actual_mech speed limits omega_reqMAX_mech amp omega_reqMIN_mech push button speed i
66. s to the position when the rotor and the stator poles start to overlap When the phase is turned off the phase current falls to zero The phase current present in the region of decreasing inductance generates negative torque The torque generated by the motor is controlled by the applied phase voltage and by the appropriate definition of switching turn on and turn off angles For more details see 3 As is apparent from the description the SR motor requires position feedback for motor phase commutation In many cases this requirement is addressed by using position sensors like encoders Hall sensors etc The result is that the implementation of mechanical sensors increases costs and decreases system reliability Traditionally developers of motion control products have attempted to lower system costs by reducing the number of sensors A variety of algorithms for sensorless control have been developed most of which involve evaluation of the variation of magnetic circuit parameters that are dependent on the rotor position 2 5 Aligned Unaligned Aligned Stator Phase A LJ LI LJ Rotor gt rL Te m gt t i i i 1 i position time i 1 i 1 phase A energizing position time Oon pha Ooff pha Figure 3 2 Phase Energizing The motor itself is a low cost machine of simple construction High speed operation is possible thus the motor is suitable for high speed applications like vacuum cleaners fans white go
67. services rules and guidelines This software infrastructure is designed to let DSP5680x software developers create high level efficient and portable code The application code is available in SDK This chapter describes how the SR motor control application is written under SDK 9 1 Drivers and Library Function The SR motor control application uses the following drivers e ADC driver e Quadrature Timer driver e Quadrature Decoder driver e PWM driver e LED driver e SCI driver e PC master software driver e Switch driver only for DSPS56F805EVM amp DSP56F807EVM e Brake driver All drivers are included in the bsp ib library The SR motor control application uses the following library functions e srmcemt3ph2spp SR motor commutation algorithm srm lib library e srmcacAngleCalc SR motor commutation angle calculation algorithm srm lib library e controller standard PI controller mcfunc lib library e switchcontrol switch control mcfunc lib library e boardId board identification bsp lib library MOTOROLA 3 Phase SR Motor Control with Encoder 49 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc SDK Implementation 9 2 Appconfig h File The purpose of the appconfig h file is to provide a mechanism for overwriting default configuration settings which are defined in the config h file There are two appconfig h files The first appconfig h file is dedicated to External R
68. simultaneously Phases B amp C After 50msec one phase is turned off Phase C the other phase stays powered Phase B After an additional 550 msec the rotor is stabilized enough in the aligned position with respect to the powered phase Phase B stabilize the rotor in the aligned position with respect to that phase In total the stabilization takes 1 sec After this time the rotor is stable enough to reliably start the motor in the desired direction of rotation 3 Phase SR Motor Control with Encoder For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Design 5 2 2 Position and Speed Sensing The position information is used to generate accurate switching instants of the power converter ensuring drive stability and fast dynamic response Velocity feedback is derived from the position information so that an additional velocity sensor is unneeded All members of the Motorola DSP 56F80x family except 56F801 have an on chip quadrature decoder module connected to a quadrature timer This peripheral is commonly used for position and speed sensing The quadrature decoder position counter counts up down each edge of Phase A and Phase B signals according to their order see Figure 5 3 The Phase A and Phase B inputs of the DSP controller are routed through a switch matrix to a general purpose timer module and quadrature decoder module as well see Figure 5 4 The timer module can use all
69. stage can be incorporated into the determination of the actual voltage present in the motor phase 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Design 0 7 active not corrected discharge not corrected 0 6 0 5 0 4 3 i i 0 l DE E i l 0 01 0 02 0 03 0 04 0 05 current A O Oo ine k Oo time sec 0 7 active discharge 0 6 0 5 0 4 0 3 current A 0 2 0 1 time sec Figure 5 10 Measured 3 Phase Currents without Noise Correction and with Noise Correction Implemented MOTOROLA 3 Phase SR Motor Control with Encoder 29 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Hardware Implementation 5 2 6 Power Module Temperature Sensing The measured power module temperature is used for thermal protection The hardware realization is shown in Figure 5 11 The circuit consists of four diodes connected in series a bias resistor and a noise suppression capacitor The four diodes have a combined temperature coefficient of 8 8 mV C The resulting signal Temp_sense is fed back to an A D input where software can be used to set safe operating limits In the presented application the temperature in degrees Celsius is calculated
70. the motor requires electronic control for operation Several power stage topologies are being implemented according to the number of motor phases and the desired control algorithm The particular structure of the SR power stage structure defines the freedom of control for an individual phase A power stage with two independent power switches per motor phase is the most used topology Such a power stage for 3 Phase SR motors is illustrated in Figure 3 5 It permits control of the individual phases fully independent of each other and thus permits the widest freedom of control Other power stage topologies share some of the power devices for several phases thus saving on power stage cost but with these the phases cannot be controlled fully independently Note that this particular topology of SR power stage is fault tolerant in contrast to power stages of AC induction motors because it eliminates the possibility of a rail to rail short circuit During normal operation the electromagnetic flux in an SR motor is not constant and must be built for every stroke In the motoring period these strokes correspond to the rotor position when the rotor poles are approaching the corresponding stator pole of the excited phase In the case of Phase A shown in Figure 3 1 the stroke can be established by activating the switches Q1 and Q2 At low speed operation the Pulse Width Modulation PWM applied to the corresponding switches modulates the voltage level Tw
71. this sequence is read and evaluated according to the decoding table If the correct SR power stage is not identified the fault Wrong Power Stage disables drive operation 5 2 1 Initialization and Start Up Before the motor can be started rotor alignment and initialization of the control algorithms must be performed see Figure 5 2 since the absolute position is not known MOTOROLA 3 Phase SR Motor Control with Encoder 19 For More Information On This Product Go to www freescale com System Design 20 First the rotor needs to be aligned to a known position to be able to start the motor in the desired Freescale Semiconductor Inc Start Command Accepted Turn on Phases B amp C Any Rotor Position Wait to Ensure the Initial Pulse Turn Off Phase C Wait 550msec Rotor Stabilized 4 Measure Phase Resistance as an Average of Phase B Aligned 32 Measurements i Commutate Phases Turn off Phase B Turn on Phase A v Motor Starts Figure 5 2 Start Up Sequence direction of rotation This is done in the following steps 1 2 3 Step 1 provides the initial impulse to the rotor If Phase B is exactly in an unaligned position and thus does not generate any torque Phase C provides the initial movement Then Phase C is disconnected and Phase B stays powered Step 2 The stabilization pulse to Phase B must be long enough to Two phases are turned on
72. ty of the motor The torque generated by the motor phase is a function of the magnetic flux therefore the phase torque is not constant for a constant phase current for different motor positions This creates torque ripple and noise in the SR motor Figure 3 3 Magnetization Characteristics of the SR Motor A mathematical model of an SR motor can be developed The model is based on the electrical diagram of the motor incorporating the phase resistance and phase inductance 1 The diagram for one phase is illustrated in Figure 3 4 6 3 Phase SR Motor Control with Encoder MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory Lpn f 0 Figure 3 4 Electrical Diagram of One SR Motor Phase According to Figure 3 4 any voltage applied to a phase of the SR motor can be described as a sum of voltage drops in the phase resistance and induced voltages on the phase inductance upn t Toh iph Ur D EQ 3 1 where Uph is the voltage applied to a phase ph is the phase resistance iph is the phase current rph 18 the induced voltages over the phase inductance The equation EQ 3 1 supposes that all phases are independent and have no mutual influence h that is a function of the phase The induced voltage u7 is defined by the magnetic flux linkage F current z ph and the rotor position 0 So the induced voltage can be express
73. unt resistor is shown in Figure 5 8 The phase current is visible only when both switches are turned on the phase current flows through switches and the sensing resistor or when both switches are turned off phase current flows through the freewheeling diodes and the sensing resistor When both switches of the phase are turned on the measured current is negative so it needs to be inverted The diagram shows that for a reliable current shape reconstruction the sensing needs to be synchronized with the PWM frequency at the center of the PWM pulse and both positive and the negative voltage drop polarities should be measured The zero current may be set to half of the ADC range so both the positive and the negative voltage drops on the phase current shunt resistors can be measured The voltage drop is then amplified according to the ADC range Proceeding like this the current can be read with accuracy and credibility MOTOROLA 3 Phase SR Motor Control with Encoder 25 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Design Figure 5 9 illustrates the actual phase currents of a 3 Phase motor measured on the shunt resistors as described above The previously specified current sensing method is described from the DSP processor point of view It seems the measured phase current is negative which is caused by inverting differential amplifier Actually the measured phase current flowing through s
74. ximal measured voltage For DC Bus voltage the scaling equation is the following V DC_BUS EQ 8 3 MAX u_dc_bus Where u_dc_bus is the scaled variable of the DC Bus voltage Frac16 Vpc_BUS is the measured DC Bus voltage V Vmax is the maximal measurable DC Bus voltage V MOTOROLA 3 Phase SR Motor Control with Encoder 45 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Implementation Notes In the application Vmax 407V for the high voltage platform The other application voltage variables are scaled in the same way active phase voltage u_active discharge phase voltage u_discharge DC Bus under voltage limit start up voltage 8 1 2 Phase Current Scaling The application phase currents are scaled to the maximal measured phase current For the active phase current the scaling equation is the following i_active active _ EQ 8 4 phase_max Where i_active is the scaled variable of the active phase current Frac16 iactive 1S the measured active phase current A iphase max S the maximal measurable phase current A In the application iphase max 5 86A for the high voltage platform The other application phase current variables are scaled in the same way desired current i_desired discharge current i_discharge current offsets i_phase_A_offset i_phase_B_ offset i_phase_C_offset 8 1 3 Electrical Angle Scaling The application electrical angle i

Download Pdf Manuals

image

Related Search

Related Contents

REGLAMENTO TÉCNICO DGNTI-COPANIT P. 1 REPÚBLICA DE  Service Manual, UBK 815 Bicycle.fm  28000Series - GE Measurement & Control  ポータブル プロジェクタール  Kenwood DPX503 Car Stereo System User Manual  上肢台の高さ調節方法 上肢台の高さ調節方法 上肢台の高さ調節方法  electribe Owner`s manual  17”LCD Drawer KVM Console with 8/16 Ports Combo  OPERATING INSTRUCTIONS SPARE PARTS LIST  Smeg PC45X User's Manual  

Copyright © All rights reserved.
Failed to retrieve file