Robot
The embedded systems for UTRA's autonomous humanoid soccer-playing robot
|
Register-setting functions. More...
![]() |
Functions | |
void | Dynamixel_SetID (Dynamixel_HandleTypeDef *hdynamixel, uint8_t ID) |
Sets the ID (identification number) for the current motor. More... | |
void | Dynamixel_SetBaudRate (Dynamixel_HandleTypeDef *hdynamixel, uint32_t baud) |
Sets the baud rate of a particular motor. More... | |
void | Dynamixel_SetReturnDelayTime (Dynamixel_HandleTypeDef *hdynamixel, uint16_t microSec) |
Sets the time, in microseconds, that the motor should wait before returning a status packet. More... | |
void | Dynamixel_SetCWAngleLimit (Dynamixel_HandleTypeDef *hdynamixel, float minAngle) |
Sets the clockwise angle limit for the current motor. More... | |
void | Dynamixel_SetCCWAngleLimit (Dynamixel_HandleTypeDef *hdynamixel, float maxAngle) |
Sets the counter-clockwise angle limit for the current motor. More... | |
void | Dynamixel_SetHighestVoltageLimit (Dynamixel_HandleTypeDef *hdynamixel, float highestVoltage) |
Sets the highest operating voltage limit for the current motor. More... | |
void | Dynamixel_SetLowestVoltageLimit (Dynamixel_HandleTypeDef *hdynamixel, float lowestVoltage) |
Sets the lowest operating voltage limit for the current motor. More... | |
void | Dynamixel_SetMaxTorque (Dynamixel_HandleTypeDef *hdynamixel, float maxTorque) |
Sets the maximum torque limit for all motor operations. More... | |
void | Dynamixel_SetStatusReturnLevel (Dynamixel_HandleTypeDef *hdynamixel, uint8_t status_data) |
Sets the conditions under which a status packet will be returned. More... | |
void | Dynamixel_SetAlarmLED (Dynamixel_HandleTypeDef *hdynamixel, uint8_t alarm_LED_data) |
Sets the conditions under which the motor LED will light up. More... | |
void | Dynamixel_SetAlarmShutdown (Dynamixel_HandleTypeDef *hdynamixel, uint8_t alarm_shutdown_data) |
Sets the conditions under which the motor will turn off its torque. More... | |
void | Dynamixel_TorqueEnable (Dynamixel_HandleTypeDef *hdynamixel, uint8_t isEnabled) |
Enables or disables torque for current motor. More... | |
void | Dynamixel_LEDEnable (Dynamixel_HandleTypeDef *hdynamixel, uint8_t isEnabled) |
Toggles the motor LED. More... | |
void | Dynamixel_SetGoalPosition (Dynamixel_HandleTypeDef *hdynamixel, float goalAngle) |
Sets the goal position of the motor in RAM. More... | |
void | Dynamixel_SetGoalVelocity (Dynamixel_HandleTypeDef *hdynamixel, float goalVelocity) |
Sets the goal velocity of the motor in RAM. More... | |
void | Dynamixel_SetGoalTorque (Dynamixel_HandleTypeDef *hdynamixel, float goalTorque) |
Sets the torque limit for the motor in RAM. More... | |
void | Dynamixel_LockEEPROM (Dynamixel_HandleTypeDef *hdynamixel) |
Locks the EEPROM of the current motor until the next power cycle. More... | |
void | Dynamixel_SetPunch (Dynamixel_HandleTypeDef *hdynamixel, float punch) |
Sets a quantity proportional to the minimum current supplied to the motor during operation. More... | |
Register-setting functions.
This subsection provides a set of functions which provide interfaces for setting motor register values.
void Dynamixel_LEDEnable | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
uint8_t | isEnabled | ||
) |
Toggles the motor LED.
Instruction register address: 0x19 (RAM)
Default value: 0x00
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
isEnabled |
|
Definition at line 551 of file DynamixelProtocolV1.c.
void Dynamixel_LockEEPROM | ( | Dynamixel_HandleTypeDef * | hdynamixel | ) |
Locks the EEPROM of the current motor until the next power cycle.
Instruction register address: 0x2F (RAM)
Default value: 0x00
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
Definition at line 715 of file DynamixelProtocolV1.c.
void Dynamixel_SetAlarmLED | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
uint8_t | alarm_LED_data | ||
) |
Sets the conditions under which the motor LED will light up.
Register bits may be set simultaneously.
Register address: 0x11 (EEPROM) Default value: 0x24 (0b00100100)
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
alarm_LED_data | the bits indicate the following:
|
Definition at line 477 of file DynamixelProtocolV1.c.
void Dynamixel_SetAlarmShutdown | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
uint8_t | alarm_shutdown_data | ||
) |
Sets the conditions under which the motor will turn off its torque.
Register bits may be set simultaneously
Register address: 0x12 (EEPROM) Default value: 0x24 (0b00100100)
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
alarm_shutdown_data | the bits indicate the following:
|
Definition at line 509 of file DynamixelProtocolV1.c.
void Dynamixel_SetBaudRate | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
uint32_t | baud | ||
) |
Sets the baud rate of a particular motor.
Register address is 0x04 in motor EEPROM
Instruction register address: 0x04 (EEPROM) Default value: 0x01
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
baud | the baud rate. Arguments in range [7844, 1000000] are valid |
Definition at line 169 of file DynamixelProtocolV1.c.
void Dynamixel_SetCCWAngleLimit | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
float | maxAngle | ||
) |
Sets the counter-clockwise angle limit for the current motor.
If maxAngle for CCW angle limit is 0 AND minAngle for CW angle limit is 0, then motor is in wheel mode where it can continuously rotate. Otherwise, motor is in joint mode where its motion is constrained between the set bounds.
Register 0x08 in EEPROM for low byte, 0x09 in EEPROM for high byte
Instruction register address: 0x08 (EEPROM)
Default value: 0x03FF
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
maxAngle | the maximum angle for all motor operations. Arguments between 0 and 300 are valid |
Definition at line 303 of file DynamixelProtocolV1.c.
void Dynamixel_SetCWAngleLimit | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
float | minAngle | ||
) |
Sets the clockwise angle limit for the current motor.
If maxAngle for CCW angle limit is 0 AND minAngle for CW angle limit is 0, then motor is in wheel mode where it can continuously rotate. Otherwise, motor is in joint mode where its motion is constrained between the set bounds.
Register 0x06 in EEPROM for low byte, 0x07 in EEPROM for high byte
Instruction register address: 0x06 (EEPROM)
Default value: 0x0000
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
minAngle | the minimum angle for all motor operations. Arguments between 0 and 300 are valid |
Definition at line 261 of file DynamixelProtocolV1.c.
void Dynamixel_SetGoalPosition | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
float | goalAngle | ||
) |
Sets the goal position of the motor in RAM.
Takes a double between 0 and 300, encodes this position in an upper and low hex byte pair (with a maximum of 1023 as defined in the AX-12 user manual), and sends this information (along with requisites) over UART. Low byte is 0x1E in motor RAM, high byte is 0x1F in motor RAM.
Instruction register address: 0x1E (RAM)
Default value: None
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
goalAngle | the desired angular position. Arguments between 0 and 300 are valid. Note that 150 corresponds to the middle position |
Definition at line 579 of file DynamixelProtocolV1.c.
void Dynamixel_SetGoalTorque | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
float | goalTorque | ||
) |
Sets the torque limit for the motor in RAM.
The initial value is taken from 0x0E and 0x0F (max torque in EEPROM)
Low byte is 0x22 in motor RAM, high byte is 0x23 in motor RAM.
Instruction register address: 0x22 (RAM)
Default value: ADDR14 (low byte) and ADDR15 (high byte)
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
goalTorque | the percentage of the maximum possible torque (max: 100). Gets converted into a 10-bit number |
Definition at line 694 of file DynamixelProtocolV1.c.
void Dynamixel_SetGoalVelocity | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
float | goalVelocity | ||
) |
Sets the goal velocity of the motor in RAM.
Low byte is 0x20 in motor RAM, high byte is 0x21 in motor RAM
Instruction register address: 0x20 (RAM) Default value: None
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
goalVelocity | the goal velocity in RPM. Arguments of 0-114 are valid when in joint mode. 0 corresponds to MAX motion in joint mode, and minimum motion in wheel mode. In wheel mode, negative arguments correspond to CW rotation |
Definition at line 626 of file DynamixelProtocolV1.c.
void Dynamixel_SetHighestVoltageLimit | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
float | highestVoltage | ||
) |
Sets the highest operating voltage limit for the current motor.
Instruction register address: 0x0C (EEPROM)
Default value: 140 (0xBE)
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
highestVoltage | the highest operating voltage in volts |
Definition at line 345 of file DynamixelProtocolV1.c.
void Dynamixel_SetID | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
uint8_t | ID | ||
) |
Sets the ID (identification number) for the current motor.
Note that the instruction will be broadcasted using the current ID. As such, if the ID is not known, the motor ID should be initialized to the broadcast ID (0xFE) in the Dynamixel_Init function
Instruction register address: 0x03 (EEPROM) Default value: 1
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
ID | the number between 0 and 252 or equal to 254 to identify the motor. If 0xFE (254), any messages broadcasted to that ID will be broadcasted to all motors |
Definition at line 143 of file DynamixelProtocolV1.c.
void Dynamixel_SetLowestVoltageLimit | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
float | lowestVoltage | ||
) |
Sets the lowest operating voltage limit for the current motor.
Instruction register address: 0x0D (EEPROM)
Default value: 60 (0x3C)
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
lowestVoltage | the lowest operating voltage in volts |
Definition at line 377 of file DynamixelProtocolV1.c.
void Dynamixel_SetMaxTorque | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
float | maxTorque | ||
) |
Sets the maximum torque limit for all motor operations.
Low byte is addr 0x0E in motor RAM, high byte is addr 0x0F in motor RAM
Register address: 0x0E (EEPROM)
Default value: 0x3FF
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
maxTorque | the maximum torque as a percentage (max: 100). Gets converted to 10-bit number |
Definition at line 408 of file DynamixelProtocolV1.c.
void Dynamixel_SetPunch | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
float | punch | ||
) |
Sets a quantity proportional to the minimum current supplied to the motor during operation.
Units are not specified in the datasheet, and therefore this function is not entirely useful without sufficient testing
Low byte at address 0x30 and high byte at address 0x31
Instruction register address: 0x30
Default value: 0x0020 (maximum: 0x3FF)
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
punch | for now, arguments in range [0, 1023] are valid |
Definition at line 737 of file DynamixelProtocolV1.c.
void Dynamixel_SetReturnDelayTime | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
uint16_t | microSec | ||
) |
Sets the time, in microseconds, that the motor should wait before returning a status packet.
Instruction register address: 0x05(EEPROM)
Default value: 250 (0xFA)
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
microSec | the time in microseconds to delay. Arguments in range [2, 508] are valid. Default: 500 |
Definition at line 228 of file DynamixelProtocolV1.c.
void Dynamixel_SetStatusReturnLevel | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
uint8_t | status_data | ||
) |
Sets the conditions under which a status packet will be returned.
Register address: 0x10 (EEPROM)
Default value: 0x02
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
status_data |
|
Definition at line 440 of file DynamixelProtocolV1.c.
void Dynamixel_TorqueEnable | ( | Dynamixel_HandleTypeDef * | hdynamixel, |
uint8_t | isEnabled | ||
) |
Enables or disables torque for current motor.
Instruction register address: 0x18 (RAM)
Default value: 0x00
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
isEnabled |
|
Definition at line 528 of file DynamixelProtocolV1.c.