Odrive as BMW X-drive controller

#1

Hi!

Im trying to figure out if it is possible to use ODrive to control an actuator on/off, based on max set current.

I need to alter 4wheel drive on/off through a BMW X-drive transfer case, and it uses an actuator controlled clutch.

The actuator is a bldc motor, and no encoder.
I’ve searched through litterature from BMW, and I understand that they, based on current limits, check max/min stroke of the actuator at each power off cycle.

I’d like to do the same, but I’m not as advaced as BMW, so I don’t need to stop in the middle, I only need on/off based on an adjustable current setting.

The motor turns maximum 20-25turns from full off to full on.

Is this possible with ODrive?
D7a0cn5O

#2

You may find some inspiration from this guy: https://www.youtube.com/watch?v=NeU2C2hAI6s
He’s controlling he Odrive from an arduino and has the arduino constantly querying current level and using the results to do a tactile feedback.

1 Like
#3

Hi!

So it is not possible to set it up, directly on the odrive itself?

#4

It has been done by a user but I don’t remember who that was exactly… It’s not natively implemented.

#5

Picture of the actuator motor.

#6

Do you have hall sensor feedback? You will need it to use ODrive.
You can just drive a fixed velocity for a fixed time: if it hits an endstop it will drive into it with the current limit. You can then switch into position control if you want to hold it there (or a little away from it to not use too much current).
You will have some external logic board or PC connected? How will you send the actuation command?

#7

Hi Oskar! Thanks for stepping by! :slight_smile:

I don’t have any feedback sensor, but I will look into possibilities to install one.

Actuation command will come from switches in the car, through an arduino, if needed (if I can’t trigger it directly at the Odrive board.

Another option is to run until “max set current” (record steps) on initialisation at first power up. Then switch to position mode in operation, for more precice control.

Yes, if I free up the axle, it will start spinning in reverse, and releases the tension of the clutch, so I need some holding power when stopped.

#8

If I’m modifying the cover for the motor, I may be able to install an encoder like this, will it be compatible with odrive?

#9

That one is too high of a voltage. Look for “open collector (NPN)” encoders

#10

Like this one?

1 Like
#11

That one should work well.

1 Like
#12

Ah, good!
Looking forward to get the parts, and start figuring out things.
Now with the encoder, I can setup a calibration routine to find the max clamp force, and rely on the position for the rest of control.

#13

Since the encoder is marked with ABZ pins, I assume it has the Index pin.
If so, I can store this in the controller, and make it return to this position each power up, and the start the position control from there?

#14

Should be possible to do that. One thing to be aware of is you likely can’t have too much mechanical load on the rotor while the odrive is doing its index search. Before the index is found the odrive has to use an open loop vector rotation in order spin the motor. If there is too much of a load the rotor won’t stay locked to the field rotation. If this won’t work for you then you may need to look into using an absolute encoder. There is currently only beta support for running with an absolute encoder.

#15

Hi!
Just had time to study the oem bmw controller, and it contains a AS5134 encoder chip installed in the center of the shaft.
https://ams.com/documents/20143/36005/AS5134_DS000159_1-00.pdf/bad93920-013b-7c5d-9065-37e18f6f7558

How difficult, compared with a mechanical encoder, is it to include this chip in an arduino application?

#16

Found my solution :slight_smile:

Using this:
http://www.massmind.org/Techref/io/sensor/pos/enc/ENC2.htm

Instead of the oem board, acting as a normal encoder to the o-drive :slight_smile:

1 Like