Skip to content

Commit f46949c

Browse files
Merge pull request #81 from ROBOTIS-GIT/feature_XW_XD430_540
Feature xw xd430 540
2 parents a573c32 + 1e98dfa commit f46949c

5 files changed

Lines changed: 78 additions & 16 deletions

File tree

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Dynamixel2Arduino
2-
version=0.4.9
2+
version=0.5.0
33
author=ROBOTIS
44
license=Apache-2.0
55
maintainer=Will Son(willson@robotis.com)

src/Dynamixel2Arduino.cpp

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ const uint16_t model_number_table[] PROGMEM = {
4545
XM540_W150, XM540_W270,
4646
XH430_V210, XH430_V350, XH430_W210, XH430_W350,
4747
XH540_V150, XH540_V270, XH540_W150, XH540_W270,
48+
XD430_T210, XD430_T350,
49+
XD540_T150, XD540_T270,
50+
XW430_T200, XW430_T333,
4851
XW540_T140, XW540_T260,
4952

5053
PRO_L42_10_S300_R,
@@ -350,12 +353,18 @@ bool Dynamixel2Arduino::setBaudrate(uint8_t id, uint32_t baudrate)
350353
case XH430_V350:
351354
case XH430_W210:
352355
case XH430_W350:
356+
case XD430_T210:
357+
case XD430_T350:
353358
case XM540_W150:
354359
case XM540_W270:
355360
case XH540_W150:
356361
case XH540_W270:
357362
case XH540_V150:
358363
case XH540_V270:
364+
case XD540_T150:
365+
case XD540_T270:
366+
case XW430_T200:
367+
case XW430_T333:
359368
case XW540_T140:
360369
case XW540_T260:
361370
switch(baudrate)
@@ -669,12 +678,18 @@ bool Dynamixel2Arduino::setOperatingMode(uint8_t id, uint8_t mode)
669678
case XH430_V350:
670679
case XH430_W210:
671680
case XH430_W350:
681+
case XD430_T210:
682+
case XD430_T350:
672683
case XM540_W150:
673684
case XM540_W270:
674685
case XH540_W150:
675686
case XH540_W270:
676687
case XH540_V150:
677688
case XH540_V270:
689+
case XD540_T150:
690+
case XD540_T270:
691+
case XW430_T200:
692+
case XW430_T333:
678693
case XW540_T140:
679694
case XW540_T260:
680695
if(mode == OP_POSITION){
@@ -1174,8 +1189,16 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_xm430_w210_w350[] PROGMEM
11741189
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
11751190
};
11761191

1177-
const ModelDependencyFuncItemAndRangeInfo_t dependency_xh430_w210_w350[] PROGMEM = {
1178-
#if (ENABLE_ACTUATOR_XH430)
1192+
const ModelDependencyFuncItemAndRangeInfo_t dependency_xh430_wt210_wt350[] PROGMEM = {
1193+
#if (ENABLE_ACTUATOR_XH430 || ENABLE_ACTUATOR_XD430)
1194+
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -648, 648, 2.69},
1195+
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -648, 648, 2.69},
1196+
#endif
1197+
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
1198+
};
1199+
1200+
const ModelDependencyFuncItemAndRangeInfo_t dependency_xw430_t200_t333[] PROGMEM = {
1201+
#if (ENABLE_ACTUATOR_XW430)
11791202
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -648, 648, 2.69},
11801203
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -648, 648, 2.69},
11811204
#endif
@@ -1190,9 +1213,9 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_xh430_v210_v350[] PROGMEM
11901213
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
11911214
};
11921215

