@@ -60,7 +60,10 @@ const uint16_t model_number_table[] PROGMEM = {
6060 PRO_M42P_010_S260_R,
6161 PRO_M54P_040_S250_R, PRO_M54P_060_S250_R,
6262 PRO_H42P_020_S300_R,
63- PRO_H54P_100_S500_R, PRO_H54P_200_S500_R
63+ PRO_H54P_100_S500_R, PRO_H54P_200_S500_R,
64+
65+ YM070_210_M001_RH, YM070_210_B001_RH, YM070_210_R051_RH, YM070_210_R099_RH, YM070_210_A051_RH, YM070_210_A099_RH,
66+ YM080_230_M001_RH, YM080_230_B001_RH, YM080_230_R051_RH, YM080_230_R099_RH, YM080_230_A051_RH, YM080_230_A099_RH
6467};
6568
6669const uint8_t model_number_table_count = sizeof (model_number_table)/sizeof (model_number_table[0 ]);
@@ -492,6 +495,55 @@ bool Dynamixel2Arduino::setBaudrate(uint8_t id, uint32_t baudrate)
492495 }
493496 break ;
494497
498+ case YM070_210_M001_RH:
499+ case YM070_210_B001_RH:
500+ case YM070_210_R051_RH:
501+ case YM070_210_R099_RH:
502+ case YM070_210_A051_RH:
503+ case YM070_210_A099_RH:
504+ case YM080_230_M001_RH:
505+ case YM080_230_B001_RH:
506+ case YM080_230_R051_RH:
507+ case YM080_230_R099_RH:
508+ case YM080_230_A051_RH:
509+ case YM080_230_A099_RH:
510+ switch (baudrate)
511+ {
512+ case 9600 :
513+ baud_idx = 0 ;
514+ break ;
515+ case 57600 :
516+ baud_idx = 1 ;
517+ break ;
518+ case 115200 :
519+ baud_idx = 2 ;
520+ break ;
521+ case 1000000 :
522+ baud_idx = 3 ;
523+ break ;
524+ case 2000000 :
525+ baud_idx = 4 ;
526+ break ;
527+ case 3000000 :
528+ baud_idx = 5 ;
529+ break ;
530+ case 4000000 :
531+ baud_idx = 6 ;
532+ break ;
533+ case 4500000 :
534+ baud_idx = 7 ;
535+ break ;
536+ case 6000000 :
537+ baud_idx = 8 ;
538+ break ;
539+ case 10500000 :
540+ baud_idx = 9 ;
541+ break ;
542+ default :
543+ return false ;
544+ }
545+ break ;
546+
495547 default :
496548 return false ;
497549 break ;
@@ -757,16 +809,35 @@ bool Dynamixel2Arduino::setOperatingMode(uint8_t id, uint8_t mode)
757809 ret = writeControlTableItem (ControlTableItem::OPERATING_MODE, id, 16 );
758810 }
759811 break ;
760-
812+
813+ case YM070_210_M001_RH:
814+ case YM070_210_B001_RH:
815+ case YM070_210_R051_RH:
816+ case YM070_210_R099_RH:
817+ case YM070_210_A051_RH:
818+ case YM070_210_A099_RH:
819+ case YM080_230_M001_RH:
820+ case YM080_230_B001_RH:
821+ case YM080_230_R051_RH:
822+ case YM080_230_R099_RH:
823+ case YM080_230_A051_RH:
824+ case YM080_230_A099_RH:
825+ if (mode == OP_POSITION){
826+ ret = writeControlTableItem (ControlTableItem::OPERATING_MODE, id, 3 );
827+ }else if (mode == OP_VELOCITY){
828+ ret = writeControlTableItem (ControlTableItem::OPERATING_MODE, id, 1 );
829+ }else if (mode == OP_CURRENT){
830+ ret = writeControlTableItem (ControlTableItem::OPERATING_MODE, id, 0 );
831+ }
832+ break ;
833+
761834 default :
762835 break ;
763836 }
764837
765838 return ret;
766839}
767840
768-
769-
770841bool Dynamixel2Arduino::setGoalPosition (uint8_t id, float value, uint8_t unit)
771842{
772843 if (unit != UNIT_RAW && unit != UNIT_DEGREE)
@@ -1450,6 +1521,89 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_pro_ra_plus_h54_200[] PRO
14501521 {LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0 , 0 , 0 }
14511522};
14521523
1524+ const ModelDependencyFuncItemAndRangeInfo_t dependency_ym070_210_000_rh[] PROGMEM = {
1525+ #if (ENABLE_ACTUATOR_Y)
1526+ {SET_POSITION, GOAL_POSITION, UNIT_DEGREE, -2147483648 , 2147483647 , 0.0006866455 },
1527+ {GET_POSITION, PRESENT_POSITION, UNIT_DEGREE, -2147483648 , 2147483647 , 0.0006866455 },
1528+
1529+ {SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -642200 , 642200 , 0.01 },
1530+ {GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -642200 , 642200 , 0.01 },
1531+
1532+ {SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2080 , 2080 , 0.01 },
1533+ {GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2080 , 2080 , 0.01 },
1534+ #endif
1535+ {LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0 , 0 , 0 }
1536+ };
1537+
1538+ const ModelDependencyFuncItemAndRangeInfo_t dependency_ym070_210_051_rh[] PROGMEM = {
1539+ #if (ENABLE_ACTUATOR_Y)
1540+ {SET_POSITION, GOAL_POSITION, UNIT_DEGREE, -2147483648 , 2147483647 , 0.0006866455 },
1541+ {GET_POSITION, PRESENT_POSITION, UNIT_DEGREE, -2147483648 , 2147483647 , 0.0006866455 },
1542+
1543+ {SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -12592 , 12592 , 0.01 },
1544+ {GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -12592 , 12592 , 0.01 },
1545+
1546+ {SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2080 , 2080 , 0.01 },
1547+ {GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2080 , 2080 , 0.01 },
1548+ #endif
1549+ {LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0 , 0 , 0 }
1550+ };
1551+
1552+ const ModelDependencyFuncItemAndRangeInfo_t dependency_ym070_210_099_rh[] PROGMEM = {
1553+ #if (ENABLE_ACTUATOR_Y)
1554+ {SET_POSITION, GOAL_POSITION, UNIT_DEGREE, -2147483648 , 2147483647 , 0.0006866455 },
1555+ {GET_POSITION, PRESENT_POSITION, UNIT_DEGREE, -2147483648 , 2147483647 , 0.0006866455 },
1556+
1557+ {SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -6486 , 6486 , 0.01 },
1558+ {GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -6486 , 6486 , 0.01 },
1559+
1560+ {SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2080 , 2080 , 0.01 },
1561+ {GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2080 , 2080 , 0.01 },
1562+ #endif
1563+ {LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0 , 0 , 0 }
1564+ };
1565+
1566+ const ModelDependencyFuncItemAndRangeInfo_t dependency_ym080_230_000_rh[] PROGMEM = {
1567+ #if (ENABLE_ACTUATOR_Y)
1568+ {SET_POSITION, GOAL_POSITION, UNIT_DEGREE, -2147483648 , 2147483647 , 0.0006866455 },
1569+ {GET_POSITION, PRESENT_POSITION, UNIT_DEGREE, -2147483648 , 2147483647 , 0.0006866455 },
1570+
1571+ {SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -355600 , 355600 , 0.01 },
1572+ {GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -355600 , 355600 , 0.01 },
1573+
1574+ {SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2240 , 2240 , 0.01 },
1575+ {GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2240 , 2240 , 0.01 },
1576+ #endif
1577+ {LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0 , 0 , 0 }
1578+ };
1579+
1580+ const ModelDependencyFuncItemAndRangeInfo_t dependency_ym080_230_051_rh[] PROGMEM = {
1581+ #if (ENABLE_ACTUATOR_Y)
1582+ {SET_POSITION, GOAL_POSITION, UNIT_DEGREE, -2147483648 , 2147483647 , 0.0006866455 },
1583+ {GET_POSITION, PRESENT_POSITION, UNIT_DEGREE, -2147483648 , 2147483647 , 0.0006866455 },
1584+
1585+ {SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -6972 , 6972 , 0.01 },
1586+ {GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -6972 , 6972 , 0.01 },
1587+
1588+ {SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2240 , 2240 , 0.01 },
1589+ {GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2240 , 2240 , 0.01 },
1590+ #endif
1591+ {LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0 , 0 , 0 }
1592+ };
1593+
1594+ const ModelDependencyFuncItemAndRangeInfo_t dependency_ym080_230_099_rh[] PROGMEM = {
1595+ #if (ENABLE_ACTUATOR_Y)
1596+ {SET_POSITION, GOAL_POSITION, UNIT_DEGREE, -2147483648 , 2147483647 , 0.0006866455 },
1597+ {GET_POSITION, PRESENT_POSITION, UNIT_DEGREE, -2147483648 , 2147483647 , 0.0006866455 },
1598+
1599+ {SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -3591 , 3591 , 0.01 },
1600+ {GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -3591 , 3591 , 0.01 },
1601+
1602+ {SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2240 , 2240 , 0.01 },
1603+ {GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2240 , 2240 , 0.01 },
1604+ #endif
1605+ {LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0 , 0 , 0 }
1606+ };
14531607
14541608static ItemAndRangeInfo_t getModelDependencyFuncInfo (uint16_t model_num, uint8_t func_num)
14551609{
@@ -1646,7 +1800,32 @@ static ItemAndRangeInfo_t getModelDependencyFuncInfo(uint16_t model_num, uint8_t
16461800 p_common_ctable = dependency_ctable_pro_ra_pro_plus_model;
16471801 p_dep_ctable = dependency_pro_ra_plus_h54_200;
16481802 break ;
1649-
1803+
1804+ case YM070_210_M001_RH:
1805+ case YM070_210_B001_RH:
1806+ p_common_ctable = dependency_ym070_210_000_rh;
1807+ break ;
1808+ case YM070_210_R051_RH:
1809+ case YM070_210_A051_RH:
1810+ p_common_ctable = dependency_ym070_210_051_rh;
1811+ break ;
1812+ case YM070_210_R099_RH:
1813+ case YM070_210_A099_RH:
1814+ p_common_ctable = dependency_ym070_210_099_rh;
1815+ break ;
1816+ case YM080_230_M001_RH:
1817+ case YM080_230_B001_RH:
1818+ p_common_ctable = dependency_ym080_230_000_rh;
1819+ break ;
1820+ case YM080_230_R051_RH:
1821+ case YM080_230_A051_RH:
1822+ p_common_ctable = dependency_ym080_230_051_rh;
1823+ break ;
1824+ case YM080_230_R099_RH:
1825+ case YM080_230_A099_RH:
1826+ p_common_ctable = dependency_ym080_230_099_rh;
1827+ break ;
1828+
16501829 default :
16511830 break ;
16521831 }
0 commit comments