Skip to content

Commit 6c8b70a

Browse files
Merge pull request #82 from ROBOTIS-GIT/feature_XW_XD430_540
review 0.5.0 update
2 parents f46949c + 2b2d06a commit 6c8b70a

File tree

2 files changed

+49
-16
lines changed

2 files changed

+49
-16
lines changed

src/Dynamixel2Arduino.cpp

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,14 +1117,12 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_ctable_2_0_common[] PROGM
11171117
|| ENABLE_ACTUATOR_XC330 \
11181118
|| ENABLE_ACTUATOR_XC430 \
11191119
|| ENABLE_ACTUATOR_XL430 \
1120-
|| ENABLE_ACTUATOR_XM430 || ENABLE_ACTUATOR_XH430 \
1121-
|| ENABLE_ACTUATOR_XM540 || ENABLE_ACTUATOR_XH540)
1120+
|| ENABLE_ACTUATOR_XM430 || ENABLE_ACTUATOR_XH430 || ENABLE_ACTUATOR_XD430 \
1121+
|| ENABLE_ACTUATOR_XM540 || ENABLE_ACTUATOR_XH540 || ENABLE_ACTUATOR_XD540 \
1122+
|| ENABLE_ACTUATOR_XW540 || ENABLE_ACTUATOR_XW430)
11221123
{SET_POSITION, GOAL_POSITION, UNIT_DEGREE, -1048575, 1048575, 0.088},
11231124
{GET_POSITION, PRESENT_POSITION, UNIT_DEGREE, -2147483647 , 2147483647, 0.088},
11241125

1125-
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1126-
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1127-
11281126
{SET_PWM, GOAL_PWM, UNIT_RAW, -885, 885, 1},
11291127
{GET_PWM, PRESENT_PWM, UNIT_RAW, -885, 885, 1},
11301128
#endif
@@ -1135,6 +1133,9 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_mx64_2[] PROGMEM = {
11351133
#if (ENABLE_ACTUATOR_MX64_PROTOCOL2)
11361134
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -1193, 1193, 3.36},
11371135
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -1193, 1193, 3.36},
1136+
1137+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1138+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
11381139
#endif
11391140
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
11401141
};
@@ -1143,14 +1144,17 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_mx106_2[] PROGMEM = {
11431144
#if (ENABLE_ACTUATOR_MX106_PROTOCOL2)
11441145
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 3.36},
11451146
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 3.36},
1147+
1148+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1149+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
11461150
#endif
11471151
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
11481152
};
11491153

11501154
const ModelDependencyFuncItemAndRangeInfo_t dependency_xl330_M288_M077[] PROGMEM = {
11511155
#if (ENABLE_ACTUATOR_XL330)
1152-
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -1150, 1150, 1},
1153-
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -1150, 1150, 1},
1156+
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -1750, 1750, 1},
1157+
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -1750, 1750, 1},
11541158

11551159
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -2047, 2047, 0.229},
11561160
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -2047, 2047, 0.229},
@@ -1180,11 +1184,13 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_xc330_t181_t288[] PROGMEM
11801184
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
11811185
};
11821186

1183-
11841187
const ModelDependencyFuncItemAndRangeInfo_t dependency_xm430_w210_w350[] PROGMEM = {
11851188
#if (ENABLE_ACTUATOR_XM430)
11861189
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -1193, 1193, 2.69},
11871190
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -1193, 1193, 2.69},
1191+
1192+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1193+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
11881194
#endif
11891195
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
11901196
};
@@ -1193,14 +1199,20 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_xh430_wt210_wt350[] PROGM
11931199
#if (ENABLE_ACTUATOR_XH430 || ENABLE_ACTUATOR_XD430)
11941200
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -648, 648, 2.69},
11951201
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -648, 648, 2.69},
1202+
1203+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1204+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
11961205
#endif
11971206
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
11981207
};
11991208

12001209
const ModelDependencyFuncItemAndRangeInfo_t dependency_xw430_t200_t333[] PROGMEM = {
12011210
#if (ENABLE_ACTUATOR_XW430)
1202-
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -648, 648, 2.69},
1203-
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -648, 648, 2.69},
1211+
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 2.69},
1212+
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 2.69},
1213+
1214+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1215+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
12041216
#endif
12051217
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
12061218
};
@@ -1209,6 +1221,9 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_xh430_v210_v350[] PROGMEM
12091221
#if (ENABLE_ACTUATOR_XH430)
12101222
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -689, 689, 1.34},
12111223
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -689, 689, 1.34},
1224+
1225+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1226+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
12121227
#endif
12131228
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
12141229
};
@@ -1218,6 +1233,20 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_xm540_xh540_xt540_xw540[]
12181233
|| ENABLE_ACTUATOR_XD540 || ENABLE_ACTUATOR_XW540)
12191234
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 2.69},
12201235
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 2.69},
1236+
1237+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1238+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1239+
#endif
1240+
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
1241+
};
1242+
1243+
const ModelDependencyFuncItemAndRangeInfo_t dependency_xh540_v150_v270[] PROGMEM = {
1244+
#if (ENABLE_ACTUATOR_XH540 || ENABLE_ACTUATOR_XD540)
1245+
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -1188, 1188, 2.69},
1246+
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -1188, 1188, 2.69},
1247+
1248+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1249+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
12211250
#endif
12221251
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
12231252
};
@@ -1526,8 +1555,6 @@ static ItemAndRangeInfo_t getModelDependencyFuncInfo(uint16_t model_num, uint8_t
15261555
case XM540_W270:
15271556
case XH540_W150:
15281557
case XH540_W270:
1529-
case XH540_V150:
1530-
case XH540_V270:
15311558
case XD540_T150:
15321559
case XD540_T270:
15331560
case XW540_T140:
@@ -1536,6 +1563,12 @@ static ItemAndRangeInfo_t getModelDependencyFuncInfo(uint16_t model_num, uint8_t
15361563
p_dep_ctable = dependency_xm540_xh540_xt540_xw540;
15371564
break;
15381565

1566+
case XH540_V150:
1567+
case XH540_V270:
1568+
p_common_ctable = dependency_ctable_2_0_common;
1569+
p_dep_ctable = dependency_xh540_v150_v270;
1570+
break;
1571+
15391572
// case PRO_L42_10_S300_R:
15401573
// case PRO_L54_30_S400_R:
15411574
// case PRO_L54_30_S500_R:

src/utility/config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
#define ENABLE_ACTUATOR_XL320 1
1919
#define ENABLE_ACTUATOR_XL330 1
2020
#define ENABLE_ACTUATOR_XC330 1
21-
#define ENABLE_ACTUATOR_XL430 1 //Includes 2XL430
22-
#define ENABLE_ACTUATOR_XC430 1 //Includes 2XC430
21+
#define ENABLE_ACTUATOR_XL430 1 // includes 2XL430
22+
#define ENABLE_ACTUATOR_XC430 1 // includes 2XC430
2323
#define ENABLE_ACTUATOR_XM430 1
24-
#define ENABLE_ACTUATOR_XH430 1
24+
#define ENABLE_ACTUATOR_XH430 1 // includes V lineup
2525
#define ENABLE_ACTUATOR_XD430 1
2626
#define ENABLE_ACTUATOR_XM540 1
27-
#define ENABLE_ACTUATOR_XH540 1
27+
#define ENABLE_ACTUATOR_XH540 1 // includes V lineup
2828
#define ENABLE_ACTUATOR_XD540 1
2929
#define ENABLE_ACTUATOR_XW430 1
3030
#define ENABLE_ACTUATOR_XW540 1

0 commit comments

Comments
 (0)