AN908
DS00908A-page 10
2004 Microchip Technology Inc.
The FdWeak.s file contains the function for field weak-
ening. The application code, as provided, does not
implement field weakening. Field weakening allows a
motor to be run at higher than the rated speed. At these
higher speeds, the voltage delivered to the motor is
kept constant while the frequency is increased.
A field weakening constant is defined in the User-
Parms.h file. This value is derived from the V/Hz con-
stant of the motor. The motor that was used to develop
this application has a working voltage of 230VAC and
is designed for an input frequency of 60Hz. Based on
these values, the V/Hz constant is 230/60 = 3.83. The
value of 3750 defined for the field weakening constant
in UserParms.h was empirically derived based on the
V/Hz constant of the motor and the absolute scaling of
A/D feedback values for the application.
When the motor operates within its rated speed and
voltage range, the reference for the I
d
control loop is
held constant. The field weakening constant in
UserParms.h is used as the reference value for the
control loop. In the normal operating range of the
motor, the rotor flux is kept constant.
If field weakening is implemented, the I
d
control loop
reference should be reduced linearly when the motor is
said to ‘run out of voltage’. The motor ‘runs out of volt-
age’ when the V/Hz ratio for the motor can not be main-
tained. For example, assume that you are driving a 230
VAC motor with a 115 VAC power source. Since the
motor is designed to run at 230 VAC and 60 Hz, the
motor would ‘run out of voltage’ at 30 Hz when operat-
ing from a 115 VAC supply. Above 30 Hz, the I
d
control
loop reference should be linearly reduced as a function
of frequency.
You can determine the drive frequency where your
ACIM application will run out of voltage by monitoring
the inverter DC bus voltage.
When operating in a region where field weakening
would be required, the I
d
and I
q
control loops will satu-
rate, which effectively limits the motor flux. The use of
field weakening allows the vector control algorithm to
limit its output without saturating the control loops. This
is one of the key benefits of field weakening. The oper-
ating range of the motor can be extended while closed
loop control is maintained.
You can experiment with field weakening in this
application by changing the defined reference value in
UserParms.h. By lowering this value, you can limit the
available voltage that can be delivered to the motor.
This file contains the
InvPark()
function, which pro-
cesses the voltage vector values, V
d
and V
q
, which are
generated by the inner PI current control loops. The
InvPark()
function ‘un-rotates’ the voltage vector
values to align them with the stationary reference
frame. The function produces the v
α
and v
β
values. The
rotation is accomplished using sine and cosine values
of the new rotor flux angle that was previously
calculated in the rotor current model equations.
This routine works the same for both integer scaling
and 1.15 scaling.
This file has two functions,
MeasCompCurr()
and
InitMeasCompCurr()
. The
MeasCompCurr()
function reads S/H channels CH1 and CH2 of the ADC,
scales them as signed fractional values using
qKa
,
qKb
and put the results
qIa
and
qIb
of
ParkParm
. A run-
ning average of the A/D offset is maintained and is
subtracted from the ADC value before scaling.
The
InitMeasCompCurr()
function is used to
initialize the A/D offset values at startup.
Scaling and offset variables associated with these
functions are kept in the
MeasCurrParm
data
structure, which is declared in the MeasCurr.h file.
This file contains the
OpenLoop()
function that calcu-
lates a new rotor flux angle when the application is
running open loop. The function calculates the change
in rotor flux angle for the desired operating speed. The
change in rotor flux angle is then added to the old angle
to set the new angle of the voltage vector.
This file contains the
CalcPI()
function, which
executes a PI controller. The
CalcPI()
function
accepts a pointer to a structure that contains the PI
coefficients, input and reference signals, output limits
and the PI controller output value.
This file contains the
ReadADC0()
and
ReadSignedADC0()
functions. These functions read
the data obtained from sample/hold Channel 0 of the
ADC, scale the value and store the results.
The
ReadSignedADC0()
function is currently used to
read a reference speed value from the potentiometer
on the demo board. If speed is obtained from another
source, these functions are not required for the
application.
This file has the
CalcSVGen()
function, which calcu-
lates the final PWM values as a function of the 3-phase
voltage vector.