Mks SERVO42D, SERVO57D User Manual

MKS SERVO42D/57D_CAN V1.0.3 User Manual
1
MKS SERVO42D/57D_CAN V1.0.3
USER MANUAL
manual
discription
firmware
date
V1.0.0
First release
V1.0.0
Mar-2023
V1.0.1
1.Added SR_OPEN, SR_CLOSE control mode.
V1.0.1
Apr-2023
2.It can set any working current.
3.Redefined speed and acceleration for serial Mode.
4. Add the "92" command , It can set the current position to 0 point.
5. Add the "8D" command, It can set the group address.
V1.0.2
1.Slave does not answer if broadcast address or group address is used.
V1.0.2
May-2023
2.OUT_1 port output stall indication.
V1.0.3
1. Add the "9A" command, It can set the parameter of 0_Mode.
V1.0.3
Jul-2023
2. Add the "8F" command, It can locked the key.
3. Add the "34" command, It can read the IO Ports status.
4. the number of slave addresses can be set by menu is change to 16.
5. add left and right endstop limit function.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
2

Part1. Feature

1.1 Interface

1. SERVO42D_CAN Interface
Note: EVCC/EGND is powered by SERVO42D 5V(20mA)
2. SERVO57D_CAN Interface
MKS SERVO42D/57D_CAN V1.0.3 User Manual
3

1.2 Key Operation

Key
Function
Next
move down
Enter
Confirm
Menu
Enter/exit parameter setting menu
3. How to View parameter
Press the Menu key to Enter the Menu press the Next key to move to the sub-option press the Enterkey, then it show the value.
4. How to setting Parameter
Press the Menu key to Enter the Menu
press the Next key to move to sub-option press the Enterkey, it show the value. press the Next key to move to the value press the Enterkey to set the value.

1.3 Parameter description

1. 0.0° - the angle of the motor shaft.(unit degree).
Note : It calculated based on the read encoder value, dynamically
displayed
2. 0.00err - the err of the motor shaft angle.
3. 0clk - the pulses have been received.

1.4 Work mode

Work Mode
MAX RPM
Work Current
OPEN
pulse interface
CR_OPEN
400RPM
Fixthe work current is Ma
serial interface
SR_OPEN
CLOSE
pulse interface
CR_CLOSE
1500RPM
Fixthe work current is Ma
serial interface
SR_CLSOE
vFOC
pulse interface
CR_vFOC
3000RPM
self-adaption, the Max current
is Ma
serial interface
SR_vFOC
Note1: The default work mode is CR_vFOC. Note2: It can work without encoder in“OPEN” work mode.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
4

Part2. Wire

2.1 Motor wire

Note: The motor internal resistance should be less than 10 ohms.
1. SERVO42D_CAN motor wire
2. SERVO57D_CAN motor wire
MKS SERVO42D/57D_CAN V1.0.3 User Manual
5

2.2 Pulse interface wire

Note: if the (STP/DIR/EN)signal high level is 3.3V,the COM must be 3.3V
if the (STP/DIR/EN)signal high level is 5.0V,the COM must be 5.0V
and so on.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
6

2.3 CAN wire

1. SERVO42D_CAN Single-slave
Note: Single slave communication does not need 120Ω Terminal.
2. SERVO57D_CAN Single-slave
Note: Single slave communication does not need 120Ω Terminal.
3. Multiple-slave
MKS SERVO42D/57D_CAN V1.0.3 User Manual
7

2.4 End stop wire

1. SERVO42D_CAN end stop wire
Note: EVCC/EGND is powered by SERVO42D 5V(20mA)
2. SERVO57D_CAN end stop wire
SW1
PIN
ON
OFF
3
EVCC/EGND is powered by SERVO57D 5V(20mA)
EVCC/EGND is powered by externally power.(3.3V-24V)
2
1
CAN 120Ω Terminal
NULL
Note: The mechanical switch only needs to be connected the "EGND, IN_1", and the SW1 pin2 must be in the ON state.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
8

2.5 IO Port Description

PORT
Function
57D
42D
IN_1
home or left-limit
IN_2
right-limit
Х
OUT_1
stall indication: 0-protected; 1-unprotected
Х OUT_2
reserved
Х

2.6 EndStop-limit Description

1. The EndStop-limit function needs to be turned on: (Menu -> EndLimit or serial command "90")
2. When first time to using the limit function or changing the limit parameters, it is necessary to go home; (Menu -> GoHome or serial command "91")
3. After the left-endstop is triggered, the motor will no longer run to the left;
4. After the right-endstop is triggered, the motor will no longer run to the right; (only for 57D)
MKS SERVO42D/57D_CAN V1.0.3 User Manual
9

Part3. Menu description

