0% found this document useful (0 votes)
35 views

RS485 Communication Protocol-V47

The document discusses the RS485 communication protocol for MD series BLDC motor controllers. It includes details on the controller models, communication terminology, packet structure, and parameter IDs. The protocol allows sending and receiving data to control motor speed, position, and other parameters. Data is transmitted in packets with a header, ID numbers, parameter ID, data number, data values, and checksum for error checking.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

RS485 Communication Protocol-V47

The document discusses the RS485 communication protocol for MD series BLDC motor controllers. It includes details on the controller models, communication terminology, packet structure, and parameter IDs. The protocol allows sending and receiving data to control motor speed, position, and other parameters. Data is transmitted in packets with a header, ID numbers, parameter ID, data number, data values, and checksum for error checking.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 78

RS485(232) communication protorol on MD series controller

Communication protocol on
MD series controllers
(ver.4.5)

www.motordriver.co.kr Ver.4.7 May./2022 P. 1/78


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 12~24VDC 3 ○
MD50C 12~24 VDC 3.5 ○ ○ ○
PNT50 12~48 VDC 3x2 ○ ○
MD100 12~24 VDC 7 ○
MD200 12~48 VDC 10 ○ ○ ○
MD200T 12~48 VDC 10x2 ○ ○ ○ ○ ○ ○
MD400 12~48 VDC 20 ○ ○ ○ ○ ○ ○ ○ ○
MD400T 12~48 VDC 20x2 ○ ○ ○ ○ ○ ○ ○ ○
MD500S C12~48 VDC 20 ○ ○ ○ ○ ○ ○
MD750 24~72 VDC 30 ○ ○ ○ ○ ○ ○ ○ ○
MD750T 24~72 VDC 30x2 ○ ○ ○ ○ ○ ○ ○ ○
MD1K 12~48 VDC 50 ○ ○ ○ ○ ○ ○ ○ ○
MD1KT 24~72 VDC 50x2 ○ ○ ○ ○ ○ ○ ○ ○
MD2K 24~72 VDC 100 ○ ○ ○ ○ ○ ○ ○
MDA200 110~220VAC 1.5 ○(Op) ○ ○
MDA400 110~220 VAC 2.5 ○(Op) ○ ○(Op) ○
MDA1K 110~220 VAC 5 ○ ○ ○ ○ ○ ○ ○
110~220 VAC
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.7 May./2022 P. 2/78


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.7 May./2022 P. 3/78


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.7 May./2022 P. 4/78


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 :
l Sending:
BYTE byChkSend, byCHK;
byChkSend = RMID+TMID+ID+PID+Data number + Data..;
byCHK = ~byChkSen +1

l Receiving:

www.motordriver.co.kr Ver.4.7 May./2022 P. 5/78


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)

START/STOP

Wiring condition on the moving direction and limit switch

www.motordriver.co.kr Ver.4.7 May./2022 P. 6/78


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.7 May./2022 P. 7/78


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.7 May./2022 P. 8/78


RS485(232) communication protorol on MD series controller

- The contents of CMD(PID_COMMAND, 10)


Type : C(command), W(write data to memory)
No. PID_COMMAND Type Contents on CMD number
2 CMD_TQ_OFF C Tq-off, motor free state
3 CMD_BRAKE2 C Brake command for motor2(at dual channel controller)
4 CMD_BRAKE C Erectric brake
5 CMD_MAIN.. BC_ON C PID_MAIN_DATA, broadcasting ON
6 CMD_MAIN_BC_OFF C broadcasing OFF of PID_MAIN_DATA
8 CMD_ALARM_RESET C Reset alarm
10 CMD_POSI_RESET C Position reset(set position to zero)
11 CMD_MONITOR_BC_ON C PID_MONITOR, broadcasting ON
12 CMD_MONITOR_BC_OFF C Broadcasting off of PID_MONITOR
13 CMD_IO_MONITOR_ON C PID_IO_MONITOR BC ON
14 CMD_IO_MONITOR_OFF C PID_IO_MONITOR BC OFF
15 CMD_FAN_ON C Fan ON(motor cooling fan)
16 CMD_FAN_OFF C Fan OFF
17 CMD_CLUTCH_ON C Mechanical brake(clutch) ON
18 CMD_CLUTCH_OFF C Mechanical brake OFF
20 CMD_TAR_VEL_OFF C/W Erase target vel, set by PID_TAR_VEL
21 CMD_SLOW_START_OFF C/W Erase target slow/start value
22 CMD_SLOW_DOWN_OFF C/W Erase target slow/down vaule
23 CMD_CAN_RESEND_ON, C Send CAN data to RS485 serial port.
24 CMD_CAN_RESEND_OFF C Turn off resending of CAN data
25 CMD_MAX_TQ_OFF C Erase target limit load(max. current)
26 CMD_ENC_OFF C/W Cancel the use of encoder sensor.
27 CMD_LOW_SPEED_LIMIT_OFF, C/W Cancel the set of low speed limit.
28 CMD_HIGH_SPEED_LIMIT_OFF C/W Cancel the set of high speed limit.
29 CMD_SPEED_LIMIT_OFF C/W Cancel the set of low/high speed limits.

30 CMD_HALL_PPM_OFF C/W Cancel the set of HALL_PPM for linear cylinder control
31 CMD_CURVE.. OFF C/W Cancel set of curve fitting func.
32 CMD_STEP.. OFF C/W Cancel step input mode
44 CMD_UICOM_OFF C I/O control(ctrl 11pin cnt) available
45 CMD_UICOM_ON C I/O control disable(when comm. is used)
46 CMD_MAX_RP._OFF C/W Cancel max. speed set by DIP SW
47 CMD_HALL_TY..OFF C/W Cancel set of motor hall type
48 CMD_LOW..POT_OFF C/W Cancel set of low limit of POT input
49 CMD_HIGH.POT_OFF C/W Cancel set of high limit of POT input
50 CMD_MAIN..BC_ON2 C PID_MAIN_DATA, BC ON for 2nd motor

www.motordriver.co.kr Ver.4.7 May./2022 P. 9/78


RS485(232) communication protorol on MD series controller

No. PID_COMMAND Type Contents on CMD number


51 CMD_MAIN..BC_OFF2 C PID_MAIN_DATA, BC OFF for 2nd motor

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

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


