dynamixel_const.py
Go to the documentation of this file.
00001 # -*- coding: utf-8 -*-
00002 #
00003 # Software License Agreement (BSD License)
00004 #
00005 # Copyright (c) 2010-2011, Cody Jorgensen, Antons Rebguns.
00006 # All rights reserved.
00007 #
00008 # Redistribution and use in source and binary forms, with or without
00009 # modification, are permitted provided that the following conditions
00010 # are met:
00011 #
00012 #  * Redistributions of source code must retain the above copyright
00013 #    notice, this list of conditions and the following disclaimer.
00014 #  * Redistributions in binary form must reproduce the above
00015 #    copyright notice, this list of conditions and the following
00016 #    disclaimer in the documentation and/or other materials provided
00017 #    with the distribution.
00018 #  * Neither the name of University of Arizona nor the names of its
00019 #    contributors may be used to endorse or promote products derived
00020 #    from this software without specific prior written permission.
00021 #
00022 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00023 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00025 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00026 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00027 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00028 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00029 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00031 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00032 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00033 # POSSIBILITY OF SUCH DAMAGE.
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 # Control Table Constants
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   # For EX-106
00102 DXL_SENSED_CURRENT_H = 57
00103 DXL_CURRENT_L = 68    # For MX-64 and up; different unit than EX-106
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 # Status Return Levels
00111 DXL_RETURN_NONE = 0
00112 DXL_RETURN_READ = 1
00113 DXL_RETURN_ALL = 2
00114 
00115 # Instruction Set
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 # Broadcast Constant
00125 DXL_BROADCAST = 254
00126 
00127 # Error Codes
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 # Static parameters
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 # These are guesses as Dynamixel documentation doesn't have any info about it
00145 DXL_MIN_PUNCH = 0
00146 DXL_MAX_PUNCH = 255
00147 
00148 DXL_MAX_SPEED_TICK = 1023                   # maximum speed in encoder units
00149 DXL_MAX_TORQUE_TICK = 1023                  # maximum torque in encoder units
00150 
00151 KGCM_TO_NM = 0.0980665                      # 1 kg-cm is that many N-m
00152 RPM_TO_RADSEC = 0.104719755                 # 1 RPM is that many rad/sec
00153 
00154 # maximum holding torque is in N-m per volt
00155 # maximum velocity is in rad/sec per volt
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,                       #  1.0 NM @ 12V
00162            'velocity_per_volt':  (54 * RPM_TO_RADSEC) / 12.0,      #  54 RPM @ 12V
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,                       #  2.1 NM @ 12V
00170            'velocity_per_volt':  (78 * RPM_TO_RADSEC) / 12.0,      #  78 RPM @ 12V
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,                       #  3.7 NM @ 18.5V
00178            'velocity_per_volt':  (85 * RPM_TO_RADSEC) / 18.5,      #  85 RPM @ 18.5V
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,                       #  1.5 NM @ 12V
00186            'velocity_per_volt':  (59 * RPM_TO_RADSEC) / 12.0,      #  59 RPM @ 12V
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,                       # 0.2 NM @ 12V
00194            'velocity_per_volt':  (470 * RPM_TO_RADSEC) / 12.0,     # 470 RPM @ 12V
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,                       #  1.8 NM @ 12V
00202            'velocity_per_volt':  (97 * RPM_TO_RADSEC) / 12.0,      #  97 RPM @ 12V
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,                       #  1.3 NM @ 12V
00210            'velocity_per_volt':  (54 * RPM_TO_RADSEC) / 12.0,      #  54 RPM @ 12V
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,                       #  2.6 NM @ 12V
00218            'velocity_per_volt':  (126 * RPM_TO_RADSEC) / 12.0,     # 126 RPM @ 12V
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,                       #  3.7 NM @ 18.5V
00226            'velocity_per_volt':  (85 * RPM_TO_RADSEC) / 18.5,      #  85 RPM @ 18.5V
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,                       #  5.3 NM @ 18.5V
00234            'velocity_per_volt':  (64 * RPM_TO_RADSEC) / 18.5,      #  64 RPM @ 18.5V
00235            'rpm_per_tick':       0.111,
00236            'features':           []
00237          },
00238     107: { 'name':               'EX-106',
00239            'encoder_resolution': 4096,
00240            'range_degrees':      250.92,
00241            'torque_per_volt':    10.9 / 18.5,                      # 10.9 NM @ 18.5V
00242            'velocity_per_volt':  (91 * RPM_TO_RADSEC) / 18.5,      #  91 RPM @ 18.5V
00243            'rpm_per_tick':       0.111,
00244            'features':           [DXL_SENSED_CURRENT_L]
00245          },
00246     360: { 'name':               'MX-12W',
00247            'encoder_resolution': 4096,
00248            'range_degrees':      360.0,
00249            'torque_per_volt':    0.2 / 12.0,                        #  torque not specified!
00250            'velocity_per_volt':  (470 * RPM_TO_RADSEC) / 12.0,      #  470 RPM @ 12.0V
00251            'rpm_per_tick':       0.114,
00252            'features':           [DXL_GOAL_ACCELERATION]
00253          },
00254      29: { 'name':               'MX-28',
00255            'encoder_resolution': 4096,
00256            'range_degrees':      360.0,
00257            'torque_per_volt':    2.5 / 12.0,                       #  2.5 NM @ 12V
00258            'velocity_per_volt':  (55 * RPM_TO_RADSEC) / 12.0,      #  54 RPM @ 12.0V
00259            'rpm_per_tick':       0.114,
00260            'features':           [DXL_GOAL_ACCELERATION]
00261          },
00262     310: { 'name':               'MX-64',
00263            'encoder_resolution': 4096,
00264            'range_degrees':      360.0,
00265            'torque_per_volt':    6.0 / 12.0,                       #  6 NM @ 12V
00266            'velocity_per_volt':  (63 * RPM_TO_RADSEC) / 12.0,      #  63 RPM @ 12.0V
00267            'rpm_per_tick':       0.114,
00268            'features':           [DXL_CURRENT_L, DXL_TORQUE_CONTROL_MODE, DXL_GOAL_ACCELERATION]
00269          },
00270     320: { 'name':               'MX-106',
00271            'encoder_resolution': 4096,
00272            'range_degrees':      360.0,
00273            'torque_per_volt':    8.4 / 12.0,                       #  8.4 NM @ 12V
00274            'velocity_per_volt':  (45 * RPM_TO_RADSEC) / 12.0,      #  45 RPM @ 12.0V
00275            'rpm_per_tick':       0.114,
00276            'features':           [DXL_CURRENT_L, DXL_TORQUE_CONTROL_MODE, DXL_GOAL_ACCELERATION]
00277          },
00278 }
00279 


dynamixel_driver
Author(s): Antons Rebguns, Cody Jorgensen
autogenerated on Sun Oct 5 2014 23:32:33