1. CAL : Calibrate the motor.
2. Mode : Work mode selection.
CR_OPEN pulse interface Open mode, the motor run without encoder CR_CLOSE pulse interface Close mode, the motor run with encoder. CR_vFOC pulse interface FOC mode, the motor run with encoder. SR_OPEN serial interface Open mode, the motor run without encoder SR_CLOSE serial interface Close mode, the motor run with encoder. SR_vFOC serial interface FOC mode, the motor run with encoder.
(Default: CR_vFOC)
Mode
MAX RPM
Work Current
OPEN
pulse interface
CR_OPEN
400RPM
Fixthe work current is Ma
serial interface
SR_OPEN
CLOSE
pulse interface
CR_CLOSE
1500RPM
Fixthe work current is Ma
serial interface
SR_CLSOE
vFOC
pulse interface
CR_vFOC
3000RPM
self-adaption, the Max current is
Ma
serial interface
SR_vFOC
Note: CR_CLOSE is better than CR_vFOC for 3D printing.
3. Ma : Set the current.
SERVO42D0200400...3000(mA) (default 1600mA) SERVO57D0400800...5200(mA) (default 3200mA) SERVO28D0200400...3000(mA) (default 600mA) SERVO35D0200400...3000(mA) (default 800mA) Other Current such as 123mA need to be set by serial command .It
will be added to the last options.
4. MStep : Set subdivisions.
Supports subdivision from 1 to 256. (Default: 16) subdivisions 1,2,4,8,16,32,64,128, and 256 can be set by Menu. Other subdivisions such as 67 subdivisions need to be set by
serial command.
5. En : Set the effective level of EN pin.
H High level is valid. L Low level is effective. Hold the driver board is always enabled. (Default: L)
6. Dir : Set the positive direction of motor rotation.
CW Clockwise rotation is positive
MKS SERVO42D/57D_CAN V1.0.3 User Manual
10
CCW Counterclockwise rotation is positive (Default: CW)
7. AutoSDD Set auto turn off the OLED screen.
Disable disable auto turn off the OLED
Enable enable auto turn off the OLED
(Default: Disable) If set to Enable, the screen will automatically turn off after
about 15 seconds, and any button can wake up the screen again.
8. Protect : Set the motor shaft locked-rotor protection function.
Disable: disable protection Enable: enable protection (Default: Disable) After this option is enabled, the protection will be triggered when it is detected to be locked-rotor, and the motor will be release. Note: you can release the protection status by pressing the Enter button or the serial command.
9. MPlyer : Set internal 256 subdivision.
(Default: Enable) Note: After this option is Enabled, it automatically enable internal 256 subdivision, it can reduce the vibration and noise when the motor at low speed.
10. CanRate Set the bit rate of CAN interface.
125K250K500K,1M (Default: 500K)
11. CanID: Set the the slave address of CAN interface.
01 09 10 (Default: 01) Note: The addresses greater than 10 need to be set by serial command. After it is set, it will be added to this option.
12. CanRSP : Choose whether the slave respond in speed/positon mode.
Disable: disable respond Enable: enable respond (Default: Enable) Note: If disable respond, It can query the running status of the motor by serial command “F1”.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
11
13. 0_Mode : The motor will go back to zero when power on.
Disable do not go back to zero. DirMode go back to zero with direction of CW or CCW (the direction is set in O_Dir menu). NearMode go back to zero with minimum angle. (Default: Disable)
14. Set 0 : Set the zero point for go back when power on.
(O_Mode must not be Disable)
15. 0_Speed : Set the speed of go back to zero point.
0 slowest. ... 4 fastest.
16. 0_Dir : Set the direction of go back to zero point.
CW Clockwise. CCW Counterclockwise. (Default: CW)
17. HmTrig Set the effective level of the end stop.
Low Low level is effective High High level is valid (Default: Low)
18. HmDir Set the direction of go home
CW Clockwise rotation is positive CCW Counterclockwise rotation is positive (Default: CW)
19. HmSpeed Set the speed (RPM) of go home
30 60 90 120 150 180
Other speed such as 600(RPM) need to be set by serial command .
It will be added to the last options.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
12
20. EndLimit : Set the endstop-limit function.
Disable: disable endstop-limit Enable: enable endstop-limit (Default: Disable)
21. GoHomeGo home
Note1: It need an “end stop”. The motor will keep running until it hits the limit switch. Note2: If the limit switch is already closed, the motor will rotate in the opposite direction to homeDir until the limit switch is opened, and then go home.
22. Restore : Reload the default parameters.
After restored the default parameters, it needs to Calibrate the motor. Note: Press the "Next" key first, then power on, it can quickly restore the default parameters.
23. About : Show version parameters.
24. Exit :Exit the parameter setting menu.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
13

Part4. CAN data format