54 CMD_IO_MONIT..BC_ON2 C 54 : PID_IO_MONITOR, BC ON for 2nd motor
55 CMD_IO_MONIT..BC_OFF2 C 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 W Save the motor position and operating time(s)
61 CMD_PNT_MAIN_DATA_BC_ON C Broadcasting on for PID_PNT_MAIN_DATA
62 CMD_PNT_MAIN_DATA_BC_OFF C Broadcasting off for PID_PNT_MAIN_DATA
63 CMD_INIT_SET C Reserved
64 CMD_CLR_ALARM_LOG C/W Clear alarm log data(refer to the PID_ALARM_LOG)
Reset the encoder param set(not use encoder) for
65 CMD_ENC1_OFF C/W
motor1 of dual channel controller
Reset the encoder param set(not use encoder) for
66 CMD_ENC2_OFF C/W
motor2 of dual channel controller
Stop the motor and turn on the electric-brake
67 CMD_EMER_ON C
(short of UVW output)
68 CMD_EMER_OFF C Stop the motor and set the motor free state(Tq-off)
69 CMD_BRAKE1 C Electric brake on for motor1
70 CMD_BRAKE2 C Electric brake on for motor2
71 CMD_POSI_SS_OFF C/W Not use position SLOW/START param.
72 CMD_POSI_SD_OFF C/W Not use position SLOW/DOWN param.
73 CMD_INIT_SET_CW C Initial setting command with direction CW

75 CMD_ROBOT_ANG_RESET C Reset robot angle


76 CMD_ ROBOT_MONITOR_BC_ON C Broadcasting on for the PID_ROBOT_MONITOR
77 CMD_ROBOT_MONITOR_BC_OFF C Broadcasting off for the PID_ROBOT_MONITOR
78 CMD_GOTO_BOOT_MODE C/W Reserved
79 CMD_RESET_SYSTEM C Reset the controller(rebooting)
80 CMD_BUZZER_ON C/W Buzzer used for the buzzer installed controller
81 CMD_BUZZER_OFF C/W Buzzer is not used
Off the Syncronization control(normal controller)
83 CMD_SYNC_OFF C/W
(master-slave control)
84 CMD_NO_SYSTEM_RESET C Protect to reset system by commucation
PNT_PNT_IO_MONITOR BC(Broadcasting)
85 CMD_PNT_IO_MONITOR_ON C
Or Heartbeat (10Hz)

www.motordriver.co.kr Ver.4.7 May./2022 P. 10/78


RS485(232) communication protorol on MD series controller

No. PID_COMMAND Type Contents on CMD number


89 CMD_RESET_TOTAL_CNT C Reset counting when aging system
90 CMD_INIT_SET2 C/W Command for FUNC_INIT_SET2 of FUNC_CMD(183, 184)
91 CMD_STALL_ALARM_OFF C/W Don’t generate stall-alarm
92 CMD_STALL_ALARM_ON C/W Stall-alarm available(default)

www.motordriver.co.kr Ver.4.7 May./2022 P. 11/78


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 : there is no inversion on motor speed, posi.
BYTE
22 R/W PID_INV_SIGN_OUT 1 : Inverse for motor speed and position
0
Motor speed : 500rpm -> -500rpm(monitor)
183, TMID, ID, 22, 1, DATA, CHK

www.motordriver.co.kr Ver.4.7 May./2022 P. 12/78


RS485(232) communication protorol on MD series controller

DATA(applied for dual channel controllers)


0 : No signal inversion for motor2(default) BYTE
23 R/W PID_INV_SIGN_OUT2
1 : Inversion for motor2 signal(speed, position) 0
183, TMID, ID, 23, 1, DATA, CHK
PID_STOP_STATUS
Control stop status DATA(0, 1, 2)
(when the speed input is 0 : If speed input is zero, don't control(free)
zero, START/STOP->ON) 1 : Control zero speed(servo-lock)
0 : STOP_TQ_OFF 2 : Full dynamic braking BYTE
24 R/W
1 : STOP_SERVO_LOCK 3 : If reference speed is zero then tq-off motor 0
2 : STOP_BRAKE 4 : After motor stop, full dynamic braking
3 : STOP_FREE 5 : START/STOP signal off->full dyanmic braking
4 : STOP_BRAKE2 183, TMID, ID, 24, 1, DATA, CHK
5 : STOP_SS_BRAKE
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)

www.motordriver.co.kr Ver.4.7 May./2022 P. 13/78


