Professional Documents
Culture Documents
ANF32X-24
Table of Contents
SUMMARY...................................................................................................................... 3
5 REFERENCE.......................................................................................................... 24
Summary
This applications note describes how to control an ACIM with the use of a frequency converter. The
theory behind the system and several different ways of speed-controlling an induction motor are
discussed. Finally an example of control-schemes are described and illustrated in code.
Looking at the motor from an electrical side, the ACIM consists of six coils, three coils in the stator and
three in the rotor (See Figure 2). Looking at these coils it is possible to make the electrical equivalent
diagram for the machine. This equivalent is represented by reactance's and resistors, here X = 2π•f•L [Ω].
Stator
Rotor
I1
RFE Xh
When the motor is loaded in the normal load area, the rotor-frequency will differ from the frequency
made from the rotational-field created on stator - the slip. In the equivalent this change can be described
as an adjustment of R'2 with the factor 1/s (see Figure 4), where s = the slip.
R1 X1 X’2 R’2
I1 I’2
1− s
RFE Xh R2 '
s
f * 60
n = n0 − ns = − ns [1]
p
where,
n0 is the rotational field created from stator.
ns is the slip speed.
p the number of polepairs.
This equation indicates the three ways of changing the speed on the shaft. Changing the slip, the polepairs
or the frequency. Slip-changes can only be done from either changing the rotor resistant (Phase-Wound
Motors) or the input-voltage on stator. Polepair change; again a direct change of the motor-windings,
where a coupling between different phases can be achieved. The last control-way is the frequency here
the only limit is the source added to the motor. If the voltage applied to the machine can be changed from
low voltage / frequency to high voltage /frequency an optimal speed-control is achievable.
I’2
1− s
UTH R2 '
s
U TH
I'2 = [3]
R TH + R' 2 /s + j(X TH + x'2 )
The torque for the machine can now be expressed from [4] - the torque as a function of the slip-change
and gives us:
T Tkip, nkip
n
1 = n/n0 n0
The area 0 < n/n0 < 1 is called the area for standard operation, here the machine is functioning as a motor.
When the ratio is moved to n/n0 > 1 the drive starts to work as a generator, the motor will in this area
contribute with a back-torque and deliver energy back though the powerstage. In this application note the
discussion is only concerning the motor-area.
As it can be seen at Figure 7 the system includes 4 basic blocks which are:
IV. Control-block - here all the necessary adjustment of the system are done. For the frequency
converter this control-block controls the inverter to deliver the wanted waveforms to the motor,
meaning the voltage to frequency ratio.
Today many power-electronic companies manufacture integrated power devices, in this case the
integration of the rectifiers, inverters and drive-circuit for the IGBT's are packaged in one or two chips
and can be bought as standalone devices with all the relevant electronics included. Such a device is
chosen for this demo-application. The device is International Rectifiers PowIRtrain (IRPTXXX1) but any
other power device could have been used.
At Figure 8 the voltage reference for one of the three phases with corresponding angle and PWM are
illustrated. The three-phase references VrefA, VrefB and VrefC can be expressed as:
1
For more information see http://www.irf.com/
2
For more information see applications note ANF32X-17
3
For more information see applications note ANF32X-3
where the displacement of the voltages are as expressed 120°. These three-phase references can be used
directly in this simple three-phase generation as control-voltages for the frequency converter with
sinusoidal reference.
3
Motorvoltage = Netvoltage = 0.866 * Netvoltage [9]
2
One of the simple ways of extending the usage of the DC-link voltages is by adding an extra harmonic to
the sinusoidal voltage reference. In this case the third harmonic are added which results in three phase
references expressed as:
By utilizing just the unity scaled sine as generation platform for the third harmonic, this results in a
maximum amplitude of 0.886*Netvoltage. By adjusting this value by 15.5% a better utilization of the
DC-bus voltage is achieved, meaning the efficiency from the distribution-net to the Power Inverter.
Vc Vc Vc
− • 100% = 15.5 % [11]
3 2 2
4
For more information see applications note ANF32X-11
It is known that a balanced three-phase set of voltages is represented in the stationary reference frame by
a space vector of constant magnitude, equal to the amplitude of the voltages, and rotating with angular
speed ω = 2π ⋅ fRe f . As can be seen at Figure 11, the eight possible states of an inverter are represented
as two null-vectors and six active-state vectors forming a hexagon. SVM now approximates the rotating
reference vector in each switching cycle by switching between the two nearest active-state vectors and the
null-vectors. In order to maintain the effective switching frequency of the power devices at a minimum,
the sequence of toggling between these vectors is organised such that only one leg is affected in every
step.
It may be anticipated that the maximum obtainable output voltage is increased with ordinary SVM up to
90% of the inverter capability. It is also a relatively easy task to improve this technique in order to reach
full inverter capability.
β
V3=(0,1,0) V2=(1,1,0)
II
Vd/2
III I
0 A B C V4=(0,1,1) V0=(0,0,0)
V V1=(1,0,0)
Vd V7=(1,1,1) α
IV VI
Vd/2
V
V5=(0,0,1) V6=(1,0,1)
a) b)
Plotting the control-angle with corresponding voltage-references is illustrated on Figure 12. The relations
between the voltage-reference the PWM-sequence can be seen on Figure 12 (2)
Max Voltage
Acceleration time
Frequency of Motor
Boost Speed Cut Speed
Voltage (Hz)
15 bit
Delta_init = , 15 bit = 32768 [15]
Number_of_steps
For the voltage profile the syntax is the same,
PWM_freq 1
PWMCycles_period = , Increment = [16]
MAX_FREQ PWMCycles_period
15 Bit
Boost Voltage = [17]
VOLT_SCALING
15 bit * BOOST_FREQ
Boost_speed = [18]
MAX_FREQ
15 bit * CUT_FREQ
Boost_speed = [19]
MAX_FREQ
15 bit * MAX_FREQ
Boost_speed = [20]
MAX_FREQ
All these general constants are defined in “main.h” and together with the associated macros (further
description see code section) they enable the full RAMP / Boost control. A specific macro is done to
calculate the acceleration speed anywhere in the code. The mathematical calculation of the parameters is
done in the "main.h" and the "v_f_ctrl.dsp" files.
As with the structure from the ADIs Standard Motor Control Library, macros are defined. For this
application six macros are used for configuration and update in the code. The following table reassumes
the set of macros that are defined with this application.
Operation Usage
Configuration of the IR_Reset IR_reset_PIO3;
Configuration of the Ramps Ramps_Init_Speed_profile;
Set the minimum speed Set_Minimum_Speed;
Set the acceleration of the speed ramp Ramps_Calculate_Speed_Profile(EXP,NOM)
Calculate the projecting voltage and angle V_F_ctrl_Calculate_Angle_volt
Update the SVM and calculate duty-cycle V_F_ctrl_SVM_Calculation
As already mentioned in the theory, these routines require some configuration constants, which are
declared in a dedicated section of the main include-file "main.h". If a routine require internal
configuration constants are declared in the associated include-file "Ramps.h", "V_F_CTRL.h" or
"IR_reset.h". The following section will explain each of the routines in details linked with the relevant
segments of code that are found in any of the files described in Table 1.
{ wait 10 usec }
cntr = 150;
do IR_delay until ce;
nop;
IR_delay: nop;
Clear_Bit_DM(PIODATA0, 3); { set PIO(3) low to enable the PowIRtrain }
IR_delay2: nop;
wait_IR:
Test_Bit_DM(SYSSTAT,0); { wait for PowIRtrain fault output to be }
{ deserted i.e. high }
If_Clr_Jump(rst);
rts;
.ENDMOD;
.MACRO ir_reset_PIO3;
call ir_reset_PIO3_;
.ENDMACRO;
ar = 0;
dm(speed_command) = ar;
dm(speed_profile) = ar;
dm(count) = ar;
dm(delta) = ar;
RTS;
my0 = Minimum_speed;
dm(Speed_command) = my0;
Over_Min_Speed:
RTS;
{**************************************************************************************}
* *
* Constants that need to be defined in main.h: *
* *
*.CONST Number_of_Steps = xxx; Number of steps in the ramp *
*.CONST Count_div = (PWM_freq/Number_of_Steps);Count number for timescaling *
*.CONST Delta_Init = xxx; stepsize for the speedsteps *
***************************************************************************************}
With these values declared, the ramp definition and calculation can be done in the
Ramps_Speed_Profiles_ routine.
Change the speed set point using a ramp profile. When a speed change is requested, produce a ramp, which
takes the chosen acceleration-time to get to next speed level. The input value for this ramp generator is the
value stored in init_count and the constant Delta_Init calculated in "main.h". The routine checks the
speed_command value. Is the value less than the last calculated speed_profile the value is decreased. If the
value of speed_command is bigger than last calculation the speed_profile are increased.
Ramps_Speed_Profiles_:
Calc_Profile:
ar = dm(init_count);
dm(count) = ar;
ar = Delta_Init; { Calculated in the main.h }
dm(delta)=AR;
ar = dm(speed_command);
ay0 = dm(speed_profile);
ar = ar-ay0;
if le jump negative_speed_change; { If speed_profile > Speed_command jump }
{ negative_speed_change }
}
Positive_Speed_Change:
ar = ABS ar;
ay0 = dm(delta);
ar = ar - ay0;
if le jump Done; { if speed_profile = Speedcommand jump Done }
Negative_Speed_Change:
ar = ABS ar;
ay0 = dm(delta);
ar = ar - ay0;
if le jump Done; { if speed_profile = Speedcommand jump Done }
Done:
End_Profile:
RTS;
CALL ramps_Speed_Profiles_;
.ENDMACRO;
From these values, the calculated constants for the voltage profile are defined and ready to use in the
related code. The complexity of the equations is easy to understand comparing with those of section 2.2.4.
The macro itself calls the V_F_ctrl_Calculate_Angle_volt_ routine which and returns with d/q voltage
references for the space vector modulation.
The routine consists of two parts. First section calculates the angle on base of the calculated angle
increment (Increment) and the speed_profile returned from the Ramps_Calculate_Speed_Profile macro.
V_F_ctrl_CALCULATE_ANGLE_VOLT_:
mr = 0; { Clear mr }
mr1 = dm(Theta); { Preload Theta }
mx0 = dm(Speed_Profile); { Load Speed profile signal }
my0 = Increment;
mr = mr + mx0*my0 (SS); { Compute new angle & store }
dm(Theta) = mr1;
Second section of the routine checks the Speed_profile and depending on the selected speed_profile see
Figure 13 the voltage is projected. Due to the SVM5, the voltage is applied in the d/q-frame and not the
standard three-phase frame. On additional parameter is included this code (V_F_SCALE) - The scaling
of voltages compared to the speed. By this meaning not an even ration of Voltage over Frequency
operation.
EX. The motor needs to run from 0 to 120 Hz but the applied voltage has to be max. at 60 Hz. (see
Figure 13). In this case the ratio of V/F is not one but two. This means that the slope actually has
to be twice the size. For that reason a gain factor V_F_SCALE ("main.h") is introduced. This
factor controls the scaling of the V/F (In the code an extra scaling of 8 is done to overcome higher
frequencies).
5
For further information see ANF32X-11,17
Boost_Frequency:
ar = dm(Speed_Profile);
ar = abs ar; { Check if speed is in the minimum speed range }
ay0 = Boost_speed;
ar = ar - ay0;
if ge jump Over_Boost_Frequency;
{ if speed_profile=>Boost_speed jump Over_Boost_Frequency }
my0 = Boost_voltage;
dm(voltage_profile) = my0;
JUMP Out_of_Voltage_setting;
Over_Boost_Frequency:
ar = dm(Speed_Profile);
ar = abs ar; { Check if speed is in the minimum speed range }
ay0 = Cut_Speed;
ar = ar - ay0;
if ge jump Max_voltage; { if speed_profile = Speedcommand jump Boost_added }
my0 = sr0;
dm(voltage_profile) = my0;
Max_voltage:
my0 = Maximum_voltage;
dm(voltage_profile) = my0;
DM(Vdq_ref)= my0; { Set constant Vdq reference (Voltage_profile,0) }
ar = pass 0;
DM(Vdq_ref+1)= ar;
Out_of_Voltage_setting:
RTS;
{*******************************************************************************************}
{ Set up SVM-module for transformation and SVM-generated PWM }
{*******************************************************************************************}
RTS;
.ENDMOD;
Next, the general systems constants and PWM configuration constants (main.h – see the next section) are
included. Also included are the Library functions for the PWM, ADC, DAC, Transformations to D/Q - Alpha
/ Beta, SVM and of course the applications specific routines - IR_reset, ramps and v_f_ctrl.
6
For further information see ANF32X-17
{***************************************************************************************
* Include General System Parameters and Libraries *
***************************************************************************************}
#include <main.h>;
#include <adcF32x.h>;
#include <autocalx.h>;
#include <pwmF32x.h>;
#include <refframe.h>;
#include <svpwm.h>;
#include <aux_dac.h>;
The first thing that is done in the initialisation block (Startup) is checking a selected PIO line for level. If the
PIO-pin is high jump to an ERASE BOOT FROM FLASH BIT routine in ROM and return. If not, just go
ahead with normal operation. This small macro is done to enable re-coding of the FLASH memory. For
further information (See Reference Manual). In this example the PIO-pin 6 is chosen as erase pin. Secondly
the Resetting of the PowerIRtrain is activated. Followed by the PWM block initialisation. Note how the
interrupt vectors for the PWMSync and PWMTrip service routines are passed as arguments. Then
initialisation of the ADC, AutoCalibration and AUXDAC block is completed. The next step is to initialise the
profiles used in the speed definition. As the next thing in the start-up sequence the interrupt IRQ2 is enabled
by setting the corresponding bit in the IMASK register after this the program enters a loop which just waits
for interrupts.
Finally all the variables declared in DM are initialised – This is done in the Main.h
{********************************************************************************************}
{ Start of program code }
{********************************************************************************************}
Startup:
PWM_Init(PWMSYNC_ISR, PWMTRIP_ISR);
ADC_Init;
AutoCal_INIT;
Write_AUXDAC_Init; { Initialize the use of AUXPWM channels as DAC }
Ramps_Init_Speed_profile;
rts;
The first thing that is done in the PWMSYNC_IRS is the Autocalibration. The Speed_command is read
though the converter on ADC1 and used as set-point for the control. With the call of Set_Minimum_Speed the
minimum selected speed (see "main.h") is selected. Using ramps_Calculate_Speed_Profile(0x5,0x4fff) the
acceleration time is set to 20 seconds and from here the Speed_profile value is used to calculate the Angle
and the Voltages. Finally the complete PWM sequence is calculated with the use of v
V_F_ctrl_SVM_Calculation. Before exiting the ISR the Auxiliary channels on the PWM block are updated –
used as DAC though a low-pass filter.
{********************************************************************************************}
{ PWM Interrupt Service Routine }
{********************************************************************************************}
PWMSYNC_ISR:
Auto_Calibrate;
ADC_Read(ADC1); { Read value on ADC1 }
{********************************************************************************
* Use the Write_AUXPWM macro to plot on AUXDAC for debugging *
********************************************************************************}
Write_AUXPWM(AUXCH0,Theta);
Write_AUXPWM(AUXCH1,Speed_Command);
RTI;
The PWM-Trip routine is in this example used to check on the trip pin on the PowerIR-train7. This TRIP-pin
is hardwired to the PWM_TRIP_PIN on the ADMCF32X device. When the PowerIRtrain’s pin goes low, in
the case of over-current or temperature the PWMTRIP_ISR check on the status of the pin. The actions are as
given
1. Check the PWMTRIP in the SYSSTAT – if high jump to restart
2. If not wait 80 µs – and then check SYSSTAT again
3. If it now has gone high call restart PWM …..
PWMTRIP_ISR:
{********************************************************************************
* PWM Trip Interrupt Service Routine *
********************************************************************************}
Trip_Ena:
CNTR = H#3FF ;
DO Wait0 UNTIL CE; { wait 80us}
Wait0: NOP;
Test_Bit_DM(SYSSTAT,0); { check the PWMTRIP input. Still low ? }
If_Clr_Jump(Trip_Ena);
DIS SEC_REG;
RTI;
{********************************************************************************
* After a shutdown - restart the PWM. *
********************************************************************************}
7
For more information look in datasheet on IRPTXXX family at www.irf.com
RESTART_PWM:
RTI;
.ENDMOD;
#include <admcf32x.h>;
#include <macro.h>;
#include <putvectr.h>; { Put_vector function }
#include <Flash_CT.h>; { Special Control unit for the Flash }
As described in the “The Library Documentation File”, every library routine has a section in main.h for its
configuration parameters. The following defines the parameters for the RAMPS and V_F_CTRL block used
in this example.
{********************************************************************************************}
{ Library: RAMP BLOCK }
{ file : Ramp.dsp }
{ Application Note: V/F control with the ADMCF32X }
.CONST Number_of_Steps = 256; { Number of steps in the ramp 8 bit }
.CONST Count_div = (PWM_freq/Number_of_Steps); { Count number for timescaling }
.CONST Delta_Init = (32768/Number_of_Steps) ; { stepsize for the speedsteps }
{********************************************************************************************}
{********************************************************************************************}
{ Library: V_F_CTRL BLOCK }
{ file : V_F_CTRL.dsp }
{ Application Note: V/f control with the ADMCF32X }
{********************************************************************************************}
……..
5 Reference
[1] A Tutorial in AC Induction and Permanent Magnet Synchronous Motors. Analog Devices Inc. '94.