Skip to content

Motor Controller

SPEAR Common edited this page Feb 16, 2020 · 6 revisions

Node Values

  • spear.motor.firstboot: Flag that marks if a node should use default values
  • spear.motor.enabled: Flag that enables or disables motors on the node
  • spear.motor.actuator_id: ID used to select which messages to react to
  • spear.motor.reversed: Used to reverse the motor polarity if needed
  • spear.motor.continuous: Not in use
  • spear.motor.Kp: Constant factor for proportional component of pid
  • spear.motor.Ki: Constant factor for integral component of pid
  • spear.motor.Kd: Constant factor for differential component of pid
  • spear.motor.encoder.type: Enum describing which motor encoder is used. 0 is Pot, 1 is Quad, 2 is Abs, 3 is None
  • spear.motor.encoder.min: Minimum integer value for encoder. 0 for Pot
  • spear.motor.encoder.max: Maximum integer value for encoder. 4096 for Pot
  • spear.motor.encoder.to-radians: Conversion ratio for integer value of encoder to motor radians
  • spear.motor.encoder.endstop_min: Min integer value to hold
  • spear.motor.encoder.endstop_max: Max integer value to hold
  • spear.motor.linear.support_length: Length of support beam hinge to hinge
  • spear.motor.linear.arm_length: Length between linear hinge and support hinge
  • spear.motor.linear.length_min: Length of linear beam at min extension
  • spear.motor.linear.length_max: Length of linear beam at max extension

* Units for length do not matter as long as they are the same unit

Actuator ID's

Drive control

  • Front right motor: 41
  • Back right motor 43
  • Front left motor: 45
  • Back left motor: 44

Arm control

  • Hand:
  • Wrist left motor:
  • Wrist right motor:
  • Elbow:
  • Shoulder pitch:
  • Shoulder yaw:

Current configuration

Front right motor

  • node ID: 31
  • board ID: 1
  • spear.motor.enabled: True
  • spear.motor.actuator_id: 41
  • spear.motor.reversed: False
  • spear.motor.Kp: 0.003
  • spear.motor.Ki: 0.0
  • spear.motor.Kd: 0.0
  • spear.motor.encoder.type: 3
  • spear.motor.encoder.min: 0
  • spear.motor.encoder.max: 0
  • spear.motor.encoder.to-radians: 1.0
  • spear.motor.encoder.endstop_min: 0
  • spear.motor.encoder.endstop_max: 0
  • spear.motor.linear.support_length: 0
  • spear.motor.linear.arm_length: 0
  • spear.motor.linear.length_min: 0
  • spear.motor.linear.length_max: 0

Back right motor

  • node ID: 33
  • board ID: 3
  • spear.motor.enabled: True
  • spear.motor.actuator_id: 43
  • spear.motor.reversed: False
  • spear.motor.Kp: 0.003
  • spear.motor.Ki: 0.0
  • spear.motor.Kd: 0.0
  • spear.motor.encoder.type: 3
  • spear.motor.encoder.min: 0
  • spear.motor.encoder.max: 0
  • spear.motor.encoder.to-radians: 1.0
  • spear.motor.encoder.endstop_min: 0
  • spear.motor.encoder.endstop_max: 0
  • spear.motor.linear.support_length: 0
  • spear.motor.linear.arm_length: 0
  • spear.motor.linear.length_min: 0
  • spear.motor.linear.length_max: 0

Front left motor

  • node ID: 35
  • board ID: 5
  • spear.motor.enabled: True
  • spear.motor.actuator_id: 45
  • spear.motor.reversed: True
  • spear.motor.Kp: 0.003
  • spear.motor.Ki: 0.0
  • spear.motor.Kd: 0.0
  • spear.motor.encoder.type: 3
  • spear.motor.encoder.min: 0
  • spear.motor.encoder.max: 0
  • spear.motor.encoder.to-radians: 1.0
  • spear.motor.encoder.endstop_min: 0
  • spear.motor.encoder.endstop_max: 0
  • spear.motor.linear.support_length: 0
  • spear.motor.linear.arm_length: 0
  • spear.motor.linear.length_min: 0
  • spear.motor.linear.length_max: 0

Back left motor

  • node ID: 34
  • board ID: 4
  • spear.motor.enabled: True
  • spear.motor.actuator_id: 44
  • spear.motor.reversed: True
  • spear.motor.Kp: 0.003
  • spear.motor.Ki: 0.0
  • spear.motor.Kd: 0.0
  • spear.motor.encoder.type: 3
  • spear.motor.encoder.min: 0
  • spear.motor.encoder.max: 0
  • spear.motor.encoder.to-radians: 1.0
  • spear.motor.encoder.endstop_min: 0
  • spear.motor.encoder.endstop_max: 0
  • spear.motor.linear.support_length: 0
  • spear.motor.linear.arm_length: 0
  • spear.motor.linear.length_min: 0
  • spear.motor.linear.length_max: 0