Help on explaining get_motor_speed in panther_drive

Hello Husarion team,

In the panther_driver, there is a function named get_motor_speed defined in panther_kinematics.py. It is used to translate wheel angular speed to motor power percentage. However, the formular is unclear to me.

  1. why the angular speed multiplied with encode resolution?
  2. why the cango_factor is set to 0.04166667?

It would be helpful to have any doc or data sheet explain available to explain.

Regards
Xujiang

Hello,

Thank you for your inquiry regarding the get_motor_speed function in panther_kinematics.py and the specific calculations involved.

  1. Angular Speed Multiplied with Encoder Resolution: The multiplication of angular speed with encoder resolution serves to convert the wheel’s angular velocity (expressed in radians per second) into a motor command that can be understood by the Roboteq controller. The encoder resolution represents the number of pulses per revolution generated by the motor encoder. This multiplication ensures that the motor command is scaled appropriately based on the resolution of the encoder, allowing for precise control over the motor’s rotational speed.
  2. CANGO Factor (0.04166667): The self._cmd_cango_factor is set to 0.04166667 to convert the desired wheel speed from radians per second to a motor command in the Roboteq controller’s Closed Loop Speed mode. It essentially represents the conversion factor required to translate the desired wheel speed into the corresponding motor command that the Roboteq controller understands.

To summarize the process of conversion:

  • Step 1: Convert desired wheel speed in radians per second to motor speed considering the gear ratio.
  • Step 2: Convert motor speed to rotations per second.
  • Step 3: Convert rotations per second to rotations per minute.
  • Step 4: Convert rotations per minute to a Roboteq GO command, expressed as a permille of the maximum rotation per minute speed set in the Roboteq driver.

If you need further clarification or documentation regarding these calculations or parameters, please feel free to ask.

Best regards,
Paweł

Thank you for your reply. Which value of maximum RPM is specified in the Roboteq driver?