RS485(232) communication protorol on MD series controller

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.7 May./2022 P. 14/78


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
Potentiometer/ Must be
Refer
Signal input of connected
4 0.25~4.75V 2.5V PID_POSI_INPUT_M
CTRL (Pin #10) is motor and
ODE(42)
postion of motor potentiometer
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.7 May./2022 P. 15/78


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

▓ JS COMPLEX(Joystick complex mode)


- In dual channel controllers, the J/S(joystick) is used as a wheel-chair J/S, so control vehicle with easy
- To make the moving direction is same with J/S direction, the left and right wheels are moved separatly
- The control input(START/STOP, RUN/BRAKE, DIR) is applied with same function
- RC_COMPLEX, PULSE_COMPLEX mode is save with JS_COMPLEX mode

www.motordriver.co.kr Ver.4.7 May./2022 P. 16/78


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.7 May./2022 P. 17/78


RS485(232) communication protorol on MD series controller

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


DATA(0, 1, 2)
PID_TQ_INIT_SET
1 : Initial action for(+, CCW)direction
Initial setting is proceded
2: Initial action for (-, CW) direction
by motor current, not
When system detect more then setting
limit-switch
tq(current) then, stop and set the position to
To set the tq-limit
zero
26 C value(as a tq(current)
0 : Stop the init. Action(forced stop)
switch, use
This command is save with
PID_TQ_LIMIT_SW_VAL
FUNC_CMD_TYPE(183) value #3
Default value is about
The init. setting speed is about 20% of max.
1/5 of system max.
speed
current for safety
183, TMID, ID, 35, 1, DATA, CHK
Operating condition on limit switch for MOT2 of BYTE
27 R/W PID_LIMIT_STOP_COND2
MdxxT controller(refer PID_LIMIT_STOP_CON) 0
Stop condition on MOT2 of MDxxTcontroller BYTE
28 R/W PID_STOP_STATUS2
(refer PID_STOP_STATUS) 0
Set the control I/O(DIR, START/STOP) as a limit
BYTE
29 R/W PID_USE_LIMIT_SW2 switch for MOT2 of MdxxT controller
0
(refer PID_USE_LIMIT_SW)

www.motordriver.co.kr Ver.4.7 May./2022 P. 18/78


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
0 : stop the tour function
PID_TOUR_START 1 : start the tour function and when reach to the BYTE
Move to the positions preset position then keeps the motor free(tq off PID_TOUR_DATA(
33 C which are set by state) 191)refer to this
preset(needed more 2 : start the tour function and when reach to the PID
than 2points) target preset position, keeps the motor as a
servo-lock conditino(STOP_SERVO_LOCK)
183, TMID, ID, 33, 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

www.motordriver.co.kr Ver.4.7 May./2022 P. 19/78


RS485(232) communication protorol on MD series controller

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


DATA(0, 1, 2)
1 : CCW(+) motor direction for initialization
2: CW(-) motor direction for initialization

Turnning the motor with this initial direction, if


the I/O(INT_SPEED) input is detected, stop the
initialization and set this position to zero.
3 : for MDxxT type controller, set the
initialization direction following
(MOT1->CW, MOT2->CCW)
35 C PID_INIT_SET BYTE
4 : for MDxxT type controller
(MOT1->CCW, MOT2->CW)

0 : Stop initialization(forced stop)


If there is no set initialization speed, the motor
speed will be 20% of max. speed
And about the other type initializtion(INIT_SET2,
TQ_INIT_SET)
Refer to PID_FUNC_CMD_TYPE(183)
183, TMID, ID, 35, 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.7 May./2022 P. 20/78


RS485(232) communication protorol on MD series controller

▓ PID and COMMAND on Initialization

PID 명명 내용
-CMD_INIT_SET(63) : CCW direction initialization on PID_INIT_SET(35)
-CMD_INIT_SET_CW(73) : CW direction initialization on PID_INIT_SET
10 PID_COMMAND
-CMD_INIT_SET2(90) : CW(-) direction initialization and as the limit
switch the I/O, DIR(CTRL #6) is used
Initialization by motor current(tq)
25 PID_TQ_INIT_SET
(applied after May,6, 2022)
35 PID_INIT_SET Initailization by the I/O, INT_SPEED(CTRL, #2) as a limit switch
85 PID_FUNC_INIT_SET_DIR When the function, FUNC_IO_RECALL is used, the initial direction is set
87 PID_INIT_SET_OK Return 1 when initialization is ended
249 PID_INIT_SET_RPM Set the initialization speed(rpm)

For the command of initialization by MDUI, the command is sended pressing by button, Start InitSet(CW) or
Start InitSet(CCW), then the initialization speed is set about 20% of max. speed

www.motordriver.co.kr Ver.4.7 May./2022 P. 21/78


RS485(232) communication protorol on MD series controller

▓ Status BIT(STATE) : PID_CTRL_STATUS(34), STATUS2(39)


BIT Notation Contents
0 ALARM 1-> if there is any controller alarm, 0->no alarm
1 CTRL_FAIL The motor speed is larger than 15% of reference speed for 5s
-System voltage is over than that of normal range for 0.1s
-Input power level(over voltage detection level)
2 OVER_VOLT
220VAC(over 280VAC), 24VDC(43VDC), 48VDC(61VDC)
72VDC(100VDC)
3 OVER_TEMP More than temperature 65°C
-Overload(over than 4s at max. control load)
4 OVER_LOAD
-More than 4s operation with above 95% of limit current
HALL_FAIL or
5 -Hall-sensor fail or Inversed speed sign
ENC_FAIL
6 INV_VEL -Inverse speed fail is set more than 2s speed misalignment
7 STALL less than 5rpm and more than 50% of limit current for 3s

▓ 상태표시 2 BIT(STATE2)
BIT 명명 내용
0 REGEN_OVER_TEMP Over temperature on 100°C at regenerative resistance
1 ENC_FAIL Encoder fail(not detected the normal encoder signal)
2 SYNC_SLAVE_FAIL When the Sync. Controll is set and there is any slave controller’s error
When the Sync. Controll is set and there is no slave controller’s
3 SYNC_COM_FAIL
response

www.motordriver.co.kr Ver.4.7 May./2022 P. 22/78


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
1 : the input of RC, JS, ANALOG is used as a
refenrence position input
And the min., center, max. position is set by
following PID
PID_POSI_MIN_LIMIT(231), default : 205(5% of
4095)
BYTE
42 R/W PID_POSI_INPUT_MODE PID_POSI_CEN(232), default : 2048(50% of 4095)
0
PID_POSI_MAX_LIMIT(233), 3890(95% of 4095)

The relation bewteen reference position and the


input of device(RC, JS, ANALOG) is in the
following page
0 : normal speed control
183, TMID, ID, 42, 1, DATA, CHK

www.motordriver.co.kr Ver.4.7 May./2022 P. 23/78


RS485(232) communication protorol on MD series controller

■ input mode : INPUT_ANALOG and the 이며 위치제어입력인 경우(-1500, 0, 1500 의 위치리미트값 셋팅


조건인 경우)

아날로그 입력(외부 볼륨)과 방향입력(DIR) 의 조합에 의하여 위치입력이 결정됨


DIR 이 OFF(CCW)인 경우는 볼륨의 입력에 따라서 기준위치입력은 0~1500 이 되며
DIR 신호가 ON(CW)인 경우는 0~-1500 이 입력됨
여기서 -1500~1500 은 제어해야할 BLDC 모터의 위치값임
(PID_POSI_MIN_LIMIT(231), PID_POSI_CEN(232), PID_POSI_MAX_LIMIT(233) 참조)

기준입력(모터위치)

Max.(1500)

Max(5V) DIR(CW) 가변볼륨입력(0~5V)

DIR(CCW) Max(5V)

0( CEN)

Min.(-1500)

아날로그입력인 경우의 위치제어모드

■ 입력모드가 RC 또는 JS(조이스틱) 이며 위치제어입력인 경우(-1500, 0, 1500 의 위치리미트값 셋팅 조건)

RC 입력과 조이스틱입력모드에서는 0 을 기준으로 최소값(-) 및 최대값(+)이 나오며 이 값에 DIR 이 ON(CW)인


경우에는 입력값의 부호가 바꿔짐
2 가지 입력의 경우에도 상기 아날로그 입력처럼 최대, 최소값에 따라서 설정된 위치 최소 최대값으로 제어가 되나
단, RC 및 J/S 입력은 데드죤(DEAD ZONE)의 부분에서는 입력이 0 의 값이 됨
여기서 RC 입력은 펄스폭 1.05~1.95ms, 센터값은 1.5ms 이며 J/S 의 중간값은 2.5V, 최소값은 0V, 최대값은 5V 에
해당하며, 기본 DEAD_ZONE 의 값은 ±10%에 해당하는 2~3V 임(PID_INPUT_TYPE(25) 참조)

기준입력(모터위치)

Max.(1500)

Min(0V/1.05ms) DIR(CW) 가변입력(min~max)

DIR(CCW) Max(5V/0.95ms)

DEAD_ZONE

Min.(-1500)

RC 및 J/S 입력인 경우의 위치제어모드


www.motordriver.co.kr Ver.4.7 May./2022 P. 24/78
RS485(232) communication protorol on MD series controller

■ 포텐시오미터의 위치를 모터의 위치로 입력하고 통신입력에 의하여 위치제어를 하는 방법

1) 입력타입을 INPUT_POT(4) 로 설정(PID_INPUT_TYPE(25) 참조)


2) 통신으로 205~3,890 사이의 위치입력을 보내서 위치제어함(PID_POSI_CMD(243)참조)

당사의 모터와 포텐시오미터 센서하우징 MDSEN 을 벨트-풀리로 연결하여 위치제어하는 경우

포텐시오미터를 모터와 연결하여 위치제어를 하는 경우에 사용됨, 이때 위치의 입력범위는 0~4095 의 값을 가지며
최저값 및 최고값의 경계는 PID_LOW_POT_LIMIT(172), PID_HIGH_POS_LIMIT(173)에 의하여 설정됨
상기 리미트의 값이 설정되어있지 않은 경우에는 안전을 위하여 최저, 최대값은 4095(10 bits)의 5%와 95%, 즉
205~3,890 의 범위로 설정됨
위치기준입력이 이 설정범위를 벗어난 경우에는 최저, 또는 최대 리밋값으로 설정됨

■ MDSEN Spec.

Items Contents Remark

Nominal resistance value 5kΩ

Resistance tolerance ±20%

Independent linearity ±2%

Effective electrical angle 324˚±5˚

Mechanical angle 300˚

Operation temp. range -30~80℃

Protecting grade IP40

Weight 0.05kg

Output smoothness 0.1% maximum

www.motordriver.co.kr Ver.4.7 May./2022 P. 25/78


RS485(232) communication protorol on MD series controller

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


DATA
PID_SINE_CTRL BYTE
43 R/W 1 : 정형파로 구동, 0:구형파 구동
정형파 구동 설정 1
183, TMID, ID, 43, 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(0, 1)
PID_USE_EPOSI 0 : 위치정보를 홀센서 위치로 전송함
위치정보를 모터의 1 : 위치정보를 엔코더의 위치로 전송함 BYTE
46 R/W
홀센서가 아닌 장착된 단, 엔코더 위치를 사용하는 경우에 0
엔코더의 위치로 받음 위치정보(long 타입)의 오버플루가 발생할 수 있슴
183, TMID, ID, 46, 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.7 May./2022 P. 26/78


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.7 May./2022 P. 27/78


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
PID_USE_CLUTCH DATA(0, 1)
63 R/W BYTE
클러지 사용유무 183, TMID, ID, 63, 1, DATA, CHK
PID_USE_CLUTCH2 DATA(0, 1) BYTE
64 R/W
모터 2, 클러지 사용유무 183, TMID, ID, 64, 1, DATA, CHK mdxxt 제어기
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

www.motordriver.co.kr Ver.4.7 May./2022 P. 28/78


RS485(232) communication protorol on MD series controller

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
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.7 May./2022 P. 29/78


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)
4 : MDH150(30p, 200rpm, 4096CPR) BYTE
79 R/W PID_MOT_TYPE
5 : MDH250(30p, 200rpm, 4096CPR) 0
6 : AGV750(8p, 3000rpm, 2500CPR)
7 : GGM_INV(GGM co., ltd)
8 : MDS200(MD400Rdriving module)
9 : MDH80(4”, 20p, 300rpm, 1024CPR)
10 : MDH300(8”m 29p, 600rpm, 1280CPR)
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 more than 0.2s(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.7 May./2022 P. 30/78


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

www.motordriver.co.kr Ver.4.7 May./2022 P. 31/78


RS485(232) communication protorol on MD series controller

■ 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

- RS485 통신연결,
- 마스터제어기 1 대가 다수의
6
슬레이브제어기와 485 통신으로 연결되며
SYNC_485_M
마스터제어기에는 RS485 통신외의
ULTI
수단으로 기준명령을 입력함(CTRL I/O,
CAN, ..) 마스터-RS485 통신-복수의 슬레이브

7 - CAN 통신연결
SYNC_CAN_ - 마스터제어기는 CAN 통신외의 수단으로
MULTI 기준명령을 입력함(RS485, CTRL I/O..)

마스터-CAN 통신-복수의 슬레이브

www.motordriver.co.kr Ver.4.7 May./2022 P. 32/78


RS485(232) communication protorol on MD series controller

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


DATA(0, 1)
PID_TWIN_ALARM_ON
0 : each motor stops by it’s own alarm only
MDTx, PNT50 BYTE
83 R/W 1 : if there is any alarm(MOT1 or MOT2), two
For dual type controller 1
motor stop together
183,TMID, ID, 83, 1, DATA, CHK
DATA(0, 1)
0 : modbus communication available(but, MD
PID_NO_MODBUS protocol is acknolowged then modbus is not
BYTE
84 R/W Modbus communication allowed)
0
not allowed 1 : modus communication not allowed,
MDROBOT protocol available only
183,TMID, ID, 84, 1, DATA, CHK
DATA(0, 1)
0 : initialization direction(CCW, +) BYTE
85 R/W PID_FUNC_INIT_SET_DIR
1 : initialization direction(CW, -) 0
183,TMID, ID, 85, 1, DATA, CHK
DATA(0, 1)
0 : safety function not available
PID_USE_RC_LIMIT_SW
DIR, START/STOP input is used as control I/Os
In the RC or J/S input BYTE
86 R/W 1 : DIR, START/STOP are used as limit swithes,
mode, this command use 0
(DIR->CW direction limit switch,
as a safety conditon
START/STOP->CCW direction limit switch)
183,TMID, ID, 85, 1, DATA, CHK
DATA(0, 1), MDT 제어기에서는(0, 1, 2, 3)
87 R PID_INIT_SET_OK MDT 제어기에서는 BIT0,BIT1 이 각 MOT1,2 의 BIT
상태를 표시함
DATA(0, 1)
1: MDxxT 제어기 에서 모터 한 개가 리밋스위치에 BYTE
89 R/W PID_STOP_ALL_BY_LSW
의하여 멈추는 경우, 다른 모터도 멈추는 기능 0
183,TMID, ID, 89, 1, DATA, CHK
PID_INT_SPEED_ DATA
INV_SIGN 1 : INT_SPEED 신호를 반전(HIGH->ON) BYTE
90 R/W
CTRL 커넥터 2 번의 0 : 반전하지 않음(LOW->ON) 0
INT_SPEED 신호 반전 183, TMID, ID, 90, 1, DATA, CHK

www.motordriver.co.kr Ver.4.7 May./2022 P. 33/78


RS485(232) communication protorol on MD series controller

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


DATA(0~255) : 모터턴수
리미트스위치가 동작되는 위치에서
설정모터회전수에 해당하는 위치부터 감속주행함,
PID_LIMIT_STOP_TURN 이때 감속의 속도는 PID_INIT_SET_RPM 으로
리미트스위치 가기전의 정해진 속도로 진행하거나, 이 속도가 설정이 BYTE
91 R/W
위치에서 모터의 감속주행 되어있느 않은 경우에는 최대속도의 1/10 에 0
0->기능 수행하지 않음 해당하는 속도로 감속함(기구적 리미트 위치에서
부드럽게 멈추기 위함)
이값이 0 인 경우에는 감속기능을 수행하지 않음
183,TMID, ID, 91, 1, DATA, CHK
DATA(0, 1)
0 : 스톨알람(모터이상정지 감지) 사용하지않음
1 : 스톨알람의 사용
PID_STALL_ALARM_ON DC 리니어실린더의 경우에 자체적으로 실린더의 BYTE
92 R/W
스톨알람의 사용 유,무 기구끝단에서 출력을 끊어주므로 속도가 0
감지되지않아 알람을 띄울 수 있슴, 이러한 경우를
피하려면 스톨알람을 사용하지 않아야 함.
183,TMID, ID, 92, 1, DATA, CHK

www.motordriver.co.kr Ver.4.7 May./2022 P. 34/78


RS485(232) communication protorol on MD series controller

■ PID: 95~99(1~N bytes data, PPID 를 가지는 통신패킷

PID_MDJS_CTRL(95)~99 번 까지는 첫번째 데이터가 하부 PID(Peripherial PID) 구조로 사용됨

통신속도 : 38,400bps

Header ID Parameter ID Data nubmer D1 D2~Dn Check sum


RMID TMID ID PID DataNumber PPID DATA CHK
1 byte 1 byte 1 byte 1 byte 1 byte(PPID 포함) 1 byte 2~n bytes 1 byte

- RMID(Receiving Machine ID) : 패킷의 첫번째 인식바이트(183, 모터제어기)


MID 명명 주로 사용되는 제어기의 내용
133 MID_MDJS MDJS(조이스틱 콘트롤러)
183 MID_BLDC_CTR BLDC/DC motor controller(MD, MDT, DMD, DMDT series)
184 MID_BRIDGE_CTR MDUI, TD, MDRC

- TMID(Transmitting Machine ID) : 패킷의 두번째 인식바이트(TMID, 사용자 제어기)


- ID: 각제어기의 ID(0~253, Broadcasting ID: 254)
- PID : Parameter IDentification number
- PPID : Peripherial PID(하위 PID, 1~254)
- CHK : Check Sum

PID_MDJS_CTRL(95)번은 MDJS 제어기를 기준으로 주변 장치와의 통신사양을 규정함


주변장치로는 로봇장애물 감지 제어기 및 기타 센서처리 제어기 등이 있슴
PID 타입 PID Name / 설명 내용/범위 기본값/기타
DATA number : n-1 bytes
보낼 때(MDJS:master 로 하는 경우)
PID_MDJS_CTRL Data : D2~Dn
아래의 PPID
95 R/W MDJS(MID, 133) PPID : PID_MDJS_CTRL 의 하부 PID
관련 내용 참조
중간제어기(MDUI, 184) RMID, 133, ID, 95, n, PPID, D2, ..., Dn, CHK
받는 경우(MDJS 입장에서)
133, TMID(184), ID, 95, n, PPID, D2,..., Dn, CHK

www.motordriver.co.kr Ver.4.7 May./2022 P. 35/78


RS485(232) communication protorol on MD series controller

#해당 상위 PID : PID_MDJS_CTRL(95)


PPID 타입 PPID Name /설명 내용/범위 기본값/기타
DATA number : 12
D1 : PPID(194)
D2,3 : Y 방향 조이스틱입력(-1023~1023)
D4,5 : X 방향 입력(좌,우 선회용, -1023~1023)
D6 : BT(8bits)
BIT0 : -버튼입력, BIT1 : +버튼입력
BIT2 : 부져(경음기)버튼 입력
BIT3 : C(속도감소)버튼 입력
BIT4 : M(속도증가)버튼입력
PPID_MDJS_MONITOR BIT5 : 비상(삼각형)버튼 입력
INT
194 R MDJS(MID, 133) BIT6 : Left 버튼(<<), BIT7 : Right 버튼(>>)
BIT
중간제어기(MDUI, 184) D7 : DI(8bits)
BIT0~3 : DI1~4 입력
BIT4 : 좌측면에 장착된 버튼 입력
BIT5 : 우측면에 장착된 버튼 입력
BIT6 : DIP_SW1 입력, BIT7 : DIP_SW2 입력
D8 : 스피드레벨(1~5)
D9 : 엔코더신호입력(BIT0~5), ENC1_B~ENC2_Z
D10 : 홀센서신호입력(BIT0~5), H1U~H2W
D11,12 : 외부 ADC 입력 1ch(0~1023)
TMID, 133, ID, 95, 12, PPID, D2, ..Dn, CHK

-버튼
Y 방향(전진)

뷰져(경음기)버튼

C 버튼(최대속도감소)

M 버튼(최대속도증가)

+버튼

비상버튼

우측면 장착버튼

www.motordriver.co.kr Ver.4.7 May./2022 P. 36/78


RS485(232) communication protorol on MD series controller

-MDJS 의 버튼 배선(외부배선), 내부커넥터(YDW200-26)


배선번호 Color 명명 내용
1 Black Gnd Ground(0V)
2 Brown HALL1_U 모터 1 의 홀센서 U 상 입력
3 Yellow HALL1_V 모터 1 의 홀센서 V 상 입력
4 Magenta HALL1_W 모터 1 의 홀센서 W 상 입력
5 Purple HALL2_U 모터 2 의 홀센서 U 상 입력
6 Orange HALL2_V 모터 2 의 홀센서 V 상 입력
7 Black HALL2_W 모터 2 의 홀센서 W 상 입력
8 Orange AD1 외부 ADC1(0~5V)입력
9 Red AD2 외부 ADC2(0~5V)입력
10 Sky blue DI1 외부 디지털입력 1(외부 비상스위치 입력)
11 Sky blue DI2 외부 디지털입력 2(충전기 도킹상태입력)
12 Black DI3 외부 디지털입력 3
13 Yellow CDIN 외부 RC 입력
14 White RS485+ RS485 통신 (+신호)
15 Gray RS485- RS485 통신 (-신호)
16 Brown DI4 외부 디지털입력 4
17 Magenta CAN_H CAN 통신(+신호)
18 Black CAN_L CAN 통신(-신호)
19 Green ENC1_B 모터 1 의 엔코더 B 상 입력
20 Blue ENC1_A 모터 1 의 엔코더 A 상 입력
21 Red ENC1_Z 모터 1 의 엔코더 Z 상 입력
22 Green ENC2_B 모터 2 의 엔코더 B 상 입력
23 Blue ENC2_A 모터 2 의 엔코더 A 상 입력
24 Purple ENC2_Z 모터 2 의 엔코더 Z 상 입력
25 Red VCC 5VDC, 외부기기 사용을 위한 전원출력
26 Black Gnd Ground

#색깔있는 항목은 통신에서 취급하는 항목임

==이상 PPID 관련 내용==

www.motordriver.co.kr Ver.4.7 May./2022 P. 37/78


RS485(232) communication protorol on MD series controller

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


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.7 May./2022 P. 38/78


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.7 May./2022 P. 39/78


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.7 May./2022 P. 40/78


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(0~16384)
홀센서를 가지는 DC 리니어실린더의 속도 및
위치제어를 위하여 홀센서 정보를 셋팅
홀센서(A, B 상)를 이용한 서보제어
PID_HALL_RAW_PPM
이때 속도정보(ppm)은 RPM 항목에 표시된다 INT
125 R/W 리니어실린더에서 홀센서의
PID_MONITOR(196), PID_MAIN_DATA(193), 0
미터(meter)당 출력펄스의 수
PID_POSI_VEL_DATA(204),
PID_INT_RPM_DATA(138)의 RPM 데이터에서
값을 읽을 수 있음
183, TMID, ID, 123 ,2, D1, D2, CHK

예시) DC 리니어실린더의 외형 및 출력파형(9.6pulse/mm => 9600 PPM(pulse/meter)


Timotiont 社 TA2P 모델 (TA2P-2K-200320-5211-513-6), DC 모터, 24VDC, Hall sensor: AH921
홀센서 A,B 상을 4 체배하면, 미터당 9600x4=38400 의 카운트가 가능, 즉 카운트당 0.026mm 의 위치를 표시함

www.motordriver.co.kr Ver.4.7 May./2022 P. 41/78


RS485(232) communication protorol on MD series controller

www.motordriver.co.kr Ver.4.7 May./2022 P. 42/78


RS485(232) communication protorol on MD series controller

예시) 속도제어 및 위치제어

리니어실린더를 사용한 속도제어(±300mm/min 스텝입력)

리니어실린더를 사용한 위치제어(200cnt-> 5.2mm)

-검정색(기준속도 및 기준위치), 녹색(속도, mm/min), 빨강색(위치, count)


-위치제어정도 : ±1 count(±0.026mm)를 구현함
-속도제어 : 최고속도 600mm/min(10mm/s),
-속도제어 정도 : ±1mm/min (±0.02mm/s)

www.motordriver.co.kr Ver.4.7 May./2022 P. 43/78


RS485(232) communication protorol on MD series controller

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


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
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, 8 : 125k
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

www.motordriver.co.kr Ver.4.7 May./2022 P. 44/78


RS485(232) communication protorol on MD series controller

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


DATA : 4bytes
D1,D2 : the output of master controller
D3,D4 : the brake output of master controller
PID_SYNC_CMD
if there is a brake output then the D1,D2 INT
141 C For the syncronization of
output is ignored INT
two controllers
If one set the motor free state then set the
brake output to 1(TqOff state)
TMID, 183, ID, PID, 4, D1, ..,D42, CHK
DATA : 5bytes(D1~D5)
PID_SYNC_CMD2
D1 : 0(MOT1 selection), 1 (MOT2 selection)
Dual channel controller BYTE
D2,D3 : the output of master controller
142 C use(MDxxT) INT
D4,D5 : the breke output of master ctrl.
The selection for MOT1, INT
The contents are same with PID_SYNC_CMD
MO2 is available
TMID, 183, ID, PID, 52, D1,.., D5, 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 : 4bytes
PID_PRESET_SPEED D1 : preset number(1~10)
the max. speed is set when D2 : Reserved
the preset position is D3,D4 : max. speed when recall function is BYTE
146 R/W
recalled called(rpm) INT
the max speed to the each TMID, 183, ID, PID, 3, D1, D2, D3, D4,CHK
preset position is available To read the set max. speed use following PID,
PID_REQ_PID_DATA2(164)

www.motordriver.co.kr Ver.4.7 May./2022 P. 45/78


RS485(232) communication protorol on MD series controller

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


DATA(0~3, return types for monitoring)
0 : No return
1 : PID_MONITOR
2 : PID_ACK(return received PID)
3 : PID_IO_MONITOR
PID_RETURN_TYPE
4 : PID_MAIN_DATA or, PID_PNT_MAIN_DATA
Set return data type
returned BYTE
149 R/W When command received,
5 : PID_POSI_DATA, position data returned 0
Controller send PID data set
6 : PID_VEL_DATA, speed data returned
by RET_TYPE.
In the mdxxt type controller(dual channel),
following PID is used(5, 6)
PID_PNT_POSI_DATA, PID_PNT_VEL_DATA
170:WRITE_CHK byte for safety
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.7 May./2022 P. 46/78


RS485(232) communication protorol on MD series controller

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


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
제어기 내부의 Slow down 값을 즉각적으로
적용하기 위함, 기능은 PID153 번과 같으나,
PID_QUICK_SLOW_DOWN 내부 메모리에 Writing 은 하지 않음 BYTE
159 R/W
통신용 SlowDown 값 설정 감속시의 응답시간지연(0~15s->0~1023) 0
DATA(0~1023)
183, TMID, ID, 159, 2, D1, D2, CHK
PID_PWM_OUT
DC 모터제어기로 사용하는 경우에
OUT3 단자의 출력을 지정
OUT3 단자의 출력을 설정(0~1023) BYTE
160 C
PWM_OUT = (D1 | D2<<8) 0
DC 모터제어기에 적용
183, TMID, ID, 160, 2, D1, D2, CHK
BLDC 모터제어기 관계없슴

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.7 May./2022 P. 47/78


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.7 May./2022 P. 48/78


RS485(232) communication protorol on MD series controller

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


D1: BIT0~BIT7
BIT0 : 릴레이 1 의 ON/OFF(1->ON, 0->OFF)
..
PID_DRIVE_RELAY
165 C BIT7 : 릴레이 8 의 ON/OFF BIT
RLY10 제어기 통신제어
D2 : BIT0~BIT2
BIT0,1 : 릴레이 9,10 의 ON/OFF
183, TMID, ID, 165, 2, D1, D2, CHK

번호 10 번 릴레이접점 번호 1 번 릴레이접점

www.motordriver.co.kr Ver.4.7 May./2022 P. 49/78


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 : INPUT_MODE 에서 외부센서
PID_LOW_POT_LIMIT Potentiometer 를 사용하여 위치제어를 하는
172 R/W INT
POT 모드 최저값 설정 경우에 센서입력값의 최저값을 설정
183, TMID, 254, 172, 2, D1, D2, CHK
DATA : INPUT_MODE 에서 외부센서
PID_HIGH_POT_LIMIT Potentiometer 를 사용하여 위치제어를 하는
173 R/W INT
POT 모드 최고값 설정 경우에 센서입력값의 최고값을 설정
183, TMID, 254, 173, 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

www.motordriver.co.kr Ver.4.7 May./2022 P. 50/78


RS485(232) communication protorol on MD series controller

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


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
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
DATA : 4bytes(MOT1 , MOT2 speed(rpm)
PID_PNT_VEL_DATA D1,D2 : MOT1 speed(rpm)
177 R WORD
Speeds on MOT1, MOT2 D3,D4 : MOT2speed(rpm)
183, 184, ID, 177, 2, D1, D2, CHK
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
PID_CW_MAX_RPM DATA : 최대 속도, range(0~20,000rpm)
181 R/W WORD
CW 방향의 최대회전수설정 183, TMID, ID, 181, 2, D1, D2, CHK
DATA : 최대 속도, range(0~20,000rpm)
PID_CCW_MAX_RPM
182 R/W MAX_SPEED= (D1 | D2<<8) WORD
CW 방향의 최대회전수설정
183, TMID, ID, 182, 2, D1, D2, CHK
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

www.motordriver.co.kr Ver.4.7 May./2022 P. 51/78


RS485(232) communication protorol on MD series controller

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


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, x, CHK

▓ 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)

www.motordriver.co.kr Ver.4.7 May./2022 P. 52/78


RS485(232) communication protorol on MD series controller

- 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

● 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.7 May./2022 P. 53/78


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.7 May./2022 P. 54/78


RS485(232) communication protorol on MD series controller

● TYPE_ POSI2(7)
PID_FUNC_POSI 에 의해 설정된 속도 및 증분위치에 따라서 START/STOP 신호가 들어올때(ON)일 때 설정된
위치로 움직이고 이 같이 0(OFF)이면 원점으로 복귀함
위치제어의 방향은 CTRL 커넥터의 DIR 에 의하여 결정됨

X-axis is time(s)
ON
START/STOP signal
OFF

DIR signal(ON/OFF)

+Target Posi.

Init. Posi.

-Target Posi.

www.motordriver.co.kr Ver.4.7 May./2022 P. 55/78


RS485(232) communication protorol on MD series controller

● TYPE_ IO_RECALL(8)
1) 상기 TYPE_TOUR 에서를 참조할 것.
2) 먼저는 프리셋 정보가 있어야 함(사용 가능 프리셋정보는 총 7 개임, 1~7)
3) CTRL 커넥터의 DIR, RUN/BRAKE, START/STOP 의 3 가지 신호의 조합에 해당하는 위치로 입력신호가
변할때마다 그에 해당하는 프리셋번호로 모터가 이동함
4) 이 기능이 셋팅되면 기 셋팅된 위치로 이동하기 위하여 기준점이 되는 초기점을 잡기위하여 초기화를 진행함
5) 초기화의 속도는 CTRL 커넥터의 속도볼륨에 의한 속도입력의 1/3 의 속도로 진행됨, 프리셋 동작은 속도입력에
의해서 진행됨
6) 이 기능의 타입이 지정되면 제어기는 바로 모터를 구동하여 상기의 TYPE_INIT_SET 기능처럼 초기화 동작을
수행함(초기화 후에 I/O 신호의 입력에 따라서 프리셋 제어가 수행됨)

