Cur Mod
Cur Mod
Description This module takes as input both IQs and IDs, currents coming from the
PARK transform, as well as the rotor mechanical speed and gives the
rotor flux position.
IQs
pu
IDs Theta
pu CUR_MOD pu
Wr
pu
•
Each pre-initialized “_iq” CURMOD structure consumes 18 words in the
data memory
□
Code size mentioned here is the size of the calc() function
C Interface
Object Definition
The structure of CURMOD object is defined by following structure definition
CURMOD
The module definition is created as a data type. This makes it convenient to instance an
interface to the current model. To create multiple instances of the module simply declare
variables of type CURMOD.
CURMOD_handle
User defined Data type of pointer to CURMOD module
CURMOD_DEFAULTS
Structure symbolic constant to initialize CURMOD module. This provides the initial values
to the terminal variables as Well as method pointers.
Methods
void cur_mod_calc(CURMOD_handle);
This definition implements one method viz., the current model computation function. The
input argument to this function is the module handle.
Module Usage
Instantiation
The following example instances two CURMOD objects
CURMOD cm1, cm2;
Initialization
To Instance pre-initialized objects
CURMOD cm1 = CURMOD_DEFAULTS;
CURMOD cm2 = CURMOD_DEFAULTS;
Example
The following pseudo code provides the information about the module usage.
main()
{
cm1.Kr = parem1_1; // Pass parameters to cm1
cm1.Kt = parem1_2; // Pass parameters to cm1
cm1.K = parem1_3; // Pass parameters to cm1
}
Digital Control Systems (DCS) Group 3
Texas Instruments
Constant Computation Function
Since the current model module requires three constants (Kr, Kt, and K) to be input
basing on the machine parameters, base quantities, mechanical parameters, and
sampling period. These four constants can be internally computed by the C function
(cur_const.c, cur_const.h). The followings show how to use the C constant computation
function.
Object Definition
The structure of CURMOD_CONST object is defined by following structure definition
CURMOD_CONST
The module definition is created as a data type. This makes it convenient to instance an
interface to the current model constant computation module. To create multiple instances
of the module simply declare variables of type CURMOD_CONST.
CURMOD_CONST_handle
User defined Data type of pointer to CURMOD_CONST module
CURMOD_CONST_DEFAULTS
Structure symbolic constant to initialize CURMOD_CONST module. This provides the
initial values to the terminal variables as Well as method pointers.
Methods
void cur_mod_const_calc(CURMOD_CONST_handle);
This definition implements one method viz., the current model constant computation
function. The input argument to this function is the module handle.
Module Usage
Instantiation
The following example instances two CURMOD_CONST objects
CURMOD_CONST cm1_const, cm2_const;
Initialization
To Instance pre-initialized objects
CURMOD_CONST cm1_const = CURMOD_CONST_DEFAULTS;
CURMOD_CONST cm2_const = CURMOD_CONST_DEFAULTS;
Example
The following pseudo code provides the information about the module usage.
main()
{
Technical Background
With the asynchronous drive, the mechanical rotor angular speed is not by definition,
equal to the rotor flux angular speed. This implies that the necessary rotor flux position
cannot be detected directly by the mechanical position sensor used with the
asynchronous motor (QEP or tachometer). The current model module be added to the
generic structure in the regulation block diagram to perform a current and speed closed
loop for a three phases ACI motor in FOC control.
The current model consists of implementing the following two equations of the motor in
d,q reference frame:
di mR
i dS = TR + i mR
dt
1 dθ i qS
fs = =n+
ω b dt TR i mR ω b
Where We have:
Knowledge of the rotor time constant is critical to the correct functioning of the current
model as it is this system that outputs the rotor flux speed that will be integrated to get
the rotor flux position.
Assuming that i qSk +1 ≈ i qSk the above equations can be discretized as follows:
T
i mR k +1 = i mR k + (i dSk − i mR k )
TR
1 i qSk
f Sk +1 = n k +1 +
TR ωω b i mR k +1
In this equation system, T represents the Main loop control period. In a FOC control this
usually corresponds to the Timer 1 underflow interrupt period.
T 1
Let the two above equations constants and be renamed respectively K t and
TR TR ω b
K R . These two constants need to be calculated according to the motor parameters and
initialize into the cur_mod.c file.
Once the motor flux speed (fs) has been calculated, the necessary rotor flux position in
per-unit ( θ ) is computed by the integration formula:
θ = θ k -1 + Kf s k
where K = Tf b
The user should be aware that the current model module constants depend on the motor
parameters and need to be calculated for each type of motor. The information needed to
do so are the rotor resistance, the rotor inductance (which is the sum of the magnetizing
inductance and the rotor leakage inductance ( L R = L H + L σR )).
Next, Table 1 shows the correspondence of notations betWeen variables used here and
variables used in the program (i.e., cur_mod.c, cur_mod.h). The software module
requires that both input and output variables are in per unit values.
i dS IDs
n Wr
Output θ Theta
Others i mR IMDs