RX72M Group
Single-Chip Motor Control via EtherCAT Communications
R01AN5434EJ0110 Rev.1.10
Page 48 of 85
Aug.31.2020
5.22 R_MTR_GetErrorStatus
This function gets the error state of the encoder position and velocity control.
Format
uint16_t R_MTR_GetErrorStatus(uint8_t u1_id)
Parameters
u1_id
Specifies the ID of the motor to be controlled.
MTR_ID_A /* Motor A*/
Return Values
Error status
Properties
The prototypes are declared in r_mtr_driver_ecat_acces.h.
Description
The error states are described in the following list.
Macro Name
Value
Type of Error
MTR_ERROR_NONE
0x0000
No error
MTR_ERROR_OVER_CURRENT_HW 0x0001
Overcurrent error (H/W detection)
MTR_ERROR_OVER_VOLTAGE
0x0002
Inverter main line overvoltage error
MTR_ERROR_OVER_SPEED
0x0004
Rotation velocity error
MTR_ERROR_HALL_TIMEOUT
0x0008
Not in use
MTR_ERROR_BEMF_TIMEOUT
0x0010
Not in use
MTR_ERROR_HALL_PATTERN
0x0020
Hole detection angle error
MTR_ERROR_BEMF_PATTERN
0x0040
Not in use
MTR_ERROR_UNDER_VOLTAGE
0x0080
Inverter main line undervoltage error
MTR_ERROR_OVER_CURRENT_SW 0x0100
Overcurrent error (S/W detection)
MTR_ERROR_UNKNOWN
0xffff
Not in use
Example
uint16_t u2_error_status;
/* Get FOC error status */
u2_error_status = R_MTR_GetErrorStatus(MTR_ID_A);