The CAN uses standard frames.
Downlink package(PC → SERVO42D/57D)
CAN ID
DLC
byte1
byte2byte(n-1)
Byte(n)(n8)
ID
DLC(n)
code
data
Check(CRC)
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2byte(n-1)
Byte(n) (n8)
ID
DLC(n)
(code)
data
Check (CRC)
1. The CAN ID range is 00~2047.default is 01.
00 is the broadcast address; 01~10 can be set in the CanID option of the display menu; greater than 10 need to be set by serial commands.
2. The function code (code) executes the corresponding command.
for example, 0x80 executes the calibration command.
3. The Check code is CHECKSUM 8bit
CRC = (ID + byte1 + … + byte(n) ) & 0xFF
For example: command“01 30 CRC”
CRC = (0x01 + 0x30) & 0xFF = 0x31 & 0xFF = 0x31
Note: Slave does not answer if broadcast address is used.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
14

Part5. CAN command description

Note: Please set the CAN ID first.(default:01) The default CAN ID for the following chapters is 01.

5.1 Read parameter command

1. command1 : 01 30 CRC
read the encoder value(carry).
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
01 2 30
CRC(31)
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2byte5
byte6
byte7
byte8
01
8
code
carry
value
Check
30
carry(int32_t)
value(uint16_t)
CRC
carry: the carry vaule of the encoder. value: the current vaule of the encoder.(range 0~0x3FFF) When value is greater than 0x3FFF, carry +=1.
When Value is less than 0, carry -=1. For example: If the current carry|value is 0x3FF0, After one turn CCW,the carry|value
(+0x4000) is 0x13FF0.
If the current carry|value is 0x3FF0, After one turn CW,the carry|value (-
0x4000)is 0xFFFFFFFF3FF0.
The Cangaroo example is as follows:
MKS SERVO42D/57D_CAN V1.0.3 User Manual
15
2. command2 : 01 31 CRC
read the encoder value(addition).
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
01 2 31
CRC(32)
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2byte7
byte8
01
8
code
value
Check
31
value(int48_t)
CRC
After one turn clockwise,the value += 0x4000; After one turn CCW,the value -= 0x4000;
For example: If the current value is 0x3FF0, After one turn CCW,the value(+0x4000) is
0x7FF0.
If the current value is 0x3FF0, After one turn CW,the value(-0x4000) is 0xFFFFFFFFFFF0.
3. Command3 : 01 32 CRC
Read the real-time speed of the motor.(RPM)
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
01 2 32
CRC(33)
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2byte3
byte4
01
4
code
data
Check
32
speed(int16_t)
CRC
Note : if it run CCW,the speed > 0 (RPM)
if it run CW,the speed < 0 (RPM)
MKS SERVO42D/57D_CAN V1.0.3 User Manual
16
4. Command4 : 01 33 CRC
Read the number of pulses received.
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
01 2 33
CRC(34)
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2byte5
byte6
01
6
code
data
Check
33
pulses(int32_t)
CRC
5. Command6 : 01 34 CRC
read the IO Ports status.
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
01 2 34
CRC(3B) Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
34
status(uint8_t)
CRC
status
bit7
bit6
bit5
bit4
bit3
bit2
bit1
bit0
reserved
OUT_2
OUT_1
IN_2
IN_1
6. Command5 : 01 39 CRC
read the error of the motor shaft angle.
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
01 2 39
CRC(3A)
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2byte5
Byte6
01
4
code
data
Check
39
error(int32_t)
CRC
MKS SERVO42D/57D_CAN V1.0.3 User Manual
17
The error is the difference between the angle you want to control
minus the real-time angle of the motor, 0~51200 corresponds to
0~360°.
for example, when the angle error is 1°, the return error is
51200/360= 142.222, and so on.
7. Command6 : 01 3A CRC
read the En pins status.
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
01 2 3A
CRC(3B) Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
3A
enable(uint8_t)
CRC
enable =1 Enabled
enable =0 Disabled
8. Command7 : 01 3B CRC
Read the go back to zero status when power on.
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
01 2 3B
CRC(3C) Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
3B
status(uint8_t)
CRC
status =0 going to zero.
status =1 go back to zero success.
status =2 go back to zero fail.
9. Command8 : 01 3D CRC
Release the motor shaft locked-rotor protection state.
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
01 2 3D
CRC(3E) Uplink framePC SERVO42D/57D
MKS SERVO42D/57D_CAN V1.0.3 User Manual
18
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
3D
status(uint8_t)
CRC
status =1 release success.
status =0 release fail.
10. Command9 : FA 01 3E CRC
Read the motor shaft protection state.
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
01 2 3E
CRC(3F)
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
3E
status(uint8_t)
CRC
status =1 protected.
status =0 no protected.

5.2 Set parameters command

