|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrbrain.AXRegister
brbrain.AX12Register
public class AX12Register
Represents the Dynamixel AX-12 registers in a high-level way.
Copyright (C) 2008 Marsette A. Vona, III
Field Summary | |
---|---|
static AX12Register |
AX12_ALARM_LED
bitmask of E_* constants to trigger the LED (RW) |
static AX12Register |
AX12_ALARM_SHUTDOWN
bitmask of E_* constants to trigger torque off (RW) |
static AX12Register |
AX12_BAUD_RATE
Dynamixel Baud Rate (RW), natural units [kbits/sec]. |
static AX12Register |
AX12_CCW_ANGLE_LIMIT
counter-clockwise angle limit (RW), natural units [deg] |
static AX12Register |
AX12_CCW_COMPLIANCE_MARGIN
Counter-clockwise compliance margin (RW), natural units normalized to [0.0, 1.0]. |
static AX12Register |
AX12_CCW_COMPLIANCE_SLOPE
Counter-clockwise compliance slope (RW), natural units normalized to [0.0, 1.0]. |
static AX12Register |
AX12_CW_ANGLE_LIMIT
clockwise angle limit (RW), natural units [deg] |
static AX12Register |
AX12_CW_COMPLIANCE_MARGIN
Clockwise compliance margin (RW), natural units normalized to [0.0, 1.0]. |
static AX12Register |
AX12_CW_COMPLIANCE_SLOPE
Clockwise compliance slope (RW), natural units normalized to [0.0, 1.0]. |
static AX12Register |
AX12_DOWN_CALIBRATION
undocumented pot calibration (RO) |
static AX12Register |
AX12_ERROR
Virtual register containing the error status of the dynamixel (RO). |
static AX12Register |
AX12_FIRMWARE_VERSION
dynamixel firmware version (RO) |
static AX12Register |
AX12_GOAL_POSITION
Goal position (RW), natural units [deg]. |
static AX12Register |
AX12_HIGHEST_LIMIT_TEMPERATURE
limit temp (RW), natural units [deg Celcius] |
static AX12Register |
AX12_HIGHEST_LIMIT_VOLTAGE
high limit voltage (RW), natural units [Volts] |
static AX12Register |
AX12_ID
dynamixel ID (RW) |
static AX12Register |
AX12_LED
direct LED control (RW), boolean, positive logic |
static AX12Register |
AX12_LOCK
Whether to restrict writing to registers AX12_TORQUE_ENABLE
through AX12_TORQUE_LIMIT (RW), boolean. |
static AX12Register |
AX12_LOWEST_LIMIT_VOLTAGE
low limit voltage (RW), natural units [Volts] |
static AX12Register |
AX12_MAX_TORQUE
Maximum torque (RW), natural units normalized to [0.0, 1.0]. |
static AX12Register |
AX12_MODEL_NUMBER
dynamixel model number (RO) |
static AX12Register |
AX12_MOVING
Whether the servo is currentl moving (RO), boolean |
static AX12Register |
AX12_MOVING_SPEED
Moving speed (RW), natural units [rev/min]. |
static AX12Register |
AX12_PRESENT_LOAD
Current "load" (RO), natural units normalized to [0.0, 1.0]. |
static AX12Register |
AX12_PRESENT_POSITION
Current position (RO), natural units [deg] |
static AX12Register |
AX12_PRESENT_SPEED
Current speed (RO), natural units [rev/min] |
static AX12Register |
AX12_PRESENT_TEMPERATURE
Current temperature (RO), natural units [degrees Celcius] |
static AX12Register |
AX12_PRESENT_VOLTAGE
Current voltage (RO), natural units [Volts] |
static AX12Register |
AX12_PUNCH
Initial current to apply after the position error has exceeded the compliance margin (RW), natural units normalized to [0.0, 1.0]. |
static AX12Register |
AX12_REGISTERED_INSTRUCTION
Whether there is a registered instruction pending (RW), boolean |
static AX12Register |
AX12_RETURN_DELAY_TIME
Dynamixel return delay time (RW), natural units [usec]. |
static AX12Register |
AX12_STATUS_RETURN_LEVEL
Dynamixel status return level (RW). |
static AX12Register |
AX12_TORQUE_ENABLE
enables torque generation (RW), boolean, positive logic |
static AX12Register |
AX12_TORQUE_LIMIT
See AX12_MAX_TORQUE |
static AX12Register |
AX12_UP_CALIBRATION
undocumented pot calibration (RO) |
static java.lang.String |
DYNAMIXEL_TYPE
the Dynamixel type identifier |
static AXRegister |
FIRST_RAM_REGISTER
first register in RAM |
static AXRegister |
FIRST_REGISTER
first register in RAM |
static double |
MOVING_SPEED_TO_COUNTS_PER_MS
Multiplication factor taking AX12_MOVING_SPEED raw value to
position counts per millisecond. |
protected static int |
nextOrdinal
next register ordinal during class init |
static float |
NOMINAL_BATTERY_VOLTAGE
nominal battery voltage in Volts (8xNiMH) = (8x1.2V) = 9.6V |
static int |
NUM_REGISTERS
total number of registers |
protected static AX12Register[] |
registers
the array of AX12Register s, indexed by ordinal |
private static java.lang.String |
svnid
|
Fields inherited from class brbrain.AXRegister |
---|
E_ANGLE_LIMIT, E_CHECKSUM, E_INPUT_VOLTAGE, E_INSTRUCTION, E_OVERHEATING, E_OVERLOAD, E_RANGE, max, MAX_DYNAMIXEL_ID, min, naturalUnitsLabel, naturalUnitsPerCount, ordinal, prettyName, RAM_START_ADDRESS, signMagnitude11Bit, startAddr, useNaturalUnitsByDefault, width, writeable |
Constructor Summary | |
---|---|
protected |
AX12Register(int ordinal,
java.lang.String prettyName,
int startAddr)
read-only unsigned 1-byte reg, natural units are counts |
protected |
AX12Register(int ordinal,
java.lang.String prettyName,
int startAddr,
float naturalUnitsPerCount,
java.lang.String naturalUnitsLabel,
boolean useNaturalUnitsByDefault)
read-only unsigned 1-byte reg |
protected |
AX12Register(int ordinal,
java.lang.String prettyName,
int startAddr,
int width)
read-only unsigned reg, natural units are counts |
protected |
AX12Register(int ordinal,
java.lang.String prettyName,
int startAddr,
int width,
boolean signMagnitude11Bit,
float naturalUnitsPerCount,
java.lang.String naturalUnitsLabel,
boolean useNaturalUnitsByDefault)
read-only reg with all options |
protected |
AX12Register(int ordinal,
java.lang.String prettyName,
int startAddr,
int width,
float naturalUnitsPerCount,
java.lang.String naturalUnitsLabel,
boolean useNaturalUnitsByDefault)
Read-only unsigned reg (be careful of confusion with AX12Register(int, String, int, int, int, String, boolean) ). |
protected |
AX12Register(int ordinal,
java.lang.String prettyName,
int startAddr,
int min,
int max)
writeable unsigned 1-byte reg, natural units are coutns |
protected |
AX12Register(int ordinal,
java.lang.String prettyName,
int startAddr,
int min,
int max,
float naturalUnitsPerCount,
java.lang.String naturalUnitsLabel,
boolean useNaturalUnitsByDefault)
writeable unsigned 1-byte reg |
protected |
AX12Register(int ordinal,
java.lang.String prettyName,
int startAddr,
int width,
int min,
int max)
writeable unsigned reg, natural units are counts |
protected |
AX12Register(int ordinal,
java.lang.String prettyName,
int startAddr,
int width,
int min,
int max,
boolean signMagnitude11Bit,
float naturalUnitsPerCount,
java.lang.String naturalUnitsLabel,
boolean useNaturalUnitsByDefault)
writeable reg with all options |
protected |
AX12Register(int ordinal,
java.lang.String prettyName,
int startAddr,
int width,
int min,
int max,
float naturalUnitsPerCount,
java.lang.String naturalUnitsLabel,
boolean useNaturalUnitsByDefault)
writeable unsigned reg |
protected |
AX12Register(int ordinal,
java.lang.String prettyName,
int startAddr,
int min,
int max,
java.lang.String naturalUnitsLabel,
boolean useNaturalUnitsByDefault)
writeable unsigned 1-byte reg, natural units are counts |
Method Summary | |
---|---|
static AX12Register[] |
getAllRegisters()
covers getAllRegisters(AX12Register[], int) , always conses |
static AX12Register[] |
getAllRegisters(AX12Register[] regs)
covers getAllRegisters(AX12Register[], int) , starts at 0 |
static AX12Register[] |
getAllRegisters(AX12Register[] regs,
int start)
get a copy of the ordered array of AX12Registers |
static float |
getCalibratedStiffness(int complianceSlope)
Covers getCalibratedStiffness(int, float) , uses NOMINAL_BATTERY_VOLTAGE . |
static float |
getCalibratedStiffness(int complianceSlope,
float voltage)
Get the stiffness of an AX-12 actuator in units of kg*cm/deg. |
protected java.lang.String |
getDynamixelType()
returns DYNAMIXEL_TYPE |
static AXRegister |
getFirstRAMRegister()
get the FIRST_RAM_REGISTER |
static AXRegister |
getFirstRegister()
get the FIRST_REGISTER |
int |
getNumRegisters()
get the total number of AX12Registers |
static AXRegister |
getRegister(int ordinal)
get the AX12Register at the specified ordinal |
AXRegister |
getRelativeRegister(int offset)
get the register with the given relative ordinal |
static float |
interp(float abscissa,
float valueAtLowEnd,
float abscissaAtLowEnd,
float valueAtHighEnd,
float abscissaAtHighEnd)
Linearly interpolate between the points (abscissaAtLowEnd, valueAtLowEnd) and (abscissaAtHighEnd, valueAtHighEnd). |
Methods inherited from class brbrain.AXRegister |
---|
check, check, checkSpan, clamp, clamp, containsReadOnlyRegs, decode, dup, dup, encode, ensureCapacity, errorsToString, errorsToString, fromNaturalUnits, isBoolean, isRAM, nextRegister, prevRegister, span, span, span, span, toIdentifierString, toNaturalUnits, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DYNAMIXEL_TYPE
public static final float NOMINAL_BATTERY_VOLTAGE
public static final double MOVING_SPEED_TO_COUNTS_PER_MS
Multiplication factor taking AX12_MOVING_SPEED
raw value to
position counts per millisecond.
Tested both @12.4V and @9.8V 500->400 @ 20: 3s (f = 100/(3000*20) = 100/60000 = 1/600) 500->400 @ 10: 6s (f = 100/(6000*10) = 100/60000 = 1/600) 500->400 @ 5: 11s (f = 100/(11000*5) = 100/55000 = 1/550) 500->400 @ 2: 25s (f = 100/(25000*2) = 100/50000 = 1/500) 500->400 @ 1: 49s (f = 100/(49000*1) = 100/49000 = 1/490)
protected static int nextOrdinal
public static final AX12Register AX12_MODEL_NUMBER
public static final AX12Register AX12_FIRMWARE_VERSION
public static final AX12Register AX12_ID
public static final AX12Register AX12_BAUD_RATE
Dynamixel Baud Rate (RW), natural units [kbits/sec].
See table in dynamixel docs for standard rates.
Changing this will probably make the CM-5 firmware unhappy.
public static final AX12Register AX12_RETURN_DELAY_TIME
Dynamixel return delay time (RW), natural units [usec].
Changing this will probably make the CM-5 firmware unhappy.
public static final AX12Register AX12_CW_ANGLE_LIMIT
public static final AX12Register AX12_CCW_ANGLE_LIMIT
public static final AX12Register AX12_HIGHEST_LIMIT_TEMPERATURE
public static final AX12Register AX12_LOWEST_LIMIT_VOLTAGE
public static final AX12Register AX12_HIGHEST_LIMIT_VOLTAGE
public static final AX12Register AX12_MAX_TORQUE
Maximum torque (RW), natural units normalized to [0.0, 1.0].
According to dynamixel manual, max torque 0 enables "Free Run" mode,
whatever that is. Also note that the dynamixel appears to copy this
value to AX12_TORQUE_LIMIT
at boot and may not respect changes to
it (or to AX12_TORQUE_LIMIT
?) until the next boot.
It is unclear how the dynamixel measures "torque" and "load" (current sensing? or based only on servo error?), and calibration relating to physical units is TBD.
public static final AX12Register AX12_STATUS_RETURN_LEVEL
Dynamixel status return level (RW).
0 means no return packets, 1 means return packets only for READ_DATA, 2 means return packets always.
Changing this will probably make the CM-5 firmware unhappy.
public static final AX12Register AX12_ALARM_LED
E_*
constants to trigger the LED (RW)
public static final AX12Register AX12_ALARM_SHUTDOWN
E_*
constants to trigger torque off (RW)
public static final AX12Register AX12_DOWN_CALIBRATION
public static final AX12Register AX12_UP_CALIBRATION
public static final AX12Register AX12_TORQUE_ENABLE
public static final AX12Register AX12_LED
public static final AX12Register AX12_CW_COMPLIANCE_MARGIN
Clockwise compliance margin (RW), natural units normalized to [0.0, 1.0].
This is the angular slop allowed before current is applied.
Calibration relating to physical units is TBD.
public static final AX12Register AX12_CCW_COMPLIANCE_MARGIN
Counter-clockwise compliance margin (RW), natural units normalized to [0.0, 1.0].
This is the angular slop allowed before current is applied.
Calibration relating to physical units is TBD.
public static final AX12Register AX12_CW_COMPLIANCE_SLOPE
Clockwise compliance slope (RW), natural units normalized to [0.0, 1.0].
This appears to be 1.0 minus the P-gain.
Actual calibration relating to physical units of rotational stiffness depends on operating voltage.
In an example, the dynamixel documentation states that only the integer part of the base-2 log of this value is significant.
public static final AX12Register AX12_CCW_COMPLIANCE_SLOPE
Counter-clockwise compliance slope (RW), natural units normalized to [0.0, 1.0].
This appears to be 1.0 minus the P-gain.
Actual calibration relating to physical units of rotational stiffness depends on operating voltage.
In an example, the dynamixel documentation states that only the integer part of the base-2 log of this value is significant.
public static final AX12Register AX12_GOAL_POSITION
Goal position (RW), natural units [deg].
Servo is centered when goal position is at center of range.
public static final AX12Register AX12_MOVING_SPEED
Moving speed (RW), natural units [rev/min].
It appears that in position control mode this is effectively a(n unsigned) speed limit, with the limit disabled when this is set to zero.
Setting both AX12_CW_ANGLE_LIMIT
and AX12_CCW_ANGLE_LIMIT
to zero appears to switch the servo to velocity
control mode, where the value of this register is the signed goal
velocity.
public static final AX12Register AX12_TORQUE_LIMIT
AX12_MAX_TORQUE
public static final AX12Register AX12_PRESENT_POSITION
public static final AX12Register AX12_PRESENT_SPEED
public static final AX12Register AX12_PRESENT_LOAD
Current "load" (RO), natural units normalized to [0.0, 1.0].
It is unclear whether "load" is the same as "torque" here.
Calibration to physical units is TBD.
public static final AX12Register AX12_PRESENT_VOLTAGE
public static final AX12Register AX12_PRESENT_TEMPERATURE
public static final AX12Register AX12_REGISTERED_INSTRUCTION
public static final AX12Register AX12_MOVING
public static final AX12Register AX12_LOCK
Whether to restrict writing to registers AX12_TORQUE_ENABLE
through AX12_TORQUE_LIMIT
(RW), boolean.
Once this is set it becomes immutable until power cycle.
public static final AX12Register AX12_PUNCH
Initial current to apply after the position error has exceeded the compliance margin (RW), natural units normalized to [0.0, 1.0].
Calibration to physical units TBD.
public static final AX12Register AX12_ERROR
Virtual register containing the error status of the dynamixel (RO).
The error status is a bitfield of the E_*
bits.
private static final java.lang.String svnid
protected static AX12Register[] registers
AX12Register
s, indexed by ordinal
public static final int NUM_REGISTERS
public static final AXRegister FIRST_REGISTER
public static final AXRegister FIRST_RAM_REGISTER
Constructor Detail |
---|
protected AX12Register(int ordinal, java.lang.String prettyName, int startAddr, int width, int min, int max, boolean signMagnitude11Bit, float naturalUnitsPerCount, java.lang.String naturalUnitsLabel, boolean useNaturalUnitsByDefault)
protected AX12Register(int ordinal, java.lang.String prettyName, int startAddr, int width, boolean signMagnitude11Bit, float naturalUnitsPerCount, java.lang.String naturalUnitsLabel, boolean useNaturalUnitsByDefault)
protected AX12Register(int ordinal, java.lang.String prettyName, int startAddr, int width, int min, int max, float naturalUnitsPerCount, java.lang.String naturalUnitsLabel, boolean useNaturalUnitsByDefault)
protected AX12Register(int ordinal, java.lang.String prettyName, int startAddr, int width, int min, int max)
protected AX12Register(int ordinal, java.lang.String prettyName, int startAddr, int min, int max, java.lang.String naturalUnitsLabel, boolean useNaturalUnitsByDefault)
protected AX12Register(int ordinal, java.lang.String prettyName, int startAddr, int width, float naturalUnitsPerCount, java.lang.String naturalUnitsLabel, boolean useNaturalUnitsByDefault)
Read-only unsigned reg (be careful of confusion with AX12Register(int, String, int, int, int, String, boolean)
).
protected AX12Register(int ordinal, java.lang.String prettyName, int startAddr, int width)
protected AX12Register(int ordinal, java.lang.String prettyName, int startAddr, int min, int max, float naturalUnitsPerCount, java.lang.String naturalUnitsLabel, boolean useNaturalUnitsByDefault)
protected AX12Register(int ordinal, java.lang.String prettyName, int startAddr, int min, int max)
protected AX12Register(int ordinal, java.lang.String prettyName, int startAddr, float naturalUnitsPerCount, java.lang.String naturalUnitsLabel, boolean useNaturalUnitsByDefault)
protected AX12Register(int ordinal, java.lang.String prettyName, int startAddr)
Method Detail |
---|
public static float getCalibratedStiffness(int complianceSlope, float voltage)
Get the stiffness of an AX-12 actuator in units of kg*cm/deg.
Calibrated by physical experiment.
complianceSlope
- the compliance slope register value which
determines the stiffnessvoltage
- the operating voltage of the servo or NaN to use NOMINAL_BATTERY_VOLTAGE
public static float interp(float abscissa, float valueAtLowEnd, float abscissaAtLowEnd, float valueAtHighEnd, float abscissaAtHighEnd)
Linearly interpolate between the points (abscissaAtLowEnd, valueAtLowEnd) and (abscissaAtHighEnd, valueAtHighEnd).
public static float getCalibratedStiffness(int complianceSlope)
Covers getCalibratedStiffness(int, float)
, uses NOMINAL_BATTERY_VOLTAGE
.
public AXRegister getRelativeRegister(int offset)
getRelativeRegister
in class AXRegister
public int getNumRegisters()
getNumRegisters
in class AXRegister
protected java.lang.String getDynamixelType()
DYNAMIXEL_TYPE
getDynamixelType
in class AXRegister
public static AXRegister getFirstRegister()
FIRST_REGISTER
public static AXRegister getFirstRAMRegister()
FIRST_RAM_REGISTER
public static AXRegister getRegister(int ordinal)
public static AX12Register[] getAllRegisters(AX12Register[] regs, int start)
public static AX12Register[] getAllRegisters(AX12Register[] regs)
getAllRegisters(AX12Register[], int)
, starts at 0
public static AX12Register[] getAllRegisters()
getAllRegisters(AX12Register[], int)
, always conses
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |