Skip to content

Commit

Permalink
XC330 added
Browse files Browse the repository at this point in the history
  • Loading branch information
ROBOTIS-David committed Jun 17, 2021
1 parent 73c4d67 commit 886eba9
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 1 deletion.
49 changes: 48 additions & 1 deletion src/Dynamixel2Arduino.cpp
Expand Up @@ -33,6 +33,10 @@ const uint16_t model_number_table[] PROGMEM = {
XL320,
XL330_M288,
XL330_M077,
XC330_M181,
XC330_M288,
XC330_T181,
XC330_T288,
XL430_W250,
XXL430_W250,
XC430_W150, XC430_W240,
Expand Down Expand Up @@ -298,7 +302,10 @@ bool Dynamixel2Arduino::setBaudrate(uint8_t id, uint32_t baudrate)
return false;
}
break;

case XC330_M288:
case XC330_M181:
case XC330_T288:
case XC330_T181:
case XL330_M288:
case XL330_M077:
switch(baudrate)
Expand Down Expand Up @@ -652,6 +659,10 @@ bool Dynamixel2Arduino::setOperatingMode(uint8_t id, uint8_t mode)
case MX106_2:
case XL330_M288:
case XL330_M077:
case XC330_M288:
case XC330_M181:
case XC330_T181:
case XC330_T288:
case XM430_W210:
case XM430_W350:
case XH430_V210:
Expand Down Expand Up @@ -1088,6 +1099,7 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_ctable_2_0_common[] PROGM
|| ENABLE_ACTUATOR_MX64_PROTOCOL2 \
|| ENABLE_ACTUATOR_MX106_PROTOCOL2 \
|| ENABLE_ACTUATOR_XL330 \
|| ENABLE_ACTUATOR_XC330 \
|| ENABLE_ACTUATOR_XC430 \
|| ENABLE_ACTUATOR_XL430 \
|| ENABLE_ACTUATOR_XM430 || ENABLE_ACTUATOR_XH430 \
Expand Down Expand Up @@ -1131,6 +1143,29 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_xl330_M288_M077[] PROGMEM
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
};

const ModelDependencyFuncItemAndRangeInfo_t dependency_xc330_m181_m288[] PROGMEM = {
#if (ENABLE_ACTUATOR_XC330)
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2352, 2352, 1},
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2352, 2352, 1},

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

const ModelDependencyFuncItemAndRangeInfo_t dependency_xc330_t181_t288[] PROGMEM = {
#if (ENABLE_ACTUATOR_XC330)
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -910, 910, 1},
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -910, 910, 1},

{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -2047, 2047, 0.229},
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -2047, 2047, 0.229},
#endif
{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},
Expand Down Expand Up @@ -1426,6 +1461,18 @@ static ItemAndRangeInfo_t getModelDependencyFuncInfo(uint16_t model_num, uint8_t
p_dep_ctable = dependency_xl330_M288_M077;
break;

case XC330_M181:
case XC330_M288:
p_common_ctable = dependency_ctable_2_0_common;
p_dep_ctable = dependency_xc330_m181_m288;
break;

case XC330_T181:
case XC330_T288:
p_common_ctable = dependency_ctable_2_0_common;
p_dep_ctable = dependency_xc330_t181_t288;
break;

case XM430_W210:
case XM430_W350:
p_common_ctable = dependency_ctable_2_0_common;
Expand Down
6 changes: 6 additions & 0 deletions src/actuator.cpp
Expand Up @@ -169,6 +169,7 @@ const ModelControlTableInfo_t control_table_2_0[] PROGMEM = {
|| ENABLE_ACTUATOR_MX64_PROTOCOL2 \
|| ENABLE_ACTUATOR_MX106_PROTOCOL2 \
|| ENABLE_ACTUATOR_XL330 \
|| ENABLE_ACTUATOR_XC330 \
|| ENABLE_ACTUATOR_XL430 \
|| ENABLE_ACTUATOR_XC430 \
|| ENABLE_ACTUATOR_XM430 || ENABLE_ACTUATOR_XH430 \
Expand Down Expand Up @@ -256,6 +257,7 @@ const ModelControlTableInfo_t xc430_xl430_control_table[] PROGMEM = {

const ModelControlTableInfo_t xmh430_xl330_control_table[] PROGMEM = {
#if (ENABLE_ACTUATOR_XL330 \
|| ENABLE_ACTUATOR_XC330 \
|| ENABLE_ACTUATOR_XM430 \
|| ENABLE_ACTUATOR_XH430)
{ControlTableItem::CURRENT_LIMIT, 38, 2},
Expand Down Expand Up @@ -484,6 +486,10 @@ ControlTableItemInfo_t DYNAMIXEL::getControlTableItemInfo(uint16_t model_num, ui

case XL330_M288:
case XL330_M077:
case XC330_M181:
case XC330_M288:
case XC330_T181:
case XC330_T288:
case XM430_W210:
case XM430_W350:
case XH430_V210:
Expand Down
14 changes: 14 additions & 0 deletions src/actuator.h
Expand Up @@ -79,6 +79,20 @@
#define XL330_M288 (uint16_t)1200
#endif

#ifndef XC330_M181
#define XC330_M181 (uint16_t)1230
#endif
#ifndef XC330_M288
#define XC330_M288 (uint16_t)1240
#endif

#ifndef XC330_T181
#define XC330_T181 (uint16_t)1210
#endif
#ifndef XC330_T288
#define XC330_T288 (uint16_t)1220
#endif

#ifndef XC430_W150
#define XC430_W150 (uint16_t)1070
#endif
Expand Down
1 change: 1 addition & 0 deletions src/utility/config.h
Expand Up @@ -17,6 +17,7 @@

#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_XM430 1
Expand Down

0 comments on commit 886eba9

Please sign in to comment.