1. Calibrate the encoder
Same as the "Cal" option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
01 3 80
00
CRC(81) Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
80
status(uint8_t)
CRC
status =0 Calibrating.
status =1 Calibrated success.
status =2 Calibrating fail.
Note : The motor must be unloaded.
2. Set the work mode
Same as the "Mode" option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
82
mode (0~5)
CRC
MKS SERVO42D/57D_CAN V1.0.3 User Manual
19
mode = 0 CR_OPEN
mode = 1 CR_CLOSE
mode = 2 CR_vFOC
mode = 3 SR_OPEN
mode = 4 SR_CLOSE
mode = 5 SR_vFOC
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
82
status(uint8_t)
CRC
status =1 Set success.
status =0 Set fail.
Mode
MAX RPM
Work Current
OPEN
pulse interface
CR_OPEN
400RPM
Fixthe work current is the Ma
serial interface
SR_OPEN
CLOSE
pulse interface
CR_CLOSE
1500RPM
Fixthe work current is the Ma
serial interface
SR_CLSOE
vFOC
pulse interface
CR_vFOC
3000RPM
self-adaption, the Max current is
the Ma
serial interface
SR_vFOC
3. Set the current
Same as the "Ma" option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2-3
Byte4
01
3
code
data
Check
83
ma (uint16_t)
CRC
Note:the new current will show in the screen of Ma option.
SERVO42D/28D/35D: Maximum Current =3000mA
SERVO57D: Maximum Current =5200mA
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
83
status(uint8_t)
CRC
status =1 Set success.
status =0 Set fail.
4. Set subdivision
Same as the "MStep" option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
MKS SERVO42D/57D_CAN V1.0.3 User Manual
20
84
micstep(00~FF)
CRC
Note:the new micstep will show in the screen of MStep option.
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
84
status(uint8_t)
CRC
status =1 Set success.
status =0 Set fail.
5. Set the active of the En pin
Same as the "En" option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
85
enable(00~02)
CRC
enable = 00 active low (L)
enable = 01 active high (H)
enable = 02 active always (Hold)
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
85
status(uint8_t)
CRC
status =1 Set success.
status =0 Set fail.
6. Set the direction of motor rotation
Same as the "Dir" option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
86
dir(00~01)
CRC
dir = 00 CW
dir = 01 CCW
MKS SERVO42D/57D_CAN V1.0.3 User Manual
21
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
86
status(uint8_t)
CRC
status =1 Set success.
status =0 Set fail.
7. Set auto turn off the screen function
Same as the " AutoSDD " option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
87
enable(00~01)
CRC
enable = 01 enabled
enable = 00 disabled
If set to Enable, the screen will automatically turn off after about 15 seconds, and any button can wake up the screen again.
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
87
status(uint8_t)
CRC
status =1 Set success.
status =0 Set fail.
8. Set the motor shaft locked-rotor protection function
Same as the "Protect" option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
88
enable(00~01)
CRC
enable = 01 enabled protection
MKS SERVO42D/57D_CAN V1.0.3 User Manual
22
enable = 00 disabled protection
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
88
status(uint8_t)
CRC
status =1 Set success.
status =0 Set fail.
Note: you can release the protection status by pressing the Enter
button or the serial command.
9. Set the subdivision interpolation function
Same as the "Mplyer" option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
89
enable(00~01)
CRC
enable = 01 enabled interpolation function.
enable = 00 disabled interpolation function.
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
89
status(uint8_t)
CRC
status =1 Set success.
status =0 Set fail.
10. Set the CAN bitRate
Same as the "CanRate" option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
8A
bitRate (00~03)
CRC
bitRate = 00 125K
bitRate = 01 250K
MKS SERVO42D/57D_CAN V1.0.3 User Manual
23
bitRate = 02 500K
bitRate = 03 1M
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
8A
status(uint8_t)
CRC
status =1 Set success.
status =0 Set fail.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
24
11. Set the CAN ID
Same as the "CanID" option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
byte4
01
4
code
data
Check
8B
ID(00~7FF)
CRC
Note1:the new address will show in the screen of CanID option.
Note2: 0 is the broadcast address
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
8B
status(uint8_t)
CRC
status =1 Set success.
status =0 Set fail.
12. Set the slave respond
Same as the "CanRSP" option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
8C
enable(00~01)
CRC
enable = 01 enabled respond
enable = 00 disabled respond
Note: If disable respond, It can query the running status of the
motor by command “F1”.
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
8C
status(uint8_t)
CRC
status =1 Set success.
status =0 Set fail.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
25
13. Set the key lock or unlock
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
8F
enable(00~01)
CRC
enable = 01 lock the key
enable = 00 unlock the key
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
8F
status(uint8_t)
CRC
status =1 Set success.
status =0 Set fail.
14. Set the group ID
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
byte4
01
4
code
data
Check
8D
ID(01~0x7FF)
CRC Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
8D
status(uint8_t)
CRC
status =1 Set success.
status =0 Set fail.
For example, there are 6 motors with the settings ID:
Broadcast ID
Slave ID
Group ID
motor 1 0 1
0x50
motor 2 0 2
0x50
motor 3 0 3
0x50
motor 4 0 4
0x51
motor 5 0 5
0x51
motor 6 0 6
0x51
send 01 FD 01 2C 64 00 00 0C 80 1B, motor 1 will rotate a turn
send 00 FD 01 2C 64 00 00 0C 80 1A, motor1-6 will rotate a turn
send 50 FD 01 2C 64 00 00 0C 80 6A, motor1-3 will rotate a turn
send 51 FD 01 2C 64 00 00 0C 80 6B, motor4-6 will rotate a turn
Note: Slave does not answer if group address is used.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
26

