Control Modes Not Working

I’ve been stuck for a few months trying to get the ODrive to properly function. Currently, none of the control modes are working for me.

My setup
  • 42v (full charge) battery (though I have been testing with voltage around 36-40v)
  • 56v ODrive V3.6 (firmware is updated since last night - 2/1)
  • Flipsky 6374 motor
  • AMT10 Encoder
  • Default brake resistor
  • RPI (4B, IIRC)
  • Commands sent through Putty, to the RPI, where the ODrivetool (0.5.4) is used and where the ODrive is connected to. I used a 2.0 port.

After configuring the values for calibration, I run full calibration, then encoder calibration (I don’t think I should have to do the latter because full calibration should also calibrate the encoder, but if I don’t do this, I get a phase error if I try ot run an index search). Then I run an index search to make sure it works, and then I run closed loop control. Closed loop control finally works, but besides that, nothing else does. Apart from the phase error I might get after running an index search, I get no other errors that indicate anything is wrong with dump_errors(odrv0). I get no errors when trying to run any of the control modes.

Here are my configurations (let me know if you would like to see more):

odrv0




odrv0.axis1.config:

odrv0.axis1.controller:

odrv0.axis1.controller.config:

odrv0.axis1.motor: odrv0.axis1.motor:

odrv0.axis1.motor.config:

dump_errors(odrv0):

image

What could be a possible issue?
What should I be looking at to possibly fix this?

Any help would be appreciated.

What’s a phase error?

Sorry, I should’ve been more specific. I was getting a

“Error_unknown_phase_estimate”

Even if I had run the encoder calibration. So I’d just keep running it until it worked.

Could it be something wrong with the hardware? The ODrive has been really finicky in my experience.

This basically means that the encoder calibration didn’t work or hasn’t been run.

Oh. The index search has to come before the encoder offset calibration. Index search resets encoder calibration…

  1. Reboot
  2. Motor Calibration
  3. Encoder Index Search
  4. Encoder Offset Calibration
  5. Closed Loop

Check dump_errors between each if you’re not confident.

Alternatively, set use_index = True and run FULL_CALIBRATION_SEQUENCE

1 Like

Ahh I see – didn’t know that. Although when I did have it working, I believe I had use_index = True already set, but I’ll keep that in mind when I setup the other motor.

After some tinkering, I found out that the axis state (requested state?) needs to be configured before certain control modes will work. I don’t remember a mention of this anywhere in the documentation, or a clear list of what axis states there are. Does someone have a link?

Or is this the only list of requested states?
https://docs.odriverobotics.com/v/latest/fibre_types/com_odriverobotics_ODrive.html#ODrive.Axis.AxisState

Requested state 8 seems to only work with velocity control, requested state 10 seems to work with input position control, 3 & 4 seem like some kind of calibration or homing, as does 6, 9 just spins the motor continuously, and 0 stops all activity/motor movement.

One requested state also seems to enable closed-loop control, but I forget which number did that. ** Edit – looking at the link I sent, I suppose it’s requested state 7?

On a side note, does anyone know which axis states/requested states will work with the other control modes?

The only state that works with any control modes is AXIS_STATE_CLOSED_LOOP_CONTROL. In all other states, the control mode is ignored (or set inside the state, then restored on exit).

Hm, I wonder what’s happening with mine then. When I enable AXIS_STATE_CLOSED_LOOP_CONTROL I can’t seem to get any of the control modes to work. Although the axis state does do what it’s supposed to. I don’t get any errors either. I’ll give this another try tomorrow, thanks :slightly_smiling_face:

What exactly does “not work” mean? If the drive just stops listening once you go into closed loop, it’s usually noise on USB.

1 Like

That sounds right, I think. Once it enters closed loop control, I can’t use any of the other control modes to move the motor. I’ll send a video as soon as I can to show you.

How could I get rid of noise on the USB? I’m using the included cable, so there’s already the ferrite choke on there. It’s also plugged into a USB 2 port on the Raspberry Pi.

Hm… seems to be working after I plug it into another usb post? I will keep trying and update here. Really happy to see it’s working though. :slightly_smiling_face:

1 Like

Okay, so this is what I’ve been having trouble with:

** gonna upload a youtube link instead so no one needs to download anything

Sorry, wish I could just upload the video here. Basically, closed loop control + input pos work, but velocity mode does not. (this kinda bugginess isn’t limited to these controls though, it varies from time to time)

I also don’t get any errors:

@Wetmelon Sorry to bug you again – do you have any input?

Side note: is there a way to configure both motors with the same values? Instead of going through each one and copying them over.

Do you have a ferrite ring on the motor phases? Weird glitches like this are pretty common for that. Also the USB isolator to avoid ground loops.

Not easily

1 Like

I don’t – is it tough to get ferrite rings on them?

What’s a USB isolator?

Darn, that’s unfortunate.

Check the shop for ferrite rings and isolators Worldwide Shop — ODrive

Check the docs page for “ground loops”

1 Like

I’ll look into it, thanks a bunch :slightly_smiling_face: