AN1917D Freescale Semiconductor / Motorola, AN1917D Datasheet - Page 15

no-image

AN1917D

Manufacturer Part Number
AN1917D
Description
3-Phase PM Synchronous Motor Control with Quadrature Encoder Using DSP56F80x
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
MOTOROLA
5.1.1 Read Latest Position
5.1.2 Period Measuring and Velocity Calculation
5.1.3 Speed Controller
5.1.4 3-phase Sinewave generation
5.2 Software Implementation
The main data flow can be divided to four parts:
Speed control starts with the required speed omega_required_mech . This variable is set by user
buttons or remotely by the PC within allowed limits. The variable omega_required_mech is
copied to omega_desired_mech at a defined moment. This variable is used as a shadow variable
to avoid change of the required speed from the PC at any time. The variable
omega_desired_mech is input to the speed PI controller as a reference value.
MeasuredTime incorporates a time period of one phase of the Quadrature Encoder. The time period
is used for speed calculation. Calculated speed, omega_actual_mech , is input to the speed PI
controller as a secondary input. The PI controller output determines the amplitude of the generated
sinusoidal output signals.
For the rotor position scanning the Timer A0, set as a quadrature counter, is used. The Timer A0 gives
the actual rotor position shifted by 90 electrical degrees after initialization. This rotor position
RotorPosition is input to the 3-phase sinewave modulation together with required amplitude
Amplitude . The result of the sinewave modulation is written directly to the PWM block. The rotor
position scanning with sinewave modulation is performed by an interrupt routine, which is called each
PWM reload (16 kHz). The next task, which is provided by an interrupt routine, is the calculation of
the spin direction. The result, DirectionSpinning, is used for the speed calculation.
The variable u_dc_bus contains the actual DC-Bus voltage. The value is used for an under-voltage
detection.
The process Read Latest Position is executed with each PWM Reload interrupt (16 kHz). The process
reads the actual rotor position and calculates the direction of spinning.
The processes, Period Measuring and Velocity Calculation, read the time between the adjacent edges
of
omega_actual_mech .
This process compares the required and actual speed and calculates the duty cycle of the PWM output
signals. For detailed information see
The process 3-phase Sinewave Generation calculates the PWM output from the actual rotor position
and the required sinewave amplitude. The output is written to the PWM module. This process is
performed within the PWM Reload interrupt.
The general software diagram shows the Main routine entered from Reset and the interrupt states (see
Figure
one
5-2).
Speed control
Velocity calculation
3-phase sinewave generation
DC-Bus voltage measurement
phase
of
3-Phase PMSM Control with Quadrature Encoder
Freescale Semiconductor, Inc.
the
For More Information On This Product,
Quadrature
Go to: www.freescale.com
Section 3.1.4, Speed Control
Encoder
and
calculates
the
actual
Software Design
motor
speed
15

Related parts for AN1917D