I’m using ODrive’s closed-loop control mode (position or velocity control) to drive a brushless motor. However, the motor does not rotate as expected. Instead, it remains stationary and vibrates intensely. Here are my current configurations and observations:
When sending movement commands (e.g., odrv0.axis0.controller.input_pos = X), the motor only vibrates/jitters but does not rotate.
Hi! Can you please let me know the encoder and motor you’re using? Screenshots of your setup configuration in the GUI or ODrivetool would be very helpful as well.
Hi!
I have the same problem and I am using a ipower gm5208 12 und an encoder as5048a. It occurs every time I set “odrv0.axis0.requested_state = AxisState.CLOSED_LOOP_CONTROL”. I am new to odrive and I don’t know exactly how it works, it would be nice of you if you could help me.
Is it possible or even worth it to try to calculate the control parameters? I’m using it for the control of an inverted pengelum, so I need the best possible controller.
Yes, absolutely! You can analyze it as a LTI system, and calculate optimal controller gains for your desired response time. You can see the controller structure here: Controller — ODrive Documentation 0.6.10 documentation
That being said, for inverted pendulum control, you likely want to control it in torque mode, with your pendulum controller providing a torque setpoint for the ODrive. Alternatively, you can control it in position mode, but streaming in a torque feedforward equivalent to cos(theta) * l * m * g, where l is the pendulum length (assuming center of mass is at the end of the pendulum), m is the mass, and g is earth’s gravity. For instance, a 10cm pendulum at 0° (horizontal over the ground) and with a 100g weight would require a torque feedforward of cos(0°) * 10cm * 100g * 9.81 m/s^2 = 0.098 Nm. You’d constantly stream in the torque feedforward at a high rate (>100Hz ideally) – this would linearize the system’s response so you can use the ODrive’s position controller effectively.