1193-
const ModelDependencyFuncItemAndRangeInfo_t dependency_xm540_xh540_xw540[] PROGMEM = {
1194-
#if (ENABLE_ACTUATOR_XM540 || ENABLE_ACTUATOR_XH540) \
1195-
|| ENABLE_ACTUATOR_XW540
1216+
const ModelDependencyFuncItemAndRangeInfo_t dependency_xm540_xh540_xt540_xw540[] PROGMEM = {
1217+
#if (ENABLE_ACTUATOR_XM540 || ENABLE_ACTUATOR_XH540 \
1218+
|| ENABLE_ACTUATOR_XD540 || ENABLE_ACTUATOR_XW540)
11961219
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 2.69},
11971220
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 2.69},
11981221
#endif
@@ -1487,20 +1510,30 @@ static ItemAndRangeInfo_t getModelDependencyFuncInfo(uint16_t model_num, uint8_t
14871510

14881511
case XH430_W210:
14891512
case XH430_W350:
1513+
case XD430_T210:
1514+
case XD430_T350:
14901515
p_common_ctable = dependency_ctable_2_0_common;
1491-
p_dep_ctable = dependency_xh430_w210_w350;
1516+
p_dep_ctable = dependency_xh430_wt210_wt350;
14921517
break;
14931518

1519+
case XW430_T200:
1520+
case XW430_T333:
1521+
p_common_ctable = dependency_ctable_2_0_common;
1522+
p_dep_ctable = dependency_xw430_t200_t333;
1523+
break;
1524+
14941525
case XM540_W150:
14951526
case XM540_W270:
14961527
case XH540_W150:
1497-
case XH540_W270:
1528+
case XH540_W270:
14981529
case XH540_V150:
14991530
case XH540_V270:
1531+
case XD540_T150:
1532+
case XD540_T270:
15001533
case XW540_T140:
15011534
case XW540_T260:
15021535
p_common_ctable = dependency_ctable_2_0_common;
1503-
p_dep_ctable = dependency_xm540_xh540_xw540;
1536+
p_dep_ctable = dependency_xm540_xh540_xt540_xw540;
15041537
break;
15051538

15061539
// case PRO_L42_10_S300_R:

src/actuator.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ const ModelControlTableInfo_t control_table_2_0[] PROGMEM = {
172172
|| ENABLE_ACTUATOR_XC330 \
173173
|| ENABLE_ACTUATOR_XL430 \
174174
|| ENABLE_ACTUATOR_XC430 \
175-
|| ENABLE_ACTUATOR_XM430 || ENABLE_ACTUATOR_XH430 \
176-
|| ENABLE_ACTUATOR_XM540 || ENABLE_ACTUATOR_XH540) \
177-
|| ENABLE_ACTUATOR_XW540
175+
|| ENABLE_ACTUATOR_XM430 || ENABLE_ACTUATOR_XH430 || ENABLE_ACTUATOR_XD430 \
176+
|| ENABLE_ACTUATOR_XM540 || ENABLE_ACTUATOR_XH540 || ENABLE_ACTUATOR_XD540 \
177+
|| ENABLE_ACTUATOR_XW540 || ENABLE_ACTUATOR_XW430)
178178
{ControlTableItem::MODEL_NUMBER, 0, 2},
179179
{ControlTableItem::MODEL_INFORMATION, 2, 4},
180180
{ControlTableItem::FIRMWARE_VERSION, 6, 1},
@@ -284,10 +284,9 @@ const ModelControlTableInfo_t xmh540_control_table[] PROGMEM = {
284284
{ControlTableItem::LAST_DUMMY_ITEM, 0, 0}
285285
};
286286

287-
const ModelControlTableInfo_t xw540_control_table[] PROGMEM = {
288-
#if (ENABLE_ACTUATOR_XW540)
287+
const ModelControlTableInfo_t xw430_540_control_table[] PROGMEM = {
288+
#if (ENABLE_ACTUATOR_XW540 || ENABLE_ACTUATOR_XW430 )
289289
{ControlTableItem::CURRENT_LIMIT, 38, 2},
290-
291290
{ControlTableItem::GOAL_CURRENT, 102, 2},
292291
{ControlTableItem::PRESENT_CURRENT, 126, 2},
293292
#endif
@@ -496,6 +495,8 @@ ControlTableItemInfo_t DYNAMIXEL::getControlTableItemInfo(uint16_t model_num, ui
496495
case XH430_V350:
497496
case XH430_W210:
498497
case XH430_W350:
498+
case XD430_T210:
499+
case XD430_T350:
499500
p_common_ctable = control_table_2_0;
500501
p_dep_ctable = xmh430_xl330_control_table;
501502
break;
@@ -506,14 +507,18 @@ ControlTableItemInfo_t DYNAMIXEL::getControlTableItemInfo(uint16_t model_num, ui
506507
case XH540_W270:
507508
case XH540_V150:
508509
case XH540_V270:
510+
case XD540_T150:
511+
case XD540_T270:
509512
p_common_ctable = control_table_2_0;
510513
p_dep_ctable = xmh540_control_table;
511514
break;
512515

513516
case XW540_T140:
514517
case XW540_T260:
518+
case XW430_T200:
519+
case XW430_T333:
515520
p_common_ctable = control_table_2_0;
516-
p_dep_ctable = xw540_control_table;
521+
p_dep_ctable = xw430_540_control_table;
517522
break;
518523

519524
// case PRO_L42_10_S300_R:

src/actuator.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,27 @@
149149
#ifndef XH540_V270
150150
#define XH540_V270 (uint16_t)1140
151151
#endif
152+
153+
#ifndef XD430_T210
154+
#define XD430_T210 (uint16_t)1011
155+
#endif
156+
#ifndef XD430_T350
157+
#define XD430_T350 (uint16_t)1001
158+
#endif
159+
160+
#ifndef XD540_T150
161+
#define XD540_T150 (uint16_t)1111
162+
#endif
163+
#ifndef XD540_T270
164+
#define XD540_T270 (uint16_t)1101
165+
#endif
166+
167+
#ifndef XW430_T200
168+
#define XW430_T200 (uint16_t)1280
169+
#endif
170+
#ifndef XW430_T333
171+
#define XW430_T333 (uint16_t)1270
172+
#endif
152173
#ifndef XW540_T140
153174
#define XW540_T140 (uint16_t)1180
154175
#endif

src/utility/config.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@
2222
#define ENABLE_ACTUATOR_XC430 1 //Includes 2XC430
2323
#define ENABLE_ACTUATOR_XM430 1
2424
#define ENABLE_ACTUATOR_XH430 1
25+
#define ENABLE_ACTUATOR_XD430 1
2526
#define ENABLE_ACTUATOR_XM540 1
2627
#define ENABLE_ACTUATOR_XH540 1
28+
#define ENABLE_ACTUATOR_XD540 1
29+
#define ENABLE_ACTUATOR_XW430 1
2730
#define ENABLE_ACTUATOR_XW540 1
2831

2932
#define ENABLE_ACTUATOR_PRO_R 1

0 commit comments

Comments
 (0)