Brushed Motor Control?

Hello!

I have an application that requires control of one brushless motor and one brushed motor. I’ve already got an Odrive V3.6 driving the brushless motor, but I see that brushed motors don’t appear to be part of the software. I’m familiar with embedded C/C++ programming and github pull requests.

Would anyone be able to generally advise me on what would need to change? Commutation is easy, but I suppose auto-identification may need to change.

If someone could point me in the right direction, I could probably get this added to the code.

Thanks!

Euhm, what motor are you trying to drive?

Cheers

This one:

And why would you do this if you have an ODrive?

Cheers

Theoretically it is possible to drive a DC motor with an ODrive, because the output state essentially consists of three half bridges. But it seems kind of overkill to use an ODrive for this as you won’t need the special commutation techniques

Yes, that is what I would also say, why not use the ODrive how it is supposed to be used? I mean you pay for it.

Cheers

At its core similar switching concepts are used to control the two different types of motors. You would have to rip out all of the field oriented control parts of the code for one of the two axes. I haven’t mucked around in the firmware too much, but I would probably look at creating a whole new motor object because that is where the majority of the FOC logic lies.

Also, your brushed motor would hook up to only two of the three phases. There is an assumption in the firmware that the sum of the current across the three phases balances out. You would need to be careful to make sure the measure_phase_resistance code is updated to reflect how you have your brushed motor hooked up. One advantage of only using two of the three phases is if you hooked the motor up between phases B and C then you could setup logic to detect short circuits to ground in your motor because the magnitude of current in phase B should always be the opposite of the magnitude of current in phase C. If that isn’t the case then you are losing current somewhere (i.e. a short circuit).

Thanks everyone:

To answer why… We need to control one brushless motor already. I have experience with the VESC and the Odrive, but I like the Odrive more. The brushless motor is the robot wheel drive motor aka the traction motor. The brushed motor is for steering.

So I need to control two motors. The Odrive is perfectly capable (electrically) of driving a brushed motor (i’ve designed several of my own brushless motor controllers).

We were going to use a separate brushed motor controller, but I realized it simplifies our overall system to use a single motor controller architecture. Also our robot is large and driving two traction motors with the Odrive would mean long encoder and phase wires, which is undesirable. I’m comfortable with software development on embedded systems so I’m not afraid to try something unsupported - thats what makes Open Source so valuable!

Thanks @jalbob for the heads up on the measure phase resistance section. Yes I would make a new motor type. The FOC part is easy as commutation on a brushed motor is fixed of course, so it’s more about where all I need to touch the code. If I proceed with this I will try to set up a fork on my github so others can see what I am doing, and hopefully it could lead to a pull request. Even though the Odrive is slightly more controller than I need for this one motor, its low cost, open attitude, and its ability to drive our brushless traction motor all make it attractive here.