Skip to content

Commit

Permalink
Merge pull request #82 from ROBOTIS-GIT/feature_XW_XD430_540
Browse files Browse the repository at this point in the history
review 0.5.0 update
  • Loading branch information
ROBOTIS-David authored Oct 7, 2021
2 parents f46949c + 2b2d06a commit 6c8b70a
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 16 deletions.
57 changes: 45 additions & 12 deletions src/Dynamixel2Arduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1117,14 +1117,12 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_ctable_2_0_common[] PROGM
|| ENABLE_ACTUATOR_XC330 \
|| ENABLE_ACTUATOR_XC430 \
|| ENABLE_ACTUATOR_XL430 \
|| ENABLE_ACTUATOR_XM430 || ENABLE_ACTUATOR_XH430 \
|| ENABLE_ACTUATOR_XM540 || ENABLE_ACTUATOR_XH540)
|| ENABLE_ACTUATOR_XM430 || ENABLE_ACTUATOR_XH430 || ENABLE_ACTUATOR_XD430 \
|| ENABLE_ACTUATOR_XM540 || ENABLE_ACTUATOR_XH540 || ENABLE_ACTUATOR_XD540 \
|| ENABLE_ACTUATOR_XW540 || ENABLE_ACTUATOR_XW430)
{SET_POSITION, GOAL_POSITION, UNIT_DEGREE, -1048575, 1048575, 0.088},
{GET_POSITION, PRESENT_POSITION, UNIT_DEGREE, -2147483647 , 2147483647, 0.088},

{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},

{SET_PWM, GOAL_PWM, UNIT_RAW, -885, 885, 1},
{GET_PWM, PRESENT_PWM, UNIT_RAW, -885, 885, 1},
#endif
Expand All @@ -1135,6 +1133,9 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_mx64_2[] PROGMEM = {
#if (ENABLE_ACTUATOR_MX64_PROTOCOL2)
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -1193, 1193, 3.36},
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -1193, 1193, 3.36},

{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
#endif
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
};
Expand All @@ -1143,14 +1144,17 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_mx106_2[] PROGMEM = {
#if (ENABLE_ACTUATOR_MX106_PROTOCOL2)
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 3.36},
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 3.36},

{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
#endif
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
};

const ModelDependencyFuncItemAndRangeInfo_t dependency_xl330_M288_M077[] PROGMEM = {
#if (ENABLE_ACTUATOR_XL330)
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -1150, 1150, 1},
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -1150, 1150, 1},
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -1750, 1750, 1},
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -1750, 1750, 1},

{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -2047, 2047, 0.229},
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -2047, 2047, 0.229},
Expand Down Expand Up @@ -1180,11 +1184,13 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_xc330_t181_t288[] PROGMEM
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
};


const ModelDependencyFuncItemAndRangeInfo_t dependency_xm430_w210_w350[] PROGMEM = {
#if (ENABLE_ACTUATOR_XM430)
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -1193, 1193, 2.69},
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -1193, 1193, 2.69},

{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
#endif
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
};
Expand All @@ -1193,14 +1199,20 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_xh430_wt210_wt350[] PROGM
#if (ENABLE_ACTUATOR_XH430 || ENABLE_ACTUATOR_XD430)
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -648, 648, 2.69},
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -648, 648, 2.69},

{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
#endif
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
};

const ModelDependencyFuncItemAndRangeInfo_t dependency_xw430_t200_t333[] PROGMEM = {
#if (ENABLE_ACTUATOR_XW430)
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -648, 648, 2.69},
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -648, 648, 2.69},
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 2.69},
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 2.69},

{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
#endif
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
};
Expand All @@ -1209,6 +1221,9 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_xh430_v210_v350[] PROGMEM
#if (ENABLE_ACTUATOR_XH430)
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -689, 689, 1.34},
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -689, 689, 1.34},

{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
#endif
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
};
Expand All @@ -1218,6 +1233,20 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_xm540_xh540_xt540_xw540[]
|| ENABLE_ACTUATOR_XD540 || ENABLE_ACTUATOR_XW540)
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 2.69},
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 2.69},

{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
#endif
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
};

const ModelDependencyFuncItemAndRangeInfo_t dependency_xh540_v150_v270[] PROGMEM = {
#if (ENABLE_ACTUATOR_XH540 || ENABLE_ACTUATOR_XD540)
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -1188, 1188, 2.69},
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -1188, 1188, 2.69},

{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
#endif
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
};
Expand Down Expand Up @@ -1526,8 +1555,6 @@ static ItemAndRangeInfo_t getModelDependencyFuncInfo(uint16_t model_num, uint8_t
case XM540_W270:
case XH540_W150:
case XH540_W270:
case XH540_V150:
case XH540_V270:
case XD540_T150:
case XD540_T270:
case XW540_T140:
Expand All @@ -1536,6 +1563,12 @@ static ItemAndRangeInfo_t getModelDependencyFuncInfo(uint16_t model_num, uint8_t
p_dep_ctable = dependency_xm540_xh540_xt540_xw540;
break;

case XH540_V150:
case XH540_V270:
p_common_ctable = dependency_ctable_2_0_common;
p_dep_ctable = dependency_xh540_v150_v270;
break;

// case PRO_L42_10_S300_R:
// case PRO_L54_30_S400_R:
// case PRO_L54_30_S500_R:
Expand Down
8 changes: 4 additions & 4 deletions src/utility/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
#define ENABLE_ACTUATOR_XL320 1
#define ENABLE_ACTUATOR_XL330 1
#define ENABLE_ACTUATOR_XC330 1
#define ENABLE_ACTUATOR_XL430 1 //Includes 2XL430
#define ENABLE_ACTUATOR_XC430 1 //Includes 2XC430
#define ENABLE_ACTUATOR_XL430 1 // includes 2XL430
#define ENABLE_ACTUATOR_XC430 1 // includes 2XC430
#define ENABLE_ACTUATOR_XM430 1
#define ENABLE_ACTUATOR_XH430 1
#define ENABLE_ACTUATOR_XH430 1 // includes V lineup
#define ENABLE_ACTUATOR_XD430 1
#define ENABLE_ACTUATOR_XM540 1
#define ENABLE_ACTUATOR_XH540 1
#define ENABLE_ACTUATOR_XH540 1 // includes V lineup
#define ENABLE_ACTUATOR_XD540 1
#define ENABLE_ACTUATOR_XW430 1
#define ENABLE_ACTUATOR_XW540 1
Expand Down

0 comments on commit 6c8b70a

Please sign in to comment.