Datasheet
14. List of variables used in “motorcontrol.c”
The file “motorcontrol.c” includes the motor control algorithm routines. Please find below the description of the
variables used.
Label(s)
Type
Description
Unit
flgx
abyte_t
Char whose bits are used as flags
cnt_int
uint8_t
Counter for main loop synchronization
ium_off,
ivm_off,
iwm_off
uint16_t
A/D conversion offsets of measured u, v, w phase
currents; the A/D value is around 1024, that
corresponds to one half of the A/D converter supply
voltage (5Vdc) (10bits A/D); the offsets are converter
into internal current units
Internal current units
SystemPhase
uint16_t
Imposed electrical phase
Internal angles units
Phase_est
uint16_t
Estimated electrical phase
Internal angles unit
cr_ss
uint16_t
status memory for three-shunts current reading
trip_cnt
uint16_t
counter for phase-loss alarm detection
rpm_min,
rpm_max
int16_t
Minimum and maximum allowed speed.
rpm
XXXXXX_ep
int16_t
Some variables with suffix “_ep”: they are copies of
various parameters, used for EEPROM management.
c_poli
int16_t
Number of polar couples
stp_tim
int16_t
Start-up time.
mS
min_speed,
max_speed
int16_t
Minimum and maximum electrical speed.
Internal angular velocity
unit
min_speed_trip,
max_speed_trip
int16_t
Minimum and maximum electrical speed for phase lost
alarm detection
Internal angular velocity
unit
startup_cnt
int16_t
Counter for start-up.
startup_val
int16_t
Start-up time.
N° of sampling periods
delta_om
int16_t
One-step speed variation during start-up
Internal angular velocity
unit
om_chg
int16_t
End-of-start-up speed (equal to min_speed)
Internal angular velocity
unit
r_acc, r_dec
int16_t
Acceleration ramp, deceleration ramp.
rpm/main_loop_duration
krpmocp
int16_t
Conversion constant between mechanical speed and
electrical speed.
i_start
int16_t
Start-up current; during start-up, first a current ramp at
zero speed is imposed, then a speed ramp with constant
current (istart).
Internal current unit
i_max
int16_t
Maximum allowed current
Internal current unit
r_sta
int16_t
Stator resistance
Internal resistance unit
l_sync
int16_t
Synchronous inductance
Internal inductance unit
kp_cur, ki_cur
int16_t
Proportional and integral constant in current PI
controllers.