● TYPE_ TQ_INIT_SET(9)
1) CTRL 커넥터의 DIR, START/STOP 입력을 사용하지 않고 모터의 전류와 속도를 참조하여 초기화 동작을 수행함
2) 초기화 동작중의 이동은 안전상 오픈루프로 구동되며 초기 동작시의 출력은 최대출력의 약 20%로 진행함
초기화시의 감지전류는 PID_TQ_LIMIT_SW_VAL(187)을 사용하여 셋팅이 가능함
3) 초기화 동작중의 전류가 최대전류의 20%를 넘거나 속도가 멈추는 현상이 감지되면 그 위치를 초기점으로
셋팅함
4) 초기와 동작명령을 받을 때 변수가 1 이면 CCW(+)방향으로 2 인 경우에는 CW(-)방향으로 초기화를 진행함
PID_TQ_INIT_SET(26)의 내용을 참조

● TYPE_ AGING(11)
1) CTRL 커넥터의 DIR, START/STOP 입력을 기구적 양단 리미트 스위치로 사용하여 반복적으로 2 스위치 사이를
왕복운동하면서 연속적인 동작을 수행함
2) 초기 1 회 왕복동작, 즉 양단의 리미트스위치 신호감지전에는 셋팅된 초기화 속도로 진행하며 초기화속도가 0 인
경우에는 최대속도의 20%의 속도로 진행함
3) 양단의 스위치를 감지한 후에는 볼륨(SPEED_IN, CTRL 커넥터 #10)의 입력에 의한 지정된 속도로 에이징 동작을
수행함

● TYPE_ INIT_SET2(12)
1) 전원투입후, 음의 방향(모터 CW 방향) 의 초기화 속도로 움직여서 DIR(리미트스위치)신호가 끊어지면 멈추고
그 위치를 0 으로 셋팅함
2) 초기화 속도가 설정되지 않은 경우에는 최대속도의 20%의 속도로 초기화 함
3) 초기화가 끝나면 초기화모드를 취소하고 I/O 또는 통신으로 정상적인 제어가 가능함
4) DIR, START/STOP 신호를 안전장치, 즉 리미트스위치로 사용하는 경우에도 초기화가 가능함,
PID_USE_LIMIT_SW(17) 참조할 것

