I am using this motor: https://www.aliexpress.us/item/3256805726373324.html?spm=a2g0o.order_list.order_list_main.20.391f1802R0ugRh&gatewayAdapt=glo2usa
KV: 100
And I am using a 360 W power source (36 V and 10 A max) with ODrive S1.
I count 40 magnets and have set the pole pairs parameter as 20 with the ODrive online wizard.
I have the gains as follows
When I turn to position control, the motor is seems to be doing fine but if I use velocity mode and command it to turn at 2 rev / s, I only see live plotter at about 1 rev/s. And both velocity and current oscillate a lot.
I also tried the below values for gains:
Velocity Integrator Gain: 6.25
Velocity Gain: 1.25
Velocity Limit: 20
Position Gain: 500
Position Filter Bandwidth: 10
The position control still seems to be fine but the ramped velocity control mode does not show any change in behavior.
Would like suggestions on what could I do next. I think the power source is enough. I am using the ODrive OA1 encoder.
Hm, this definitely could be a calibration issue. A few questions:
- Is the OA1 mounted exactly coaxial with the motor shaft?
- Are you using the encoder magnets from our shop? How are you mounting them to the motor shaft?
- Did you do motor/encoder calibration under no load whatsoever?
Maybe you could post a video of the motor turning at that 2 rev/s speed?
-
Yes, the OA1 is exactly on the shaft
-
Yes, the encoder magnet is from the shop. It sits on top of the rotor with the help of a small 3D printed part and the magnet sticks out of it. The encoder sits on top of that at a little distance with optimal field strength.
-
Yes, I don’t currently have something to mount the motor on but I held the stator in my hand so that the rotor is able to freely move.
Video below for when the motor turns at 2 rev/s
In that video you were only using vel_gain – your vel_integrator_gain was zero. This is typically not enough to correct for steady-state error, can you try again but with vel_integrator_gain increased to maybe 0.5?
I tried different vel_integrator_gains unto 6.25 but the behavior is the same
Strange! Can you post screenshots of each page in the configuration setup?
Update:
I changed the parameters and set the motor type to high_current keeping everything else the same. It does spin at 2 rev/s now. But now irrespective of the control mode I choose, it always ends in DC_BUS_OVER_REGEN_CURRENT. Does that mean the power source (10 A max current) is not sufficient for the motor?
Oh - yeah the gimbal mode is definitely incorrect. That’s only for very very very high resistance and low power motors.
Regarding the over regen current - your power supply is fine, but your system has no way to deal with regenerated power. You need to either use a battery (and set the “DC max negative current” on page 1 “Power Source” to your battery’s maximum charge rate) or wire in and enable a brake resistor on page 1 “Power Source”. Alternatively, use a regen clamp.
Also, your gains are likely now way too high
would recommend reducing them and tuning again.
This was great. Thanks for the help. The motor does spin perfectly now.