RX72M Group
Single-Chip Motor Control via EtherCAT Communications
R01AN5434EJ0110 Rev.1.10
Page 38 of 85
Aug.31.2020
5.12 R_MTR_GetSpeed
This function gets the current velocity value in rpm.
Format
int16_t R_MTR_GetSpeed (uint8_t u1_id)
Parameters
u1_id
Specifies the ID of the motor to be controlled.
MTR_ID_A /* Motor A*/
Return Values
Current velocity [rpm]
Properties
The prototypes are declared in r_mtr_driver_acces.h.
Description
This function gets the velocity value at the time the function is executed. The unit is rpm.
A negative value indicates rotation being in the opposite direction to that of forward rotation.
Example
int16_t s2_speed;
/* Get current speed */
s2_speed = R_MTR_GetSpeed(MTR_ID_A);