RS485 Communication Protocol-V47
RS485 Communication Protocol-V47
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
l 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)
START/STOP
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
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
■ 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
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
▓ 상태표시 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
기준입력(모터위치)
Max.(1500)
DIR(CCW) Max(5V)
0( CEN)
Min.(-1500)
기준입력(모터위치)
Max.(1500)
DIR(CCW) Max(5V/0.95ms)
DEAD_ZONE
Min.(-1500)
포텐시오미터를 모터와 연결하여 위치제어를 하는 경우에 사용됨, 이때 위치의 입력범위는 0~4095 의 값을 가지며
최저값 및 최고값의 경계는 PID_LOW_POT_LIMIT(172), PID_HIGH_POS_LIMIT(173)에 의하여 설정됨
상기 리미트의 값이 설정되어있지 않은 경우에는 안전을 위하여 최저, 최대값은 4095(10 bits)의 5%와 95%, 즉
205~3,890 의 범위로 설정됨
위치기준입력이 이 설정범위를 벗어난 경우에는 최저, 또는 최대 리밋값으로 설정됨
■ MDSEN Spec.
Weight 0.05kg
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 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.
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..)
통신속도 : 38,400bps
-버튼
Y 방향(전진)
뷰져(경음기)버튼
C 버튼(최대속도감소)
M 버튼(최대속도증가)
+버튼
비상버튼
우측면 장착버튼
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
번호 10 번 릴레이접점 번호 1 번 릴레이접점
▓ 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)
● 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)
● 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.
● 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) 참조할 것
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 : 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
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
Reference position
1200
800
100
0 1023
-1023
Input range(volume, J/S, Etc)
// 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 -