RL78/G1G Sensorless Speed control of 120-degree conducting controlled permanent magnetic synchronous motor (Implementation)
R01AN3582EJ0100 Rev.1.00
Page 24 of 46
Jan 13, 2017
Table 3-11
List of Functions “mtr_driver_access.c”
File name
Function name
Process overview
mtr_driver_access.c
R_MTR_SetSpeed
Input: (uint16) u2_ref_speed / speed command value
Output: None
Set the speed command value
R_MTR_SetDir
Input: (uint8) u1_dir / rotation direction
Output: None
Set the rotation direction
R_MTR_GetSpeed
Input: None
Output: (uint16) u2_speed_rpm / rotational speed
Obtain the calculated rotational speed
R_MTR_GetDir
Input: None
Output: (uint8) g_u1_direction / rotation direction
Obtain the rotation direction
R_MTR_GetStatus
Input: None
Output: (uint8) g_u1_mode_system / motor status
Obtain the motor status
Table 3-12
List of Functions “mtr_feedback.c”
File name
Function name
Process overview
mtr_feedback.c
mtr_pi_ctrl
Input: (MTR_PI_CTRL*) pi_ctrl / PI control structure
Output: (int16) s2_ref / PI control output value
PI control