Download as pdf or txt
Download as pdf or txt
You are on page 1of 54

RS485(232) communication protorol on MD series controller

Communication protocol on
MD series controllers
(ver.4.5)

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 1/54


RS485(232) communication protorol on MD series controller

1 Introduction

Communication protocol(RS485) on the BLDC/DC motor controller


This protocol is referenced by SAE J1587(automotive diagnostic protocol standard)

1.1 MD series BLDC motor controller(OP->Option)

Curr- RS TTL EN POW_S


Name Volt CAN PULSE RC CLUTCH
ent(A) 485 232 C W
MD50 DC12~24 3 ○
MD50C DC12~24 3.5 ○ ○ ○
PNT50 DC12~48 3x2 ○ ○
MD100 DC12~24 7 ○
MD200 DC12~48 10 ○ ○ ○
MD200T DC12~48 10x2 ○ ○ ○ ○ ○ ○
MD400 DC12~48 20 ○ ○ ○ ○ ○ ○ ○ ○
MD400T DC12~48 20x2 ○ ○ ○ ○ ○ ○ ○ ○
MD500S DC12~48 20 ○ ○ ○ ○ ○ ○
MD750 DC24~72 30 ○ ○ ○ ○ ○ ○ ○ ○
MD750T DC24~72 30x2 ○ ○ ○ ○ ○ ○ ○ ○
MD1K DC12~48 50 ○ ○ ○ ○ ○ ○ ○ ○
MD1KT DC24~72 50x2 ○ ○ ○ ○ ○ ○ ○ ○
MD2K DC24~72 100 ○ ○ ○ ○ ○ ○ ○
MDA200 AC110~220 1.5 ○(Op) ○ ○
MDA400 AC110~220 2.5 ○(Op) ○ ○(Op) ○
MDA1K AC110~220 5 ○ ○ ○ ○ ○ ○ ○
AC110~220
MDA2K 10 ○ ○ ○ ○ ○ ○
3-phase avail.

 PULSE : speed control by 0~400kpps pulse input


 RC : Wireless RC input
 ENC : Encoder input available(A,B,Z)
 CAN : CAN communication, extended mode only
 TTL232 : TTL level RS232 (G, Rx, Tx, 5VDC)
 CLUTCH : To drive electric brake, or clutch(G, Vpp)
 RS485 : RS485 communication(G, 485+, 485-)
 POW_SW : Power switch

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 2/54


RS485(232) communication protorol on MD series controller

1.2 Terminologies

Items Contents
MOT Motor, MOT1(motor 1), MOT2(motor 2) in the use of dual channel controller(MDT series)
Count Per Revolution, if the hall sensor of motor is 10poles then the CPR will be 30, it’s
CPR
triple of number of poles
CPR Pulse/Reveoltion, same with CPR
The number of poles that included in motor, this number is even(N, S pair)
Poles
The number of MDROBOT’s motor is 8 poles
TQ_OFF The state that controller don’t control motor, so the motor shaft is free to turn
BRAKE or - Drive the motor as a load, so the motor will be a generator
Dynamic Braking - If the motor has the speed and rotor inertia, the current flows into controller
- About 10Hz, user can get the data from the controller
BC,
- User can request following items(PID) to get BC data
Broadcasting
PID_MAIN_DATA(193), PID_IO_MONITOR(194), PID_MONITOR(196)
- When the two motors are related or fixed in mechanically, these motor’s speed are
SYNC,
interfered to each other
Syncronized
- To avoid this interference , user control only the master motor(MOT1) and the MOT1
control or
(master) controls the MOT2 by serial commucation to synchronize each motion
Master/slave
- In this case, user can set the master controller with the wanted SYNC type
control
- Don’t need to set the slave controller(normal type)
- In general, the vehicle or robot platform has two motors in left, right sides
- In that case, user can control the vehicle by joystice or RC(Radio Control) controller with
COMPLEX, this complex mode set
Complex - The Y-axis of joystic controls the speed of forward or backward of vehicle
opration - The X-axis of joystic controls the speed of handle to turn the vehicle with CW or CCW
direction
- This control type is applied to MDT series controllers
- The number of specific position to control, to save this position user can move the
motor to specific position, and save this position with PRESET command
PRESET
- These PRESET number is 1 to 10, 10ea totally
- Refer to PID_PRESET_SAVE(30)
- To control the motor to the position which saved in PRESE, use RECALL command with
the number 1 to 10
- If there is the specific saved position in recalled number, then controller moves the
RECALL motor to that specific position
- These PRESET positions are saved but when the controller rebooted, the initial position
is zero, so to control for exact PRESET position, user must do initialization for the motor’s
absolute position

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 3/54


RS485(232) communication protorol on MD series controller

- Min. position error(the resolution for position control)


