Help getting started

Hi everyone. I hooked up my 24V oDrive with 2x 5065 motors with 2x 8192 Encoders. Downloaded all tools and flashed the firmware to the latest 0.5.3

I am following the Get Started guide and getting stuck at the "Position Control of M0 / Step #2 (Sending the motor a new position…)

When entering: odrv0.axis0.controller.input_pos = 10 the motor turns for a bit (I assume 10 turns) and stops, I can’t repeat the command again because there are errors:


My ODrive is connected to a 24V / 17A PSU which I adjusted to about 17V. (correct voltage is shown when running: odrv0.vbus_voltage)

Noob questions:

  1. In the CONFIGURE M0 Section I set the brake resistor to TRUE (I assume that’s for the 50WR5J resistor I hooked up to the AUX connector), changed the Motor Type to: MOTOR_TYPE_HIGH_CURRENT and set my encoder CPR to 8192. Everything else is default. With this I can run calibration, and test the AXIS_STATE_CLOSED_LOOP_CONTROL (which works as intended, it fights me gently when trying to move the shaft and keeps its position) but on the next step(Sending the motor to a new position), I can only run the command one time, and then it stops working until I reboot because of the errors. What should I do here?

  2. My application doesn’t require the motors to spin crazy fast - it’s a reel to reel application (motion picture film) all I need is adequate tension for moving the film from one reel to another. Is my 24V PSU with 5065 motors a good fit for this?

  3. When doing the initial calibration, you don’t want to have any load on the motors correct? Only after this initial config you install the motors in your project for final tuning? I’m going direct drive for this with each reel attached to the motors.

1 Like

Maybe my first post is too open ended… here’s a condensed version:

What should I modify to fix the errors below?


odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT
odrv0.axis0.encoder.config.cpr = 8192
odrv0.axis0.motor.config.pole_pairs = 7
odrv0.config.enable_brake_resistor = True
odrv0.config.brake_resistance = 0.47

odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE

*****No Errors

odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL


system: no error
axis: no error
motor: Error(s):
sensorless_estimator: no error
encoder: no error
controller: Error(s):

Both motors are working now.


adjusted the vel_limit?

Yes that was one of the issue. I made a lot of progress so far and the Odrive is reacting beyond my expectations. Still a lot to tweak but I got film going from one reel to the next and back with great tension control.

Now the issue is I need to slow it down.

I calibrated AntiCogging and it works great but when I use lower velocity (around 0.5~0.7) it still is not maintaining constant speed, it oscillates, slightly speeds up and slows down. which isn’t ideal.

The feed reel is set to Velocity Torque limited and keeps the tension very nicely.

Any tips on how to get a constant speed even at low velocity?

I guess I could use a reduction gearbox but would be amazing if I didn’t have to. Please let me know if it’s feasible, if I have to change my encoder or motors etc… I haven’t learned how to use the plotting tool, for some reason it crashes my terminal on MAC - I’ll try in Windows using bootcamp. Maybe that would help me diagnose?

Tuning is done and it’s pretty steady!

I figured out that when going from forward to backward to idle… etc, I had to include the tuning voltages commands each time I switched. The tuning gets wacky if you don’t include the tuning voltages every time.

Next step, interfacing!

1 Like

The what voltages? Not sure what those are

vel_gain, vel_pos & vel_integrator_gain

I’m still tuning actually.

I loaded a full film reel (larger circumference and weight) for testing and it gets really unsteady toward the end of unspooling. Smaller reels are ok’ish.

These are my commands for moving the film from one reel to the next:


odrv0.axis0.controller.config.control_mode = CONTROL_MODE_TORQUE_CONTROL
odrv0.axis1.controller.config.control_mode = CONTROL_MODE_TORQUE_CONTROL
odrv0.axis0.controller.input_torque = .1
odrv0.axis1.controller.input_torque = -.1


odrv0.axis0.controller.config.control_mode = CONTROL_MODE_TORQUE_CONTROL
odrv0.axis1.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL
odrv0.axis0.controller.input_torque = 0.1
odrv0.axis1.controller.input_vel = -.5


odrv0.axis0.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL
odrv0.axis1.controller.config.control_mode = CONTROL_MODE_TORQUE_CONTROL
odrv0.axis0.controller.input_vel = .5
odrv0.axis1.controller.input_torque = -0.1

***Any help on tuning for something like this would be appreciated.

  • Should each direction (Forward, Rewind and hold) be tuned separately, each having their own set of “vel_gain, vel_pos & vel_integrator_gain” values ?

  • Is there a command to keep track and adjust motors based on the load as film is transferred from one reel to the next or is a simple tuning supposed to achieve that goal?

  • The take up reel gradually accelerates near the end of of roll - Trying to get a constant speed from beginning to end but having a hard time.

  • For the larger reel I have to push the vel_integrator_gain to 15-20 to keep the motion constant that doesn’t seem right?

Yeah, in an unbalanced load situation like a tensioner, it’s quite common to have to adjust the gains for different directions. It’s commonly called “gain scheduling”.

Don’t forget to reset your input_torque to 0 when you go into velocity_control mode, because it acts as a feedforward term otherwise:

odrv0.axis0.controller.config.control_mode = CONTROL_MODE_TORQUE_CONTROL
odrv0.axis0.controller.input_torque = 0.1
odrv0.axis0.controller.input_vel = 0

odrv0.axis1.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL
odrv0.axis1.controller.input_torque = 0
odrv0.axis1.controller.input_vel = -.5

This sounds like you’re having issues as the diameter of the roll changes and therefore the torque load on each reel changes… you may need a better way to estimate the linear feet per second, or the tension instead of the torque.

1 Like

That makes sense - thanks for pointing that out!

I think that’s exactly what’s happening. I will research on that.