Robot
The embedded systems for UTRA's autonomous humanoid soccer-playing robot

Register-setting functions. More...

Collaboration diagram for Setters:

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...
 

Detailed Description

Register-setting functions.

Setter functions

This subsection provides a set of functions which provide interfaces for setting motor register values.

Function Documentation

◆ Dynamixel_LEDEnable()

void Dynamixel_LEDEnable ( Dynamixel_HandleTypeDef hdynamixel,
uint8_t  isEnabled 
)

Toggles the motor LED.

Instruction register address: 0x19 (RAM)

     Default value: 0x00
Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
isEnabled
  • if 1, LED is on
  • if 0, LED is off
Returns
None

Definition at line 551 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_LockEEPROM()

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
Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
Returns
None

Definition at line 715 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_SetAlarmLED()

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)
Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
alarm_LED_datathe bits indicate the following:
  • bit 7: no function
  • bit 6: flash LED when an instruction error occurs
  • bit 5: flash LED when current load cannot be controlled with the specified maximum torque
  • bit 4: flash LED when the checksum of the transmitted packet is invalid
  • bit 3: flash LED when the command is given beyond the range of usage
  • bit 2: flash LED when the internal temperature exceeds the operating range
  • bit 1: flash LED when goal position exceeds the CW angle limit or CCW angle limit
  • bit 0: flash LED when applied voltage is out of operating range
Returns
None

Definition at line 477 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_SetAlarmShutdown()

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)
Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
alarm_shutdown_datathe bits indicate the following:
  • bit 7: no function
  • bit 6: torque off when an instruction error occurs
  • bit 5: torque off when current load cannot be controlled with the specified maximum torque
  • bit 4: torque off when the checksum of the transmitted packet is invalid
  • bit 3: torque off when the command is given beyond the range of usage
  • bit 2: torque off when the internal temperature exceeds the operating range
  • bit 1: torque off when goal position exceeds the CW angle limit or CCW angle limit
  • bit 0: torque off when applied voltage is out of operating range
Returns
None

Definition at line 509 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_SetBaudRate()

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
Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
baudthe baud rate. Arguments in range [7844, 1000000] are valid
Returns
None

Definition at line 169 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_SetCCWAngleLimit()

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

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
maxAnglethe maximum angle for all motor operations. Arguments between 0 and 300 are valid
Returns
None

Definition at line 303 of file DynamixelProtocolV1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dynamixel_SetCWAngleLimit()

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

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
minAnglethe minimum angle for all motor operations. Arguments between 0 and 300 are valid
Returns
None

Definition at line 261 of file DynamixelProtocolV1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dynamixel_SetGoalPosition()

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

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
goalAnglethe desired angular position. Arguments between 0 and 300 are valid. Note that 150 corresponds to the middle position
Returns
None

Definition at line 579 of file DynamixelProtocolV1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dynamixel_SetGoalTorque()

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)

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
goalTorquethe percentage of the maximum possible torque (max: 100). Gets converted into a 10-bit number
Returns
None

Definition at line 694 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_SetGoalVelocity()

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
Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
goalVelocitythe 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
Returns
None

Definition at line 626 of file DynamixelProtocolV1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dynamixel_SetHighestVoltageLimit()

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)
Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
highestVoltagethe highest operating voltage in volts
Returns
None

Definition at line 345 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_SetID()

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

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
IDthe 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
Returns
None

Definition at line 143 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_SetLowestVoltageLimit()

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)
Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
lowestVoltagethe lowest operating voltage in volts
Returns
None

Definition at line 377 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_SetMaxTorque()

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

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
maxTorquethe maximum torque as a percentage (max: 100). Gets converted to 10-bit number
Returns
None

Definition at line 408 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_SetPunch()

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)

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
punchfor now, arguments in range [0, 1023] are valid
Returns
None

Definition at line 737 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_SetReturnDelayTime()

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)
Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
microSecthe time in microseconds to delay. Arguments in range [2, 508] are valid. Default: 500
Returns
None

Definition at line 228 of file DynamixelProtocolV1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dynamixel_SetStatusReturnLevel()

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
Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
status_data
  • 0 to return only on ping
  • 1 to return only for reads
  • 2 to return for all commands
Returns
None

Definition at line 440 of file DynamixelProtocolV1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dynamixel_TorqueEnable()

void Dynamixel_TorqueEnable ( Dynamixel_HandleTypeDef hdynamixel,
uint8_t  isEnabled 
)

Enables or disables torque for current motor.

Instruction register address: 0x18 (RAM)

     Default value: 0x00
Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
isEnabled
  • if 1, then generates torque by impressing power to the motor
  • if 0, then interrupts power to the motor to prevent it from generating torque
Returns
None

Definition at line 528 of file DynamixelProtocolV1.c.

Here is the call graph for this function:
Here is the caller graph for this function: