00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 __author__ = 'Cody Jorgensen, Antons Rebguns'
00037 __copyright__ = 'Copyright (c) 2010-2011 Cody Jorgensen, Antons Rebguns'
00038
00039 __license__ = 'BSD'
00040 __maintainer__ = 'Antons Rebguns'
00041 __email__ = 'anton@email.arizona.edu'
00042
00043
00044 """
00045 Dynamixel Constants
00046 """
00047
00048 DXL_MODEL_NUMBER_L = 0
00049 DXL_MODEL_NUMBER_H = 1
00050 DXL_VERSION = 2
00051 DXL_ID = 3
00052 DXL_BAUD_RATE = 4
00053 DXL_RETURN_DELAY_TIME = 5
00054 DXL_CW_ANGLE_LIMIT_L = 6
00055 DXL_CW_ANGLE_LIMIT_H = 7
00056 DXL_CCW_ANGLE_LIMIT_L = 8
00057 DXL_CCW_ANGLE_LIMIT_H = 9
00058 DXL_DRIVE_MODE = 10
00059 DXL_LIMIT_TEMPERATURE = 11
00060 DXL_DOWN_LIMIT_VOLTAGE = 12
00061 DXL_UP_LIMIT_VOLTAGE = 13
00062 DXL_MAX_TORQUE_L = 14
00063 DXL_MAX_TORQUE_H = 15
00064 DXL_RETURN_LEVEL = 16
00065 DXL_ALARM_LED = 17
00066 DXL_ALARM_SHUTDOWN = 18
00067 DXL_OPERATING_MODE = 19
00068 DXL_DOWN_CALIBRATION_L = 20
00069 DXL_DOWN_CALIBRATION_H = 21
00070 DXL_UP_CALIBRATION_L = 22
00071 DXL_UP_CALIBRATION_H = 23
00072 DXL_TORQUE_ENABLE = 24
00073 DXL_LED = 25
00074 DXL_CW_COMPLIANCE_MARGIN = 26
00075 DXL_CCW_COMPLIANCE_MARGIN = 27
00076 DXL_CW_COMPLIANCE_SLOPE = 28
00077 DXL_CCW_COMPLIANCE_SLOPE = 29
00078 DXL_D_GAIN = 26
00079 DXL_I_GAIN = 27
00080 DXL_P_GAIN = 28
00081 DXL_GOAL_POSITION_L = 30
00082 DXL_GOAL_POSITION_H = 31
00083 DXL_GOAL_SPEED_L = 32
00084 DXL_GOAL_SPEED_H = 33
00085 DXL_TORQUE_LIMIT_L = 34
00086 DXL_TORQUE_LIMIT_H = 35
00087 DXL_PRESENT_POSITION_L = 36
00088 DXL_PRESENT_POSITION_H = 37
00089 DXL_PRESENT_SPEED_L = 38
00090 DXL_PRESENT_SPEED_H = 39
00091 DXL_PRESENT_LOAD_L = 40
00092 DXL_PRESENT_LOAD_H = 41
00093 DXL_PRESENT_VOLTAGE = 42
00094 DXL_PRESENT_TEMPERATURE = 43
00095 DXL_REGISTERED_INSTRUCTION = 44
00096 DXL_PAUSE_TIME = 45
00097 DXL_MOVING = 46
00098 DXL_LOCK = 47
00099 DXL_PUNCH_L = 48
00100 DXL_PUNCH_H = 49
00101 DXL_SENSED_CURRENT_L = 56
00102 DXL_SENSED_CURRENT_H = 57
00103 DXL_CURRENT_L = 68
00104 DXL_CURRENT_H = 69
00105 DXL_TORQUE_CONTROL_MODE = 70
00106 DXL_GOAL_TORQUE_L = 71
00107 DXL_GOAL_TORQUE_H = 72
00108 DXL_GOAL_ACCELERATION = 73
00109
00110
00111 DXL_RETURN_NONE = 0
00112 DXL_RETURN_READ = 1
00113 DXL_RETURN_ALL = 2
00114
00115
00116 DXL_PING = 1
00117 DXL_READ_DATA = 2
00118 DXL_WRITE_DATA = 3
00119 DXL_REG_WRITE = 4
00120 DXL_ACTION = 5
00121 DXL_RESET = 6
00122 DXL_SYNC_WRITE = 131
00123
00124
00125 DXL_BROADCAST = 254
00126
00127
00128 DXL_INSTRUCTION_ERROR = 64
00129 DXL_OVERLOAD_ERROR = 32
00130 DXL_CHECKSUM_ERROR = 16
00131 DXL_RANGE_ERROR = 8
00132 DXL_OVERHEATING_ERROR = 4
00133 DXL_ANGLE_LIMIT_ERROR = 2
00134 DXL_INPUT_VOLTAGE_ERROR = 1
00135 DXL_NO_ERROR = 0
00136
00137
00138 DXL_MIN_COMPLIANCE_MARGIN = 0
00139 DXL_MAX_COMPLIANCE_MARGIN = 255
00140
00141 DXL_MIN_COMPLIANCE_SLOPE = 1
00142 DXL_MAX_COMPLIANCE_SLOPE = 254
00143
00144
00145 DXL_MIN_PUNCH = 0
00146 DXL_MAX_PUNCH = 255
00147
00148 DXL_MAX_SPEED_TICK = 1023
00149 DXL_MAX_TORQUE_TICK = 1023
00150
00151 KGCM_TO_NM = 0.0980665
00152 RPM_TO_RADSEC = 0.104719755
00153
00154
00155
00156 DXL_MODEL_TO_PARAMS = \
00157 {
00158 113: { 'name': 'DX-113',
00159 'encoder_resolution': 1024,
00160 'range_degrees': 300.0,
00161 'torque_per_volt': 1.0 / 12.0,
00162 'velocity_per_volt': (54 * RPM_TO_RADSEC) / 12.0,
00163 'rpm_per_tick': 0.111,
00164 'features': []
00165 },
00166 116: { 'name': 'DX-116',
00167 'encoder_resolution': 1024,
00168 'range_degrees': 300.0,
00169 'torque_per_volt': 2.1 / 12.0,
00170 'velocity_per_volt': (78 * RPM_TO_RADSEC) / 12.0,
00171 'rpm_per_tick': 0.111,
00172 'features': []
00173 },
00174 117: { 'name': 'DX-117',
00175 'encoder_resolution': 1024,
00176 'range_degrees': 300.0,
00177 'torque_per_volt': 3.7 / 18.5,
00178 'velocity_per_volt': (85 * RPM_TO_RADSEC) / 18.5,
00179 'rpm_per_tick': 0.111,
00180 'features': []
00181 },
00182 12: { 'name': 'AX-12',
00183 'encoder_resolution': 1024,
00184 'range_degrees': 300.0,
00185 'torque_per_volt': 1.5 / 12.0,
00186 'velocity_per_volt': (59 * RPM_TO_RADSEC) / 12.0,
00187 'rpm_per_tick': 0.111,
00188 'features': []
00189 },
00190 300: { 'name': 'AX-12W',
00191 'encoder_resolution': 1024,
00192 'range_degrees': 300.0,
00193 'torque_per_volt': 0.2 / 12.0,
00194 'velocity_per_volt': (470 * RPM_TO_RADSEC) / 12.0,
00195 'rpm_per_tick': 0.111,
00196 'features': []
00197 },
00198 18: { 'name': 'AX-18',
00199 'encoder_resolution': 1024,
00200 'range_degrees': 300.0,
00201 'torque_per_volt': 1.8 / 12.0,
00202 'velocity_per_volt': (97 * RPM_TO_RADSEC) / 12.0,
00203 'rpm_per_tick': 0.111,
00204 'features': []
00205 },
00206 10: { 'name': 'RX-10',
00207 'encoder_resolution': 1024,
00208 'range_degrees': 300.0,
00209 'torque_per_volt': 1.3 / 12.0,
00210 'velocity_per_volt': (54 * RPM_TO_RADSEC) / 12.0,
00211 'rpm_per_tick': 0.111,
00212 'features': []
00213 },
00214 24: { 'name': 'RX-24',
00215 'encoder_resolution': 1024,
00216 'range_degrees': 300.0,
00217 'torque_per_volt': 2.6 / 12.0,
00218 'velocity_per_volt': (126 * RPM_TO_RADSEC) / 12.0,
00219 'rpm_per_tick': 0.111,
00220 'features': []
00221 },
00222 28: { 'name': 'RX-28',
00223 'encoder_resolution': 1024,
00224 'range_degrees': 300.0,
00225 'torque_per_volt': 3.7 / 18.5,
00226 'velocity_per_volt': (85 * RPM_TO_RADSEC) / 18.5,
00227 'rpm_per_tick': 0.111,
00228 'features': []
00229 },
00230 64: { 'name': 'RX-64',
00231 'encoder_resolution': 1024,
00232 'range_degrees': 300.0,
00233 'torque_per_volt': 5.3 / 18.5,
00234 'velocity_per_volt': (64 * RPM_TO_RADSEC) / 18.5,
00235 'rpm_per_tick': 0.111,
00236 'features': []
00237 },
00238 106: { 'name': 'EX-106',
00239 'encoder_resolution': 4096,
00240 'range_degrees': 250.92,
00241 'torque_per_volt': 10.9 / 18.5,
00242 'velocity_per_volt': (91 * RPM_TO_RADSEC) / 18.5,
00243 'rpm_per_tick': 0.111,
00244 'features': [DXL_SENSED_CURRENT_L]
00245 },
00246 107: { 'name': 'EX-106+',
00247 'encoder_resolution': 4096,
00248 'range_degrees': 250.92,
00249 'torque_per_volt': 10.9 / 18.5,
00250 'velocity_per_volt': (91 * RPM_TO_RADSEC) / 18.5,
00251 'rpm_per_tick': 0.111,
00252 'features': [DXL_SENSED_CURRENT_L]
00253 },
00254 360: { 'name': 'MX-12W',
00255 'encoder_resolution': 4096,
00256 'range_degrees': 360.0,
00257 'torque_per_volt': 0.2 / 12.0,
00258 'velocity_per_volt': (470 * RPM_TO_RADSEC) / 12.0,
00259 'rpm_per_tick': 0.114,
00260 'features': [DXL_GOAL_ACCELERATION]
00261 },
00262 29: { 'name': 'MX-28',
00263 'encoder_resolution': 4096,
00264 'range_degrees': 360.0,
00265 'torque_per_volt': 2.5 / 12.0,
00266 'velocity_per_volt': (55 * RPM_TO_RADSEC) / 12.0,
00267 'rpm_per_tick': 0.114,
00268 'features': [DXL_GOAL_ACCELERATION]
00269 },
00270 310: { 'name': 'MX-64',
00271 'encoder_resolution': 4096,
00272 'range_degrees': 360.0,
00273 'torque_per_volt': 6.0 / 12.0,
00274 'velocity_per_volt': (63 * RPM_TO_RADSEC) / 12.0,
00275 'rpm_per_tick': 0.114,
00276 'features': [DXL_CURRENT_L, DXL_TORQUE_CONTROL_MODE, DXL_GOAL_ACCELERATION]
00277 },
00278 320: { 'name': 'MX-106',
00279 'encoder_resolution': 4096,
00280 'range_degrees': 360.0,
00281 'torque_per_volt': 8.4 / 12.0,
00282 'velocity_per_volt': (45 * RPM_TO_RADSEC) / 12.0,
00283 'rpm_per_tick': 0.114,
00284 'features': [DXL_CURRENT_L, DXL_TORQUE_CONTROL_MODE, DXL_GOAL_ACCELERATION]
00285 },
00286 }
00287