5.3 Set Home command

1. Set the parameter of home
Same as the HmTrigHmDirHmSpeed option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
byte4-5
Byte6
Byte7
01
7
code
level
dir
speed
enable
Check
90
homeTrig
homeDir
homeSpeed
EndLimit
CRC
homeTrig the effective level of the end stop
0Low
1High
homeDir the direction of go home
0 CW
1CCW
homeSpeed the speed of go home
0~3000 (RPM)
EndLimit
0: disable endstop-limit 1: enable endstop-limit
Note : The speed description can be found in Chapter 6.1.
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
90
status(uint8_t)
CRC
status =1 set success.
status =0 set fail.
2. Go home
Same as the GoHome option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
01 2 91
CRC(92)
Note1: If the limit switch is already closed, the motor will
rotate in the opposite direction to homeDir until the limit
switch is opened, and then go home.
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
91
status(uint8_t)
CRC
status =0 go home fail.
status =1 go home start.
status =2 go home sucess.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
27
3. Set Currnet Axis to zero
It can set the current Axis to Zero. Just as “GoHome”without
run the motor.
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
01 2 92
CRC(93) Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
92
status(uint8_t)
CRC
status =0 set fail.
status =1 set success.

5.4 Set 0_Mode command

In 0_Mode, the motor can automatically return to the 0 point
position when power on. The maximum angle is 359 degrees.
1. Set the parameter of 0_Mode
Same as the 0_ModeSet 00_Speed0_Dir option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
byte4
Byte5
Byte6
01
5
Function
0_Mode
Set 0
0_Speed
0_Dir
Check
9A
mode
enable
speed
dir
CRC
mode:
0Disable do not go back to zero
1DirMode go back to zero with direction 2: NearMode go back to zero with minimum angle
enable:
0 clean zero
1 set zero
speed:
0 ~ 4 0:slowest 4:fastest
dir:
0 CW
1 CCW
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
9A
status(uint8_t)
CRC
status =0 set fail.
status =1 set success.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
28

5.5 Restore the default parameter

Same as the "Restore" option on screen
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
01 2 3F
CRC(40) Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
3F
status(uint8_t)
CRC
status =1 restore success.
status =0 restore fail.
Note1: After restored the parameters, It will reboot again,and need to calibrate the motor. Note2: Press the“Next”key,then power on the motor, the default parameter will be restored.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
29

Part6. Run the motor by CAN command

Note: This chapter needs to set the working mode to serial mode. (SR_OPEN/SR_CLOSE/SR_VFOC)

6.1 Description the parameters of speed and acceleration

1.speed
The speed parameter ranges from 0 to 3000. The larger the value, the faster the motor rotates.
When speed = 0, the motor stops rotating.
The maximum speed of the control mode is as follows:
Control mode
Max speed
Open mode Pulse interface
CR_OPEN
400(RPM)
Serial interface
SR_OPEN
Close mode Pulse interface
CR_CLOSE
1500(RPM) Serial interface
SR_CLSOE
FOC mode Pulse interface
CR_vFOC
3000(RPM) Serial interface
SR_vFOC
If the set speed is greater than the maximum speed of the control mode, the motor runs at the maximum speed of the control mode.
Note: The speed value is calibrated based on 16/32/64 subdivisions, and the speeds of other subdivisions need to be calculated based on 16 subdivisions.
For example, setting speed=1200
At 8 subdivisions, the speed is 2400 (RPM)
At 16/32/64 subdivisions, the speed is 1200 (RPM)
At 128 subdivisions, the speed is 150 (RPM)
MKS SERVO42D/57D_CAN V1.0.3 User Manual
30
2. acceleration
The value of the acceleration(acc) ranges from 0 to 255. The larger the value, the faster the motor accelerates/decelerates.
If acc=0, the motor runs without acceleration or deceleration, and runs directly at the set speed.
accelerates
Suppose at time t1the current speed is V
t1 (Vt1
< speed) at time t2the current speed is Vt2 t2 – t1 = 256-acc* 50 (uS)
The relationship between the current speed Vti, acc, and speed is
as follows:
Vt2 = Vt1 + 1 (Vt2 <= speed)
For example: acc = 236,speed = 3000
T(ms)
speedRPM
T(ms)
speed (RPM)
0
0 … … 1
1 … … 2
2
2998
2998 3 3
2999
2999 … …
3000
3000
decelerates
Suppose at time t1the current speed is V
t1 (Vt1
> speed) at time t2the current speed is Vt2 t2 – t1 = 256-acc* 50 (uS)
The relationship between the current speed Vti, acc, and speed is
as follows:
Vt2 = Vt1 - 1 (Vt2 >= speed)
MKS SERVO42D/57D_CAN V1.0.3 User Manual
31