www.motordriver.co.kr Ver.4.7 May./2022 P. 56/78


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 : 8bytes
D1~D4 : MOT1 position LONG
188 R PID_PNT_POSI_DATA
D5~D8 : MOT2 position LONG
TMID, 183, ID, PID, 8, D1,.., D8, 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.7 May./2022 P. 57/78


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.7 May./2022 P. 58/78


RS485(232) communication protorol on MD series controller

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


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.7 May./2022 P. 59/78


RS485(232) communication protorol on MD series controller

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


DATA : 11 or 12bytes
D1,2 : speed(rpm)
D3,4 : current(0~1023, 0.1A unit)
INT
D5,6 : controller output(0~1023)
INT
PID_MONITOR D7 : status of controller
196 R INT
For Monitoring D8,9,10,11 : motor position
BIT
D12 : state2
LONG
BIT0:REGEN_BRAKE_REGIST_OVER_TEMP
BIT1:ENC_FAIL(encoder signal fail)
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.7 May./2022 P. 60/78


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.7 May./2022 P. 61/78


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.7 May./2022 P. 62/78


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.7 May./2022 P. 63/78


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
DATA : 6bytes
D1,2,3,4 : reference position(relative position)
PID_INC_POSI_VEL_CMD2
D5,6 : max. reference speed (rpm)
Position command for
224 R/W If the motor position is 1000, and the LONG
MOT2(just for dual channel
command position is 100, then the target INT
controller)
motor position will be 1100.
183, TMID, ID, 224, 6, D1, .., D6, CHK

