dynamixel_const.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 #
3 # Software License Agreement (BSD License)
4 #
5 # Copyright (c) 2010-2011, Cody Jorgensen, Antons Rebguns.
6 # All rights reserved.
7 #
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
10 # are met:
11 #
12 # * Redistributions of source code must retain the above copyright
13 # notice, this list of conditions and the following disclaimer.
14 # * Redistributions in binary form must reproduce the above
15 # copyright notice, this list of conditions and the following
16 # disclaimer in the documentation and/or other materials provided
17 # with the distribution.
18 # * Neither the name of University of Arizona nor the names of its
19 # contributors may be used to endorse or promote products derived
20 # from this software without specific prior written permission.
21 #
22 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 # POSSIBILITY OF SUCH DAMAGE.
34 
35 
36 __author__ = 'Cody Jorgensen, Antons Rebguns'
37 __copyright__ = 'Copyright (c) 2010-2011 Cody Jorgensen, Antons Rebguns'
38 
39 __license__ = 'BSD'
40 __maintainer__ = 'Antons Rebguns'
41 __email__ = 'anton@email.arizona.edu'
42 
43 
44 """
45 Dynamixel Constants
46 """
47 # Control Table Constants
48 DXL_MODEL_NUMBER_L = 0
49 DXL_MODEL_NUMBER_H = 1
50 DXL_VERSION = 2
51 DXL_ID = 3
52 DXL_BAUD_RATE = 4
53 DXL_RETURN_DELAY_TIME = 5
54 DXL_CW_ANGLE_LIMIT_L = 6
55 DXL_CW_ANGLE_LIMIT_H = 7
56 DXL_CCW_ANGLE_LIMIT_L = 8
57 DXL_CCW_ANGLE_LIMIT_H = 9
58 DXL_DRIVE_MODE = 10
59 DXL_LIMIT_TEMPERATURE = 11
60 DXL_DOWN_LIMIT_VOLTAGE = 12
61 DXL_UP_LIMIT_VOLTAGE = 13
62 DXL_MAX_TORQUE_L = 14
63 DXL_MAX_TORQUE_H = 15
64 DXL_RETURN_LEVEL = 16
65 DXL_ALARM_LED = 17
66 DXL_ALARM_SHUTDOWN = 18
67 DXL_OPERATING_MODE = 19
68 DXL_DOWN_CALIBRATION_L = 20
69 DXL_DOWN_CALIBRATION_H = 21
70 DXL_UP_CALIBRATION_L = 22
71 DXL_UP_CALIBRATION_H = 23
72 DXL_TORQUE_ENABLE = 24
73 DXL_LED = 25
74 DXL_CW_COMPLIANCE_MARGIN = 26
75 DXL_CCW_COMPLIANCE_MARGIN = 27
76 DXL_CW_COMPLIANCE_SLOPE = 28
77 DXL_CCW_COMPLIANCE_SLOPE = 29
78 DXL_D_GAIN = 26
79 DXL_I_GAIN = 27
80 DXL_P_GAIN = 28
81 DXL_GOAL_POSITION_L = 30
82 DXL_GOAL_POSITION_H = 31
83 DXL_GOAL_SPEED_L = 32
84 DXL_GOAL_SPEED_H = 33
85 DXL_TORQUE_LIMIT_L = 34
86 DXL_TORQUE_LIMIT_H = 35
87 DXL_PRESENT_POSITION_L = 36
88 DXL_PRESENT_POSITION_H = 37
89 DXL_PRESENT_SPEED_L = 38
90 DXL_PRESENT_SPEED_H = 39
91 DXL_PRESENT_LOAD_L = 40
92 DXL_PRESENT_LOAD_H = 41
93 DXL_PRESENT_VOLTAGE = 42
94 DXL_PRESENT_TEMPERATURE = 43
95 DXL_REGISTERED_INSTRUCTION = 44
96 DXL_PAUSE_TIME = 45
97 DXL_MOVING = 46
98 DXL_LOCK = 47
99 DXL_PUNCH_L = 48
100 DXL_PUNCH_H = 49
101 DXL_SENSED_CURRENT_L = 56 # For EX-106
102 DXL_SENSED_CURRENT_H = 57
103 DXL_CURRENT_L = 68 # For MX-64 and up; different unit than EX-106
104 DXL_CURRENT_H = 69
105 DXL_TORQUE_CONTROL_MODE = 70
106 DXL_GOAL_TORQUE_L = 71
107 DXL_GOAL_TORQUE_H = 72
108 DXL_GOAL_ACCELERATION = 73
109 
110 # Status Return Levels
111 DXL_RETURN_NONE = 0
112 DXL_RETURN_READ = 1
113 DXL_RETURN_ALL = 2
114 
115 # Instruction Set
116 DXL_PING = 1
117 DXL_READ_DATA = 2
118 DXL_WRITE_DATA = 3
119 DXL_REG_WRITE = 4
120 DXL_ACTION = 5
121 DXL_RESET = 6
122 DXL_SYNC_WRITE = 131
123 
124 # Broadcast Constant
125 DXL_BROADCAST = 254
126 
127 # Error Codes
128 DXL_INSTRUCTION_ERROR = 64
129 DXL_OVERLOAD_ERROR = 32
130 DXL_CHECKSUM_ERROR = 16
131 DXL_RANGE_ERROR = 8
132 DXL_OVERHEATING_ERROR = 4
133 DXL_ANGLE_LIMIT_ERROR = 2
134 DXL_INPUT_VOLTAGE_ERROR = 1
135 DXL_NO_ERROR = 0
136 
137 # Static parameters
138 DXL_MIN_COMPLIANCE_MARGIN = 0
139 DXL_MAX_COMPLIANCE_MARGIN = 255
140 
141 DXL_MIN_COMPLIANCE_SLOPE = 1
142 DXL_MAX_COMPLIANCE_SLOPE = 254
143 
144 # These are guesses as Dynamixel documentation doesn't have any info about it
145 DXL_MIN_PUNCH = 0
146 DXL_MAX_PUNCH = 255
147 
148 DXL_MAX_SPEED_TICK = 1023 # maximum speed in encoder units
149 DXL_MAX_TORQUE_TICK = 1023 # maximum torque in encoder units
150 
151 KGCM_TO_NM = 0.0980665 # 1 kg-cm is that many N-m
152 RPM_TO_RADSEC = 0.104719755 # 1 RPM is that many rad/sec
153 
154 # maximum holding torque is in N-m per volt
155 # maximum velocity is in rad/sec per volt
156 DXL_MODEL_TO_PARAMS = \
157 {
158  113: { 'name': 'DX-113',
159  'encoder_resolution': 1024,
160  'range_degrees': 300.0,
161  'torque_per_volt': 1.0 / 12.0, # 1.0 NM @ 12V
162  'velocity_per_volt': (54 * RPM_TO_RADSEC) / 12.0, # 54 RPM @ 12V
163  'rpm_per_tick': 0.111,
164  'features': []
165  },
166  116: { 'name': 'DX-116',
167  'encoder_resolution': 1024,
168  'range_degrees': 300.0,
169  'torque_per_volt': 2.1 / 12.0, # 2.1 NM @ 12V
170  'velocity_per_volt': (78 * RPM_TO_RADSEC) / 12.0, # 78 RPM @ 12V
171  'rpm_per_tick': 0.111,
172  'features': []
173  },
174  117: { 'name': 'DX-117',
175  'encoder_resolution': 1024,
176  'range_degrees': 300.0,
177  'torque_per_volt': 3.7 / 18.5, # 3.7 NM @ 18.5V
178  'velocity_per_volt': (85 * RPM_TO_RADSEC) / 18.5, # 85 RPM @ 18.5V
179  'rpm_per_tick': 0.111,
180  'features': []
181  },
182  12: { 'name': 'AX-12',
183  'encoder_resolution': 1024,
184  'range_degrees': 300.0,
185  'torque_per_volt': 1.5 / 12.0, # 1.5 NM @ 12V
186  'velocity_per_volt': (59 * RPM_TO_RADSEC) / 12.0, # 59 RPM @ 12V
187  'rpm_per_tick': 0.111,
188  'features': []
189  },
190  300: { 'name': 'AX-12W',
191  'encoder_resolution': 1024,
192  'range_degrees': 300.0,
193  'torque_per_volt': 0.2 / 12.0, # 0.2 NM @ 12V
194  'velocity_per_volt': (470 * RPM_TO_RADSEC) / 12.0, # 470 RPM @ 12V
195  'rpm_per_tick': 0.111,
196  'features': []
197  },
198  18: { 'name': 'AX-18',
199  'encoder_resolution': 1024,
200  'range_degrees': 300.0,
201  'torque_per_volt': 1.8 / 12.0, # 1.8 NM @ 12V
202  'velocity_per_volt': (97 * RPM_TO_RADSEC) / 12.0, # 97 RPM @ 12V
203  'rpm_per_tick': 0.111,
204  'features': []
205  },
206  10: { 'name': 'RX-10',
207  'encoder_resolution': 1024,
208  'range_degrees': 300.0,
209  'torque_per_volt': 1.3 / 12.0, # 1.3 NM @ 12V
210  'velocity_per_volt': (54 * RPM_TO_RADSEC) / 12.0, # 54 RPM @ 12V
211  'rpm_per_tick': 0.111,
212  'features': []
213  },
214  24: { 'name': 'RX-24',
215  'encoder_resolution': 1024,
216  'range_degrees': 300.0,
217  'torque_per_volt': 2.6 / 12.0, # 2.6 NM @ 12V
218  'velocity_per_volt': (126 * RPM_TO_RADSEC) / 12.0, # 126 RPM @ 12V
219  'rpm_per_tick': 0.111,
220  'features': []
221  },
222  28: { 'name': 'RX-28',
223  'encoder_resolution': 1024,
224  'range_degrees': 300.0,
225  'torque_per_volt': 3.7 / 18.5, # 3.7 NM @ 18.5V
226  'velocity_per_volt': (85 * RPM_TO_RADSEC) / 18.5, # 85 RPM @ 18.5V
227  'rpm_per_tick': 0.111,
228  'features': []
229  },
230  64: { 'name': 'RX-64',
231  'encoder_resolution': 1024,
232  'range_degrees': 300.0,
233  'torque_per_volt': 5.3 / 18.5, # 5.3 NM @ 18.5V
234  'velocity_per_volt': (64 * RPM_TO_RADSEC) / 18.5, # 64 RPM @ 18.5V
235  'rpm_per_tick': 0.111,
236  'features': []
237  },
238  106: { 'name': 'EX-106',
239  'encoder_resolution': 4096,
240  'range_degrees': 250.92,
241  'torque_per_volt': 10.9 / 18.5, # 10.9 NM @ 18.5V
242  'velocity_per_volt': (91 * RPM_TO_RADSEC) / 18.5, # 91 RPM @ 18.5V
243  'rpm_per_tick': 0.111,
244  'features': [DXL_SENSED_CURRENT_L]
245  },
246  107: { 'name': 'EX-106+',
247  'encoder_resolution': 4096,
248  'range_degrees': 250.92,
249  'torque_per_volt': 10.9 / 18.5, # 10.9 NM @ 18.5V
250  'velocity_per_volt': (91 * RPM_TO_RADSEC) / 18.5, # 91 RPM @ 18.5V
251  'rpm_per_tick': 0.111,
252  'features': [DXL_SENSED_CURRENT_L]
253  },
254  360: { 'name': 'MX-12W',
255  'encoder_resolution': 4096,
256  'range_degrees': 360.0,
257  'torque_per_volt': 0.2 / 12.0, # torque not specified!
258  'velocity_per_volt': (470 * RPM_TO_RADSEC) / 12.0, # 470 RPM @ 12.0V
259  'rpm_per_tick': 0.114,
260  'features': [DXL_GOAL_ACCELERATION]
261  },
262  29: { 'name': 'MX-28',
263  'encoder_resolution': 4096,
264  'range_degrees': 360.0,
265  'torque_per_volt': 2.5 / 12.0, # 2.5 NM @ 12V
266  'velocity_per_volt': (55 * RPM_TO_RADSEC) / 12.0, # 54 RPM @ 12.0V
267  'rpm_per_tick': 0.114,
268  'features': [DXL_GOAL_ACCELERATION]
269  },
270  310: { 'name': 'MX-64',
271  'encoder_resolution': 4096,
272  'range_degrees': 360.0,
273  'torque_per_volt': 6.0 / 12.0, # 6 NM @ 12V
274  'velocity_per_volt': (63 * RPM_TO_RADSEC) / 12.0, # 63 RPM @ 12.0V
275  'rpm_per_tick': 0.114,
276  'features': [DXL_CURRENT_L, DXL_TORQUE_CONTROL_MODE, DXL_GOAL_ACCELERATION]
277  },
278  320: { 'name': 'MX-106',
279  'encoder_resolution': 4096,
280  'range_degrees': 360.0,
281  'torque_per_volt': 8.4 / 12.0, # 8.4 NM @ 12V
282  'velocity_per_volt': (45 * RPM_TO_RADSEC) / 12.0, # 45 RPM @ 12.0V
283  'rpm_per_tick': 0.114,
284  'features': [DXL_CURRENT_L, DXL_TORQUE_CONTROL_MODE, DXL_GOAL_ACCELERATION]
285  },
286 }
287 


dynamixel_driver
Author(s): Antons Rebguns, Cody Jorgensen
autogenerated on Tue May 12 2020 03:10:57