Tesla LDU traction control thread

Topics concerning the Tesla front and rear drive unit drop-in board
Post Reply
57 Chevy
Posts: 37
Joined: Fri Jan 24, 2020 10:43 pm
Location: New Zealand

Tesla LDU traction control thread

Post by 57 Chevy »

Thread to discuss and implement torque output modulation in a LDU when the traction limit of the tires is reached

Some background as to why: (1) I haven't seen this done yet. (2) Human in the loop traction control seems like a recipe for disaster when a LDU produces enough torque to break traction at almost any speed, particularly when used on the front axle.

The LDU setups which retain the Tesla logic board rely on either the driver skill or the inbuilt torque limiting which is tuned for the OEM car that utilises an open differential and brake-assisted wheelspin control. A comment I have heard from several places is that people are preferring to use a SDU or reduce the power output because the car is 'less fun to drive' with more power. We can and should have both if we optimise the axle torque throughput to match the tire capabilities.

This is all new to me so there will be a bit of learning and getting a few/all facts wrong to begin with. Please jump in with helpful info anytime.

A tire produces the optimum acceleration at around 10% slip. Below that the relationship between applied torque and angular acceleration is stable (more torque = more acceleration) and above that it becomes increasingly unstable (more torque = less acceleration, i.e. wheelspin)
Image
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5491023/

traction control therefore needs to modulate applied torque in a similar way to antilock brakes modulate brake pressure in order to maintain a stable state under varying conditions and speed.

We know the axle speed and therefore angular acceleration from the motor encoder and we know the applied torque from the phase current. We don't however know the reference (zero slip) wheel speed or any other forces applied to the tires such as cornering so calculating a simple ratio is probably not feasible.

A simple approach could be to determine the maximum acceleration of the vehicle by trial and error and implement a lookup table of allowable phase current values for a range of axle speeds and PID that to the commanded power/speed. This would prevent gross wheelspin during acceleration but may not optimise the acceleration or be particularly useful at preventing a spinout if accelerating while cornering.

A more complex approach could be to determine the point at which phase amps begin to roll off and angular velocity begins to climb based on a product of these two variables. I'm guessing it will be prone to noise but this could give an active monitoring of energy transfer through the tire (ultimately what we want to achieve) that is independent of the available traction at any point.

ABS brake systems modulate brake pressure relatively slowly, around 5-10Hz so the processing load will not be that great if the same can be true for traction control. I believe field weakening starts at around 150 rev/sec and above that the motor is less likely to produce enough torque to break traction so that would be a logical maximum speed range (approx 120 kph, 9000 rpm motor, 16 r/sec axle). If the traction loop updated at 10Hz that would not be many updates per axle revolution but is similar to the apply-cycle rate of ABS.

tbc
User avatar
johu
Site Admin
Posts: 6629
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 346 times
Been thanked: 1489 times
Contact:

Re: Tesla LDU traction control thread

Post by johu »

Could this be interesting?
https://github.com/jsphuebner/stm32-car ... r.cpp#L272

Prerequisites: modern car with wheel speed sensors (i.e. with ABS/ESP) and CAN bus where the values of the sensors can be found.

What I've done:
  • Grab individual wheel speeds from CAN bus
  • Calculate average axle speeds from them
  • If front axle spins faster than rear axle we have wheel spin (on front wheel drive cars) -> limit power with simple P-controller
  • If front axle spins slower than rear axle we have wheel lag -> limit regen
  • Parameters for allowed lag, allowed spin and controller gain
Vice versa for rear wheel drive.
It works well

I've currently implemented this in a separate controller (VCU) also on STM32. It sends the power limits to the inverter via CAN. I do consider porting this onto the inverter.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Jack Bauer
Posts: 3641
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 282 times
Contact:

Re: Tesla LDU traction control thread

Post by Jack Bauer »

That's brilliant Johannes. I'm doing something similar with the GS450H controller in the 7 Series.
I'm going to need a hacksaw
jon volk
Posts: 574
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Tesla LDU traction control thread

Post by jon volk »

Awesome. Looks like I need to add some VR conditioners to the VCU I’m building.
Formerly 92 E30 BMW Cabrio with Tesla power
57 Chevy
Posts: 37
Joined: Fri Jan 24, 2020 10:43 pm
Location: New Zealand

Re: Tesla LDU traction control thread

Post by 57 Chevy »

That's a neat way of implementing it with no extra hardware. I will have the stock Tesla ABS module and sensors so this could work in my setup except for when the reference frame is lost, i.e. all wheels are spinning.

There are some neat radar speed sensors that are really for agricultural machines so don't have a very high top speed which could work as a reference frame. Other than that I'm trying to come up with ideas on how to optimise on throughput, i.e. create a product of vehicle acceleration, axle angular acceleration and phase amps that has a local maxima at the optimum slip rate. This will need some hardware to test with and I'm quite some time away from turning any axles
User avatar
muehlpower
Posts: 681
Joined: Fri Oct 11, 2019 10:51 am
Location: Germany Fürstenfeldbruck
Has thanked: 14 times
Been thanked: 134 times

Re: Tesla LDU traction control thread

Post by muehlpower »

johu wrote: Tue Mar 10, 2020 7:46 pm

I've currently implemented this in a separate controller (VCU) also on STM32. It sends the power limits to the inverter via CAN. I do consider porting this onto the inverter.
what possibilities are there to limit the power of the LDU. Do I have to manipulate the signals from pot and pot2 or can I limit the amperes directly?
jon volk
Posts: 574
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Tesla LDU traction control thread

Post by jon volk »

There are already a number of ways to limit total power with the drive unit. In terms of traction control, I dont see much being more effective than realtime throttle control. I plan to do this externally with CAN throttle inputs to the LDU. Unlike a traditional ICE where you're reducing boost pressure or ignition timing to regain traction, the responsiveness of throttle manipulation is much much faster.
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
muehlpower
Posts: 681
Joined: Fri Oct 11, 2019 10:51 am
Location: Germany Fürstenfeldbruck
Has thanked: 14 times
Been thanked: 134 times

Re: Tesla LDU traction control thread

Post by muehlpower »

Then the way to go is a controller that measures the front wheel speeds, the throttle and the brake pedal position and receives the CAN signal for the LDU speed. From this, the value for pot and pot2 is determined and sent to the LDU via the can bus. The main thing is the speed difference between the front and rear axles, e.g. +/- 10km/h and the pedal positions as Limits.
Post Reply