6.2 Query/Enable the motor command

1. Query the motor status
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
01 2 F1
CRC(F2) Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
F1
status(uint8_t)
CRC
status = 0 query fail. status = 1 motor stop status = 2 motor speed up status = 3 motor speed down status = 4 motor full speed status = 5 motor is homing
2. Enable the motor
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
F3
en(00~01)
CRC
en = 00 disable. en = 01 enable.
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
F3
status(uint8_t)
CRC
status =1 Set success. status =0 Set fail.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
32

6.3 Speed mode command

In speed mode, the motor can be run with a fixed acceleration and
speed.
1. Run the motor in speed mode
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte 2
byte 3
byte 4
byte 5
01
5
code
dir
Rev
speed
acc
Check
F6
b7
b6-b4
b3-b0
b7-b0
acc
CRC
dir
——
speed
byte2: The highest bit indicates the direction, the lower 4 bits
and byte3 together indicate the speed
byte3: The lower 4 bits of byte2 and byte3 together indicate
speed
The parameter description is as follows: dir: the value range is 0/1 (CCW/CW) speed: the speed, the value range is 0-3000 acc: the acceleration, the value range is 0-255
for example Send “01 F6 01 40 02 3A”, the motor rotates forward at acc=2, speed=320RPM Send “01 F6 81 40 02 BA”, the motor reverses at acc=2, speed=320RPM
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
F6
status(uint8_t)
CRC
status = 1 run success. status = 0 run fail. Note: the Uplink framecan be disable by MenuCanRSPor Command “8C”.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
33
2. Stop the motor in speed mode
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte 2
byte 3
byte 4
byte 5
01
5
code
dir
Rev
speed
acc
Check
F6
b7
b6-b4
b3-b0
b7-b0
acc
CRC
0 0 0
The stop command can stop the motor slowly, or stop the motor
immediately.
When setting acc ≠ 0, the motor decelerates and stops slowly When setting acc = 0, the motor stops immediately
Deceleration and stop the motor slowly (acc ≠ 0)
for example: Send 01 F6 00 00 02 F9 Stop the motor with deceleration acc=2
Immediate stop command (acc = 0) for example: Send 01 F6 00 00 00 F7 Stop the motor immediately
Note: If the motor rotating more than 1000RPM, it is not a good
idea to stop the motor immediately!
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
F6
status(uint8_t)
CRC
status = 0 stop the motor fail. status = 1 start to stop the motor. status = 2 stop the motor success.
Note: the Uplink framecan be disable by MenuCanRSPor Command “8C”.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
34
3. Save/Clean the parameter in speed mode
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
FF
state
CRC
state = C8 Save. state = CA Clean.
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
FF
status(uint8_t)
CRC
status = 1 success. status = 0 fail.
NoteThe motor can rotates clockwise or counterclockwise at a constant speed when powered on.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
35

6.4 Position mode1: relative motion by pulses

In the position control mode1, the motor can be run to the
specified position with the set acceleration and speed.
1. Run the motor in position mode1
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte 2
byte 3
byte 4
byte 5-7
byte 8
01
8
code
dir
Rev
speed
acc
pulses
Check
FD
b7
b6-b4
b3-b0
b7-b0
acc
pulses
CRC
dir
——
speed
byte2: The highest bit indicates the direction, the lower 4 bits
and byte3 together indicate the speed
byte3: The lower 4 bits of byte2 and byte3 together indicate
speed
The parameter description is as follows: dir: the value range is 0/1 (CCW/CW) speed: the speed, the value range is 0-3000 acc: the acceleration, the value range is 0-255
pulses: the motor run steps, the value range is 0 – 0xFFFFFF
for example: Send 01 FD 01 40 02 00 FA 00 3B, the motor rotates 20 times in the forward direction with acc=2, speed=320RPM (16 subdivisions); Send 01 FD 81 40 02 00 FA 00 BB, the motor rotates 20 times in the reverse direction with acc=2, speed=320RPM (16 subdivisions);
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
FD
status(uint8_t)
CRC
status = 0 run fail. status = 1 run starting…. status = 2 run complete. status = 3 end limit stoped.
Note: the Uplink framecan be disable by MenuCanRSPor Command “8C”.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
36
2. Stop the motor in position mode1
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte 2
byte 3
byte 4
byte 5-7
byte 8
01
8
code
dir
Rev
speed
acc
pulses
Check
FD
b7
b6-b4
b3-b0
b7-b0
acc 0 CRC
0 0 0
The stop command can stop the motor slowly, or stop the motor
immediately.
When setting acc ≠ 0, the motor decelerates and stops slowly When setting acc = 0, the motor stops immediately
Deceleration and stop the motor slowly (acc ≠ 0) for example: Send 01 FD 00 00 04 00 00 00 02 Stop the motor with deceleration acc=4
Immediate stop command (acc = 0) for example: Send 01 FD 00 00 00 00 00 00 FE Stop the motor immediately
Note: If the motor rotating more than 1000RPM, it is not a good
idea to stop the motor immediately!
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
FD
status(uint8_t)
CRC
status = 0 stop the motor fail. status = 1 stop the motor starting…. status = 2 stop the motor complete. Note: the Uplink framecan be disable by MenuCanRSPor Command “8C”.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
37

