Page 1 of 1

Tesla LDU traction control thread

Posted: Tue Jan 28, 2020 11:45 pm
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

Re: Tesla LDU traction control thread

Posted: Tue Mar 10, 2020 7:46 pm
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.

Re: Tesla LDU traction control thread

Posted: Wed Mar 11, 2020 7:39 am
by Jack Bauer
That's brilliant Johannes. I'm doing something similar with the GS450H controller in the 7 Series.

Re: Tesla LDU traction control thread

Posted: Wed Mar 11, 2020 11:34 pm
by jon volk
Awesome. Looks like I need to add some VR conditioners to the VCU I’m building.

Re: Tesla LDU traction control thread

Posted: Sun Mar 22, 2020 5:09 am
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

Re: Tesla LDU traction control thread

Posted: Sun Apr 26, 2020 10:06 am
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?

Re: Tesla LDU traction control thread

Posted: Sun Apr 26, 2020 12:29 pm
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.

Re: Tesla LDU traction control thread

Posted: Mon Apr 27, 2020 8:16 am
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.