Low current mode?


#1

I see in the motor type enum that there is a MOTOR_TYPE_LOW_CURRENT commented out. Are there any plans to implement this in the end? Or is there another way I can get true constant-current control with motors that are in the 4 Ohm resistance & 0.001 mH inductance range?

Background:
I am using some smaller motors that are relatively high resistance and will only be drawing 1-2A. Because of the high resistance (line-to-line is 8.0 Ohms), the advice I’ve seen so far has been to go with the Gimbal control mode. I’m able to get the motors up and running with that, but I would still like to be able to command a specific, constant current, not a voltage.

I’m trying to do open-loop torque control at low velocities. I’m counting on there being a linear & non-time-varying relationship between my control input and the torque output. This is true for actual current control, but when I command a constant voltage (which is how Gimbal control mode interprets the constant current control), the motor begins to heat up, increasing the resistance of the windings and reducing the actual current that I’m getting by about 10% over the course of 10 minutes, which is too much variability for my application.

So, any ways I can get true constant-current control with higher-resistance motors?


#2

I see your issue. I think to get good true current control with a lower current range, you probably need to replace the current sense shunt resistors. See the last paragraph in this post:


#3

Ah, yes, that looks like it’ll help. I’ll try that out, thanks!


#4

Alright, I got my new current shunt resistors installed. Do I need to rebuild the firmware with SHUNT_RESISTANCE set to the new value in board_config_v3.h? I don’t see anywhere that is exposed in the Python API.


#5

I recompiled the firmware with the appropriate SHUNT_RESISTANCE value for my new resistors, and flashed it to the board. However, once I’ve saved the various config values and rebooted it, the board fails on when doing the encoder offset calibration.

Executing this Python code:

print(f'Axis error: {hex(ax.error)}')
print(f'Motor error: {hex(m.error)}')
print(f'Encoder error: {hex(e.error)}')
print(f'Axis current state: {ax.current_state}')

Results in:

Axis error: 0x101
Motor error: 0x0
Encoder error: 0x4

I think this corresponds to ERROR_NO_RESPONSE listed in encoder.hpp? However, if I turn the shaft, I can see the encoder’s shadow count changing.

This was generally working with the old firmware, with the larger shunt resistance (and before I changed the resistors on the board). The encoder wasn’t having any problems. I only changed the shunt resistor to get better current resolution for low-current applications.

Any ideas about what’s going on here?


#6

Hi, i am looking for the same application, if you have any progress, would you please kindly share some info?


#7

Unfortunately, no, I haven’t made any progress on this. I never got a response to my last question, and for now I’ve been accepting the significant amount of current noise during my tests (while running with a second, unmodified ODrive board).

I’m now trying some motors (today, actually) that have a higher torque constant (oz-in/amp), so I’m going to be putting even less current through them. That may prove to be an issue. I would certainly love some feedback in response to the error I was seeing above.