6.5 Position mode2: relative motion by axis

In the position control mode2, the motor can be run to the
specified axis with the set acceleration and speed.
Note1: the axis is the encoder value(addition).It can be read by
command “31”.
Note2: In this mode ,the axis err about +15.
Suggest running with 64 subdivisions.
1. Run the motor in position mode2
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
byte4
byte5-byte7
字节 8
01
8
code
speed
acc
Relative axis
Check
F4
speed
acc
relAxis
CRC
The parameter description is as follows: speed: the speed, the value range is 0-3000(RPM) acc: the acceleration, the value range is 0-255
relAxis: the relative axis, int24_t-8388607+8388607
For example: If the current axis is 0x8000.(read by code 31) Send 01 F4 02 58 02 00 40 00 91 The motor will relative move 0x4000 (speed = 600(RPM),acc =2) After move the axis is 0xC000.(0x8000+0x4000=0xC000)
If the current axis is 0x8000.(read by code 31) Send 01 F4 02 58 02 FF C0 00 09 The motor will relative move -0x4000 (speed = 600(RPM),acc =2) After move the axis is 0x4000.(0x8000-0x4000=0x4000)
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
F4
status(uint8_t)
CRC
status = 0 run fail. status = 1 run starting…. status = 2 run complete.
Note: the Uplink framecan be disable by MenuCanRSPor Command “8C”.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
38
2. Stop the motor in position mode2
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
byte4
byte5-byte7
字节 8
01
8
code
speed
acc
Relative axis
Check
F4 0 acc 0 CRC
The stop command can stop the motor slowly, or stop the motor
immediately.
When setting acc ≠ 0, the motor decelerates and stops slowly When setting acc = 0, the motor stops immediately
Deceleration and stop the motor slowly (acc ≠ 0) for example: Send 01 F4 00 00 04 00 00 00 F9 Stop the motor with deceleration acc=4
Immediate stop command (acc = 0) for example: Send 01 F4 00 00 00 00 00 00 F5 Stop the motor immediately
Note: If the motor rotating more than 1000RPM, it is not a good
idea to stop the motor immediately!
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
F4
status(uint8_t)
CRC
status = 0 stop the motor fail. status = 1 stop the motor starting…. status = 2 stop the motor complete. status = 3 end limit stoped.
Note: the Uplink framecan be disable by MenuCanRSPor Command “8C”.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
39

6.6 Position mode3: absolute motion by axis

In the position control mode3, the motor can be run to the
specified axis with the set acceleration and speed.
Note1: the axis is the encoder value(addition). It can be read by
command “31”.
Note2: In this mode ,the axis err about +15.
Suggest running with 64 subdivisions.
1. Run the motor in position mode3
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
byte4
byte5-byte7
字节 8
01
8
code
speed
acc
absolute axis
Check
F5
speed
acc
absAxis
CRC
The parameter description is as follows: speed: the speed, the value range is 0-3000(RPM) acc: the acceleration, the value range is 0-255
absAxis: the relative axis, int24_t-8388607+8388607
For example: If the current axis is any value Send 01 F5 02 58 02 00 40 00 92 The motor will move to 0x4000 (speed = 600(RPM),acc =2) After move the axis is 0x4000.
If the current axis is any value Send 01 F5 02 58 02 FF C0 00 10 The motor will move to -0x4000 (speed = 600(RPM),acc =2) After move the axis is -0x4000.
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
F5
status(uint8_t)
CRC
status = 0 run fail. status = 1 run starting…. status = 2 run complete. status = 3 end limit stoped.
Note: the Uplink framecan be disable by MenuCanRSPor Command “8C”.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
40
2. Stop the motor in position mode3
Downlink frame(PC SERVO42D/57D)
CAN ID
DLC
byte1
byte2
byte3
byte4
byte5-byte7
字节 8
01
8
code
speed
acc
absolute axis
Check
F5 0 acc 0 CRC
The stop command can stop the motor slowly, or stop the motor
immediately.
When setting acc ≠ 0, the motor decelerates and stops slowly When setting acc = 0, the motor stops immediately
Deceleration and stop the motor slowly (acc ≠ 0) for example: Send 01 F5 00 00 04 00 00 00 FA Stop the motor with deceleration acc=4
Immediate stop command (acc = 0) for example: Send 01 F5 00 00 00 00 00 00 F6 Stop the motor immediately
Note: If the motor rotating more than 1000RPM, it is not a goog
idea to stop the motor immediately!
Uplink framePC SERVO42D/57D
CAN ID
DLC
byte1
byte2
byte3
01
3
code
data
Check
F5
status(uint8_t)
CRC
status = 0 stop the motor fail. status = 1 stop the motor starting…. status = 2 stop the motor complete.
Note: the Uplink framecan be disable by MenuCanRSPor Command “8C”.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
41

