ODrive motor tuning: trajectory control vs filtered position control

Hi everyone,

I’m building a robot that travels along a fixed cable, similar to a gondola, but the cable itself doesn’t move. Instead, the robot has a motor, a D5312s 330KV with an ODrive OA1 encoder, controlled by an ODrive S1. The motor spins a rubber-covered wheel that presses against the cable to drive the robot forward.

The goal is for the robot to follow another object that moves below it at slowly changing speeds. Since we want to make sure the robot doesn’t exceed the cable endpoints, we’ve been using trajectory control so far. However, the results aren’t great: our setpoints are very close together, and it seems like the controller is always trying to fit a trajectory between them. As a result, the motor doesn’t have enough time to reach the desired setpoint.

So I have two questions:

  1. In trajectory control, is it possible (and safe) to update odrv0.axis0.trap_traj.config.vel_limit at ~7 Hz while the motor is running?
  2. If I switch to filtered position control, can I still define limits for maximum velocity, acceleration, and deceleration? Ideally, we’d like the controller not to try to fit an acceleration/deceleration curve in between two close setpoints, but still respect acceleration/deceleration limits at the cable endpoints.

Thanks in advance for any insights!

Cyril

Hi!

  • In trajectory control, is it possible (and safe) to update odrv0.axis0.trap_traj.config.vel_limit at ~7 Hz while the motor is running?

Yes, absolutely.

No, filtered position control is designed for streaming in an external preplanned trajectory, a walking robot is a good example

Ideally, we’d like the controller not to try to fit an acceleration/deceleration curve in between two close setpoints, but still respect acceleration/deceleration limits at the cable endpoints.
However, the results aren’t great: our setpoints are very close together, and it seems like the controller is always trying to fit a trajectory between them. As a result, the motor doesn’t have enough time to reach the desired setpoint.

I’d posit there’s some other issue here – acceleration/deceleration limits should generally be set based off of maximum system limits, and the ODrive trajectory planner will always try to fit a minimum time trajectory to your new position setpoint. Maybe you could raise the trajectory accel/decel/vel limits during the following mode, and decrease them when decelerating to endpoints, if you need different behavior there?