Professional Documents
Culture Documents
Communication Protocol On MD Series Controllers (Ver.4.5)
Communication Protocol On MD Series Controllers (Ver.4.5)
Communication protocol on
MD series controllers
(ver.4.5)
1 Introduction
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
2 Main subject
Receiving:
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
If you use communication command, then the controller uses the CTRL signals as limit switchs for system
safety
Set the DIR(CW/CCW) and START/STOP signals to ON(connected to GND) to drive motor
The relationship of the moving direction and the signal(Here, X is don't care)
CTRL connector(no. 6 and no. 8 input signal)
Reference drection Motor condition
DIR(CW/CCW) START/STOP
ON X Driving
CW
OFF X Stop
X ON Driving
CCW
X OFF Stop
DIR(CW/CCW)
Limit switch
CW Turn
GND(Pin 1)
CCW Turn
NC(Normal Close)
RUN/STOP
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
■ Types of input(PID_INPUT_TYPE)
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
■ 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
- 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
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
-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.
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
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
DATA(1~5)
Set the CAN bitrate(bits/s), BIT_RATE
PID_ECAN_BITRATE BYTE
137 W 1 : 50k, 2 : 100k
Set CAN bitrate 1
3 : 250k, 4 : 500k, 5 : 1M
183, TMID, ID, 137, 2, 0xaa, BIT_RATE, CHK
DATA(rpm)
PID_INT_RPM_DATA
138 R Return motor speed(rpm) INT
Motor speed (16bits data)
183, TMID, ID, 138, 2, D1, D2, CHK
DATA : Return current(unit 0.1A)
PID_TQ_DATA
139 R 10->1A, 15->1.5A INT
Current(0.1A)
TMID, 183, ID, 139, 2, D1, D2, CHK
DATA(-1023~1023, Reference current)
PID_TQ_CMD
140 C (here, the max. current is 1023) INT
Torque(current) control
184, 183, ID, 140, 2, D1, D2, CHK
DATA(system input voltage, 0.1V unit)
PID_VOLT_IN
143 R Return supply voltage INT
Supply voltage
TMID, 183, ID, 143, 2, D1, D2, CHK
DATA(0~3, return types for monitoring)
PID_RETURN_TYPE
0 : No return
Set return data type
1 : PID_MONITOR BYTE
149 R/W When command received,
2 : PID_ACK(return received PID) 0
Controller send PID data set
3 : PID_IO_MONITOR
by RET_TYPE.
183, TMID, ID, 149, 2, 170, RET_TYPE, CHK
PID_SLOW_START DATA(0~1023->0~15s delay)
INT
153 R/W Set the SlowStart variable Applied when the ref. speed increased
0
(not use internal volume) 183, TMID, ID, 153 ,2, D1, D2, CHK
DATA(0~1023->0~15s delay)
PID_SLOW_DOWN INT
154 R/W Applied when the ref. speed decreased.
Set the SlowDown variable 0
183, TMID, ID, 154, 2, D1, D2, CHK
PID_TAR_VEL DATA(terget speed, rpm)
INT
155 R/W Use fixed set speed, no use Replacement of internal volume
0
internal volume(SPEED_IN) 183, TMID, ID, 155, 2, D1, D2, CHK
When the encoder pulse is set. The
PID_ENC_PPR
controller uses encoder signals as a speed INT
156 R/W Set encoder CPR
sensing input 0
(count/revolution)
183, TMID, ID, 156, 2, D1, D2, CHK
1023 1023
0 0
Analog input
1023 1023
Analog input
1023 1023
0 0
-1023 -1023
Center 1023 0 1023
Joystick or RC input Dead-zone
PID_TAR_POSI_VEL
DATA : max. speed in position control(rpm)
176 R/W Max. speed in position WORD
183, 184, ID, 176, 2, D1, D2, CHK
control
PID_TQ_I_GAIN
DATA : I-gain in torque control
177 R/W Integral gain in torque WORD
183, 184, ID, 177, 2, D1, D2, CHK
control
Slow/Start(SS, 0~1023) in position control
178 R/W PID_POSI_SS INT
183, 184, ID, 178, 2, D1, D2, CHK
Slow/Dow(SD, 0~1023) in position control
179 R/W PID_POSI_SD INT
183, 184, ID, 179, 2, D1, D2, CHK
PID_COM_TAR_SPEED
DATA : Target speed(rpm)
180 C/R Refer to WORD
183, 184, ID, 180, 2, D1, D2, CHK
PID_START_STOP, 100
DATA : (0~4, Special function type)
Refer to the function below explanation
PID_FUNC_CMD_TYPE FUNC_TYPE = D1, D2 don’t care
If the function type is 0 : NONE
set(more than 1) then the 1 : SPEED
183 R/W WORD
motor used by start/stop 2 : POSITION
only. 3 : INIT_SET
(option) 4 : TOUR
Refet to the following explanation
183, 184, ID, 183, 2, D1, x, CHK
DATA(0, 1)
PID_FUNC_CMD
Run the function set by PID 183,
If function type is, then user
like as a control input signal START/STOP
184 W can use start/stop signal and WORD
Refer to the function below explanation
this PID also
0 : OFF, more than 1 : ON
(option)
183, 184, ID, 184, 2, D1, D2, CHK
▓ 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)
● TYPE_SPEED(1)
According to the input signal of START/STOP, the motor speed controlled following diagram repeatedly
And the delay time and target speed are set by PID_FUNC_SPEED
X-axis is time(s)
ON
START/STOP signal
OFF
TAR_SPEED(rpm)
Motor speed control
0
DELAY(s) DELAY(s)
- Here, the delay time unit is 0.1s
- The direction of motor is decided by the input signal DIR(CW/CCW) of CTRL I/O, and the RUN/BRAKE must
be ON
● TYPE_POSI(2)
ON
START/STOP signal
OFF
TAR_SPEED(rpm)
Motor position control
0
INC_POSI INC_POSI
● 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
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)
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)
DATA : 11 or 12bytes
D1,2 : speed(rpm)
INT
D3,4 : current(0~1023, 0.1A unit)
INT
PID_MONITOR D5,6 : controller output(0~1023)
196 R INT
For Monitoring D7 : status of controller
BIT
D8,9,10,11 : motor position
LONG
D12(reserved)
TMID, 183, ID, 196, 12, D1,..., D12, CHK
DATA : 4 bytes
PID_POSI_DATA
197 R D1,2,3,4 : position of motor LONG
Motor position
TMID, 183, ID, 197, 4, D1, D2, D3, D4, CHK
DATA : 4 bytes
PID_RPM_DATA
198 R D1,2,3,4 : motor speed(rpm) LONG
Motor speed
TMID, 183, ID, 198, 4, D1, D2, D3, D4, CHK
DATA : 4bytes(target position)
PID_INC_TAR_POSI
The reference target position will be following
199 C/R Incremental target LONG
Target posi. = current position + data
position
TMID, 183, ID, 199, 4, D1, D2, D3, D4, CHK
PID_MAIN_DATA2 Same with PID193, but the data is on the
200 R MDTx only
MAIN_DATA of motor2 motor2
PID_MONITOR2 Same with PID196, but the data is on the
201 R MDTx only
MONITOR of motor2 motor2
PID_ IO_MONITOR2 Same with PID194, but the data is on the
202 R MDTx only
IO_MONITOR of motor2 motor2
DATA : 6 bytes
D1,2 : proportional gain of positon control INT
PID_ GAIN
203 R/W D3,4 : proportional gain of speed control(P) INT
Control gain
D5,6 : integral gain of speed control(I) INT
TMID, 183, ID, 203, 6, D1, ..D6, CHK
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
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
-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.
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 : 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
1023 1023
800
100
512 800
Analog input
1023 Analog input 1023
PT1(512,100)
Reference input vs. input voltage by curve fitting(PT3,4 are negative values)
Reference position
1200
800
100
0 1023
-1023
Input range(volume, J/S, Etc)
DATA : 11bytes
Complex command for dual channel controller
D1: control type for MOT1
0 : Tq off, 1:speed(rpm), 2:position,
3:open-loop(~1023), 4:tq(current, ~1023),
PID_PNT_COMPLEX_CMD 위치인
5:brake(~1023), 255(0xff):don’t care
In the dual channel 경우까지
D2,3,4,5 : the parameter for above control type
237 C controller, user can use 고려하여
of MOT1
different commands for 변수는
D6 : control type for MOT2(refer to D1)
each motor long 타입설정
D7,8,9,10 : the parameter for MOT2
D11: request data for monitoring(0, 1, 2)
0(no return), 1(PID_PNT_MONITOR)
2(PID_PNT_MAIN_DATA)
TMID, 183, ID, 237, 11, D1, ..., D11, CHK
DATA : 12bytes
PID_CAN_RESEND
D1~4 : extended ID LONG
238 R Resend CAN comm data to
D5~12 : CAN data(PID, Data...), 최대 8Bytes BYTE...
RS485 data(packet)
TMID, 183, ID, 238, DataNum, D1, ..., Dn, CHK
PID_FUNC_SPEED
DATA : 4bytes
With target speed the
D1,D2 : Target speed(rpm)
motor run for a run INT
239 R/W D3,D4 : Delay(run time, 0.1s unit), 10->1s
time(delay) by START/STOP INT
Target speed = D2*256 + D1
signal
183, 184, ID, 239, 4, D1, ..., D4, CHK
(option)
DATA : 15bytes
D1 : 1(enable control on motor1),
0(don’t control, there is no effect)
D2~D5 : position incremental on motor1
D6,D7 : max. speed on motor1 with posi. ctrl.
PID_PNT_INC_POSI_ D8 : control enable on motor2
242 C INT
VEL_CMD D9~D12: position incremental on motor2
D13,D14: max. speed on motor2 with posi. ctrl.
D15: return data type(0, 1, 2)
0(no return), 1(PID_PNT_MONITOR)
2(PID_PNT_MAIN_DATA)
183, 184, ID, 242, 15, D1, ..., D15, CHK
DATA : 4bytes
D1~D4 : Target position
243 R/W PID_POSI_CMD LONG
D1(LSB), D4(MSB)
183, 184, ID, 243, 4, D1, ..., D4, CHK
DATA : 4bytes
D1~D4 : Incremental target position
244 R/W PID_INC_POSI_CMD Target posi. = Current posi. + Incremental LONG
Posi.
183, 184, ID, 244, 4, D1, ..., D4, CHK
DATA : 11bytes
D1 : ID1(Command enable), 0(Disable)
D2~D5 : Reference position of ID1
D6 : ID2(Command enable), 0(Disable)
246 R/W PID_PNT_POSI_CMD LONG
D7~D10 : Reference position of ID2
D11 : Controller ID
which wanted PID_MONITOR(return data)
183, 184, ID, 246, 2, D1, ..., D11, CHK
Position control for MOT2
Same with PID_POSI_CMD(243) LONG
247 C PID_POSI_CMD2
D1~D4 : target position for MOT2 MDT only
183, TMID, ID, 247, 4, D1, ..., D4, CHK
DATA : 4bytes
PID_FUNC_POSI
Target speed(rpm) = D2*256 + D1
With target speed the INT
250 R/W Target position(motor poles*3/rev)
motor move to the target INT
= D4*256 + D3
position(option)
183, 184, ID, 250, 4, D1, ..., D4, CHK
DATA : 4bytes
D1~D4 : Incremental target position on motor2
251 R/W PID_INC_POSI_CMD2 LONG
Target posi. = Current posi. + Incremental Posi.
183, 184, ID, 251, 4, D1, ..., D4, CHK
DATA : 6 bytes
D1,2 : proportional gain for position control
PID_GAIN1 INT
252 R/W D3,4 : proportional gain for speed control
Gain for MOT1 only MDTx only
D5,6 : Integral gain for speed control
TMID, 183, ID, 252, 6, D1, ..D5, D6, CHK
DATA : 6 bytes
PID_GAIN2 INT
253 R/W ”same with PID_GAIN1(252)”
Gain for MOT2 only MDTx only
TMID, 183, ID, 253, 6, D1, ..D5, D6, CHK
// 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
#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
cbySum = 0;
for(i=0; i<nPacketSize; i++) {
cbySum += *(byArray + i);
}
if(cbySum==0) return 1;
else return 0;
}
typedef struct {
BYTE byLow;
BYTE byHigh;
} IByte;
typedef struct {
BYTE byData1;
BYTE byData2;
BYTE byData3;
BYTE byData4;
} LByte;
3 History
- The end -