www.motordriver.co.kr Ver.4.7 May./2022 P. 64/78


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

1023 512 800 1023


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

www.motordriver.co.kr Ver.4.7 May./2022 P. 65/78


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.7 May./2022 P. 66/78


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.7 May./2022 P. 67/78


RS485(232) communication protorol on MD series controller

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


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)

www.motordriver.co.kr Ver.4.7 May./2022 P. 68/78


RS485(232) communication protorol on MD series controller

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


DATA : 13bytes(D1, .., D13)
D1 : MOT1 의 제어기입력신호(CTRL & ENC)
BIT0 : INT_SPEED1
BIT1,2 : ALARM_RESET, DIR1(CW/CCW)
BIT3,4 : RUN/BRAKE1, START/STOP1
BIT5,6 : ENC_B1, ENC_A1
D2 : MOT 2 의 제어기 입력신호
PID_PNT_IO_MONITOR D3 : MOT 1 의 홀센서 입력 BYTE(BITs)
241 R 듀얼채널용 제어기에서 D4 : MOT 2 의 홀센서 입력 INT
I/O 데이터의 모니터링 D5,6 : MOT1 의 속도입력 가변볼륨(0~1023) ...
D7,8 : MOT2 의 속도입력 가변볼륨(0~1023)
D9,10 : Vp, 입력전압(0.1V 단위, 240->24.0V)
VoltIn(volt) = (D12 | ((int)D13<<8))x10
D11: Slow/Start 볼륨입력(0~100)
D12: Load 볼륨입력(0~100)
D13 : 8 핀 딥스위치(DIP_SW)입력
TMID, 183, ID, PID,13, D1, ..., D13, CHK
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.7 May./2022 P. 69/78


