Basic ETB Traction Control with Lua

It's all about the code!
Post Reply
User avatar
NormanAlphaspeed
Posts: 80
Joined: Fri Jan 13, 2017 7:15 am
Location: Puerto Rico
Contact:

Basic ETB Traction Control with Lua

Post by NormanAlphaspeed »

Hi

I made a type of traction control using LUA for ETB-equipped vehicles. It is quite basic, works well in my book, but it could use a phase-in/out timer to smooth transitions into/out of traction control events.

current code is

Code: Select all

	-- traction control
	local slipRatio = rvss / fvss
	if slipRatio > 1.1 and tcState == 0 then
		setEtbAdd(slipRatio * - 40)
	else
		setEtbAdd(0)
	end
Where
slipRatio = a simple division of driving/driven wheel speeds (in this car, car is RWD, so rvss = rear vss). If one of the rear wheels is going faster than one of the front ones, we are probably slipping
tcState = a traction control on/off button

I noticed in my case that noticeable slip happens after a ratio of about 10% deviation (which is what the 1.1 represents). I multiply this by a constant -40 so if we have minimal slip, we reduce TPS by 40%, and gets multiplied by the amount of slip to compensate for more slippery situations.
image.png
The arrow indicates where slip was detected, and ETB target changes from 100% to ~50%
image.png
At the top of second gear we are starting to actually have grip, and once we shift into 3rd, we can see that slip% is small enough to where we can target 100% TPS
You do not have the required permissions to view the files attached to this post.
User avatar
AndreyB
Site Admin
Posts: 14747
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Basic ETB Traction Control with Lua

Post by AndreyB »

My Nissan SUV has four wheel sensors look how left and right wheel speeds are 20% off during intense acceleration. Per-axis average difference is below that.
image.png
You do not have the required permissions to view the files attached to this post.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
NormanAlphaspeed
Posts: 80
Joined: Fri Jan 13, 2017 7:15 am
Location: Puerto Rico
Contact:

Re: Basic ETB Traction Control with Lua

Post by NormanAlphaspeed »

AndreyB wrote:
Sun Dec 31, 2023 3:52 am
My Nissan SUV has four wheel sensors look how left and right wheel speeds are 20% off during intense acceleration. Per-axis average difference is below that.

image.png
That's because open diff. In this case it would be very benificial to do front vss average / rear vss average
User avatar
AndreyB
Site Admin
Posts: 14747
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Basic ETB Traction Control with Lua

Post by AndreyB »

I've implemented something similar under https://github.com/rusefi/rusefi/issues/5843 someone would have to give it a try :)
WhatsApp Image 2023-12-31 at 19.54.57_09a3a3c2.jpg
You do not have the required permissions to view the files attached to this post.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Post Reply