RL78/G1G Sensorless Speed control of 120-degree conducting controlled permanent magnetic synchronous motor (Implementation)
R01AN3582EJ0100 Rev.1.00
Page 29 of 46
Jan 13, 2017
3.3
List of variables of sensorless 120-degree conducting control software
Lists of variables used in this control program are given below. However, note that the local variables are not
mentioned.
In the control programs in this application note use fixed-point calculation. Therefore, some variables are already
established with fixed-point calculation. Bits number in fractional part of fixed-point number is expressed in the Q
format. For example, a "Q3" number has 3 fractional bits. "Qn" number is indicated on "Scale" column in below table.
Table 3-17 List of variables [1/4]
Variable name
Type
Scale
Content
Remarks
g_u2_max_speed_rpm
uint16
-
Rotational speed command
maximum value
Mechanical angle [rpm]
g_u2_min_speed_rpm
uint16
-
Rotational speed command
minimum value
Mechanical angle [rpm]
g_u2_margin_min_speed_rpm
uint16
-
Rotational speed command
minimum value for motor stop
Mechanical angle [rpm]
g_u2_ref_speed_rpm
uint16
-
User setting rotational speed
Mechanical angle [rpm]
g_u1_rot_dir
uint8
-
User setting rotation direction
0: CW
1: CCW
g_u1_motor_status
uint8
-
User motor status management
0: Stop
1: Rotating
2: Error
g_u1_reset_req
uint8
-
Reset request flag
0: Turning SW2 ON in error status
1: Turning SW2 OFF in error status
g_u1_sw1_cnt
uint8
-
SW1 determination counter
Chattering removal
g_u1_sw2_cnt
uint8
-
SW2 determination counter
Chattering removal
g_u1_stop_req
uint8
-
VR1 stop command flag
g_s2_v_ref
int16
Q7
Voltage command value
Speed PI control output value [V]
g_s2_vdc_ad
int16
Q7
Inverter bus voltage A/D value
[V]
g_u2_pwm_duty
uint16
-
PWM duty
g_u2_ref_speed_rad
uint16
Q3
Speed reference (user selected)
value
Electrical angle [rad/s]
g_u2_speed_rad
uint16
Q3
Measured rotational speed
Electrical angle [rad/s]
g_s2_speed_lpf_k
int16
Q14
Speed LPF parameter
st_speed
MTR_PI
_CTRL
-
Structure for speed PI control
g_u2_vu_ad
uint16
-
U phase voltage A/D value
g_u2_vv_ad
uint16
-
V phase voltage A/D value
g_u2_vw_ad
uint16
-
W phase voltage A/D value
g_u2_vn_ad
uint16
-
Three-phase voltage average
A/D value
g_u2_cnt_ol_ctrl
uint16
-
Counter for open-loop process