Part7. CAN command example

The following example uses "cangaroo.exe" PC software and "MKS
CANable" USB to CAN module.

7.1 Config the SERVO42D/57D

1. Menu → Mode → SR_vFOC.
2. Menu → CanRate → 500K.
3. Menu → CanID → 01.

7.2 Config the cangaroo

1. run the cangaroo.exe”.
2. Select tMeasurement->Start Measurement,as show below.
3. In the pop-up Measurement Setup window, click "candle0",
as shown below.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
42
4. Use the default parameters without any modification, click
"ok", as shown below.
5. The configuration is complete, as shown below.
6. Select "File" -> "Save Workspace", select the save path and name, and save the configuration.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
43
7. After the save is completed, as shown below.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
44

7.3 Read the encoder value

send 01 30 31 return 01 30 00 00 00 01 29 EF 4A
MKS SERVO42D/57D_CAN V1.0.3 User Manual
45

7.4 Run the motor in speed mode

Note : Please configure the working mode to “SR_vFOC”. Menu-> Mode -> SR_vFOC
1. Send 01 F6 01 40 02 3A, the motor will rotate at "speed = 600RPM, acc=2";
Return 01 F6 01 F8, the motor run in speed mode successful;
2. Send 01 FF C8 C8 to save the speed mode parameters; Return 01 FF 01 01, save successful;
MKS SERVO42D/57D_CAN V1.0.3 User Manual
46
3. Send 01 F6 00 00 02 F9 to stop the motor;
Return 01 F6 01 F8, the motor stops successfully;
After power-on again, the motor will run according to the save speed mode parameters.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
47

7.5 Run the motor in position mode1

Note : Please configure the working mode to “SR_vFOC”. Menu-> Mode -> SR_vFOC
1. Send 01 FD 01 40 05 09 C4 00 11, the motor will rotate forward
200 circles (16 subdivisions) with "speed = 320RPM,acc = 5"; Return 01 FD 01 FF, the motor starts to run; Return 01 FD 02 00, the motor is run completed;
2. Send 01 FD 81 40 08 30 D4 00 CB, the motor to reverse 1000
circles with "speed = 320RPM, acc = 8" (16 subdivisions); Return 01 FD 01 FF, the motor starts to run. Now, stop the motor by step 3.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
48
3. While the motor is running
Send 01 FD 00 00 01 00 00 00 FF, the motor to stop with acc=1; Return 01 FD 01 FF, the motor starting to stop; Return 01 FD 02 00, the motor has stopped;
MKS SERVO42D/57D_CAN V1.0.3 User Manual
49

Part8. FAQ

8.1 NOTE

1. Power input voltage is 12V-24V.
2. Don’t hot plug motor cable and data cable.
3. When the motor is calibrating, do not carry a load.
4. After installed the motor, or changed the motor wiring
sequence, you need to re-calibrate the motor again.
5. The default work mode is CR_vFOC(EN/STP/DIR interface).
6. Press the "Next" key first, then power on, it can quickly
restore the default parameters.
7. If “Phase Line Error!” is displayed before calibration:
b) Check the motor connection line sequence c) Check the power supply voltage and output power (24V/1A,
12V/2A);
d) If the power supply is connected to the motherboard
through the MKS APT module, try to connect the MKS APT module to ports such as X, Y, Z, E, etc., and then restart again.
e) Do not use the MKS APT module for power supply before
calibration, and the power supply is directly connected to V+ and Gnd.

8.2 FAQ

No
Question
Solution
1
Not Cal
Calibrate the motor.
2
Reverse Lookup Error!
Calibrate Fail, Check magnet and motor shaft
3
Magnet Loss!
Not install the magent.
4
Magnet Strong!
the magnet too near.
5
Magnet Weak!
the magnet too far.
6
Encoder Error!
Check magnet and motor shaft
7
Offset Current Error!
Reference voltage error
8
Phase Line Error!
The motor line sequence is wrong or the power supply is not enough
9
Wrong Protect!
Locked-rotor protection
10
Coming Back to Origin..
Going back to zero. 11
Reboot Again
The motor need to be restart.
MKS SERVO42D/57D_CAN V1.0.3 User Manual
50

Part9. Schematic

Please download MKS SERVO57D V1.0 Schematic.pdf in
https://github.com/makerbase-motor/MKS-SERVO42D https://github.com/makerbase-motor/MKS-SERVO57D

Part10. contact us

https://makerbase.aliexpress.com/ https://www.youtube.com/channel/UC2i5I1tcOXRJ2ZJiRxwpCUQ https://github.com/makerbase-motor
Loading...