Skip to main content

api_reference_motor

  • Motor class represents a DYNAMIXEL motor and provides methods to control and monitor its state, including setting goals, reading status, and configuring parameters.

Motor Class

MethodReturn TypeDescription
Motor(motor_id: int, model_number: int, connector)-Initializes the Motor instance.
enableTorque()-Enables the motor torque.
disableTorque()-Disables the motor torque.
setGoalPosition(position: int)-Sets the motor position.
setGoalVelocity(velocity: int)-Sets the motor velocity.
setGoalCurrent(current: int)-Sets the motor current.
setGoalPWM(pwm: int)-Sets the motor PWM.
LEDOn()-Turns the motor LED on.
LEDOff()-Turns the motor LED off.
ping()-Pings the motor.
isTorqueOn()IntChecks if the motor torque is enabled.
isLEDOn()IntChecks if the motor LED is enabled.
getPresentPosition()IntGets the current motor position.
getPresentVelocity()IntGets the current motor velocity.
getPresentCurrent()IntGets the current motor current.
getPresentPWM()IntGets the current motor PWM.
getMaxPositionLimit()IntGets the maximum position limit of the motor.
getMinPositionLimit()IntGets the minimum position limit of the motor.
getVelocityLimit()IntGets the velocity limit of the motor.
getCurrentLimit()IntGets the current limit of the motor.
getPWMLimit()IntGets the PWM limit of the motor.
getOperatingMode()OperatingModeGets the operating mode of the motor.
changeID(new_id: int)-Changes the ID of the motor.
setOperatingMode(mode: OperatingMode)-Sets the operating mode of the motor.
setProfileConfiguration(config: ProfileConfiguration)-Sets the profile configuration of the motor.
setDirection(direction: Direction)-Sets the direction of the motor.
setPositionPGain(value: int)-Sets the position P gain of the motor.
setPositionIGain(value: int)-Sets the position I gain of the motor.
setPositionDGain(value: int)-Sets the position D gain of the motor.
setVelocityPGain(value: int)-Sets the velocity P gain of the motor.
setVelocityIGain(value: int)-Sets the velocity I gain of the motor.
setHomingOffset(offset: int)-Sets the homing offset of the motor.
setMaxPositionLimit(limit: int)-Sets the maximum position limit of the motor.
setMinPositionLimit(limit: int)-Sets the minimum position limit of the motor.
setVelocityLimit(limit: int)-Sets the velocity limit of the motor.
setCurrentLimit(limit: int)-Sets the current limit of the motor.
setPWMLimit(limit: int)-Sets the PWM limit of the motor.
reboot()-Reboots the motor.
factoryResetAll()-Performs factory reset on the motor.
factoryResetExceptID()-Performs factory reset on the motor except ID.
factoryResetExceptIDAndBaudRate()-Performs factory reset on the motor except ID and baud rate.
stageEnableTorque()StagedCommandStages enabling the motor torque.
stageDisableTorque()StagedCommandStages disabling the motor torque.
stageSetGoalPosition(position: int)StagedCommandStages setting the motor position.
stageSetGoalVelocity(velocity: int)StagedCommandStages setting the motor velocity.
stageSetGoalCurrent(current: int)StagedCommandStages setting the motor current.
stageSetGoalPWM(pwm: int)StagedCommandStages setting the motor PWM.
stageLEDOn()StagedCommandStages turning the motor LED on.
stageLEDOff()StagedCommandStages turning the motor LED off.
stageIsTorqueOn()StagedCommandStages checking if the motor torque is enabled.
stageIsLEDOn()StagedCommandStages checking if the motor LED is enabled.
stageGetPresentPosition()StagedCommandStages getting the current motor position.
stageGetPresentVelocity()StagedCommandStages getting the current motor velocity.
stageGetPresentCurrent()StagedCommandStages getting the current motor current.
stageGetPresentPWM()StagedCommandStages getting the current motor PWM.

Variables

VariableTypeAttributeDescription
idIntinstanceSpecified Motor id.
model_numberIntinstanceModel number of the motor.
model_nameStringinstanceModel name of the motor.
connectorConnectorinstanceConnector instance.
control_tableControlTableinstanceControl table instance.
torque_statusIntinstanceTorque status cache of the motor.
operating_mode_statusOperatingModeinstanceOperating mode status cache of the motor.