Motor Settings

List of commands related to motor setting values (register)

byte[0] Command Name explanation
0x02 maxSpeed Set maximum speed
0x03 minSpeed Set minimum speed
0x05 curveType Set acceleration/deceleration curve
0x07 acc Set acceleration
0x08 dec Set deceleration
0x0E maxTorque Set maximum torque
0x18 qCurrentP Set q-axis current PID gain (P)
0x19 qCurrentI Set q-axis current PID gain (I)
0x1A qCurrentD Set q-axis current PID gain (D)
0x1B speedP Set speed PID gain (P)
0x1C speedI Set speed PID gain (I)
0x1D speedD Set speed PID gain (D)
0x1E positionP Set position PID gain (P)
0x22 resetPID Reset PID gain
0x2E interface Determine the interface that outputs the measured values
0x3A ownColor Set unique color of device LED
0x40 readRegister Get the specified setting value
0x41 saveAllRegisters Save all settings to flash
0x4E resetRegister Reset specified settings
0x4F resetAllRegisters Reset all settings

 

0x02 : maxSpeed

Set the maximum speed of the motor

byte [0] [1] [2] [3] [4] [5] [6] [7] [8]
value 0x02 uint16_t identifier float maxSpeed uint16_t crc16
explanation command task management ID maximum speed [radian / second](positive value) cyclic redundancy check (for data error detection)

 

0x03 : minSpeed

Set the maximum speed of the motor

byte [0] [1] [2] [3] [4] [5] [6] [7] [8]
value 0x03 uint16_t identifier float minSpeed uint16_t crc16
explanation command task management ID minimum speed [radian / second](positive value) cyclic redundancy check (for data error detection)

 

0x05 : curveType

Specify acceleration/deceleration curve
(motion control settings)

byte [0] [1] [2] [3] [4] [5]
value 0x05 uint16_t identifier uint8_t curveType uint16_t crc16
explanation command task management ID acceleration/deceleration curve (following) cyclic redundancy check (for data error detection)


typedef enum curveType =
{

CURVE_TYPE_NONE = 0, // Motor control OFF

CURVE_TYPE_TRAPEZOID = 1, // Motion control ON (trapezoid acceleration/deceleration)

}

 

0x07 : acc

Set the motor acceleration

byte [0] [1] [2] [3] [4] [5] [6] [7] [8]
value 0x07 uint16_t identifier float acc uint16_t crc16
explanation command task management ID acceleration [radian / second^2](positive value) cyclic redundancy check (for data error detection)

 

0x08 : dec

Set the motor deceleration

byte [0] [1] [2] [3] [4] [5] [6] [7] [8]
value 0x08 uint16_t identifier float dec uint16_t crc16
explanation command task management ID deceleration [radian / second^2](positive value) cyclic redundancy check (for data error detection)

 

0x0E : maxTorque

Set the maximum torque (absolute value) of the motor

byte [0] [1] [2] [3] [4] [5] [6] [7] [8]
value 0x0E uint16_t identifier float maxTorque uint16_t crc16
explanation command task management ID max torque [N*m](positive value) cyclic redundancy check (for data error detection)

 

0x18 : qCurrentP

Set the P (proportional) gain of the motor q-axis current PID controller

byte [0] [1] [2] [3] [4] [5] [6] [7] [8]
value 0x18 uint16_t identifier float qCurrentP uint16_t crc16
explanation command task management ID q current P gain
(positive value)
cyclic redundancy check (for data error detection)

 

0x19 : qCurrentI

Set the I (integral) gain of the motor q-axis current PID controller

byte [0] [1] [2] [3] [4] [5] [6] [7] [8]
value 0x19 uint16_t identifier float qCurrentI uint16_t crc16
explanation command task management ID q current I gain
(positive value)
cyclic redundancy check (for data error detection)

 

0x1A : qCurrentD

Set the D (derivative) gain of the motor q-axis current PID controller

byte [0] [1] [2] [3] [4] [5] [6] [7] [8]
value 0x1A uint16_t identifier float qCurrentD uint16_t crc16
explanation command task management ID q current D gain
(positive value)
cyclic redundancy check (for data error detection)

 

0x1B : speedP

Set the P (proportional) gain of the motor speed PID controller

byte [0] [1] [2] [3] [4] [5] [6] [7] [8]
value 0x1B uint16_t identifier float speedP uint16_t crc16
explanation command task management ID speed P gain
(positive value)
cyclic redundancy check (for data error detection)

 

0x1C : speedI

Set the I (integral) gain of the motor speed PID controller

byte [0] [1] [2] [3] [4] [5] [6] [7] [8]
value 0x1C uint16_t identifier float speedI uint16_t crc16
explanation command task management ID speed I gain
(positive value)
cyclic redundancy check (for data error detection)

 

0x1D : speedD

Set the D (derivative) gain of the motor speed PID controller

byte [0] [1] [2] [3] [4] [5] [6] [7] [8]
value 0x1D uint16_t identifier float speedD uint16_t crc16
explanation command task management ID speed D gain
(positive value)
cyclic redundancy check (for data error detection)

 

0x1E : positionP

Set the P (proportional) gain of the motor position PID controller

byte [0] [1] [2] [3] [4] [5] [6] [7] [8]
value 0x1E uint16_t identifier float positionP uint16_t crc16
explanation command task management ID position P gain
(positive value)
cyclic redundancy check (for data error detection)

 

0x22 : resetPID

Reset all PID parameters to default firmware settings

byte [0] [1] [2] [3] [4]
value 0x22 uint16_t identifier uint16_t crc16
explanation command task management ID cyclic redundancy check (for data error detection)

 

0x2E : interface

Set the interface (communication path) that controls the motor.
This command is supported from KM-1 firmware ver 1.18 or later.

byte [0] [1] [2] [3] [4] [5]
value 0x2E uint16_t identifier uint16_t flag uint16_t crc16
explanation command task management ID bit flag cyclic redundancy check (for data error detection)

 

0x3A : ownColor

Set the unique LED color of the motor

byte [0] [1] [2] [3] [4] [5] [6] [7]
value 0x3A uint16_t identifier uint8_t red uint8_t green uint8_t blue uint16_t crc16
explanation command task management ID red color
0-255
green color
0-255
blue color
0-255
cyclic redundancy check (for data error detection)

 

0x40 : readRegister

Read the specified setting value

byte [0] [1] [2] [3] [4] [5]
value 0x40 uint16_t identifier uint8_t register uint16_t crc16
explanation command task management ID register (same as command) cyclic redundancy check (for data error detection)

 

0x41 : saveAllRegisters

Save all settings to flash memory

byte [0] [1] [2] [3] [4]
value 0x41 uint16_t identifier uint16_t crc16
explanation command task management ID cyclic redundancy check (for data error detection)

 

0x4E : resetRegister

Reset the specified register to the initial value of firmware

byte [0] [1] [2] [3] [4] [5]
value 0x4E uint16_t identifier uint8_t register uint16_t crc16
explanation command task management ID register cyclic redundancy check (for data error detection)

 

0x4F : resetAllRegisters

Reset all registers to initial firmware values

byte [0] [1] [2] [3] [4]
value 0x4F uint16_t identifier uint16_t crc16
explanation command task management ID cyclic redundancy check (for data error detection)