IN_POSITION - If the target position is 100, and the number of IN_POSITION is 2, then the controller’s
output will be zero in the motor position between 98 and 102
- Inverse, used to inverse the speed and position of motor
INV, - In the command, the sign of motor’s reference speed and position will be inversed to
Inverse of speed the user’s reference input
and position - In monitoring, the sign of speed and position of motor will be inversed to the real
speed and position of motor
- Set the slope of acceleration
SLOW_START(SS) - If this SLOW_START is 1023(max.) the time to accelerate the motor speed, zero to max.
will be 15s
- Set the slope of deceleration
SLOW_DOWN(SD) - If this SLOW_DOWN is 1023(max.) the time to decelerate the motor speed, max. to
0)(stop) will be 15s
CLUTCH - Attached to the motor’s shaft, restrain the motor’s turning
(solenoid) - If there is no power to that CLUTCH, the motor can’t move
- CTRL I/O(11 pins), the input(#7) is the RUN/BRAKE signal
RUN/BRAKE - If this signal input is OFF, the motor is fully controlled by dynamic brake, so can’t turn
freely(restran the motor’s motion)
- CTRL I/O(11 pins), the input(#8) is the START/STOP signal
START/STOP - If this signal input is OFF, the controller don’t control the motor(as the state of no
connection with controller), so the motor is free to turn by hand
- When dwindle the speed of motor which has inertia, the motor will be generater, so
REGENERATION,
the current flows from the motor to the controller
Regeneration
- In that case, to protect over-voltage of controller, this current will be controlled to
brake
flows to the battery or regeneration-brake-resistance
- When the motor’s structure is not uniform or the hall sensor position is not in a valid
position, the operating currents will not be same with both direction CW, CCW
RECT_SINE,
- In that case, user can select this commutation type, RECT SINE
Pseudo sinuwave
- This commutation method has a good response like general sinuwave-control, but the
oprating(PWM) noise and EMI noise will be incresed
- There is some control output but no motion of motor, then stop the control output
STALL and generate this STALL alarm
- In this case, check the mechanical problems or motor’s fault
- Step input, according to the CTRL I/O(3 input) user can make 7 steps of speed input
STEP_INPUT
- These step speeds are set by communication(MDAS)
DEFAULT Default parameter settings when the program is inputted in factory

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 4/54


RS485(232) communication protorol on MD series controller

2 Main subject

2.1 Packit structure(communication with motor controller, 183)

Header ID Number Parameter ID Data number Data Check sum


RMID TMID ID PID NUM DATA CHK
ID of motor
183(const) Variable Variable Variable (1~n Bytes) Variable
controller
- RMID : Receiving Machine ID number, 183(motor controller, constant)
- TMID : Transmitting Machine ID number(variable)
- ID: Identification Number of each RMID(Motor controller Broadcasting ID is 254, 0xfe)
- PID : Parameter IDentification number
- CHK : Check Sum
- Header : PC->CTR(183, 172), CTR->PC(172, 183)
BRIDGE->CTR(183, 184), CTR->BRIDGE(184, 183)

2.1.1 MID(Machine IDentification)

MID No. Notation Remark


128 MID_MAIN_CTR Main controller(system integration controller)
133 MID_REMOCON RF remocon(RCC)
172 MID_MMI Man-Machine-Interface, PC, touch pannel, etc
183 MID_BLDC_CTR BLDC/DC motor controller(MD, MDTx, DMD, DMDTx series)
184 MID_BRIDGE_CTR MDUI, TD, etc(controller which connects MMI and BLDC controller)
186 MID_PDIST Power distribution controller(PDIST, PDIST2, PDIST3, etc)

2.1.2 Data bytes on the PID range

PID Numer 0~127 128~191 192~253


Data bytes 1 byte 2 bytes N Data bytes
- Data bytes : RMID, TMID, ID, PID, Data number, Data, ....., CHK.
- How to make check-sum :
 Sending:
BYTE byChkSend, byCHK;
byChkSend = RMID+TMID+ID+PID+Data number + Data..;
byCHK = ~byChkSen +1

 Receiving:

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 5/54


RS485(232) communication protorol on MD series controller

BYTE byChkRecv;
byChkRecv = RMID+TMID+ID+PID+Data number + Data..+CHK;
If byChkRecv is zero then the packet is normal
Order of data byte : Low-byte first.
Default settings
- Controller responses when the data is requested from the master
- Want to send command to every controller, Use the Broadcasting ID, 254(0xfe)
- Default baudrate :
AC controller(MDA200, MDA400 only) : 8 data bits, 1 stop bit, no parity, 9600bps
else : 8 data bits, 1 stop bit, no parity, 19200bps

2.2 Driving condition when communition used

If you use communication command, then the controller uses the CTRL signals as limit switchs for system
safety
Set the DIR(CW/CCW) and START/STOP signals to ON(connected to GND) to drive motor
The relationship of the moving direction and the signal(Here, X is don't care)
CTRL connector(no. 6 and no. 8 input signal)
Reference drection Motor condition
DIR(CW/CCW) START/STOP
ON X Driving
CW
OFF X Stop
X ON Driving
CCW
X OFF Stop

DIR(CW/CCW)

Limit switch
CW Turn

GND(Pin 1)

CCW Turn
NC(Normal Close)

RUN/STOP

Wiring condition on the moving direction and limit switch

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 6/54


RS485(232) communication protorol on MD series controller

2.3 Specification on communication connector

Connector Pin Notation Contents Remark


RS485 1 G
YeonHo Elec. 2 485+ RS485 connector(Option) SMH250-03
SMAW250-03 3 485-
CAN 1 CAN_H
Option SMH250-02
SMAW250-04 2 CAN_L
TTL232(MDTxS) 1,2 G, RxTTL, TTL level RS232 signal MDTxS related
MOLEX, 5267-04 3,4 TxTTL, 5VDC 9600bps MOLEX, 5267-04
1 Gnd Ground
2 5V 5VDC, Power to external MDTxS
COM2(RJ45) 3 RxD TTL232 RxD(green/white)
(HA-108-NENL) 4 485- RS485-(blue)
(T568B 5 485+ RS485+(blue/white)
connection) 6 TxD TTL232 TxD(green)
7 CAN_H CAN HIGH(brown/white)
8 CAN_L CAN LOW(brown)

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 7/54


RS485(232) communication protorol on MD series controller

2.4 PID(Parameter IDentification Number)

-R : Read only(request data by PID, PID_REQ_PID_DATA)


-W : Writing parameter (write to the flash memory)
-C : Command
-0xaa(170) : write check byte
-0xfe(254) : ID ALL(broadcasting ID)
-0x55 : default setting
-0x77 : PID gain writing(for developer)
-Condition : the data is requested and controlled from PC or MMI(MID, TMID)

2.4.1 1 Byte data( PID: 0~127 )


x : don’t care , DATA : 1bytes
PID Type PID Name/Remark Contents of data bytes/ Range Var./default
x : version(13 -> 1.3)
1 R PID_VERSION BYTE
TMID, 183, ID, 1, 1, x, CHK
PID_DEFAULT_SET DATA : 0x55(CHECK) BYTE
3 C
Default setting 183, TMID, ID, 3, 1, 0x55, CHK 0x55
REQ_PID : 0~253, wanted PID number
PID_REQ_PID_DATA
4 C To get PID data, use this command BYTE
Request data
183, TMID, 1, 4, 1, REQ_PID, CHK
PID_TQ_OFF Stop motor naturally, data don’t care(x).
5 C BYTE
Stop naturally 183, TMID, ID, 5, 1, x, CHK
PID_BRAKE Stop motor urgently(dynamic braking mode)
6 C BYTE
Dynamic brake 183, TMID, ID, 6, 1, x, CHK
PID_ACK Return received PID(RCV_PID) number
7 R BYTE
Acknologyment TMID, 183, ID, 7, 1, RCV_PID, CHK
Refer to the below table on the contents of
10 C PID_COMMAND CMD BYTE
183, TMID, ID, 10, 1, CMD, CHK
PID_ALARM_RESET DATA don’t care(x)
12 C BYTE
Reset alarm 183, TMID, ID, 12, 1, x, CHK
PID_POSI_RESET
13 C 183, TMID, ID, 13, 1, x, CHK BYTE
Reset motor position to zero
DATA(1, 0)
PID_MAIN_BC_STATE
1 : PID 193 broadcasting on BYTE
14 C Request of broadcasting of
0 : broasdcasting off 0
PID_MAIN_DATA
183, TMID, ID, 14, 1, DATA, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 8/54


RS485(232) communication protorol on MD series controller

- The contents of CMD(PID_COMMAND, 10)


No. PID_COMMAND Contents on CMD number
2 CMD_TQ_OFF Tq-off, motor free state
3 CMD_BRAKE2 Brake command for motor2(at dual channel controller)
4 CMD_BRAKE Erectric brake
5 CMD_MAIN.. BC_ON PID_MAIN_DATA, broadcasting ON
6 CMD_MAIN_BC_OFF broadcasing OFF of PID_MAIN_DATA
8 CMD_ALARM_RESET Reset alarm
10 CMD_POSI_RESET Position reset(set position to zero)
11 CMD_MONITOR_BC_ON PID_MONITOR, broadcasting ON
12 CMD_MONITOR_BC_OFF Broadcasting off of PID_MONITOR
13 CMD_IO_MONITOR_ON PID_IO_MONITOR BC ON
14 CMD_IO_MONITOR_OFF PID_IO_MONITOR BC OFF
15 CMD_FAN_ON Fan ON(motor cooling fan)
16 CMD_FAN_OFF Fan OFF
17 CMD_CLUTCH_ON Mechanical brake(clutch) ON
18 CMD_CLUTCH_OFF Mechanical brake OFF
20 CMD_TAR_VEL_OFF Erase target vel, set by PID_TAR_VEL
21 CMD_SLOW_START_OFF Erase target slow/start value
22 CMD_SLOW_DOWN_OFF Erase target slow/down vaule
23 CMD_CAN_RESEND_ON, Send CAN data to RS485 serial port.
24 CMD_CAN_RESEND_OFF Turn off resending of CAN data
25 CMD_MAX_TQ_OFF Erase target limit load(max. current)
26 CMD_ENC_OFF Cancel the use of encoder sensor.
27 CMD_LOW_SPEED_LIMIT_OFF, Cancel the set of low speed limit.
28 CMD_HIGH_SPEED_LIMIT_OFF Cancel the set of high speed limit.
29 CMD_SPEED_LIMIT_OFF Cancel the set of low/high speed limits.
31 CMD_CURVE.. OFF Cancel set of curve fitting func.
32 CMD_STEP.. OFF Cancel step input mode
44 CMD_UICOM_OFF I/O control(ctrl 11pin cnt) available
45 CMD_UICOM_ON I/O control disable(when comm. is used)
46 CMD_MAX_RP._OFF Cancel max. speed set by DIP SW
47 CMD_HALL_TY..OFF Cancel set of motor hall type
48 CMD_LOW..POT_OFF Cancel set of low limit of POT input
49 CMD_HIGH.POT_OFF Cancel set of high limit of POT input
50 CMD_MAIN..BC_ON2 PID_MAIN_DATA, BC ON for 2nd motor
51 CMD_MAIN..BC_OFF2 PID_MAIN_DATA, BC OFF for 2nd motor

52 CMD_MONIT..BC_ON2 PID_MONITOR, BC ON for 2nd motor

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 9/54


RS485(232) communication protorol on MD series controller

53 CMD_MONIT..BC_OFF2 53 : PID_MONITOR, BC OFF for 2nd motor


54 CMD_IO_MONIT..BC_ON2 54 : PID_IO_MONITOR, BC ON for 2nd motor
55 CMD_IO_MONIT..BC_OFF2 55 : PID_IO_MONITOR, BC OFF for 2nd motor
56 CMD_SYS_START Reserved
57 CMD_SYS_STOP Reserved
58 CMD_SAVE_POSI_N_TIME Save the motor position and operating time(s)
61 CMD_PNT_MAIN_DATA_BC_ON Broadcasting on for PID_PNT_MAIN_DATA
62 CMD_PNT_MAIN_DATA_BC_OFF Broadcasting off for PID_PNT_MAIN_DATA
63 CMD_INIT_SET Reserved
64 CMD_CLR_ALARM_LOG Clear alarm log data(refer to the PID_ALARM_LOG)
Reset the encoder param set(not use encoder) for
65 CMD_ENC1_OFF
motor1 of dual channel controller
Reset the encoder param set(not use encoder) for
66 CMD_ENC2_OFF
motor2 of dual channel controller
Stop the motor and turn on the electric-brake
67 CMD_EMER_ON
(short of UVW output)
68 CMD_EMER_OFF Stop the motor and set the motor free state(Tq-off)
69 CMD_BRAKE1 Electric brake on for motor1
70 CMD_BRAKE2 Electric brake on for motor2
71 CMD_POSI_SS_OFF Not use position SLOW/START param.
72 CMD_POSI_SD_OFF Not use position SLOW/DOWN param.
75 CMD_ROBOT_ANG_RESET Reset robot angle
76 CMD_ ROBOT_MONITOR_BC_ON Broadcasting on for the PID_ROBOT_MONITOR
77 CMD_ROBOT_MONITOR_BC_OFF Broadcasting off for the PID_ROBOT_MONITOR
78 CMD_GOTO_BOOT_MODE Reserved
79 CMD_RESET_SYSTEM Reset the controller(rebooting)
80 CMD_BUZZER_ON Buzzer used for the buzzer installed controller
81 CMD_BUZZER_OFF Buzzer is not used
82
Off the Syncronization control(normal controller)
83 CMD_SYNC_OFF
(master-slave control)

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 10/54


RS485(232) communication protorol on MD series controller

PID Type PID Name/Remark Contents of data bytes/ Range Var./default


DATA(0, 1)
PID_MONITOR_BC_STATE
1 : PID 196 broadcasting on BYTE
15 C Request of BC on/off of
0 : broasdcasting off 0
PID_MONITOR
183, TMID, ID, 15, 1, DATA, CHK
PID_INV_SIGN_CMD DATA(0, 1)
Inversion of moving PC sending DATA , 1000 then the controller gets
direction inversed data -1000 BYTE
16 R/W
Used to the left, right 1 : Inversion of reference direction 0
side, two wheel driving 0 : don’t use inverse sign(normal command)
system. 183, TMID, ID, 16, 1, DATA, CHK
DATA(0, 1)
1 : CTRL connector on, 6,7 is used as limit
PID_USE_LIMIT_SW BYTE
17 R/W switchs
Safety limit switch func. 1
0 : cancel limit switch function.
183, TMID, ID, 17, 1, DATA, CHK
DATA(0, 1) BYTE
1 : 2nd motor command direction inversed 0
18 R/W PID_INV_SIGN_CMD2
0 : 2nd motor normal sign PNT50
183, TMID, ID, 18, 1, DATA, CHK MDxxxT 모델
DATA(0, 1)
PID_INV_ALARM
1 : Inversion the alarm signal on/off status BYTE
19 R/W Inversion the sign of
0 : Normal signal 0
alarm signal(output)
183, TMID, ID, 19, 1, DATA, CHK
DATA
Set the number of poles of motor
Pole 4 8 10 12 2 6
PID_HALL_TYPE No. 0 1 2 3 4 5
BYTE
21 R/W Set the poles of BLDC Another number of pole can be set by
0
motor communication then, the poles number is
following, DATA = poles of motor/2
if the poles of motor is 20, then the DATA is 10
183, TMID, ID, 21, 1, DATA, CHK
DATA(0, 1, 2)
PID_STOP_STATUS
0 : If speed input is zero, don't control(free)
Control stop status BYTE
24 R/W 1 : Control zero speed
(when the speed input is 0
2 : Full dynamic braking
zero, START/STOP->ON)
183, TMID, ID, 24, 1, DATA, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 11/54


RS485(232) communication protorol on MD series controller

DATA(Input type)
0 : Analog input(0~5V) or PWM(>5Khz)
1 : Joystick(0~2.5~5), center(2.5V)
2 : Pulse(2~400Kpps)
PID_INPUT_TYPE
3 : RC servo(>250hz), 1.05~1.95ms
Set the user input type
5 : Step(1~7 step input)
0 : INPUT_ANALOG
Set the speed steps up to 7 step.
1 : INPUT_JS
The step input number is set by following
2 : INPUT_PULSE
BIT0 : INT_SPEED, CTRL No. 2
3 : INPUT_RC
BIT1 : RUN/BRAKE, CTRL No. 7
4 : INPUT_POT
BIT2 : START/STOP, CTRL No. 8 BYTE
25 R/W 5 : INPUT_STEP
Step Input = BIT0 + (BIT1x2) + (BIT2x4) 0
6 : INPUT_RF3KEY
6 : RF3KEY input
7 : INPUT_THROTTLE
7 : Throttle lever input
8:
9 : JS complex input(MDTx series controller)
9 : JS_COMPLEX
Y-axis of JS : speed, X-axis of JS : handle
10 : PROP_BRAKE
This complex mode is needed two motors and
11 : RC_COMLEX
MDTx series controller
12 : PULSE_COMPLEX
10 : Controller for regeneration brake use only
11 : RC complex input(MDTx series)
12 : Pulse complex input(MDTx series)
183, TMID, ID, 25, 1, DATA, CHK

■ Complex input(used at MDTx controller only)


To make easy control of two-wheel mobile robot or vehicle which has motors in left and right side each with
joystick(JS) or RC(remote controller), we use complex input mode
-Input1(Y-axis) : control the speed of MOT1, MOT2 with same direction
-Input2(X-axis) : for the handling, increase MOT1, and decrease MOT2 speed or vs.
If the reference speed of input1 is ref1, and that of input2 is ref2 then, the each motor speed is following

Ref_speed1 = ref1 + (Turn_ratio*ref2)


Ref_speed2 = ref1 – (Turn_ratio*ref2)
Here,
Ref_speed1 : reference speed of MOT1
Ref_speed2 : reference speed of MOT2
Turn_ratio : turnning ratio(10~100, PID_TURN_RATIO)
In this complex mode, the control I/O(START/STOP, RUN/BRAKE, CW/CCW(DIR)) function is applied and the
speed direction and handle direction is changed according to the input of DIR1, DIR2 of ctrl I/O

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 12/54


RS485(232) communication protorol on MD series controller

■ Types of input(PID_INPUT_TYPE)

Input type/ Range


No. Remark Fig.
connector Input Speed Neutral

Default setting
Analog or PWM/ 0~5V 2.5V or
0 0~max. More than 5khz
CTRL (Pin #10) Duty cycle 50% duty
SPEED_IN

deadzone:2~3V
Joystick/ -max.~
1 0~5V 2.5V (±10%)
CTRL(Pin #10) +max.
SPEED_IN

2 Pulse/PULSE_IN 2~400kpps 0~max. PULSE_IN


deadzone:
RC (>250Hz)/ min-center- 1.4~1.6ms
3 1.05~1.95ms 1.5ms
PULSE_IN(Pin #2) max Auto detection
PULSE_IN
4
INT_SPEED:D0
STEP/ 0~7 steps
5 7steps - RUN/BRAKE:D1
CTRL (Pin #10) input
START/STOP:D2
Analog START/STOP:CCW
RF3KEY/ CW, CCW, 2.5V or
6 input DIR :CW
CTRL(Pin #6,7,8,10) STOP 50% duty
0~max. RUN/BRAKE:STOP
THROTTLE
7 1.4~4.1V 0~max. 2.75V
CTRL(Pin #10)
JS COMPLEX
CTRL(Pin #10) 0~5V deadzone:2~3V
-max.~
9 SPEED_IN1 JS1:speed 2.5V (±10%)
+max.
SPEED_IN2 JS2:handle SPEED_IN
MDTx only
To use the motor
Proportional as a load only, use
10 Brake control 0~5V 0~ max. - this mode with
CTRL (Pin #10) regenerative-brake-
resistance

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 13/54


RS485(232) communication protorol on MD series controller

Input type/ Range


No. Remark Fig.
connector Input Speed Neutral
RC COMPLEX 1.05~1.95ms deadzone:
min-center-
11 RC1, RC2 RC1:speed 1.5ms 1.4~1.6ms
max
MDTx only RC2:handle Auto detection
PULSE COMPLEX
PULSE1:speed
12 PULSE1, PULSE2 2~400kpps 0~max. PULSE_IN
PULSE2:handle
MDTx only

■ Step input
7steps speed setting
STEP INPUT(CTRL connector) Default setting(%)
No. INT_SPEED RUN/BRKAKE START/STOP Percentage of max. speed
0 OFF OFF OFF 0(stop condition)
1 ON OFF OFF 14
2 OFF ON OFF 28
3 ON ON OFF 42
4 OFF OFF ON 57
5 ON OFF ON 71
6 OFF ON ON 85
7 ON ON ON 100

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 14/54


RS485(232) communication protorol on MD series controller

■ Input mode setting.

-Select wanted input type in the InputType combo box


-Select INPUT_TYPE in DataTypes combo box
-Press WriteData button.

▓ Proportional Brake mode

- Select proportional brake mode of the input types in the write combo-box
- It is better to remove the regenerative-resistance insalled in the controller, just use external-regenerative
resistance with enough power(watt)
- Attach external regeneration brake
(In the case of 24VDC, the controller’s power is 400 watt, then external regen.-resistance must be following
Power(W) = V(voltage) x I(current) so
The current, I(A) is 200/24, ,about 10A
V = IxR, R = 24/10 = about 2 Ohm, so select the external regen.-resistance of 2 Ohm and the power must be
more than 200watt
Power(watt) = IxIxR = 10x10x2 = 200W
- The brake reference input is applied from CTRL I/O(START/STOP ), external volume or communication
- Use this PROP. BRAKE mode, don’t care the signal DIR(CW/CCW) and RUN/BRAKE of CTRL I/O

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 15/54


RS485(232) communication protorol on MD series controller

PID Type PID Name/Remark Contents of data bytes/ Range Var./default


DATA(1~10)
PID_PRESET_SAVE Preset number(address, 1~10) BYTE
30 C
Save preset position Set current position to the preset address
183, TMID, ID, 31, 1, DATA, CHK
DATA(1~10)
PID_PRESET_RECALL Preset number(address, 1~10) BYTE
31 C Go to the recalled Recall the saved preset DATA and move to that
preset position position.(position control)
183, TMID, ID, 32, 1, DATA, CHK
DATA(BIT0~7)
BIT0 : ALARM, (1-> alarm status, 0->normal)
BIT1 : CTRL_FAIL, Speed control fail
BIT2 : OVER_VOLT, Over voltage
PID_CTRL_STATUS BIT3 : OVER_TEMP, Over temperature BIT
34 R
Control status BIT4 : OVER_LOAD, Overload 0
BIT5 : HALL_FAIL, Hall sensor or encoder fail
BIT6 : INV_VEL, Motor speed inversed
BIT7 : STALL, motor not moved
184, 183, ID, 34, 1, DATA, CHK
DATA(0, 1)
PID_START_INV_SIGN
1 : Inverse START/STOP signal(HIGH->ON) BYTE
36 R/W START/STOP signal
0 : Normal signal(LOW->ON) 0
inversion
183, 184, ID, 36, 1, DATA, CHK
DATA(0, 1)
PID_RUN_INV_SIGN
1 : Inverse RUN/BRAKE signal(HIGH->ON) BYTE
37 R/W RUN/BRAKE signal
0 : Normal signal(LOW->ON) 0
inversion
183, 184, ID, 37, 1, DATA, CHK
DATA(0, 1)
1 : Regen. function ON,
PID_REGENERATION
0 : Do not regeneration action(when the motor is BYTE
38 R/W Regeneration function
turned by external load, then not resist to 1
use or not
sustain the reference speed.
183, 184, ID, 38, 1, DATA, CHK
PID_CTRL_STATUS2
DATA(control status of motor2)
Req. For the control BYTE
39 R Refer to PID34, PID_CTRL_STATUS
status of motor2(dual MDTx only
183, TMID, ID, 39, 1, DATA, CHK
channel ctrl)

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 16/54


RS485(232) communication protorol on MD series controller

PID Type PID Name/Remark Contents of data bytes/ Range Var./default


DATA(0, 1)
Stop status when limit switch is ON(CW/CCW
PID_LIMIT_STOP_COND
and STAR/STOP) BYTE
40 R/W Set the stop condition
1 : BRAKE(dynamic braking) 0
when limit switch is ON
0 : natural stop(Free, TqOff)
183, 184, ID, 40, 1, DATA, CHK
DATA(0, 1)
PID_TQ_LIMIT_SW
1 : over 90% of max. set current, stop the motor BYTE
41 R/W Use the current level as
0 : don’t use current limit switch function 0
limit switchs
183, 184, ID, 41, 1, DATA, CHK
DATA(0, 1)
PID_TQ_CTRL 1 : current control(torque) BYTE
44 R/W
Current(torque) control 0 : Speed control 0
183, 184, ID, 44, 1, DATA, CHK
DATA(0, 1)
1 : Bluetooth commucation, BYTE
45 R/W PID_BLUETOOTH
0 : don't care 0
183, 184, ID, 45, 1, DATA, CHK
DATA(BIT0~6)
Digital input of CTRL I/O(connector)
BIT0 : INT_SPEED(by internal volume)
BIT1 : ALARM_RESET input
PID_DI BIT2 : DIR(CW/CCW), direction input
48 R BIT
Digital input (ON/OFF) BIT3 : RUN/BRAKE input of CTRL I/O
BIT4 : START/STOP input of CTRL I/O
BIT5 : ENC_B input(encoder)
BIT6 : ENC_A input
183, TMID, ID, 48, 1, DATA, CHK
DATA(0, 1)
PID_IN_POSITION_OK Refer to the PID_IN_POSITION(171)
In position signal 1 : the target position is reached in the range of
49 R BYTE
(position control OK or resolution of position control
not) 0 : not reached to the target position
183, TMID, ID, 49, 1, DATA, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 17/54


RS485(232) communication protorol on MD series controller

DATA(0, 1)
1 : at the current more than 90% of max. limit,
and over 4s of load(current) stop the motor and
PID_OVERLOAD_ALARM_ out the alarm signal
51 R/W BIT
ON 0 : just limit the current according to the max.
limit, and if the current is over 120% of max.
limit, then out the alarm signal
183, TMID, ID, 51, 1, DATA, CHK
DATA(0, 1)
1 : Inverse the motor speed sign when the
PID_DIP_INV
motor speed is detected with inversed speed
52 R/W Inverse the motor speed BIT
direction
Ex) 100rpm->-100rpm
0 : don’t care(normal speed condition)
183, TMID, ID, 52, 1, DATA, CHK
DATA (0, 1)
1 : do open-loop control
53 R/W PID_DIP_OPEN BIT
0 : closed-loop control
183, TMID, ID, 53, 1, DATA, CHK
DATA(0, 1)
1 : with START/STOP and DIR of CTRL I/O, the
motor reference speed is decided
- START/STOP on : CCW command
54 R/W PID_DIP_CHG - DIR on : CW command BIT
0 : the motor direction is decided by DIR only
- DIR on : CW direction
- DIR off : CCW direction
183, TMID, ID, 54, 1, DATA, CHK
DATA (0, 1)
1 : use when the motor phase CW, CCW is not
normal(biased condition), the currents between
55 R/W PID_RECT_SINE BYTE
CW and CCW direction are quite different
0 : normal sine-wave commutation
183, TMID, ID, 55, 1, DATA, CHK
DATA : 10~100(%)
In the complex input type(dual channel BYTE
56 R/W PID_TURN_RATIO controller), set the ratio of handle reference 50
Refer to the PID_INPUT_TYPE(25) MDTx only
183, TMID, ID, 56, 1, DATA, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 18/54


RS485(232) communication protorol on MD series controller

DATA : unit(s), range(15~60s)


Set the time(s) to reach max. speed when the
57 R/W PID_MAX_SS_TIME BYTE
SLOW/START volume is in max. position
183, TMID, ID, 57, 1, DATA, CHK
DATA(0, 1)
PID_DIR_ INV_SIGN
1 : inverse DIR input signal(HIGH->ON) BYTE
58 R/W Inverse DIR signal of
0 : normal condition(LOW->ON) 0
CTRL I/O, #7
183, TMID, ID, 58, 1, DATA, CHK
DATA(1~10), preset number
1~10 : delete saved preset value(position DATA)
59 W PID_DELETE_PRESET 0xfe(254) : delete all preset(all saved position BYTE
data, #1~10)
183, TMID, ID, 59, 1, DATA, CHK
DATA
Return latest occured alarm contents
60 R PID_LATE_ALARM BIT
Refer to the alarm contents(PID_CTRL_STATUS)
183, TMID, ID, 60, 1, DATA, CHK
DATA(0, 1)
1 : don’t care the volume LOAD, and the limit
current is default set value(max. current) BYTE
61 R/W PID_USE_MAX_TQ
0 : the max. current limit is decided by internal 0
volume, LOAD
183, TMID, ID, 61, 1, DATA, CHK
DATA
BYTE
65 R/W PID_HALL2_TYPE Refer to the PID_HALL_TYPE(21) of MOT2
MDTx only
183, TMID, ID, 65, 1, DATA, CHK
DATA(0~100%)
0 : Don’t care), the limit current is decided by
internal volume, LOAD
PID_TQ_RATIO 1~100 : the percentage for the max. set current
BYTE
66 R/C The set current ratio to If the max. current is 100A, and this input value
0
the max. current is 50(%), then the limit current will be 50A
This value is not saved, just applied when this
command is set
183, TMID, ID, 66, 1, DATA, CHK
PID_USE_CLUTCH1 DATA(0, 1) BYTE
67 R/W
Use clutch1 or not 183, TMID, ID, 67, 1, DATA, CHK MDTx only
PID_HALL1_TYPE DATA(refer to the PID 21) BYTE
68 R/W
Set hall sensor1 type 183, TMID, ID, 68, 1, DATA, CHK MDTx only

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 19/54


RS485(232) communication protorol on MD series controller

PID_RECT_SINE1 DATA(refer to the PID 55) BYTE


69 R/W
Set comutation type1 183, TMID, ID, 69, 1, DATA, CHK MDTx only
PID_RECT_SINE2 DATA(refer to the PID 55) BYTE
70 R/W
Set comutation type2 183, TMID, ID, 70, 1, DATA, CHK MDTx only
PID_INV_SIGN_CMD1
DATA(refer to the PID 16) BYTE
71 R/W Input command sign for
183, TMID, ID, 71, 1, DATA, CHK MDTx only
MOT1
PID_USE_LIMIT_SW1
DATA(refer to the PID 17) BYTE
72 R/W Use limit SW(switch) for
183, TMID, ID, 72, 1, DATA, CHK MDTx only
MOT1
PID_STOP_STATUS1 DATA(refer to the PID 24) BYTE
73 R/W
Stop status for MOT1 183, TMID, ID, 73, 1, DATA, CHK MDTx only
DATA(refer to the PID 40)
Stop condtion when limit-switch is detected for BYTE
74 R/W PID_LIMIT_STOP_COND1
MOT1 MDTx only
183, TMID, ID, 74, 1, DATA, CHK
DATA(0, 1)
Set the motor control direction in COMPLEX
PID_COMPLEX_DIR
type of input
Motor control direction is BYTE
75 R/W 0 : the turnning direction of MOT1, MOT2 are
changed when the input 0
not same
type is COMPLEX
1 : the turnning direction of both motor is same
183, TMID, ID, 75, 1, DATA, CHK
DATA(0, 1)
PID_USE_EMER_SW 1 : if the RUN/BRAKE signal is ON, stop the
BYTE
76 R/W Use RUN/BRAKE signal as motor(electric-brake ON)
0
a emergency switch input 0 : normal operating condition
183, TMID, ID, 76, 1, DATA, CHK
DATA(0, 1)
1 : controlled by serial communication
0 : controlled by CTRL I/O BYTE
78 R/C PID_UI_COM
If the commucation command is, this var. set 0
and CTRL I/O is ignored(don’t care)
183, TMID, ID, 78, 1, DATA, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 20/54


RS485(232) communication protorol on MD series controller

PID Type PID Name/Remark Contents of data bytes/ Range Var./default


DATA(set the motor type)
Set the control parameter according to the
following special motor type
0 : not specified
1 : GGM(drive the motor of GGM co., ltd)
3 : MDH100(20p, 300rpm, 4096CPR) BYTE
79 R/W PID_MOT_TYPE
4 : MDH150(30p, 200rpm, 4096CPR) 0
5 : MDH250(30p, 200rpm, 4096CPR)
6 : AGV750(8p, 3000rpm, 2500CPR)
7 : GGM_INV(GGM co., ltd)
8 : MD400R(MD400Rdriving module)
183, TMID, ID, 79, 1, DATA, CHK
DATA(0, 1)
Replace the encoder sigal A and B phase
BYTE
80 R/W PID_ENC_INV_DIR 0 : normal encoder signal
0
1 : replace the A, B signal each other
183, TMID, ID, 80, 1, DATA, CHK
DATA(0, 1)
0 : detech fault signal at once, stop the motor
BYTE
81 R/W PID_CYCLIC_FAULT 1 : during the detection of fault signal stop the
0
motor output, else run again
183, TMID, ID, 81, 1, DATA, CHK

-Status bits
BIT Name Contents
0 ALARM Alarm detected, system abnormal.
1 CTRL_FAIL The motor speed is larger than 30% of reference speed during 15s
2 OVER_VOLT Supply voltage is over the set max. voltage.
3 OVER_TEMP More than 65℃, At 55~65 deg, the output is limited proportionally.
Detect more than set max. current over 4s. or
4 OVER_LOAD
150% of max current is detected.(urgent alarm)
Failed hall sensor, detected hall value is 0, or 7
5 HALL_FAIL
If used encoder, this error will include encoder fail also
Sign of motor speed is not same with output sign.(inverse signal
6 INV_VEL
detect)
7 STALL The speed is zero but the output is, more than 2s.

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 21/54


RS485(232) communication protorol on MD series controller

PID Type PID Name/Remark Contents of data bytes/ Range Var./default


DATA(0, 1, 2, 3, 4, 5)
- set the SYNC type to the master controller
only, and the slave controller is connected to the
master with serial communication
- don’t set the SYNC type to the slave
controller(use as a normal type)
PID_SYNC_TYPE
- the speed command is inputted to the master
controller only
the synconized control is
- the master controller controls the slave BYTE
82 R/W needed when the two
controller with serial communication 0
motors are connected to
DATA Status of connection to the slave
each other
0 Not sync. Type(normal type)
master/slave control
1 Syncronized with RS485 comm.
2 With CAN communication
3 With TTL RS232 comm.
4 With RS232 comm.
5 MDTx series controller only
183, TMID, ID, 82, 1, DATA, CHK

■ SYNC_TYPE, classified by the type of serial communication


TYPE no. Contents Fig.
RS485 serial commucation with the slave
1 controller, the input to the master
SYNC_485 controller is CTRL I/O, CAN, etc, but RS485
RS485

2
CAN communication
SYNC_CAN
CAN

3
TTL RS232
SYNC_TTL
TTL RS232

4
RS232
SYNC_232
RS232
Operated MOT1 as a master, and MOT2
5
as a slave, the control input is applied to
SYNC_MDT
the MOT1 only MDTx series only

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 22/54


RS485(232) communication protorol on MD series controller

PID_START_STOP DATA(0, 1, 2)
If there is a target 0 : STOP, 1 : CCW direction driving
speed(by PID180) then 2 : CW direction driving BYTE
100 C
control like as Refer to PID_COM_TAR_SPED(180) 0
START/STOP, DIR I/O Target speed is set by PID_COM_TAR_SPEED 183,
act. 184, ID, 100, 1, DATA, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 23/54


RS485(232) communication protorol on MD series controller

2.4.2 2 bytes data(PID: 101~190), DATA = (D1 | D2<<8) = D1 + (D2*256)

PID Type PID Name/Remark Contents of data bytes/ Range Var./default


The current limit to generate over-load alarm
Default current
After the time set by PID_ALARM_TQ_DELAY,
PID_ALARM_TQ limit is the
101 R/W the alarm out is on and the motor is stopped
Set the alarm torque(current) 95% of max.
Unit : 0.1A, 15->1.5A
current
183, TMID, ID, 101, 2, D1, D2, CHK
The set current limit of PID_ALARM_TQ is
PID_ALARM_TQ_DELAY detected more than this delay time,
Set the time to generate then the controller generates the overload INT
102 R/W
overload alarm alarm, and stop the motor 4s(400)
(1/100s unit) Unit : 10ms, 100->1s, 1000->10s
183, TMID, ID, 102, 2, D1, D2, CHK
DATA(250~)
if the reference speed input is zero and after
this set time, the clutch is cut-off(stop the
INT
103 R/W PID_CLUTCH_STOP_DELAY motor)
250(0.5s)
- the unit of input value is 2ms
- the min. input is 250 : 0.5s
183, TMID, ID, 103, 2, D1, D2, CHK
Display the max. control output
104 R PID_MAX_OUT INT
RMID, TMID, ID, 104, 2, D1, D2, CHK
- proportional dynamic-braking output
- according to the input, the dynamic-
braking output is applied to the motor(by
107 C PID_PROP_BRAKE BYTE
UVW short)
BRAKE_OUT = (D1 | D2<<8)
183, TMID, ID, 107, 2, D1, D2, CHK
DATA(0~1023->0~15sdelay),
INT
PID_SLOW_START1 Replace the role of volume, SLOW/START
108 R/W 0
SLOW/START of MOT1 time(s) to reach to max. speed
MDTx only
183, TMID, ID, 108 ,2, D1, D2, CHK
DATA(0~1023->0~15sdelay),
INT
PID_SLOW_START2 Replace the role of volume, SLOW/START
109 R/W 0
SLOW/START of MOT2 time(s) to reach to max. speed
MDTx only
183, TMID, ID, 109 ,2, D1, D2, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 24/54


RS485(232) communication protorol on MD series controller

DATA : (0~1023->0~15s delay) INT


PID_SLOW_DOWN1
111 R/W replace the role of volume, SLOW/DOWN 0
SLOW/DOWN for MOT1
183, TMID, ID, 111 ,2, D1, D2, CHK MDTx only
PID_SLOW_DOWN2 INT
112 R/W 183, TMID, ID, 112 ,2, D1, D2, CHK
SLOW/DOWN for MOT2 MDTx only
PID_POSI_SS1 DATA : (0~1023->0~15s delay)
INT
113 R/W SLOW/START for MOT1 at Set the SLOW/START in position control
MDTx only
position control 183, TMID, ID, 113 ,2, D1, D2, CHK
PID_POSI_SS2 DATA : (0~1023->0~15s delay)
INT
114 R/W SLOW/START for MOT2 at Set the SLOW/START in position control
MDTx only
position control 183, TMID, ID, 114 ,2, D1, D2, CHK
PID_POSI_SD1 DATA : (0~1023->0~15s delay)
INT
115 R/W SLOW/DOWN for MOT2 at Set the SLOW/DOWN in position control
MDTx only
position control 183, TMID, ID, 115 ,2, D1, D2, CHK
PID_POSI_SD2 DATA : (0~1023->0~15s delay)
INT
116 R/W SLOW/DOWN for MOT2 at Set the SLOW/DOWN in position control
MDTx only
position control 183, TMID, ID, 116 ,2, D1, D2, CHK
DATA (rpm)
PID_TAR_VEL1 If this param. is set then the speed input by INT
117 R/W
Target speed for MOT1 the CTRL I/O is ignored MDTx only
183, TMID, ID, 117 ,2, D1, D2, CHK
DATA (rpm)
PID_ TAR_VEL2 If this param. is set then the speed input by INT
118 R/W
Target speed for MOT2 the CTRL I/O is ignored MDTx only
183, TMID, ID, 118 ,2, D1, D2, CHK
PID_IN_POSITION1
Allowable position error to DATA(allowable position error) INT
119 R/W
stop the position control on 183, TMID, ID, 119 ,2, D1, D2, CHK MDTx only
MOT1
PID_IN_POSITION2 DATA(allowable position error) INT
120 R/W
For MOT2 183, TMID, ID, 120 ,2, D1, D2, CHK MDTx only

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 25/54


RS485(232) communication protorol on MD series controller

PID_MAX_RPM1 DATA(rpm) INT


121 R/W
Max. speed of MOT1 83, TMID, ID, 121 ,2, D1, D2, CHK MDTx only
PID_MAX_RPM2 DATA (rpm) INT
122 R/W
Max. speed of MOT2 183, TMID, ID, 122 ,2, D1, D2, CHK MDTx only
PID_ENC_RAW_PPR1 DATA(refer to PID 156) INT
123 R/W
Set encoder PPR of MOT1 183, TMID, ID, 123 ,2, D1, D2, CHK MDTx only
DATA(0~1023)
PID_MIN_SSSD - PID_SLOW_START, refer to PID 153
124 R/W Set the min. of - Set the min. Limit for SLOW/START or INT
SLOW/START(delay time, s) SLOW/DOWN param.
183, TMID, ID, 123 ,2, D1, D2, CHK
DATA(rpm)
PID_VEL_CMD
DATA>0, CCW direction
130 C Velocity command INT
DATA<0, CW direction
(unit : rpm)
183, TMID, ID, 130, 2, D1, D2, CHK
PID_VEL_CMD2
DATA(rpm) INT
131 C Velocity command for
183, TMID, ID, 131, 2, D1, D2, CHK MDTx only
MOT2(unit : rpm)
Write command(0xaa)
PID_ID
ID : 1~253 : setting ID BYTE
133 W ID setting(one controller
ID(254) : received by any ID of controller 1
must be connected only)
183, TMID, 254, 133, 2, 0xaa, ID, CHK
DATA : -1023~1023
PID_OPEN_VEL_CMD
134 C Open-loop output INT
Open-loop control
183, TMID, ID, 134, 2, D1, D2, CHK
Set the baudrate, BAUD
1 : 9600bps, 2 : 19200bps BYTE
PID_BAUDRATE
135 W 3 : 38400bps, 4 : 57600bps 1:AC power
Baudrate setting(RS485)
5 : 115200bps 2:DC power
183, TMID, ID, 135, 2, 0xaa, BAUD, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 26/54


RS485(232) communication protorol on MD series controller

DATA(1~5)
Set the CAN bitrate(bits/s), BIT_RATE
PID_ECAN_BITRATE BYTE
137 W 1 : 50k, 2 : 100k
Set CAN bitrate 1
3 : 250k, 4 : 500k, 5 : 1M
183, TMID, ID, 137, 2, 0xaa, BIT_RATE, CHK
DATA(rpm)
PID_INT_RPM_DATA
138 R Return motor speed(rpm) INT
Motor speed (16bits data)
183, TMID, ID, 138, 2, D1, D2, CHK
DATA : Return current(unit 0.1A)
PID_TQ_DATA
139 R 10->1A, 15->1.5A INT
Current(0.1A)
TMID, 183, ID, 139, 2, D1, D2, CHK
DATA(-1023~1023, Reference current)
PID_TQ_CMD
140 C (here, the max. current is 1023) INT
Torque(current) control
184, 183, ID, 140, 2, D1, D2, CHK
DATA(system input voltage, 0.1V unit)
PID_VOLT_IN
143 R Return supply voltage INT
Supply voltage
TMID, 183, ID, 143, 2, D1, D2, CHK
DATA(0~3, return types for monitoring)
PID_RETURN_TYPE
0 : No return
Set return data type
1 : PID_MONITOR BYTE
149 R/W When command received,
2 : PID_ACK(return received PID) 0
Controller send PID data set
3 : PID_IO_MONITOR
by RET_TYPE.
183, TMID, ID, 149, 2, 170, RET_TYPE, CHK
PID_SLOW_START DATA(0~1023->0~15s delay)
INT
153 R/W Set the SlowStart variable Applied when the ref. speed increased
0
(not use internal volume) 183, TMID, ID, 153 ,2, D1, D2, CHK
DATA(0~1023->0~15s delay)
PID_SLOW_DOWN INT
154 R/W Applied when the ref. speed decreased.
Set the SlowDown variable 0
183, TMID, ID, 154, 2, D1, D2, CHK
PID_TAR_VEL DATA(terget speed, rpm)
INT
155 R/W Use fixed set speed, no use Replacement of internal volume
0
internal volume(SPEED_IN) 183, TMID, ID, 155, 2, D1, D2, CHK
When the encoder pulse is set. The
PID_ENC_PPR
controller uses encoder signals as a speed INT
156 R/W Set encoder CPR
sensing input 0
(count/revolution)
183, TMID, ID, 156, 2, D1, D2, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 27/54


RS485(232) communication protorol on MD series controller

PID_LOW_SPEED_LIMIT DATA : Setting range is 0~512


Set the low value of analog If the input is lower than LOW_LIMIT INT
157 R/W
input(lower then this value is This input is treated as a zero 0
same as zero input) 183, TMID, ID, 154, 2, D1, D2, CHK
DATA : Setting range is 512~1023
PID_HIGH_SPEED_LIMIT
If the input is higher than this HIGH_LIMIT INT
158 R/W Set the higher value of
then this input is same to HIGH_LIMIT 0
analog input
183, TMID, ID, 158, 2, D1, D2, CHK

Reference input(no limit condition) Reference input(limit applied)

1023 1023

0 0
Analog input
1023 1023
Analog input

Low speed limit High speed limit

Reference input vs. input voltage by SPEED_LIMIT

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 28/54


RS485(232) communication protorol on MD series controller

PID Type PID Name/Remark Contents of data bytes/ Range Var./default


PID_PWM_OUT DATA(Out PWM output , 0~1023) BYTE
160 R/W Out PWM of OUT3 terminal DMD series controller only 0
When DC motor control 183, 184, ID, 160, 2, D1, D2, CHK DMD series
DATA(Setting range is 0~1023)
PID_DEAD_ZONE
162 R/W Applied at J/S and RC input mode.
Refer to the below figure. INT
183, TMID, ID, 162, 2, D1, D2, CHK
Request PID data with a parameter
PID_REQ_PID_DATA2 REQ_PID : Requested PID BYTE
Used to request below PID PARAM BYTE
164 R PID_CURVE_PT PID_CURVE_PT : PT number(1,2,3,4)
PID_STEP_INPUT PID_STEP_INPUT : Step number(1~7)
PID_PRESET_DATA PID_PRESET_DATA : Preset number(1~20)
183, TMID, ID, 164, 2, REQ_PID, PARAM, CHK

Reference input(no dead-zone) Reference input(dead-zone applied)

1023 1023

0 0

-1023 -1023
Center 1023 0 1023
Joystick or RC input Dead-zone

Reference input by dead-zone setting(Joystic and RC input)

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 29/54


RS485(232) communication protorol on MD series controller

PID Type PID Name/Remark Contents of data bytes/ Range Var./default


DATA : reference velocity of motor(rpm)
PID_REF_RPM
166 R CW(-), CCW(+) INT
Reference velocity
TMID, 183, ID, 166, 2, D1, D2, CHK
PID_PV_GAIN DATA : proportional gain for position control
167 R/W INT
P-gain of position control 183, TMID, ID, 167, 2, D1, D2, CHK
PID_P_GAIN DATA : proportional gain for velocity control
168 R/W INT
P-gain for velocity control 183, TMID, ID, 168, 2, D1, D2, CHK
PID_I_GAIN DATA : integral gain for velocity control
169 R/W INT
I-gain for velocity control 183, TMID, ID, 169, 2, , D1, D2, CHK
DATA : proportional gain for tq. control
PID_TQ_P_GAIN TqErr = Reference torque – motor torque
170 R/W INT
P-gain for tq(current) control Output = TQ_P_GAIN*TqErr/GAIN_FACTOR
183, TMID, ID, 170, 2, D1, D2, CHK
DATA : resolution for position control
PID_IN_POSITION
Ex) IN_POSITION->10, In the error less than 10,
171 R/W Resolution for the position INT
the control output will be zero
control
183, TMID, ID, 167, 2, D1, D2, CHK
DATA : Tq off condition on motor1, 2
PID_PNT_TQ_OFF 1->TqOff(stop), 0->don’t care
Stop two motors for the D3 : return data type
BIT, BIT
174 C controller which drives two 0 : no return data
MDTx only
motors(dual channel 1 : return PID_PNT_MONITOR
controller) 2 : return PID_PNT_MAIN_DATA
183, TMID, ID, 174, 3, D1, D2, D3, CHK
DATA : Brake condition on motor1, 2
1->brake , 0->don’t care
D3 : return data type
PID_PNT_BRAKE BIT, BIT
175 C 0 : no return data
Brake command MDTx only
1 : return PID_PNT_MONITOR
2 : return PID_PNT_MAIN_DATA
183, TMID, ID, 175, 3, D1, D2, D3, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 30/54


RS485(232) communication protorol on MD series controller

PID_TAR_POSI_VEL
DATA : max. speed in position control(rpm)
176 R/W Max. speed in position WORD
183, 184, ID, 176, 2, D1, D2, CHK
control
PID_TQ_I_GAIN
DATA : I-gain in torque control
177 R/W Integral gain in torque WORD
183, 184, ID, 177, 2, D1, D2, CHK
control
Slow/Start(SS, 0~1023) in position control
178 R/W PID_POSI_SS INT
183, 184, ID, 178, 2, D1, D2, CHK
Slow/Dow(SD, 0~1023) in position control
179 R/W PID_POSI_SD INT
183, 184, ID, 179, 2, D1, D2, CHK
PID_COM_TAR_SPEED
DATA : Target speed(rpm)
180 C/R Refer to WORD
183, 184, ID, 180, 2, D1, D2, CHK
PID_START_STOP, 100
DATA : (0~4, Special function type)
Refer to the function below explanation
PID_FUNC_CMD_TYPE FUNC_TYPE = D1, D2 don’t care
If the function type is 0 : NONE
set(more than 1) then the 1 : SPEED
183 R/W WORD
motor used by start/stop 2 : POSITION
only. 3 : INIT_SET
(option) 4 : TOUR
Refet to the following explanation
183, 184, ID, 183, 2, D1, x, CHK
DATA(0, 1)
PID_FUNC_CMD
Run the function set by PID 183,
If function type is, then user
like as a control input signal START/STOP
184 W can use start/stop signal and WORD
Refer to the function below explanation
this PID also
0 : OFF, more than 1 : ON
(option)
183, 184, ID, 184, 2, D1, D2, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 31/54


RS485(232) communication protorol on MD series controller

▓ FUNCTION type(PID_FUNC_CMD_TYPE)

- By START/STOP signal input(CTRL I/O), the motor speed or position controlled according to the set pattern
repeatedly
- Related PID : PID_FUNC_CMD_TYPE, PID_FUNC_CMD, PID_FUNC_SPEED, PID_FUNC_POSI
- There are 4 types for following(TYPE_SPEED/TYPE_POSI/ TYPE_INIT_SET/ TYPE_TOUR)

- Refer to the control panel of MDAS communication program

● TYPE_SPEED(1)
According to the input signal of START/STOP, the motor speed controlled following diagram repeatedly
And the delay time and target speed are set by PID_FUNC_SPEED
X-axis is time(s)
ON
START/STOP signal
OFF
TAR_SPEED(rpm)
Motor speed control
0

DELAY(s) DELAY(s)
- Here, the delay time unit is 0.1s
- The direction of motor is decided by the input signal DIR(CW/CCW) of CTRL I/O, and the RUN/BRAKE must
be ON

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 32/54


RS485(232) communication protorol on MD series controller

● TYPE_POSI(2)

The target speed and incremental position are set by PID_FUNC_POSI

X-axis is motor position

ON
START/STOP signal
OFF
TAR_SPEED(rpm)
Motor position control
0

INC_POSI INC_POSI

- Command, PID_FUNC_CMD can be used instead of signal input, START/STOP


- The direction of motor is decided by DIR(CW/CCW)
- The motor position : Incremental position/revolution = Poles of motor x 3

● TYPE _INIT_SET(3)
If there is an input of INT_SPEED of CTRL I/O, then the controller set the motor position to zero
When this INIT_SET command is applied, the motor direction is set by the DATA of PID_FUNC_CMD command
Here,
0 : stop the position initialization
1 : with CCW direction, motor turns for initialization
2 : with CW direction, motor turns for initialization
In both direction, the limit switch is INT_SPEED of CTRL I/O samely

● TYPE _TOUR(4)
Refer to PID_TOUR_START(33), PID_TOUR_DATA(191), PID_PRESET_DATA(227)
With the speed and delay time(s) and target position set by PID_TOUR_DATA, motor moves to each position
repeatedly
To make this function, user must set the target positions by PID_PRESET_DATA, and send start command by
PID_TOUR_START

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 33/54


RS485(232) communication protorol on MD series controller

Preset/Recall Control : press this button to pup up the tour menu

Teminology Contents Remark


Preset Set the target position Max. 10EA available
Recall Select specific preset number then motor moves that position Just one position
Continually, motor moves to target positions set by PRESET,
Tour More than one position
with the speed and delay set by PID_TOUR_DATA
PID_PRESET_SAVE(30), PID_PRESET_RECALL(31)
User must set the preset
PID_TOUR_START(33), PID_PRESET_DATA(227, 228)
Related PID data prior to TOUR
PID_TOUR_DATA(191), PID_FUNC_CMD_TYPE(183)
command
PID_FUNC_CMD(183)

Comand order
1) With preset combo-box, set the target preset position with the button, Save Preset
2) To move to the each preset position, use the button Recall Preset
3) To make TOUR function, use the button Tour Start and want to make the stop condition as a serve lock,
use the button, Tour Start(Servo Lock)

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 34/54


RS485(232) communication protorol on MD series controller

PID Type PID Name/Remark Contents of data bytes/ Range Var./default


DATA : span for no-communication input
PID_COM_WATCH_DELAY
(0.1s unit, 100->10s)
Stop the motor when there
185 R/W If there is no serial communication during over WORD
is no serial command during
this time, stop the motor(for safety)
this set time
183, TMID, ID, 185, 2, D1, D2, CHK
DATA : Current limit value(0.1A unit)
PID_TQ_LIMIT_SW_VAL
Over this current, stop the motor, but the
Current limit to use as a limit
187 R/W other direction input is, clear this limit WORD
switch, refer to the
condtion and move motor again
PID_TQ_LIMIT_SW(41)
183, TMID, ID, 187, 2, D1, D2, CHK
DATA : max. open-loop output(100~1023)
If the open-loop input is more than this set
190 R/W PID_MAX_OPEN_OUT value, then the output will replaced by this WORD
max. open-loop output
183, TMID, ID, 190, 2, D1, D2, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 35/54


RS485(232) communication protorol on MD series controller

2.4.3 N bytes data(PID: 190~253)

PID Type PID Name/Remark Contents of data bytes/ Range Var./default


DATA : 4bytes
PID_TOUR_DATA
D1,D2 : Target speed(rpm) INT(1000)
Set parameters for TOUR
191 R/W D3,D4 : Pause time(delay, 0.1s unit) INT(10)
function(target speed,
100->1s MDT only
pause time(delay))
183, TMID, ID, 191, 4, D1, ..D4, CHK
DATA : 7bytes, output range : 0~1023)
D1 : enable for MOT1(0, 1)
0 : no action for MOT1(disable)
1 : dynamic brake action for MOT1 (enable) BYTE
PID_PNT_PROP_BRAKE D2,D3 : dynamic brake output for MOT1 INT
Dynamic brake control D3 : enable for MOT2(0, 1) BYTE
192 C
for MOT1, MOT2 of dual D4,D5 : dynamic brake output for MOT2 INT
channel controller D7: return data type BYTE
0 : no return MDT only
1 : return data on PID_PNT_MONITOR
2 : return data on PID_PNT_MAIN_DATA
183, TMID, ID, 192, 7, D1, ..,D7, CHK
DATA : 16 or 17 bytes(D1~D17)
D1,2 : Speed(rpm)
INT
D3,4 : Current (0~1023, 0.1A unit)
INT
D5 : Control type.
BYTE
0 : Tq-off(stop)
1 : Speed control(closed-loop control)
2 : Position control
3 : Open-loop control
PID_MAIN_DATA
193 R D6,7 : Reference speed(rpm)
Main data for monitoring INT
D8,9 : Control output
D10: Status of controller(refer to below.)
D11,12,13,14 : Motor position
LONG
D15 : Brake duty(regernarative resistor, 0~255)
BYTE
D16 : Temperature(0~100deg)
BYTE
D17 : Status2, refer to the below on STATUS2
If there is no temp. sensor D16 will be zero
TMID, 183, ID, 193, 17, D1, ..., D17, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 36/54


RS485(232) communication protorol on MD series controller

DATA : 17bytes
D1,2 : motor speed( rpm)
Speed(rpm) = (D1 | ((int)D2<<8))x10
D3,4 : current (0~1023, 0.1A unit)
D5 : status on controller
D6 : input signal(CTRL, ENC)
BIT0 : INT_SPEED
BIT1,2 : ALARM_RESET, DIR(CW/CCW)
BIT3,4 : RUN/BRAKE, START/STOP INT
BIT5,6 : ENC_B, ENC_A
D7,8 : external speed input(0~1023) INT
D9 : 8PIN dip_sw input(0~255) BIT
PID_IO_MONITOR
D10 : hall sensor signal(Hu, Hv, Hw) BIT
Used when speed in/out
D11 :
194 R range is bigger than
BIT0~3 : controller types
327676 rpm
1:MDA400C, 2:MDA1K, 3:MDA2K
4:MD750, 5:MDA200, 10:MD400
INT
D12 : etc(switch input) BIT
BIT0 : DIP_SW_STEP BYTE
BIT1 : DIP_SW_INV_ALM
BIT2 : TEMP. switch(MDA400)
D13,14 : input voltage(0.1Vunit, 240->24.0V)
VoltIn(volt) = (D13 | ((int)D14<<8))x10
D15: Slow/Start(SS, 0~100)
D16:Slow/Down(SD,0~100)
D17:Load(current limit, 0~100)
184, 183, ID, 194, 17, D1, ..., D17, CHK
PID_TAR_POSI
DATA : 4bytes
1)set the target position
Target position to controlled with
195 R/W 2)with PID_START_STOP, LONG
PID_START_STOP(100)
the position control
184, 183, ID, 195, 17, D1, ..., D4, CHK
activated(for modbus)

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 37/54


RS485(232) communication protorol on MD series controller

DATA : 11 or 12bytes
D1,2 : speed(rpm)
INT
D3,4 : current(0~1023, 0.1A unit)
INT
PID_MONITOR D5,6 : controller output(0~1023)
196 R INT
For Monitoring D7 : status of controller
BIT
D8,9,10,11 : motor position
LONG
D12(reserved)
TMID, 183, ID, 196, 12, D1,..., D12, CHK
DATA : 4 bytes
PID_POSI_DATA
197 R D1,2,3,4 : position of motor LONG
Motor position
TMID, 183, ID, 197, 4, D1, D2, D3, D4, CHK
DATA : 4 bytes
PID_RPM_DATA
198 R D1,2,3,4 : motor speed(rpm) LONG
Motor speed
TMID, 183, ID, 198, 4, D1, D2, D3, D4, CHK
DATA : 4bytes(target position)
PID_INC_TAR_POSI
The reference target position will be following
199 C/R Incremental target LONG
Target posi. = current position + data
position
TMID, 183, ID, 199, 4, D1, D2, D3, D4, CHK
PID_MAIN_DATA2 Same with PID193, but the data is on the
200 R MDTx only
MAIN_DATA of motor2 motor2
PID_MONITOR2 Same with PID196, but the data is on the
201 R MDTx only
MONITOR of motor2 motor2
PID_ IO_MONITOR2 Same with PID194, but the data is on the
202 R MDTx only
IO_MONITOR of motor2 motor2
DATA : 6 bytes
D1,2 : proportional gain of positon control INT
PID_ GAIN
203 R/W D3,4 : proportional gain of speed control(P) INT
Control gain
D5,6 : integral gain of speed control(I) INT
TMID, 183, ID, 203, 6, D1, ..D6, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 38/54


RS485(232) communication protorol on MD series controller

DATA : 6 bytes
PID_POSI_VEL_DATA
D1 : control status BYTE
Read motor position and
204 R D2,3 : speed(rpm) INT
speed with controller’s
D4,5,6,7 : position LONG
status
TMID, 183, ID, 205, n, D1, ..Dn, CHK
DATA : max. 20 bytes (character)
PID_TYPE
205 R If the type is MD1K-V1.0, then n is 9(number) CHAR
Type of controller
TMID, 183, ID, 205, n, D1, ..Dn, CHK
DATA : 15Bytes
D1 : ID of controller1
When two motor conroller used (like PNT50..)
D1 : 1:Enable, 0:Disable of motor1
PID_PNT_POSI_CMD D2,3,4,5 : reference position of motor1 BYTE
Position control for two- D6,7 : max. velocity on motor1 LONG
motor-driver D8 : ID of controller2 BYTE
206 C
(MDTx controller, At two motor conroller :enable(1) or disable (0) LONG
PNT50, MD200T, D9,10,11,12 : reference position of motor2
MD400T, MD750T) D13,14 : max. velocity on motor2
D15: return data type
0(no return), 1(PNT_MONITOR),
2(PNT_MAIN_DATA)
183, TMID, ID, 206, 15, D1, D2, .., D15, CHK
DATA : 7Bytes
D1 : 1(MOT1 enable), 0:disable
D2,3 : reference velocity on motor1(rpm)
D4 : 1(MOT2 enable), 0:disable
D5,6 : reference velocity on motor2(rpm)
D7: return data type BYTE
PID_PNT_VEL_CMD 0(no return), 1(PNT_MONITOR), INT
207 C Velocity control for dual 2(PNT_MAIN_DATA) BYTE
channel controllers If the controller’s type is not MDxxxT, just INT
type of one motor driving(MDxxx), then the D1 MDTx only
is ID of controller1 and D4 is the ID of
controller2
If this ID is zero, then the controller is not
responded
183, TMID, ID, 207, 6, D1, D2, .., D6, D7, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 39/54


RS485(232) communication protorol on MD series controller

DATA : 7Bytes
D1 : ID of controller1, 0:disable
D2,3 : output on motor1(-1023~1023)
BYTE
PID_PNT_OPEN_VEL_CMD D4 : ID of controller2, 0:disable
INT
208 C Open-loop control for D5,6 : output on motor2(-1023~1023)
BYTE
dual channel controllers D7: return data type
INT
0(no return), 1(PNT_MONITOR),
2(PNT_MAIN_DATA)
183, TMID, ID, 208, 6, D1, D2, .., D7, CHK
DATA : 7Bytes
D1 : ID of controller1, 0:disable
BYTE
D2,3 : reference tq. on motor1(-1023~1023)
INT
PID_PNT_TQ_CMD D4 : ID of controller2, 0:disable
BYTE
209 C Torque control for dual D5,6 : reference tq. on motor2(-1023~1023)
INT
channel controllers D7: return data type
PNT50
0(no return), 1(PNT_MONITOR),
MD750T
2(PNT_MAIN_DATA)
183, TMID, ID, 209, 6, D1, D2, .., D7, CHK
DATA : 18 Bytes
D1,2 : speed(rpm) of motor1
INT
D3,4 : current of motor1(0.1A unit, 100->10A)
INT
D5 : status bit of motor1
BIT
PID_PNT_MAIN_DATA D6,7,8,9 : position of motor1
LONG
210 R MAIN_DATA for dual D10,11: speed(rpm) of motor2
channel controllers D12,13 : current of motor2
(0.1A unit, 100->10A)
PNT50
D14 : status bit of motor2
MD750T
D15,16,17,18 : position of motor2
TMID, 183, ID, 210, 18, D1,..., D11, D18, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 40/54


RS485(232) communication protorol on MD series controller

-Status bits
BIT Name Contents
0 ALARM Alarm detected, system abnormal.
1 CTRL_FAIL The motor speed is larger than 30% of reference speed during 15s
2 OVER_VOLT Supply voltage is over the set max. voltage.
3 OVER_TEMP More than 65℃, At 55~65 deg, the output is limited proportionally.
Detect more than set max. current over 4s. or
4 OVER_LOAD
150% of max current is detected.(urgent alarm)
Failed hall sensor, detected hall value is 0, or 7
5 HALL_FAIL
If used encoder, this error will include encoder fail also
Sign of motor speed is not same with output sign.(inverse signal
6 INV_VEL
detect)
7 STALL The speed is zero but the output is, more than 2s.

PID Type PID Name/Remark Contents of data bytes/ Range Var./default


DATA : 2Bytes
PID_MAX_LOAD
211 R/W D1,2 : Max. current available. INT
Set the max. current
TMID, 183, ID, 211, 2, D1, D2, CHK
DATA : 11Bytes
D1 : ID of controller1, 0:disable
BYTE
PID_PNT_INC_POSI_CMD D2,3,4,5 : Relative position on motor1
LONG
Increment position control D6 : enable on motor2, 0:disable
BYTE
215 C for two controllers or two D7,8,9,10 : relative position on motor2
LONG
motor driving controller D11: return data type
0(no return), 1(PNT_MONITOR),
MDTx only
2(PNT_MAIN_DATA)
183, 184, ID, 215, 11, D1, D2, .., D11, CHK
DATA : 7Bytes BYTE
D1: control status of MOT1 INT
D2,3 : speed of MOT1(rpm) BYTE
216 R PID_PNT_MONITOR D4: control status of MOT2 INT
D5,6 : speed of MOT2(rpm) BYTE
D7 : temperature(deg)
183, TMID, ID, 216, 6, D1, D2, .., D7, CHK MDTx only
DATA : 4 bytes
PID_POSI_SET D1,2,3,4 : (long type position data)
217 C LONG
Set the motor position Change the motor position by set value
183, TMID, ID, 217, 4, D1, D2, D3, D4, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 41/54


RS485(232) communication protorol on MD series controller

DATA : 4Bytes
PID_POSI_SET2 D1,2,3,4 : set position on motor2 LONG
218 C
Set the motor2 position Change motor position by the set position. MDTx only
183, TMID, ID, 218, 4, D1, D2, D3, D4, CHK
DATA : 6 bytes
D1,2,3,4 : Ref. position
PID_POSI_VEL_CMD LONG
D5,6 : max. control speed(rpm)
219 C Position control with max. INT
If the speed is zero, then use a half of max.
target speed.
speed
183, TMID, ID, 219, 6, D1, .., D6, CHK
DATA : 6bytes
D1,2,3,4 : reference increment position
D5,6 : max. speed(rpm)
PID_INC_POSI_VEL_CMD
220 C Current motor position is 100 LONG
Position command
And the ref. input is 200, then the motor goes INT
to the position, 300
183, 184, ID, 219, 6, D1, .., D6, CHK
DATA : 2 bytes
PID_MAX_RPM
221 R/W D1,2 : max. speed(rpm) INT
Max. speed(rpm)
TMID, 183, ID, 221, 2, D1, D2, CHK
DATA : 4 bytes
PID_SPEED_LIMIT Limit speed input(analog input)
222 R/W Refer to above fig. D1,2 : low speed limit(0~512) INT
(Low/high speed limit) D3,4 : high speed limit(512~1023) INT
183, TMID, ID, 222, 4, D1, D2, D3, D4, CHK
DATA : 2 bytes
D1,2 : min. target speed(rpm)
PID_MIN_RPM
223 R/W Less than this value, the input speed will be INT
Set the min. Target speed
ignored(replaced with this min. speed, but 0) INT
183, TMID, ID, 223, 2, D1, D2, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 42/54


RS485(232) communication protorol on MD series controller

DATA : 3 bytes
Set the step input(7 steps)
D1 : step number(1~7) BYTE
D2,3 : speed(rpm) INT
PID_STEP_INPUT BIT0 : CTRL, Pin no. 2, INT_SPEED
225 R/W
Set the step speed. BIT1 : CTRL, Pin no. 7, RUN/BRAKE
BIT2 : CTRL, Pin no.8, START/STOP
Speed step(1~7, step 0 is zero velocity, stop)
SpeedStepNumber = BIT0 + BIT1x2 + BIT2x4
183, TMID, ID, 225, 4, D1, D2, D3, CHK
DATA : 5 bytes
D1 : Number of curvefitting point(1~4), BYTE
Positive axis point(1:PT1, 2:PT2)
PID_CURVE_PT
226 R/W Negative axis point(3:PT3, 4:PT4)
Set the curve fitting points
D2,3 : point x(0~1023) must be>0 INT
D4,5 : point y(0~1023), must be>0 INT
183, 184, ID, 226, 5, D1, D2, D3, CHK

Refer. Input(no curve fitting) Refer. Input(cuver fitting applied)


PT2(800,800)

1023 1023

800

100

512 800
Analog input
1023 Analog input 1023
PT1(512,100)
Reference input vs. input voltage by curve fitting(PT3,4 are negative values)

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 43/54


RS485(232) communication protorol on MD series controller

PID Type PID Name/Remark Contents of data bytes/ Range Var./default


DATA : 5Bytes
Return preset data(position) according to the
preset number.
227 R PID_PRESET_DATA BYTE
D1 : preset number(1~20)
LONG
D2,3,4,5 : Set preset data(position)
183, TMID, ID, 227, 5, D1, .., D5, CHK
Data : 5Bytes
Return preset data(position) according to the
PID_PRESET_DATA2 preset number for MOT2
228 R BYTE
Preset Data for MOT2 D1 : preset number(1~20)
LONG
D2,3,4,5 : Set preset data(position)
183, TMID, ID, 228, 5, D1, .., D5, CHK
DATA : 9 bytes
D1 : latest alarm status(refer to PID #60)
D2 : count for CTRL_FAIL(control fail)
D3 : count for OVER_VOLT(over/low voltage)
D4 : count for OVER_TEMP(over tempratiure) BYTE
229 R PID_ALARM_LOG D5 : count for short(U,V,W) or peak current Max. count :
D6 : count for OVER_LOAD 255
D7 : count for HALL_FAIL(hall sensor failure)
D8 : count for abnormal motor speed direction
D9 : count for STALL(stall alarm)
183, TMID, ID, 229, 9, D1, .., D9, CHK
Target(reference) position
230 R PID_REF_POSI LONG
183, 184, ID, 230, 4, D1, .., D4, CHK
DATA : 4Bytes
Min. reference position to the min. input
231 R/W PID_POSI_MIN_LIMIT LONG
D1,2,3,4 : position
183, 184, ID, 231, 4, D1, .., D4, CHK
DATA : 4Bytes
Reference center position to the zero input
232 R/W PID_POSI_CEN LONG
D1,2,3,4 : position
183, TMID, ID, 232, 4, D1, .., D4, CHK
DATA : 4Bytes
Max. refence position to the max. input.
233 R/W PID_POSI_MAX_LIMIT LONG
D1,2,3,4 : position
183, TMID, ID, 233, 4, D1, .., D4, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 44/54


RS485(232) communication protorol on MD series controller

Reference position

1200

800

100

0 1023
-1023
Input range(volume, J/S, Etc)

Reference position to the values, MIN_LIMIT(100), CEN(800), MAX_LIMIT(1200), PID231~233

PID Type PID Name/Remark Contents of data bytes/ Range Var./default


DATA : 4bytes, unit(s)
D1~4 : if the controller rebooted, this value will
PID_TIME
234 R be reset also, to save this value to memory use LONG
Operating time(s)
PID_COMMAND(CMD_SAVE_POSI_N_TIME)
TMID, 183, ID, 234, 4, D1, ..., D4, CHK
DATA : 4bytes
PID_TQ_GAIN This gain is applied for current control
INT
235 R/W Set gains for current D1,2 : proporational gain(P-Gain)
INT
control(torque) D3,4 : intergral gain(I-Gain)
TMID, 183, ID, 235, 4, D1, ..., D4, CHK
DATA : 6bytes
PID_POSI_VEL_CMD2
Used for dual channel controller LONG
Move to the target
236 C D1~4 : target position for MOT2 INT
position with max. target
D5,6 : max. target speed for MOT2 MDT only
speed for MOT2
TMID, 183, ID, 236, 6, D1, ..., D6, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 45/54


RS485(232) communication protorol on MD series controller

DATA : 11bytes
Complex command for dual channel controller
D1: control type for MOT1
0 : Tq off, 1:speed(rpm), 2:position,
3:open-loop(~1023), 4:tq(current, ~1023),
PID_PNT_COMPLEX_CMD 위치인
5:brake(~1023), 255(0xff):don’t care
In the dual channel 경우까지
D2,3,4,5 : the parameter for above control type
237 C controller, user can use 고려하여
of MOT1
different commands for 변수는
D6 : control type for MOT2(refer to D1)
each motor long 타입설정
D7,8,9,10 : the parameter for MOT2
D11: request data for monitoring(0, 1, 2)
0(no return), 1(PID_PNT_MONITOR)
2(PID_PNT_MAIN_DATA)
TMID, 183, ID, 237, 11, D1, ..., D11, CHK
DATA : 12bytes
PID_CAN_RESEND
D1~4 : extended ID LONG
238 R Resend CAN comm data to
D5~12 : CAN data(PID, Data...), 최대 8Bytes BYTE...
RS485 data(packet)
TMID, 183, ID, 238, DataNum, D1, ..., Dn, CHK
PID_FUNC_SPEED
DATA : 4bytes
With target speed the
D1,D2 : Target speed(rpm)
motor run for a run INT
239 R/W D3,D4 : Delay(run time, 0.1s unit), 10->1s
time(delay) by START/STOP INT
Target speed = D2*256 + D1
signal
183, 184, ID, 239, 4, D1, ..., D4, CHK
(option)

DATA : 15bytes
D1 : 1(enable control on motor1),
0(don’t control, there is no effect)
D2~D5 : position incremental on motor1
D6,D7 : max. speed on motor1 with posi. ctrl.
PID_PNT_INC_POSI_ D8 : control enable on motor2
242 C INT
VEL_CMD D9~D12: position incremental on motor2
D13,D14: max. speed on motor2 with posi. ctrl.
D15: return data type(0, 1, 2)
0(no return), 1(PID_PNT_MONITOR)
2(PID_PNT_MAIN_DATA)
183, 184, ID, 242, 15, D1, ..., D15, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 46/54


RS485(232) communication protorol on MD series controller

DATA : 4bytes
D1~D4 : Target position
243 R/W PID_POSI_CMD LONG
D1(LSB), D4(MSB)
183, 184, ID, 243, 4, D1, ..., D4, CHK
DATA : 4bytes
D1~D4 : Incremental target position
244 R/W PID_INC_POSI_CMD Target posi. = Current posi. + Incremental LONG
Posi.
183, 184, ID, 244, 4, D1, ..., D4, CHK
DATA : 11bytes
D1 : ID1(Command enable), 0(Disable)
D2~D5 : Reference position of ID1
D6 : ID2(Command enable), 0(Disable)
246 R/W PID_PNT_POSI_CMD LONG
D7~D10 : Reference position of ID2
D11 : Controller ID
which wanted PID_MONITOR(return data)
183, 184, ID, 246, 2, D1, ..., D11, CHK
Position control for MOT2
Same with PID_POSI_CMD(243) LONG
247 C PID_POSI_CMD2
D1~D4 : target position for MOT2 MDT only
183, TMID, ID, 247, 4, D1, ..., D4, CHK
DATA : 4bytes
PID_FUNC_POSI
Target speed(rpm) = D2*256 + D1
With target speed the INT
250 R/W Target position(motor poles*3/rev)
motor move to the target INT
= D4*256 + D3
position(option)
183, 184, ID, 250, 4, D1, ..., D4, CHK
DATA : 4bytes
D1~D4 : Incremental target position on motor2
251 R/W PID_INC_POSI_CMD2 LONG
Target posi. = Current posi. + Incremental Posi.
183, 184, ID, 251, 4, D1, ..., D4, CHK
DATA : 6 bytes
D1,2 : proportional gain for position control
PID_GAIN1 INT
252 R/W D3,4 : proportional gain for speed control
Gain for MOT1 only MDTx only
D5,6 : Integral gain for speed control
TMID, 183, ID, 252, 6, D1, ..D5, D6, CHK
DATA : 6 bytes
PID_GAIN2 INT
253 R/W ”same with PID_GAIN1(252)”
Gain for MOT2 only MDTx only
TMID, 183, ID, 253, 6, D1, ..D5, D6, CHK

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 47/54


RS485(232) communication protorol on MD series controller

2.4 PID header

// General ID definition
#define ID_ALL 0xfe
#define ID_WRITE_CHK 0xaa
#define ID_DEFALUT_CHK 0x55 // Default setting(write)
#define ID_DEVELOPER_CHK 0x77

///////////////////////////////////////////////////////
// Command : RMID, TMID, ID, PID, DATA number, DATA.., CHK
/////////////////////////////////////////////
// PID one-byte DATA : PID 0~127
#define PID_DEFAULT_SET 3
#define PID_REQ_PID_DATA 4
#define PID_TQ_OFF 5
#define PID_BRAKE 6
#define PID_ACK 7

/////////////////////////////////////////
#define PID_COMMAND 10

#define CMD_TQ_OFF 2
#define CMD_BRAKE 4
#define CMD_MAIN_DATA_BC_ON 5
#define CMD_MAIN_DATA_BC_OFF 6
#define CMD_ALARM_RESET 8
#define CMD_POSI_RESET 10
#define CMD_MONITOR_BC_ON 11
#define CMD_MONITOR_BC_OFF 12
#define CMD_IO_MONITOR_BC_ON 13
#define CMD_IO_MONITOR_BC_OFF 14
#define CMD_FAN_ON 15
#define CMD_FAN_OFF 16
#define CMD_CLUTCH_ON 17
#define CMD_CLUTCH_OFF 18
#define CMD_TAR_VEL_OFF 20
#define CMD_SLOW_START_OFF 21
#define CMD_SLOW_DOWN_OFF 22

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 48/54


RS485(232) communication protorol on MD series controller

#define CMD_CAN_RESEND_ON 23
#define CMD_CAN_RESEND_OFF 24
#define CMD_MAX_LOAD_OFF 25
#define CMD_ENC_PPR_OFF 26
#define CMD_LOW_SPEED_LIMIT_OFF 27
#define CMD_HIGH_SPEED_LIMIT_OFF 28

#define PID_ALARM_RESET 12
#define PID_POSI_RESET 13
#define PID_MAIN_BC_STATUS 14
#define PID_MONITOR_BC_STATUS 15
#define PID_INV_SIGN_CMD 16
#define PID_USE_LIMIT_SW 17
#define PID_INV_ALARM 18
#define PID_HALL_TYPE 19
#define PID_INPUT_TYPE 25
#define PID_PRESET_SAVE 30
#define PID_PRESET_RECALL 31

// PID two-byte DATA : PID 128 ~ 192


#define PID_VEL_CMD 130
#define PID_VEL_CMD2 131
#define PID_ID 133
#define PID_OPEN_VEL_CMD 134
#define PID_BAUD_RATE 135 // 9600, 19200, 38400, 57600 , 115200
#define PID_ECAN_BITRATE 137 // 50K,100K,250K,500K,1M
#define PID_INT_RPM_DATA 138
#define PID_TQ_DATA 139

#define PID_VOLT_IN 143


#define PID_CCW_PHASE_OFFSET 146
#define PID_CW_PHASE_OFFSET 147

// 0 no return, 1:Monitor, 2:Ack return


#define PID_RETURN_TYPE 149
#define RETURN_TYPE_MONITOR 1
#define RETURN_TYPE_ACK 2
#define RETURN_TYPE_IO_MONITOR 3

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 49/54


RS485(232) communication protorol on MD series controller

#define PID_TQ_PO 150


#define PID_OVER_MODULATION 152
#define PID_SLOW_START 153
#define PID_SLOW_DOWN 154
#define PID_TAR_VEL 155
#define PID_ENC_PPR 156
#define PID_LOW_SPEED_LIMIT 157
#define PID_HIGH_SPEED_LIMIT 158
#define PID_SLOW_START_DOWN 159
#define PID_DEAD_ZONE 162
#define PID_READ_ADDR 163
#define PID_REQ_PID_DATA2 164

// PID N-byte DATA : PID 193 ~ 240


#define PID_MAIN_DATA 193
#define PID_IO_MONITOR 194
#define PID_MONITOR 196
#define PID_POSI_DATA 197
#define PID_RPM_DATA 198
#define PID_VEL_GAIN 202
#define PID_VEL_GAIN2 203
#define PID_TYPE 205
#define PID_PNT_POSI_VEL_CMD 206
#define PID_PNT_VEL_CMD 207
#define PID_PNT_OPEN_VEL_CMD 208
#define PID_PNT_TQ_CMD 209
#define PID_PNT_MAIN_DATA 210
#define PID_MAX_LOAD 211
#define PID_LIMIT_TQ 212
#define PID_PNT_INC_POSI_CMD 215

#defien PID_POSI_SET 217


#define PID_POSI_SET2 218

#define PID_POSI_VEL_CMD 219


#define PID_INC_POSI_VEL_CMD 220 // Incremental posi. cmd.
#define PID_MAX_RPM 221
#define PID_SPEED_LIMIT 222
#define PID_MIN_RPM 223

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 50/54


RS485(232) communication protorol on MD series controller

#define PID_SPEED_LIMIT2 224


#define PID_STEP_INPUT 225 // No, input.
#define PID_CURVE_PT 226 // No. PtX(int), PtY(int)
#define PID_PRESET_DATA 227 // only position.

#define PID_POSI_MIN_LIMIT 231


#define PID_POSI_CEN 232
#define PID_POSI_MAX_LIMIT 233
#define PID_TIME 234
#define PID_CAN_RESEND 238
#define PID_FUNC_SPEED 239
#define PID_PHASE_OFFSET 241
#define PID_POSI_CMD 243
#define PID_INC_POSI_CMD 244
#define PID_WRITE_ADDR 245
#define PID_PNT_POSI_CMD 246
#define PID_FUNC_POSI 250

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 51/54


RS485(232) communication protorol on MD series controller

2.5 Sample program

// Test the packet using check-sum in InBuf


short IsChkSumOK(BYTE *byArray, short nPacketSize)
{
short i;
BYTE cbySum;

cbySum = 0;
for(i=0; i<nPacketSize; i++) {
cbySum += *(byArray + i);
}
if(cbySum==0) return 1;
else return 0;
}

// From the input array, return the chksum


BYTE GetCheckSum(short nPacketSize, BYTE *byArray)
{
BYTE byTmp=0;
short i;

for(i=0; i<nPacketSize; i++) byTmp += *(byArray+i);


return (~byTmp + 1);
}

short GetMainData(BYTE byData[])


{
BLDC.nRPM = Byte2Int(byData[0], byData[1]);
BLDC.wTq = Byte2Int(byData[2], byData[3]);
BLDC.byType = byData[4]; //Control type
BLDC.nRefVel = Byte2Int(byData[5], byData[6]);
BLDC.nOut = Byte2Int(byData[7], byData[8]);
BLDC.byStatus = byData[9];;
BLDC.nPosi = Byte2LInt(byData[10], byData[11], byData[12], byData[13]);
BLDC.byBrakeDuty = byData[14];
BLDC.byTemp = byData[15];
return 1;
}

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 52/54


RS485(232) communication protorol on MD series controller

// Make interger from two bytes


short Byte2Int(BYTE byLow, BYTE byHigh)
{
return (byLow | (short)byHigh<<8);
}

// Make long type Data from four bytes


int Byte2LInt(BYTE byData1, BYTE byData2, BYTE byData3, BYTE byData4)
{
return((int)byData1 | (int)byData2<<8 | (int)byData3<<16 | (int)byData4<<24);
}

typedef struct {
BYTE byLow;
BYTE byHigh;
} IByte;

typedef struct {
BYTE byData1;
BYTE byData2;
BYTE byData3;
BYTE byData4;
} LByte;

// Get the low and high byte from interger


IByte Int2Byte(short nIn)
{
IByte Ret;

Ret.byLow = nIn & 0xff;


Ret.byHigh = nIn>>8 & 0xff;
return Ret;
}

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 53/54


RS485(232) communication protorol on MD series controller

3 History

VERSION DATE CONTENTS


V3.6 2013.05.09 PID number 10, 16, 137, 144, 150, 152, 153, 154, 155, 238, 241 added
V3.7 2013.05.16 PID number 17, 131, 149, 194, 238 added.
CMD_MAX_LOAD_OFF,25
CMD_ENC_PPR_OFF,26
CMD_LOW_SPEED_LIMIT_OFF,27
V3.8 2013.08.02
CMD_HIGH_SPEED_LIMIT_OFF, 28 added
PID number 19, 21, 156, 157, 158, 203 added
Write funn. Added of PID211, PID_MAX_LOAD
PID number 19, 21, 25, 30, 31, 159, 162, 163, 164, 203, 222, 225, 226,
V3.9 2014.04.17
227 added
MID defined.
V4.0 2016.01.14
PID added.
V4.1 2016.09.20 PID added on torque(current) control
PID_PNT... added.(two motor controller or to drive two motor controller
Concurrently(PNT50, MD750T, MD400T)
V4.2 2017.01.22
PID_CW_PHASE_OFFSET, ..CCW_PHASE_OFFSET replaced
PID_PHASE_OFFSET(241)
V4.3 2017.10.11 Special function related PID added(139, 250, 183, 184)
PID_PNT... related protocol changed(with return Data type definition)
RJ45 pin map is changed(our controller changed it’s RJ45 signal type for the
V4.4 2019.07.16
optimum noise filtering, so refer to the page 5
RS584- and TTL232TxD signal is changed each other.
V4.5 2021.01.10 PID, terminology added

- The end -

www.motordriver.co.kr Ver.4.5 Jan./2021 P. 54/54

You might also like