RL78/G1G Sensorless Speed control of 120-degree conducting controlled permanent magnetic synchronous motor (Implementation)
R01AN3582EJ0100 Rev.1.00
Page 35 of 46
Jan 13, 2017
Table 3-24 List of Macro definitions
“main.h”
File name
Macro name
Definition value
Remarks
main.h
M_CW
0
Rotation direction
M_CCW
1
VOFFSET_MEASURE_CNT
CP_OFFSET_CALC_TIME
Counts for measurement of voltage offset [ms]
BOOT_REF_V
CP_BOOT_REF_V
Voltage reference at draw-in [V]
V_UP_PERIOD
CP_V_UP_TIME
Time to increase voltage step at draw-in [ms]
V_CONST_PERIOD
CP_V_CONST_TIME
Period of constant voltage at draw-in [ms]
MAX_SPEED
CP_MAX_SPEED_RPM
Maximum of rotational speed command
Mechanical angle [rpm]
MIN_SPEED
CP_MIN_SPEED_RPM
Minimum of rotational speed command
Mechanical angle [rpm]
MARGIN_SPEED
50.0f
Rotational speed command minimum value
creation constants for stop
Mechanical angle [rpm]
MARGIN_MIN_SPEED
MIN_SPEED - MARGIN_SPEED
Minimum of rotational speed to control motor stop
Mechanical angle [rpm]
OL_START_RPM
CP_OL_START_RPM
Speed of open loop at start-up
Mechanical angle [rpm]
OL_MODE1_CHANGE_RPM
CP_OL_MODE1_CHANGE_RPM
Speed to change open loop mode1
Mechanical angle [rpm]
OL_MODE2_CHANGE_RPM
CP_OL_MODE2_CHANGE_RPM
Speed to change open loop mode2
Mechanical angle [rpm]
OL_START_REFV
(int16) CP_OL_START_REFV
Voltage reference of open loop at start-up [V]
OL_MODE1_RATE_RPM
CP_OL_MODE1_RATE_RPM
Increase step of speed at open loop mode1
[rpm/control period]
OL_MODE2_RATE_REFV
(int16)
CP_OL_MODE2_RATE_REFV
Increase step of voltage at open loop mode2 [V]
OL_MODE2_RATE_RPM
CP_OL_MODE2_RATE_RPM
Increase step of speed at open loop mode2
[rpm/control period]
OL_MODE3_RATE_REFV
(int16)
CP_OL_MODE3_RATE_REFV
Increase step of voltage at open loop mode3 [V]
OL_MODE3_MAX_REFV
(int16)
CP_OL_MODE3_MAX_REFV
Maximum voltage of open loop [V]
LIMIT_SPEED_CHANGE
(int16)
CP_LIMIT_SPEED_CHANGE
Step to increase speed reference
Electrical angle [rad/s]
SPEED_PI_KP
(int16) CP_SPEED_PI_KP
Speed proportional gain
SPEED_PI_KI
(int16) CP_SPEED_PI_KI
Speed Integral gain
SPEED_LPF_K
(int16) CP_SPEED_LPF_K
Speed LPF parameter
SW_ON
0
Active in case of “Low”
SW_OFF
1
CHATTERING_CNT
10
Counts to remove chattering
VR1_SCALING
(MAX 422) / 0x200
Speed command value creation constant
ADJUST_OFFSET
0x1FF
Speed command value offset adjustment constant
POLE_PAIR
MP_POLE_PAIRS
Pole pairs
REQ_CLR
0
Clear VR1 stop command flag
REQ_SET
1
Set VR1 stop command flag