RL78/G1G Sensorless Speed control of 120-degree conducting controlled permanent magnetic synchronous motor (Implementation)
R01AN3582EJ0100 Rev.1.00
Page 38 of 46
Jan 13, 2017
Table 3-28
List of Macro definitions “mtr_spm_less_120.h” [1/4]
File name
Macro name
Definition value
Remarks
mtr_spm_less_
120.h
MTR_POLE_PAIRS
MP_POLE_PAIRS
Motor Pole pairs
MTR_TWOPI
2 * 3.14159265f
2
π
MTR_RPM_RAD
13726
Calculate parameter for
[rpm
]→[rad/s] (scale: Q3)
MTR_RAD_RPM
4889
Calculate parameter for
[rad/s]
→[rpm] (scale: Q12)
MTR_SPEED_LIMIT_RPM
3500
Speed limit Mechanical angle [rpm]
MTR_SPEED_LIMIT
MTR_SPEED_LIMIT_RPM
* MTR_TWOPI / 60
Speed limit Electrical angle [rad/s]
MTR_SPEED_PI_DECIMATION
0
Number of interrupt decimation times
for speed PI control
MTR_SPEED_PI_KP
(int16) CP_SPEED_PI_KP
Speed PI proportional gain
MTR_SPEED_PI_KI
(int16) CP_SPEED_PI_KI
Speed PI Integral gain
MTR_SPEED_PI_LIMIT_V
24 * 0x80
Voltage PI control output limit [V]
(scale: Q7)
MTR_SPEED_PI_I_LIMIT_V
24 * 0x80 * 0x80000
Voltage PI control output limit [V]
Integral part (for calculation)
(scale: Q12)
MTR_SPEED_CALC_BASE
576
Calculate parameter to translate
the timer counter to rotational speed
[rad/s] (scale: Q3)
MTR_CNT_START_CALC
30
Wait speed measurement still zero-
cross is detected become this counts
MTR_SPEED_LPF_K
(int16) CP_SPEED_LPF_K
Speed LPF parameter
MTR_LIMIT_SPEED_CHANGE
CP_LIMIT_SPEED_CHANGE
Step to increase speed reference
Electrical angle [rad/s]
MTR_MAX_DRIVE_V
(int16) 22 * 0x80
Maximum command voltage [V]
(scale: Q7)
MTR_MIN_DRIVE_V
(int16) 0.10 * 0x80
Minimum command voltage [V]
(scale: Q7)
MTR_MAX_BOOT_V
8.0 * 0x80
Maximum command voltage at draw-in
[V] (scale: Q7)
MTR_TIMEOUT_CNT
50
Timeout limit [ms]
MTR_STOP_BEMF
122
Value to judge motor stopped
MTR_SHIFT_ADJUST
2
Value of angle shift adjusting
MTR_OL_CTRL_PERIOD
15
Control period of open loop [ms]
MTR_OL_START_RPM
CP_OL_START_RPM
Speed of open loop at start-up
Mechanical angle [rpm]
MTR_OL_MODE1_CHANGE_RPM CP_OL_MODE1_CHANGE_RPM
Speed to change open loop mode1
Mechanical angle [rpm]
MTR_OL_MODE2_CHANGE_RPM CP_OL_MODE2_CHANGE_RPM
Speed to change open loop mode2
Mechanical angle [rpm]
MTR_OL_START_REFV
(int16) CP_OL_START_REFV
Voltage reference of open loop at start-
up [V]
MTR_OL_MODE1_RATE_RPM
CP_OL_MODE1_RATE_RPM
Increase step of speed at open loop
mode1 [rpm/control period]
MTR_OL_MODE2_RATE_REFV
(int16)
CP_OL_MODE2_RATE_REFV
Increase step of voltage at open loop
mode2 [V]
MTR_OL_MODE2_RATE_RPM
CP_OL_MODE2_RATE_RPM
Increase step of speed at open loop
mode2 [rpm/control period]