We just cleared integrator gain, because the integrator winds up and interferes with steering
For manual control, I think torque mode is the ‘safest’.
paul: For torque mode to work, it has to have a load - if it is on the test bench then even a very small torque will cause the motor to reach its max speed very quickly. On the ground it will be different.
You can check it by applying a very small torque e.g. 0.01, and keep on doubling it until you see a small movement. Then you can check with your hands to see how much torque it is applying.
This is a quirk of Python: You need False with a capital F. But I’d advise to leave it set to True, and adjust the vel_limit, for safety.
You could even attach vel_limit to a ‘throttle’ on a joystick - this would give you a speed limit that you can adjust as you get more confident with the machine.
motor.config.current_lim set to 90
for 800 watt on 36 volt should be enough?
The battery gives the power as I tested the same battery with the motor controller from wheelway, with good power. ( hoover board battery)
I don’t understand the bandwidth thing in the Odrive set up. Is it the min / max frequency that can be supplied to the coils of the motor.( for oscilloscope I understand ) I have the bandwidth set to 100
I think that hall effect encoders + torque mode might need some special tuning. For your question about bandwidth: this sets a filter cutoff in the firmware, not the frequency sent to the coils.
For example, the motor current control bandwidth sets how fast the torque controller responds (really, the PI gains used for the current controller).
The encoder bandwidth acts like a low-pass filter on the encoder data. Velocity is the change in position over time, so if encoder bandwidth is very high and you have very few encoder counts over time, the ODrive will see velocity spikes instead of a smooth velocity measurement. For encoders with low resolution, a low encoder bandwidth setting will improve the velocity measurement.
For the torque control problem: it will be useful to compare motor current in the velocity control + vel_integrator_gain mode, and then check motor current in torque control.
Can you plot odrv0.axis0.motor.current_control.Iq_measured (torque-producing current) in odrivetool and see what it looks like when you run the motor?
You can plot like this in odrivetool - start_liveplotter(lambda: [odrv0.axis0.motor.current_control.Iq_measured]).
Note that motor torque = Iq_measured * torque_constant, so this is a measure of how much current is actually being commanded.
Check this plot with the configuration that had good power, and then check it with the configuration that had no power.
Velocity mode with PWM to control both wheels and be able to make a differential steering.
Not a closed loop ( does not work for the cart as wheel spins back to position.)
When I put Integrator gain up to 1 I have very good power / torque on the wheel
I measured the current Iq.
gain 0.1 current 0.7
gain 0.5 current 2.2 good power!
gain 1 current 2.4 very good power!
In torque control mode current 0.7 and no PWM.
Is the Odrive the right controller for this application ?
So just the good power and velocity PWM and I am ready!
I would like to get it work with the Odrive.
Someone made a cart with differential steering already?
For the sake of ODrive terminology - I understand what you mean by “not closed loop” control, but ODrive is always in “closed loop”, even in torque control. It also makes sense that you would not want much integrator gain!
For your testing, what were your velocity and torque commands? The velocity control works by measuring the error (velocity command - actual velocity) and multiplying that by the gains.
The regular velocity gain acts like a spring - torque = vel_gain * (velocity command - actual velocity). So, for example, you could increase the torque output by commanding an “unrealistic” velocity! You might try setting your vel_limit very high, keep vel_gain the same, and expanding your PWM max and min settings. This should allow more torque, without increasing vel_gain or adding vel_integrator_gain.
The integrator gain acts like an accumulator - it adds up the speed error over time, so it will “grow” the torque output until it hits max current as long as there is speed error (command - actual). This is also why it tries to keep track of position, despite being in velocity control mode.
In torque control mode, the power will depend on what your max and min pwm settings are. Iq_measured should be input_torque / motor.config.torque_constant.
I think the “unrealistic” velocity commands will work for your setup, while also allowing you to have speed control. ODrive can work for this application. I am note sure if someone has already made a differential steering cart already.