RS485(232) communication protorol on MD series controller

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


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

www.motordriver.co.kr Ver.4.7 May./2022 P. 70/78


RS485(232) communication protorol on MD series controller

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


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

- PID_PNTxxx 명령어의 경우 제어기 2 개에 동시에 명령을 보내는 경우에 broadcasting ID(0xfe)


를 사용하여 명령을 보내고 ID1 에는 제어기 1 의 ID 를 ID2 에는 제어기 2 의 ID 를 입력할 것
- PNT50, MD400T, MD400T 등의 2 개모터 구동용 제어기사용시에는 ID1, ID2 가 1 인 경우에 motor1, motor2 에
대한 명령이 수행됨(0 인 경우에는 수행되지 않음)

www.motordriver.co.kr Ver.4.7 May./2022 P. 71/78


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.7 May./2022 P. 72/78


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.7 May./2022 P. 73/78


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.7 May./2022 P. 74/78


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.7 May./2022 P. 75/78


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.7 May./2022 P. 76/78


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.7 May./2022 P. 77/78


RS485(232) communication protorol on MD series controller

3 History

Ver Data Contents Program version


PID number 10, 16, 137, 144, 150, 152, 153, 154, 155, 238,
V3.6 2013.05.09
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,
V3.9 2014.04.17 225, 226,
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
V4.2 2017.01.22 Concurrently(PNT50, MD750T, MD400T)
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
V4.4 2019.07.16
signal type for the 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
-PID_PNT_VEL_DATA(177), PID_PNT_POSI_DATA(188) added
-return data type added(PID149)
MD V7.7n
RETURN_TYPE_POSI_DATA(5)
V6.3 2021.06.19 NMD V2.1d
RETURN_TYPE_VEL_DATA(6)
MDT V6.0h
-PID_PRESET_SPEED(PID146)added
-PID_RC_LIMIT_SW(PID86) added

- The end -

www.motordriver.co.kr Ver.4.7 May./2022 P. 78/78

You might also like