| |
Datasheet Home \ Datasheet Details
Download
PDF Abstract Text:
Freescale Semiconductor, Inc..
3-Phase PM Synchronous Motor Torque Vector Control Using 56F805
Freescale Semiconductor, Inc.
Freescale Semiconductor, Inc..
3-Phase PM Synchronous Motor Torque Vector Control Using 56F805
Designer Reference Manual
Hybrid Controller
DRM018 / D Rev. 0, 03 / 2003
MOTOROLA.COM / SEMICONDUCTORS
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Freescale Semiconductor, Inc..
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Freescale Semiconductor, Inc..
3-Phase PM Synchronous Motor Torque Vector Control Using 56F805
Designer Reference Manual - Rev. 0
by: Peter Balazovic Motorola Czech System Laboratories Roznov pod Radhostem, Czech Republic
DRM018 - Rev. 0 MOTOROLA
Designer Reference Manual 3
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Revision history
To provide the most up-to-date information, the revision of our documents on the World Wide Web will be the most current. Your printed copy may be an earlier revision. To verify you have the latest information available, refer to: http://www.motorola.com / semiconductors The following revision history table summarizes changes contained in this document. For your convenience, the page number designators have been linked to the appropriate location.
Freescale Semiconductor, Inc..
Revision history
Date January 2003 Revision Level 1 Initial release Description Page Number(s) N / A
Designer Reference Manual 4
DRM018 - Rev. 0 MOTOROLA
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Designer Reference Manual - 3-Ph. PMSM Torque Vector Control
List of Sections
Freescale Semiconductor, Inc..
DRM018 - Rev. 0 MOTOROLA
Designer Reference Manual 5
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
List of Sections
Freescale Semiconductor, Inc..
Designer Reference Manual 6
DRM018 - Rev. 0 MOTOROLA
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Designer Reference Manual - 3-Ph. PMSM Torque Vector Control
Table of Contents
Section 1. Introduction
Freescale Semiconductor, Inc..
Section 2. Target Motor Theory
2.1 2.2 2.3 2.4 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 Permanent Magnet Synchronous Motor . . . . . . . . . . . . . . . . . . 19 Mathematical Description of PM Synchronous Motor. . . . . . . . 20 Digital Control of PM Synchronous Motor. . . . . . . . . . . . . . . . . 26
Section 3. System Description
Section 4. Hardware Design
DRM018 - Rev. 0 MOTOROLA
Designer Reference Manual 7
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Table of Contents
Section 5. Software Design
Freescale Semiconductor, Inc..
Section 6. System Setup
Appendix A. References Appendix B. Glossary
Designer Reference Manual 8
DRM018 - Rev. 0 MOTOROLA
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Designer Reference Manual - 3-Ph. PMSM Torque Vector Control
List of Figures
Figure 2-1 2-2 2-3 2-4 2-5 2-6 2-7 2-8 Title Page
Freescale Semiconductor, Inc..
DRM018 - Rev. 0 MOTOROLA
Designer Reference Manual 9
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
List of Figures
Freescale Semiconductor, Inc..
Designer Reference Manual 10
DRM018 - Rev. 0 MOTOROLA
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Designer Reference Manual - 3-Ph. PMSM Torque Vector Control
List of Tables
Table 1-1 3-1 4-1 4-2 6-1 6-2 6-3 Title Page
Freescale Semiconductor, Inc..
DRM018 - Rev. 0 MOTOROLA
Designer Reference Manual 11
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
List of Tables
Freescale Semiconductor, Inc..
Designer Reference Manual 12
DRM018 - Rev. 0 MOTOROLA
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Designer Reference Manual - 3-Ph. PMSM Torque Vector Control
Section 1. Introduction
1.1 Contents
Freescale Semiconductor, Inc..
1.2 Application Benefit
DRM018 - Rev. 0 MOTOROLA Introduction For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 13
Freescale Semiconductor, Inc.
Introduction 1.3 Motorola DSP Advantages and Features
Freescale Semiconductor, Inc..
One typical member of the family, the DSP56F805, provides the following peripheral blocks: · Two Pulse Width Modulator modules (PWMA & PWMB), each with six PWM outputs, three Current Sense inputs, and four Fault inputs fault tolerant design with deadtime insertion 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 Dec0 & Quad Dec1), each with four inputs, or two additional Quad Timers A & 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 (SCI0 & SCI1), each with two pins, or four additional GPIO lines Serial Peripheral Interface (SPI), 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)
DRM018 - Rev. 0 Introduction For More Information On This Product, Go to: www.freescale.com MOTOROLA
Designer Reference Manual 14
Freescale Semiconductor, Inc.
Introduction Motorola DSP Advantages and Features
Software-programmable, Phase Lock Loop-based frequency synthesizer for the DSP core clock Table 1-1. Memory Configuration
DSP56F801 DSP56F803 DSP56F805 DSP56F807
Program Flash Data Flash Program RAM
8188 x 16-bit 2K x 16-bit 1K x 16-bit 1K x 16-bit 2K x 16-bit
32252 x 16-bit 4K x 16-bit 512 x 16-bit 2K x 16-bit 2K x 16-bit
61436 x 16-bit 8K x 16-bit 2K x 16-bit 4K x 16-bit 2K x 16-bit
Freescale Semiconductor, Inc..
Data RAM Boot Flash
The most interesting peripherals, from the PM synchronous 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: · · · · · · · · · · Three complementary PWM signal pairs, or six independent PWM signals Complementary channel operation Deadtime insertion Separate top and bottom pulse width correction via current status inputs or software Separate top and bottom polarity control Edge-aligned or center-aligned PWM signals 15 bits of resolution Half-cycle reload capability Integral reload rates from one to 16 Individual software-controlled PWM output
DRM018 - Rev. 0 MOTOROLA Introduction For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 15
Freescale Semiconductor, Inc.
Introduction
· · · · Programmable fault protection Polarity control 20mA current sink capability on PWM pins Write-protectable registers
The PM synchronous motor control utilizes the PWM block set in the complementary PWM mode, permitting generation of control signals for all switches of the power stage with inserted deadtime. The PWM block generates three sinewave outputs mutually shifted by 120 degrees.
Freescale Semiconductor, Inc..
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: · · · · · · · · · · · · · ·
Designer Reference Manual 16 Introduction For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Introduction Motorola DSP Advantages and Features
The application utilizes the ADC 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.
Freescale Semiconductor, Inc..
DRM018 - Rev. 0 MOTOROLA Introduction For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 17
Freescale Semiconductor, Inc.
Introduction
Freescale Semiconductor, Inc..
Designer Reference Manual 18 Introduction For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Designer Reference Manual - 3-Ph. PMSM Torque Vector Control
Section 2. Target Motor Theory
2.1 Contents
2.2 Permanent Magnet Synchronous Motor . . . . . . . . . . . . . . . . . . 19 Mathematical Description of PM Synchronous Motor. . . . . . . . 20 Digital Control of PM Synchronous Motor. . . . . . . . . . . . . . . . . 26
Freescale Semiconductor, Inc..
2.2 Permanent Magnet Synchronous Motor
The PM synchronous motor is a rotating electric machine with a classic 3-phase stator like that of an induction motor the rotor has surface-mounted permanent magnets (see Figure 2-1).
Stator Stator winding (in slots) Shaft Rotor Air gap Permanent magnets
Figure 2-1. PM Synchronous Motor - Cross Section
DRM018 - Rev. 0 MOTOROLA Target Motor Theory For More Information On This Product, Go to: www.freescale.com Designer Reference Manual 19
Freescale Semiconductor, Inc.
Target Motor Theory
In this respect, the PM synchronous motor is equivalent to an induction motor, where the air gap magnetic field is produced by a permanent magnet, so the rotor magnetic field is constant. PM synchronous motors offer a number of advantages in designing modern motion control systems. The use of a permanent magnet to generate substantial air gap magnetic flux makes it possible to design highly efficient PM motors.
2.3 Mathematical Description of PM Synchronous Motor
Freescale Semiconductor, Inc..
The model used for vector control design can be understood by using space vector theory. The three-phase motor quantities (such as voltages, currents, magnetic flux, etc.) are expressed in terms of complex space vectors. Such a model is valid for any instantaneous variation of voltage and current and adequately describes the performance of the machine under both steady-state and transient operation. The complex space vectors can be described using only two orthogonal axes. We can look at the motor as a two-phase machine. Using a two-phase motor model reduces the number of equations and simplifies the control design.
2.3.1 Space Vector Definition Assume isa, isb, isc are the instantaneous balanced three-phase stator currents:
(EQ 2-1.)
Then we can define the stator current space vector as follows:
(EQ 2-2.)
Designer Reference Manual 20 Target Motor Theory For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Target Motor Theory Mathematical Description of PM Synchronous Motor
phase- b
Freescale Semiconductor, Inc..
Figure 2-2. Stator Current Space Vector and Its Projection The space vector defined by (EQ 2-2.) can be expressed utilizing two-axis theory. The real part of the space vector is equal to the instantaneous value of the direct-axis stator current component, is, and whose imaginary part is equal to the quadrature-axis stator current component, is. Thus, the stator current space vector, in the stationary reference frame attached to the stator can be expressed as:
(EQ 2-3.)
In symmetrical three-phase machines, the direct and quadrature axis stator currents is, is are fictitious quadrature-phase (two-phase)
DRM018 - Rev. 0 MOTOROLA Target Motor Theory For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 21
Freescale Semiconductor, Inc.
Target Motor Theory
current components, which are related to the actual three-phase stator currents as follows:
(EQ 2-4.)
(EQ 2-5.)
Freescale Semiconductor, Inc..
The space vectors of other motor quantities (voltages, currents, magnetic fluxes etc.) can be defined in the same way as the stator current space vector. For a description of the PM synchronous motor, the symmetrical three-phase smooth-air-gap machine with sinusoidally-distributed windings is considered. The voltage equations of stator in the instantaneous form can then be expressed as:
(EQ 2-6.) (EQ 2-7.) (EQ 2-8.)
where uSA, uSB and uSC are the instantaneous values of stator voltages, iSA, iSB and iSC are the instantaneous values of stator currents, and SA, SB, SC are instantaneous values of stator flux linkages, in phase SA, SB and SC. Due to the large number of equations in the instantaneous form, the equations (EQ 2-6.), (EQ 2-7.) and (EQ 2-8.), it is more practical to
Designer Reference Manual 22 Target Motor Theory For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Target Motor Theory Mathematical Description of PM Synchronous Motor
rewrite the instantaneous equations using two axis theory (Clarke transformation). The PM synchronous motor can be expressed as:
(EQ 2-9.) (EQ 2-10.) (EQ 2-11.) (EQ 2-12.) (EQ 2-13.)
Freescale Semiconductor, Inc..
where:
, is the stator orthogonal coordinate system
uS, is the stator voltage iS, is the stator current S, is the stator magnetic flux M is the rotor magnetic flux RS is the stator phase resistance LS is the stator phase inductance / F is the electrical rotor speed / fields speed p is the number of poles per phase J is the inertia TL is the load torque
r is the rotor position in , coordinate system
DRM018 - Rev. 0 MOTOROLA Target Motor Theory For More Information On This Product, Go to: www.freescale.com Designer Reference Manual 23
Freescale Semiconductor, Inc.
Target Motor Theory
frame () attached to the stator and the real axis (x) of the general reference frame, then (EQ 2-14.) defines the stator current space vector in general reference frame:
(EQ 2-14.)
Freescale Semiconductor, Inc..
Figure 2-3. Application of the General Reference Frame
The stator voltage and flux-linkage space vectors can be similarly obtained in the general reference frame. Similar considerations hold for the space vectors of the rotor voltages, currents and flux linkages. The real axis (r) of the reference frame attached to the rotor is displaced from the direct axis of the stator reference frame by the rotor angle r. Since it can be seen that the angle between the real axis (x) of the general reference frame and the real axis of the reference frame rotating with the rotor (r) is g-r, in the general reference frame, the space vector of the rotor currents can be expressed as:
(EQ 2-15.)
DRM018 - Rev. 0
Designer Reference Manual 24 Target Motor Theory For More Information On This Product, Go to: www.freescale.com
MOTOROLA
Freescale Semiconductor, Inc.
Target Motor Theory Mathematical Description of PM Synchronous Motor
where i r is the space vector of the rotor current in the rotor reference frame. The space vectors of the rotor voltages and rotor flux linkages in the general reference frame can be similarly expressed. The motor model voltage equations in the general reference frame can be expressed by utilizing introduced transformations of the motor quantities from one reference frame to the general reference frame. The PM synchronous motor model is often used in vector control algorithms. The aim of vector control is to implement control schemes which produce high dynamic performance and are similar to those used to control DC machines. To achieve this, the reference frames may be aligned with the stator flux-linkage space vector, the rotor flux-linkage space vector or the magnetizing space vector. The most popular reference frame is the reference frame attached to the rotor flux linkage space vector, with direct axis (d) and quadrature axis (q). After transformation into d-q coordinates, the motor model as follows:
Freescale Semiconductor, Inc..
(EQ 2-16.) (EQ 2-17.) (EQ 2-18.) (EQ 2-19.) (EQ 2-20.)
(EQ 2-21.)
DRM018 - Rev. 0 MOTOROLA Target Motor Theory For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 25
Freescale Semiconductor, Inc.
Target Motor Theory
From the equation (EQ 2-21.), it can be seen that the torque is dependent and can be directly controlled by the current isq only. It is obvious to obtain PM synchornous motor torque eqaution as follwos:
(EQ 2-22.)
2.4 Digital Control of PM Synchronous Motor
Freescale Semiconductor, Inc..
Usually the applications of the PM synchronous motors are powered by inverters. The inverter converts DC power to AC power at the required frequency and amplitude. The typical 3-phase inverter is illustrated in Figure 2-4.
Designer Reference Manual 26 Target Motor Theory For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Target Motor Theory Digital Control of PM Synchronous Motor
output voltage is mostly created by a pulse width modulation (PWM) technique, where an isosceles triangle carrier wave is compared with a fundamental-frequency sine modulating wave, and the natural points of intersection determine the switching points of the power devices of a half bridge inverter. This technique is shown in Figure 2-5. The 3-phase voltage waves are shifted 120o to each other and, thus, a 3-phase motor can be supplied.
Freescale Semiconductor, Inc..
Generated Sine Wave 1
PWM Carrier Wave
PWM Output T 1 (Upper Switch) PWM Output T 2 (Lower Switch)
Figure 2-5. Pulse Width Modulation The most popular power devices for motor control applications are Power MOSFETs and IGBTs. A Power MOSFET is a voltage-controlled transistor. It is designed for high-frequency operation and has a low voltage drop thus, it has low power losses. However, the saturation temperature sensitivity limits the MOSFET application in high-power applications. An insulated-gate bipolar transistor (IGBT) is a bipolar transistor controlled by a MOSFET on its base. The IGBT requires low drive current, has fast switching time, and is suitable for high switching
DRM018 - Rev. 0 MOTOROLA Target Motor Theory For More Information On This Product, Go to: www.freescale.com Designer Reference Manual 27
Freescale Semiconductor, Inc.
Target Motor Theory
frequencies. The disadvantage is the higher voltage drop of a bipolar transistor, causing higher conduction losses.
2.4.1 Vector Control of PM Synchronous Motor Vector Control is an elegant control method of a PM synchronous motor, where field-oriented theory is used to control space vectors of magnetic flux, current, and voltage. It is possible to set up the coordinate system to decompose the vectors into a magnetic field-generating part and a torque-generating part. The structure of the motor controller (Vector Control controller) is then almost the same as for a separately-excited DC motor, which simplifies the control of PM synchronous motor. This Vector Control technique was developed specifically to achieve a similarly dynamic performance in PM synchronous motors. As explained in 3.3 Vector Control Drive Concept, there is chosen a torque control with inner current closed-loop, where the rotor flux is considered as zero input. This method is broken down onto the field-generating and torque-generating parts of the stator current to be able to separately control the magnetic flux and the torque. In order to do so, we need to set up the rotary coordinate system connected to the rotor magnetic field this system is generally called a "d-q coordinate system". Very high CPU performance is needed to perform the transformation from rotary to stationary coordinate systems. Therefore, the Motorola DSP56F80x is very well suited for use in a Vector Control algorithm. All transformations which are needed for Vector Control will be described in the next section.
Freescale Semiconductor, Inc..
2.4.2 Block Diagram of Vector Control Figure 2-6 shows the basic structure of Vector Control of the PM synchronous motor. To perform Vector Control, follow these steps: · · ·
Designer Reference Manual 28 Target Motor Theory For More Information On This Product, Go to: www.freescale.com
Measure the motor quantities (phase voltages and currents) Transform them into the two-phase system (, ) using Clarke transformation Calculate the rotor flux space vector magnitude and position angle
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Target Motor Theory Digital Control of PM Synchronous Motor
Transform stator currents into the d-q coordinate system using Park transformation The stator current torque- (isq) and flux- (isd) producing components are controlled separately by the controllers The output stator voltage space vector is calculated using the decoupling block The stator voltage space vector is transformed back from the d-q coordinate system into the two-phase system and fixed with the stator by inverse Park transformation Using sinewave modulation, the output 3-phase voltage is generated
Freescale Semiconductor, Inc..
Torque Command
Line Input
Decoupling
Sinewave Generation
Flux Command
ISq IS ISa
3-phase Power Stage
Forward Park Transformation
Forward Clarke Transformation
ISb ISc
PMSM motor
Position
Position / Speed sensor
Figure 2-6. Block Diagram of PM Synchronous Motor Vector Control
2.4.3 Vector Control Transformations Transforming the PM synchronous motor into a DC motor is based on points of view. As shown in 2.4.2 Block Diagram of Vector Control, a coordinate transformation is required.
DRM018 - Rev. 0 MOTOROLA Target Motor Theory For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 29
Freescale Semiconductor, Inc.
Target Motor Theory
The following transformations are involved in Vector Control: · · Transformations from a 3-phase to a 2-phase system (Clarke transformation) Rotation of orthogonal system - , to d-q (Park transformation) - d-q to , (Inverse Park transformation) 2.4.3.1 Clarke Transformation Figure 2-7 shows how the three-phase system is transformed into a two-phase system.
Freescale Semiconductor, Inc..
phase- b
iS iSb - measured
iSa - measured iS
, phase-a
iSc - calculated
phase- c
Figure 2-7. Clarke Transformation
Designer Reference Manual 30 Target Motor Theory For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Target Motor Theory Digital Control of PM Synchronous Motor
To transfer the graphical representation into mathematical language:
(EQ 2-23.)
In most cases, the 3-phase system is symmetrical, which means that the sum of the phase quantities is always zero.
Freescale Semiconductor, Inc..
(EQ 2-24.)
The constant "K" can be freely chosen and equalizing the -quantity and a-phase quantity is recommended. Then:
(EQ 2-25.)
We can fully define the Park-Clarke transformation:
(EQ 2-26.)
2.4.3.2 Transformation from , to d-q Coordinates and Backwards Vector Control is performed entirely in the d-q coordinate system to make the control of PM synchronous motors elegant and easy see 2.4.2 Block Diagram of Vector Control. Of course, this requires transformation in both directions and the control action must be transformed back to the motor side.
DRM018 - Rev. 0 MOTOROLA Target Motor Theory For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 31
Freescale Semiconductor, Inc.
Target Motor Theory
First, establish the d-q coordinate system:
(EQ 2-27.)
(EQ 2-28.)
Freescale Semiconductor, Inc..
Then transform from , to d-q coordinates:
(EQ 2-29.)
Figure 2-8 illustrates this transformation.
Field
Figure 2-8. Establishing the d-q Coordinate System (Park Transformation)
Designer Reference Manual 32 Target Motor Theory For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Target Motor Theory Digital Control of PM Synchronous Motor
The backward (Inverse Park) transformation (from d-q to , ) is:
(EQ 2-30.)
2.4.4 PMSM Vector Control This section describes the control regarding the required stator current vectors isd, isq. There are two speed ranges (shown in Figure 2-9), which differ by controlled current vector: · · Control in Normal Operating Range is a control mode for a speed required below nominal motor speed Control in Field-Weakening Range is a control mode for a speed required above nominal motor speed. This application does not utilize control in field-weakening range.
Freescale Semiconductor, Inc..
(EQ 2-31.)
DRM018 - Rev. 0 MOTOROLA Target Motor Theory For More Information On This Product, Go to: www.freescale.com Designer Reference Manual 33
Freescale Semiconductor, Inc.
Target Motor Theory
Freescale Semiconductor, Inc..
normal operating range
field weakenning range
speed
stator current id
Figure 2-9. Normal Operation and Field-Weakening
Designer Reference Manual 34 Target Motor Theory For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Designer Reference Manual - 3-Ph. PMSM Torque Vector Control
Section 3. System Description
3.1 Contents
Freescale Semiconductor, Inc..
3.2 System Specification
The motor control system is designed to drive a 3-phase PM synchronous motor in a closed-loop of torque-generating part of current isq. The application meets the following performance specifications: · · · · Torque vector control of PM motor using the quadrature encoder as a position sensor Targeted for DSP56F805EVM Running on a 3-phase Low-volatge PM synchronous motor control development platform at 12 DC Control technique incorporates: - Vector Control with torque-generating part of current isq - Rotation in both directions - Motoring and generator mode with brake - Start from any motor position with rotor alignment · · Manual interface (Start / Stop switch, Up / Down push button control, LED indicator) PC master software control interface (motor start / stop, speed set-up)
DRM018 - Rev. 0 MOTOROLA System Description For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 35
Freescale Semiconductor, Inc.
System Description
· · · PC master software remote monitor Power stage board identification Overvoltage, undervoltage, overcurrent and overheating fault protection
The PM synchronous drive introduced here is designed to power a high-voltage PM synchronous motor with a quadrature encoder. It has the following specifications:
Freescale Semiconductor, Inc..
Table 3-1. High Voltage Hardware Set Specifications
3.3 Vector Control Drive Concept
A standard system concept is used with this drive see Figure 3-1. The system incorporates the following hardware parts: · · Three-phase PM synchronous motor high-voltage development platform Feedback sensors for: - Position (quadrature encoder) - DCBus voltage
Designer Reference Manual 36 System Description For More Information On This Product, Go to: www.freescale.com DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
System Description Vector Control Drive Concept
- Phase currents - DCBus overcurrent detection - Temperature · The DSP56F805 evaluation module
The drive can be controlled in two different operational modes: In the Manual operational mode, the required speed is set by the Start / Stop switch and the Up / Down push buttons.
Freescale Semiconductor, Inc..
In the PC master software operational mode, the required speed and Start / Stop switch are set by the PC.
Figure 3-1. Drive Concept
DRM018 - Rev. 0 MOTOROLA System Description For More Information On This Product, Go to: www.freescale.com Designer Reference Manual 37
Freescale Semiconductor, Inc.
System Description
Designer Reference Manual 38 System Description For More Information On This Product, Go to: www.freescale.com DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc..
Freescale Semiconductor, Inc.
System Description System Blocks Concept
of wrong hardware, the program stays in an infinite loop, displaying the fault condition.
3.4 System Blocks Concept
Freescale Semiconductor, Inc..
DRM018 - Rev. 0 MOTOROLA System Description For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 39
Freescale Semiconductor, Inc.
System Description
In addition to the quadrature decoder, the input signals (Phase A, Phase B and Index) are connected to quad timer module A. The quad timer module consists of four quadrature timers. Due to the wide variability of quad timer modules, it is possible to use this module to decode quadrature encoder signals, sense position, and speed. A configuration of the quad timer module is shown in Figure 3-3.
Freescale Semiconductor, Inc..
Figure 3-3. Quad Timer Module A Configuration 3.4.1.1 Position Sensing The position and speed sensing algorithm uses all of the timers in module A and an additional timer as a time base. Timers A0 and A1 are used for position sensing. Timer A0 permits connection of three input signals to the quadrature timer A1, even if timer A1 has only two inputs (primary and secondary), accomplished by using timer A0 as a quadrature decoder only. It is set to count in the quadrature mode, count to zero, and then reinitialize. This timer setting is used to decode
Designer Reference Manual 40 System Description For More Information On This Product, Go to: www.freescale.com DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
System Description System Blocks Concept
Freescale Semiconductor, Inc..
(EQ 3-1.)
where:
speed alculated speed k N scaling constant number of pulses per constant period
DRM018 - Rev. 0 MOTOROLA System Description For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 41
Freescale Semiconductor, Inc.
System Description
T accurate period of N pulses
The algorithm requires two timers for counting pulses and measuring their period, and a third timer as a time base see Figure 3-3. Timer A2 counts the pulses of the quadrature encoder, and timer A3 counts a system clock divided by 2. The values in both timers can be captured by each edge of the Phase A signal. The time base is provided by timer D0, which is set to call the speed processing algorithm every 900µs. An explanation of how the speed processing algorithm works follows.
Freescale Semiconductor, Inc..
First, the new captured values of both timers are read. The difference in the number of pulses and their accurate time interval are calculated from actual and previous values. The new values are then saved for the next period, and the capture register is enabled. From that moment, the first edge of Phase A signal captures the values of both timers (A2, A3) and the capture register is disabled. This process is repeated on each call of the speed processing algorithm see Figure 3-4.
Figure 3-4. Speed Processing
Designer Reference Manual 42 System Description For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
System Description System Blocks Concept
3.4.1.3 Minimum and Maximum Speed Calculation The minimum speed is calculated with the following equation:
(EQ 3-2.)
where:
min Minimum obtainable speed rpm Number of pulses per revolution 1 / rev Period of speed measurement (calculation period) s
Freescale Semiconductor, Inc..
N Tcalc
In the application, the quadrature encoder has 1024 pulses per revolution and a calculation period of 900µs was chosen on the basis of a motor mechanical constant. Thus, (EQ 3-2.) calculates the minimum speed as 16.3 rpm. The maximum speed can be expressed as:
(EQ 3-3.)
where:
max N Maximum obtainable speed rpm Number of pulses per revolution 1 / rev
TclkT2 Period of input clock to timer A2 s
(EQ 3-4.)
where:
DRM018 - Rev. 0 MOTOROLA System Description For More Information On This Product, Go to: www.freescale.com Designer Reference Manual 43
Freescale Semiconductor, Inc.
System Description
k max N Scaling constant in (EQ 3-1.) Maximum of the speed range rpm Number of pulses per revolution 1 / rev
TclkT2 Period of input clock to timer A2 s
In this application, the maximum measurable speed is limited to 6000rpm.
NOTE:
Freescale Semiconductor, Inc..
3.4.1.4 Position Reset with Rotor Alignment After reset, the rotor position is unknown, because a quadrature encoder does not give an absolute position until the index pulse arrives. As shown in Figure 3-5, the rotor position must be aligned with the d axis of the d-q coordinate system before a motor begins running. The alignment algorithm is shown in Figure 3-6. First, the position is set to zero, independent of the actual rotor position. (The value of the quadrature encoder does not affect this setting). Then the Id current is set to alignment current. The rotor is now aligned to the required position. After rotor stabilization, the encoder is reset to the zero position, then the Id current is set back to zero, and alignment is finished. The alignment is executed only once during the first transition from the Stop to Run state of the Run / Stop switch.
Designer Reference Manual 44 System Description For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
System Description System Blocks Concept
unknown rotor position (not aligned)
Freescale Semiconductor, Inc..
zero rotor position (aligned)
Figure 3-5. Rotor Alignment
Alignment
Set fixed position (0°)
Reset encoder position
Wait for rotor stabilization
Set position from encoder
Figure 3-6. Rotor Alignment Flow Chart
DRM018 - Rev. 0 MOTOROLA System Description For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 45
Freescale Semiconductor, Inc.
System Description
3.4.2 Current Sensing Phase currents are measured by a shunt resistor in each phase. A voltage drop on the shunt resistor is amplified by an operational amplifier, and shifted up by 1.65V. The resultant voltage is converted by an A / D converter (see Figure 3-7 and Figure 3-8).
Freescale Semiconductor, Inc..
Q1 SKB04N60
Q3 SKB04N60
Q5 SKB04N60
Q2 SKB04N60
Q4 SKB04N60
Q6 SKB04N60
sense
Figure 3-7. Current Shunt Resistors
R323 390
1.65V ref
C307 100nF
C306 3.3uF / 10V
LM285M U304
Figure 3-8. Current Amplifier
Designer Reference Manual 46 System Description For More Information On This Product, Go to: www.freescale.com
+ U301B MC33502D
1.65V + / - 1.65V
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
System Description System Blocks Concept
As shown in Figure 3-7, the currents cannot be measured at any moment. For example, the current flows through Phase A (and shunt resistor R1) only if transistor Q2 is switched on. Likewise, the current in Phase B can be measured if transistor Q4 is switched on, and the current in Phase C can be measured if transistor Q6 is switched on. To get a moment of current sensing, a voltage shape analysis must be done. The voltage shapes of two different PWM periods are shown in Figure 3-11. The voltage shapes correspond to center-aligned PWM sinewave modulation. As shown, the best moment of current sampling is in the middle of the PWM period, where all bottom transistors are switched on. To set the exact moment of sampling, the DSP56F80x family offers the ability to synchronize ADC and PWM modules via the SYNC signal. This exceptional hardware feature, patented by Motorola, is used for current sensing. The PWM outputs a synchronization pulse, which is connected as an input to the synchronization module TC2 (Quad Timer C, counter / timer 2). A high-true pulse occurs for each reload of the PWM, regardless of the state of the LDOK bit. The intended purpose of TC2 is to provide a user-selectable delay between the PWM SYNC signal and the updating of the ADC values. A conversion process can be initiated by the SYNC input, which is an output of TC2. The time diagram of the automatic synchronization between PWM and ADC is shown in Figure 3-9.
Freescale Semiconductor, Inc..
DRM018 - Rev. 0 MOTOROLA
Designer Reference Manual System Description For More Information On This Product, Go to: www.freescale.com 47
Freescale Semiconductor, Inc.
System Description
PWM COUNTER PWM SYNC
Freescale Semiconductor, Inc..
PWM GENERATOR OUTPUTS 0, 1
dead-time / 2 dead-time / 2
PWM PINS 0, 1
POWER STAGE VOLTAGE TC2 COUNTER TC2 OUTPUT ADC CONVERSION ADC ISR
dead-time
Figure 3-9. Time Diagram of PWM and ADC Synchronization However, all three currents cannot be measured from one voltage shape. The PWM period II in Figure 3-11 shows a moment when the bottom transistor of Phase A is switched on for a very short time. If the on-time is shorter than a critical time, the current can not be accurately measured. The critical time is given by hardware configuration (transistor commutation times, response delays of the processing
Designer Reference Manual 48 System Description For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
System Description System Blocks Concept
electronics, etc.). Therefore, only two currents are measured and a third current is calculated from the following equation:
(EQ 3-5.)
I. PWM PERIOD
II. PWM RELOAD
Freescale Semiconductor, Inc..
ADC sampling point
Figure 3-10. Voltage Shapes of Two Different PWM Periods
DRM018 - Rev. 0 MOTOROLA System Description For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 49
Freescale Semiconductor, Inc.
System Description
II. 1 duty cycle ratios 0.8 0.6 0.4 0.2 0 0
Phase A Phase B Phase C
Freescale Semiconductor, Inc..
360 angle
Sector 1 Sector 2 Sector 3 Sector 4 Sector 5 Sector 6
Figure 3-11. 3-phase Sinewave Voltages and Corresponding Sector Value A decision must now be m ade about which phase current should be calculated. The simplest technique is to calculate the current of the most positive voltage phase. For example, Phase A generates the most positive voltage within section 0 - 60°, Phase B within section 60° - 120°, and so on see Figure 3-11. In this case, the output voltages are divided into six sectors, as shown in Figure 3-11. The current calculation is then made according to the actual sector value. Sectors 1 and 6:
(EQ 3-6.)
Sectors 2 and 3:
(EQ 3-7.)
Designer Reference Manual 50 System Description For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
System Description System Blocks Concept
Sectors 4 and 5:
(EQ 3-8.)
NOTE:
The sector value is used for current calculation only, and has no other meaning in the sinewave modulation. But if we use any type of space vector modulation, we can get the sector value as part of space vector calculation.
Freescale Semiconductor, Inc..
(EQ 3-9.)
To speed up the initialization of the voltage sensing (the filter has exponential dependency with constant of 1 / N samples), the moving average filter, which calculates the average value from the last N samples, can be used for initialization:
(EQ 3-10.)
3.4.4 Power Module Temperature Sensing The measured power module temperature is used for thermal protection The hardware realization is shown in Figure 3-12. The circuit consists of four diodes connected in series, a bias resistor, and a noise suppression
DRM018 - Rev. 0 MOTOROLA System Description For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 51
Freescale Semiconductor, Inc.
System Description
(EQ 3-11.)
where:
Freescale Semiconductor, Inc..
Power module temperature in centigrades Diodes-dependent conversion constant Diodes-dependent conversion constant
D1 BAV99LT1
D2 BAV99LT1
C1 100nF
Figure 3-12. Temperature Sensing
Designer Reference Manual 52 System Description For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Designer Reference Manual - 3-Ph. PMSM Torque Vector Control
Section 4. Hardware Design
4.1 Contents
Freescale Semiconductor, Inc..
4.2 Hardware Set-up
DRM018 - Rev. 0 MOTOROLA Hardware Design For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 53
Freescale Semiconductor, Inc.
Hardware Design
Freescale Semiconductor, Inc..
Figure 4-1. High-Voltage Hardware System Configuration
Designer Reference Manual 54 Hardware Design For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Hardware Design DSP56F805EVM Controller Board
Freescale Semiconductor, Inc..
NOTE:
4.3 DSP56F805EVM Controller Board
The DSP56F805EVM is used to demonstrate the abilities of the DSP56F805 and to provide a hardware tool allowing the development of applications that use the DSP56F805. The DSP56F805EVM is an evaluation module board that includes a DSP56F805 part, peripheral expansion connectors, external memory
DRM018 - Rev. 0 MOTOROLA Hardware Design For More Information On This Product, Go to: www.freescale.com Designer Reference Manual 55
Freescale Semiconductor, Inc.
Hardware Design
Freescale Semiconductor, Inc..
Designer Reference Manual 56 Hardware Design For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Hardware Design 3-Ph BLDC Low Voltage Power Stage
DSP56F805
RESET LOGIC RESET SPI 4-Channel 10-bit D / A
MODE / IRQ LOGIC
MODE / IRQ
SCI #0
RS-232 Interface
DSub 9-Pin
Freescale Semiconductor, Inc..
Program Memory 64Kx16-bit
Address, Data & Control
CAN Interface SCI #1 CAN TIMER GPIO Peripheral Expansion Connector(s) Debug LEDs PWM LEDs Over V Sense Over I Sense Zero Crossing Detect
Data Memory 64Kx16-bit Memory Expansion Connector(s) JTAG Connector
JTAG / OnCE
Primary UNI-3
DSub 25-Pin
Parallel JTAG Interface
PWM #2
Secondary UNI-3
Low Freq Crystal
XTAL / EXTAL
Power Supply 3.3V, 5.0V & 3.3VA
Figure 4-2. Block Diagram of the DSP56F805EVM
4.4 3-Ph BLDC Low Voltage Power Stage
DRM018 - Rev. 0 MOTOROLA Hardware Design For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 57
Freescale Semiconductor, Inc.
Hardware Design
Input connections are made via 40-pin ribbon cable connector J13. Power connections to the motor are made with fast-on connectors J16, J17, and J18. They are located along the back edge of the board, and are labeled Phase A, Phase B, and Phase C. Power requirements are met with a 12-volt power supply that has a 10- to 16-volt tolerance. Fast-on connectors J19 and J20 are used for the power supply. J19 is labeled +12V and is located on the back edge of the board. J20 is labeled 0V and is located along the front edge. Current measuring circuitry is set up for 50 amps full scale. Both bus and phase leg currents are measured. A cycle by cycle overcurrent trip point is set at 46 amps. The LV BLDC power stage has both a printed circuit board and a power substrate. The printed circuit board contains MOSFET gate drive circuits, analog signal conditioning, low-voltage power supplies, and some of the large passive power components. This board also has a 68HC705JJ7 microcontroller used for board configuration and identification. All of the power electronics that need to dissipate heat are mounted on the power substrate. This substrate includes the power MOSFETs, brake resistors, current-sensing resistors, bus capacitors, and temperature sensing diodes. Figure 4-3 shows a block diagram.
Freescale Semiconductor, Inc..
POWER INPUT
BIAS POWER
BRAKE
SIGNALS TO / FROM CONTROL BOARD
MOSFET POWER MODULE GATE DRIVERS PHASE CURRENT PHASE VOLTAGE BUS CURRENT BUS VOLTAGE MONITOR BOARD ID BLOCK ZERO CROSS BACK-EMF SENSE TO MOTOR
Figure 4-3. Block Diagram
Designer Reference Manual 58 Hardware Design For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Hardware Design Motor-Brake Specifications
The electrical characteristics in Table 4-1 apply to operation at 25°C with a 12-Vdc supply voltage. Table 4-1. Electrical Chatacteristics of the 3-Ph BLDC Low Voltage Power Stage
Characteristic Motor Supply Voltage Quiescent current Symbol Vac ICC VIH VIL VOut ISense VBus IPK IRMS PBK PBK(Pk) Pdiss Min 10 - 2.0 - 0 - - - - - - - Typ 12 175 - - - 33 60 - - - - - Max 16 - - 0.8 3.3 - - 46 30 50 100 85 Units V mA V V V mV / A mV / V A A W W W
Freescale Semiconductor, Inc..
Min logic 1 input voltage Max logic 0 input voltage Analog output range Bus current sense voltage Bus voltage sense voltage Peak output current (300 ms) Continuous output current Brake resistor dissipation (continuous) Brake resistor dissipation (15 sec pk) Total power dissipation
4.5 Motor-Brake Specifications
The AC induction motor-brake set incorporates a 3-phase AC induction motor and attached BLDC motor brake. The AC induction motor has four poles. The incremental position encoder is coupled to the motor shaft, and position Hall sensors are mounted between motor and brake. They allow sensing of the position if required by the control algorithm. Detailed motor-brake specifications are listed in Table 4-2. In a target application a customer specific motor is used.
DRM018 - Rev. 0 MOTOROLA Hardware Design For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 59
Freescale Semiconductor, Inc.
Hardware Design
Table 4-2. Motor - Brake Specifications
Set Manufactured Motor Specification: EM Brno, Czech Republic eMotor Type: Pole-Number: Nominal Speed: AM40V 3-Phase AC Induction Motor 4 1300 rpm 3 x 200 V 0.88 A SG40N 3-Phase BLDC Motor 3 x 27 V 2.6 A 6 1500 rpm Baumer Electric BHK 16.05A 1024-12-5 1024
Freescale Semiconductor, Inc..
Nominal Voltage: Nominal Current: Brake Specification: Brake Type: Nominal Voltage: Nominal Current: Pole-Number: Nominal Speed: Position Encoder Type: Pulses per Revolution:
4.6 Hardware Documentation
Designer Reference Manual 60 Hardware Design For More Information On This Product, Go to: www.freescale.com
MB1 Motor-Brake AM40V + SG40N
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Hardware Design Hardware Documentation
Freescale Semiconductor, Inc..
DRM018 - Rev. 0 MOTOROLA Hardware Design For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 61
Freescale Semiconductor, Inc.
Hardware Design
Freescale Semiconductor, Inc..
Designer Reference Manual 62 Hardware Design For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Designer Reference Manual - 3-Ph. PMSM Torque Vector Control
Section 5. Software Design
5.1 Contents
Freescale Semiconductor, Inc..
5.2 Main Software Flow Chart
The main software flow chart incorporates the Main routine entered from Reset (see Figure 5-1) and Interrupt states (see Figure 5-2, Figure 5-4). The Main routine includes the initialization of the DSP and the main loop. The software consist of processes: Application Control, PM Synchronous Motor (PMSM) Control, Analog sensing, Position and Speed Measurement, and Fault Control. The Application Control process is the highest software level which precedes settings for other software levels. The input of this level is the Run / Stop switch, Up / Down buttons for manual control, and PC master software (via the registers shown in 5.3 Data Flow). This process is handled by Drive Control called from Main see Figure 5-1. The PMSM (PM Synchronous Motor) Control process provides most of the motor control functionality. It is executed mainly in Current Processing. Current Processing is called from ADC Complete Interrupt
DRM018 - Rev. 0 MOTOROLA Software Design For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 63
Freescale Semiconductor, Inc.
Software Design
Freescale Semiconductor, Inc..
Designer Reference Manual 64
DRM018 - Rev. 0 Software Design For More Information On This Product, Go to: www.freescale.com MOTOROLA
Freescale Semiconductor, Inc.
Software Design Main Software Flow Chart
Reset
DSP Initialization
Freescale Semiconductor, Inc..
Figure 5-1. Software Flow Chart - General Overview I The Check switch state routine handles manual switch control. This routine is called regularly in drive control processing state. It is responsible for software control flow due to reading the state of the RUN / STOP switch.
DRM018 - Rev. 0 MOTOROLA Software Design For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 65
Freescale Semiconductor, Inc.
Software Design
Freescale Semiconductor, Inc..
PWM: set duty cycles to pwmABC
Analog Sensing-ADC Phase Set set ADC converter phase current samples - two (easily measured) phases
Return
Figure 5-2. Software Flow Chart - ADC interrupt
Designer Reference Manual 66 Software Design For More Information On This Product, Go to: www.freescale.com DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Software Design Main Software Flow Chart
Freescale Semiconductor, Inc..
Return
Figure 5-3. Software Flow Chart - PWM A Fault interrupt
DRM018 - Rev. 0 MOTOROLA Software Design For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 67
Freescale Semiconductor, Inc.
Software Design
Interrupt D0 QTimer Speed Measurement Processing
PMSM Control Torque, and Alignment Processing: proceeds according to its status
Freescale Semiconductor, Inc..
get speed from Speed Measurement
LED Indication Processing
Return
Figure 5-4. S / W Flow Chart - General Overview
5.3 Data Flow
The PM synchronous motor vector control drive control algorithm is described in the data flow charts shown in Figure 5-5 and Figure 5-6.
Designer Reference Manual 68 Software Design For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Software Design Data Flow
The variables and constants described should be clear from their names.
Start / Stop Switch
Up / Down Buttons
PC Master
Green LED
appState
Freescale Semiconductor, Inc..
Application Control
pmsmCtrlStatus anSensingCtrlStatus
LED Indication
PHASEA, PHASEB, INDEX
PC Master Software
Position, Speed Measurement
Analog Sensing (Temperature, DCBus volt. Phase Currents a, b, c)
PMSM Control
reloadSWtmrSpeedControl reloadSWtmrAlignment pwmABC
PWM Generation
Figure 5-5. Data Flow - Part 1
DRM018 - Rev. 0 MOTOROLA Software Design For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 69
Freescale Semiconductor, Inc.
Software Design
PWM Faults
(Overvoltage / Overcurrent)
Check Index Position
faultCtrlStatus
Freescale Semiconductor, Inc..
Fault Control
pmsmCtrlStatus PWMEN bit
appFaultStatus PC Master Software
PWM Generation
PWM Outputs
Figure 5-6. Data Flow - Part 2 The data flows consist of the processes described in the following sections.
5.3.1 Application Control Process The Application Control process is the highest software level, which precedes settings for other software levels. The process state is determined by the variable appState. The application can be controlled either: · ·
Designer Reference Manual 70 Software Design For More Information On This Product, Go to: www.freescale.com
Manually From PC master software
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Software Design Data Flow
Freescale Semiconductor, Inc..
5.3.2 LED Indication Process This process controls the LED flashing according to appState.
5.3.3 Analog Sensing Process The Analog sensing process handles sensing, filtering and correction of analog variables (phase currents, temperature, DC Bus voltage).
5.3.5 PMSM (PM Synchronous Motor) Control Process The PMSM (PM Synchronous Motor) Control process provides most of the motor control functionality. Figure 5-7 shows the data flow inside the process PMSM Current control. It shows essential subprocesses of the process: Sine Cosine Transformations Current Control Speed and Alignment Control.
DRM018 - Rev. 0 MOTOROLA Software Design For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 71
Freescale Semiconductor, Inc.
Software Design
Freescale Semiconductor, Inc..
Designer Reference Manual 72 Software Design For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Software Design Data Flow
Freescale Semiconductor, Inc..
Current q Regulator
Current d Regulator
Feed Forward
Scaling DCBus Ripple Compensation
Space Vector Modulation
pwmABC svmSector
Figure 5-7. Data Flow - PMSM Control - Current Control
DRM018 - Rev. 0 MOTOROLA Software Design For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 73
Freescale Semiconductor, Inc.
Software Design
The Feed Forward process provides the following calculations:
coefBEMFShft
(EQ 5-1.)
(EQ 5-2.)
Freescale Semiconductor, Inc..
Designer Reference Manual 74 Software Design For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Software Design State Diagram
Freescale Semiconductor, Inc..
5.4 State Diagram
The software can be split into the processes shown in 5.3 Data Flow. The following processes are described below: · · · · Application Control Sate Diagram PMSM Control State Diagram Fault Control State Diagram Analog Sensing State Diagram
All processes start with the DSP Initialization state after Reset.
5.4.1 DSP Initialization The DSP Initialization state: · Initializes: - PWM - Application Control - PM Synchronous Motor Control - Analog Sensing
DRM018 - Rev. 0 MOTOROLA Software Design For More Information On This Product, Go to: www.freescale.com Designer Reference Manual 75
Freescale Semiconductor, Inc.
Software Design
- Fault Control - LED Indication · · · Sets manual application operating mode Enables masked interrupts Application Control: Initialization Triggers, which set all affected processes to the Begin Application Initialization state
Freescale Semiconductor, Inc..
5.4.2 Application Control State Diagram The Application Control process is detailed in Figure 5-8.
Application Control:
Application Control: Fault Fault Control: Begin Fault
Fault Control: Begin Fault
Figure 5-8. State Diagram - Application Control
Designer Reference Manual 76 Software Design For More Information On This Product, Go to: www.freescale.com DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Software Design State Diagram
Freescale Semiconductor, Inc..
5.4.3 PMSM Control State Diagram A state diagram of the Commutation Control process is illustrated in Figure 5-9.
DRM018 - Rev. 0 MOTOROLA Software Design For More Information On This Product, Go to: www.freescale.com Designer Reference Manual 77
Freescale Semiconductor, Inc.
Software Design
Application Control: Init
PMSM Control:
Initialization
done done
Freescale Semiconductor, Inc..
PMSM Control: Begin Stop or Fault clear RunFlag clear AlignFlag
Application Control: Begin Stop / Fault
PMSM Control: Alignment timeout search Current ramp Alignment Timeout PMSM Control: End Alignment Set Zero Position set AlignInitDoneFlag clear AlignFlag
done PMSM Control: Run
PMSM Control: Begin Run set RunFlag done
Designer Reference Manual 78 Software Design For More Information On This Product, Go to: www.freescale.com DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Software Design State Diagram
alignment state provides current control and timeout search. When alignment timeout occurs, End Alignment is entered. In that state, the Position Sensing Zero Position is set, so the position sensor is aligned with the real vector of the rotor flux. When the End Alignment state ends, the PMSM Control enters a regular Run state, where the motor is running at the required speed. If the Application Control state is set to Begin Stop or Begin Fault, the PMSM Control enters the Begin Stop or Fault, then the Stop or Fault.
Freescale Semiconductor, Inc..
DRM018 - Rev. 0 MOTOROLA Software Design For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 79
Freescale Semiconductor, Inc.
Software Design
Reset Fault Control:
DSP Initialization
Application Control: Init Fault Control: Application Initialization clear appFaultStatus pcb identification
Freescale Semiconductor, Inc..
done Fault Control: No Fault searching faults
Fault: Undervoltage (filtered) Overheating (filtered) Overcurrent (fault pin) Overvoltage (fault pin) wrong PCB Position Sensing fault
Figure 5-10. State Diagram Fault Control
5.4.5 Analog Sensing State Diagram The state diagram of the Analog Sensing subprocess is shown in Figure 5-11. The DSP Initialization state initializes hardware modules like ADC, synchronization with PWM, etc. In Begin Init, Initialization is started, so the variables for initialization sum and the InitDoneFlag are cleared. In the Init Proceed state, the temperature, DCBus voltage and phase current samples are sensed and summed. After required analog sensing, Init samples are sensed, and the Init Finished state is entered.
Designer Reference Manual 80 Software Design For More Information On This Product, Go to: www.freescale.com DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Software Design Scaling of Quantities
Reset
Freescale Semiconductor, Inc..
Figure 5-11. State Diagram - Analog Sensing
5.5 Scaling of Quantities
The PM synchronous motor vector 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:
- 1.0 SF +1.0 -2
(EQ 5-3.)
DRM018 - Rev. 0 MOTOROLA Software Design For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 81
Freescale Semiconductor, Inc.
Software Design
(EQ 5-4.)
Freescale Semiconductor, Inc..
where:
Fractional Value is the fractional representation of the real value Frac16 Real Values is the real value of the quantity V, A, RPM, etc. Real Quantity Range Max is the maximum of the quantity range, defined in the application V, A, RPM, etc.
(EQ 5-5.)
for Frac16 16-bit signed value and:
(EQ 5-6.)
Designer Reference Manual 82 Software Design For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Software Design Scaling of Quantities
for Frac32 32-bit signed value.
(EQ 5-7.)
Fractional form, a conversion from Fraction Value to Frac16 and Frac32 Value can be provided by the C language macro.
Freescale Semiconductor, Inc..
(EQ 5-8.)
where:
uFrac uReal Fractional representation of voltage - Real voltage quantities in physical units V
DRM018 - Rev. 0 MOTOROLA Software Design For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 83
Freescale Semiconductor, Inc.
Software Design
(EQ 5-9.)
Freescale Semiconductor, Inc..
where:
iFrac iReal Fractional representation of current quantities - Real current quantities in physical units A
NOTE:
Designer Reference Manual 84 Software Design For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Software Design Scaling of Quantities
5.5.3 Speed Scaling Speed quantities are scaled to the defined speed range maximum, which should be set lower than all speed variables in the application, so it was set higher than the maximum mechanical speed of the drive. The relationship between real and fractional representation of speed quantities is:
(EQ 5-11.)
Freescale Semiconductor, Inc..
where:
5.5.4 Position Scaling Position Scaling is described in 3.4.1.1 Position Sensing
5.5.5 Temperature Scaling As shown in 3.4.4 Power Module Temperature Sensing, the temperature variable does not have a linear dependency.
DRM018 - Rev. 0 MOTOROLA Software Design For More Information On This Product, Go to: www.freescale.com
Designer Reference Manual 85
Freescale Semiconductor, Inc.
Software Design 5.6 PI Controller Tuning
5.7 Subprocesses Relation and State Transitions
Freescale Semiconductor, Inc..
Designer Reference Manual 86 Software Design For More Information On This Product, Go to: www.freescale.com
DRM018 - Rev. 0 MOTOROLA
Freescale Semiconductor, Inc.
Designer Reference Manual - 3-Ph. PMSM Torque Vector Control
Section 6. System Setup
6.1 Contents
|