RX72M Group
Single-Chip Motor Control via EtherCAT Communications
R01AN5434EJ0110 Rev.1.10
Page 25 of 85
Aug.31.2020
4. Motion Control Parameters
The definitions of the settings in the sample program for the motion control parameters set in the CiA402
objects are given below.
4.1 Velocity Parameters
In the sample program, the parameter serving as the unit of velocity is defined as the number counted from
the encoder per control cycle. Since the control cycle is very short, the velocity values are handled as fixed-
point numbers in 16.16 bit format after being multiplied by 2
16
, i.e. 65536.
For the conversion of the unit of velocity produced by counting from the encoder per second to the
corresponding control parameter, the number has to be multiplied by the number of control cycle time slices
in a second and then by 65536.
Since the control cycle of the sample program is 500 us, the velocity derived from 5000 being counted by the
encoder in a second is converted by the formula:
5000 × 0.0005 × 65536 = 163840
So, the corresponding velocity value is 163840.
4.2 Acceleration Parameters
In the sample program, the unit of acceleration parameter is defined as the number counted by the encoder
per square of the control cycle. In a similar way to the calculation and handling of velocity, the acceleration
and deceleration values are handled as fixed-point numbers in 16.16 bit format after being multiplied by 2
16
,
i.e. 65536.
For the conversion of unit from the number counted by the encoder count per second to the control
parameter, the number has to be multiplied by the square of the position cycle time slice and then by 65536.
Since the control cycle is 500 us, the acceleration derived from 5000 being counted by the encoder in a
second is converted by the formula:
5000 × 0.0005 × 0.0005 × 65536 = 81
So, the corresponding acceleration value is 81.
4.3
Conversion of Units by the RMW
The control parameters such as gain obtained through tuning by the motor control development support tool
"Renesas Motor Workbench" are reflected in the source code of the motor control program, so the same
values are also used in control via EtherCAT.
On the other hand, as the position and velocity command values that the RMW uses are in different units
from those specified for use as motion control parameters set in the CiA402 objects, conversion is required.
Table 4-1 lists the formulae used to convert command values used in the RMW into CiA402 object command
values.
Table 4-1 Command Value Conversion Formulae: RMW to CiA402
Item
RMW
Command
Value
CiA402
Command Value
Formulae
Data Type
Position
Θ[deg]
P
C
[count]
P
C
=
Θ
÷ 360 × CPR
INT32
Velocity
R[rpm]
S
C
[count/s]
SC = R ÷ 60 × CPR × T
S
× K
Q
INT32 (16.16)
Acceleration t
ACC
[s] *
1
A
C
[count/s
2
]
AC = R ÷ t
ACC
÷ 60 × CPR × T
S
× T
S
× K
Q
UINT32 (16.16)