launch control

It's all about the code!
md_sanci
Posts: 28
Joined: Thu May 30, 2019 6:13 am
Soldering skill: yes
Coding skill?: yes

Re: launch control

Post by md_sanci » Tue Jun 25, 2019 4:28 pm

Hello all, i did today first test with fule and after that spark cut. It is looking ok.
@russian: can i share the code so you can decide if you keep it or not?

User avatar
russian
Site Admin
Posts: 9520
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: launch control

Post by russian » Tue Jun 25, 2019 6:28 pm

The answer to "can I share code" is ALWAYS YES.

Did you have a chance to look at unit tests or simulator? Would you be able to either add a unit test or integration test of your new functionality?
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

md_sanci
Posts: 28
Joined: Thu May 30, 2019 6:13 am
Soldering skill: yes
Coding skill?: yes

Re: launch control

Post by md_sanci » Tue Jun 25, 2019 7:09 pm

I have tried unit tests last night but i was missing the compiler, tomorrow i will post a patch file here, i have 2 weeks till the race and i have a lot in the todo list, hope i can get the unit tests on and i can even uodate them, i have only one request to you, can you take a look at the patch and give me a short review, should i continue or not, i would really like a feedback, i did not had the time to understand all the mechanisms and i extended the max rpm limit that was already implemented :D

Lyonz
kit assembler
Posts: 53
Joined: Sat Apr 21, 2018 12:08 am
Soldering skill: yes
Coding skill?: yes

Re: launch control

Post by Lyonz » Tue Jun 25, 2019 8:43 pm

I all
This is good news for me :D .
Because I have 4 cars today that runs in Rusefi, and I need a lot of this "LC" and "NLS" function.
Everything works nickel, except these missing functions.
If you need someone to test... ;)

md_sanci
Posts: 28
Joined: Thu May 30, 2019 6:13 am
Soldering skill: yes
Coding skill?: yes

Re: launch control

Post by md_sanci » Wed Jun 26, 2019 4:25 am

Hello all,

As promissed here is the patch file, 25 lines of code :)))
Attachments
launch_control.patch
(2.56 KiB) Downloaded 64 times
Last edited by md_sanci on Wed Jun 26, 2019 5:59 am, edited 1 time in total.

User avatar
russian
Site Admin
Posts: 9520
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: launch control

Post by russian » Wed Jun 26, 2019 4:29 am

Give me a day or two to review.

Please do not get me wrong - I am happy for any patches, but since I would have to maintain and it and be able to explain it to people, I believe the only way for me to accept important functional changes is if they come with unit tests. I hope this is understandable.

Let me look into adding code coverage tools on my side so that we have a nicer for all process.
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

md_sanci
Posts: 28
Joined: Thu May 30, 2019 6:13 am
Soldering skill: yes
Coding skill?: yes

Re: launch control

Post by md_sanci » Wed Jun 26, 2019 6:03 am

russian wrote:
Wed Jun 26, 2019 4:29 am
Give me a day or two to review.

Please do not get me wrong - I am happy for any patches, but since I would have to maintain and it and be able to explain it to people, I believe the only way for me to accept important functional changes is if they come with unit tests. I hope this is understandable.

Let me look into adding code coverage tools on my side so that we have a nicer for all process.
I can understand you, and i appreciate a lot what you are doing, i would really like to help, but i have a lot to catch up, to understand how all the things are working, and what is the correct process to be able to push/share stuff.

Since this was extending the current rpmhardlimit, it looked right to place it here, hope it will pass you're Quality control :D

BTW, i was looking at the code this morning, and i was thinking it would be good to be able to disable fule or spark cut at hardrpm limit. Considering a drag application, starting with launch control, 1st gear it will spin the wheel like hell if you loose tracktion, but i will do some tests with the car and see what is the best approach :)

md_sanci
Posts: 28
Joined: Thu May 30, 2019 6:13 am
Soldering skill: yes
Coding skill?: yes

Re: launch control

Post by md_sanci » Wed Jun 26, 2019 10:33 am

md_sanci wrote:
Wed Jun 26, 2019 4:25 am
Hello all,

As promissed here is the patch file, 25 lines of code :)))
Hehe, just noticed i have to invert the clutch pedal logic :))) i have written the code to go with my harness not the harness to go with the code.

User avatar
russian
Site Admin
Posts: 9520
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: launch control

Post by russian » Wed Jun 26, 2019 11:52 am

md_sanci wrote:
Wed Jun 26, 2019 10:33 am
just noticed i have to invert the clutch pedal logic :))) i have written the code to go with my harness not the harness to go with the code.
I think code should be flexible to work with your harness, not harness work with the code. Looks like what we need here is a setting "invert clutch reading"?
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
russian
Site Admin
Posts: 9520
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: launch control

Post by russian » Wed Jun 26, 2019 11:43 pm

russian wrote:
Wed Jun 26, 2019 11:52 am
md_sanci wrote:
Wed Jun 26, 2019 10:33 am
just noticed i have to invert the clutch pedal logic :))) i have written the code to go with my harness not the harness to go with the code.
I think code should be flexible to work with your harness, not harness work with the code. Looks like what we need here is a setting "invert clutch reading"?
Here are new settings for you, hope this helps - https://github.com/rusefi/rusefi/commit ... c8c3d2c0c9
At the moment the settings do nothing, you would need to add the code for those to start working.

Do you need more settings to implement the feature right?
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

Реконструктор
Posts: 11
Joined: Mon May 13, 2019 11:22 am
Soldering skill: yes
Coding skill?: yes

Re: launch control

Post by Реконструктор » Wed Jul 03, 2019 6:23 pm

Not sure if useful, but here is my 5 kopeek. :) The perfect launch occurs not where you are at max power, but on max torque. Which, in most engines, occurs around 4-4500 rpm. So the driver's goal is to work with the gas pedal in order to keep engine revving around it's max torque rpms. If you ever played Need For Speed Underground 2 or raced on drag strip, you know how it is. :) So the automatic launch control is control of the throttle. Fuel/spark cut which acts as rev limiter you guys (and most tuner shop boxes) have implemented is not a good idea. It is easy to implement one.

The another aspect of the launch control is that most of the cars does not have enough grip to send it's max torque adequately to the tarmac. Here you have to monitor all of the ABS sensors and if slippage is detected, start closing throttle, until the car no longer burn tires.
I understand it is hard to implement mechanically on many cars, it's just some theory.

md_sanci
Posts: 28
Joined: Thu May 30, 2019 6:13 am
Soldering skill: yes
Coding skill?: yes

Re: launch control

Post by md_sanci » Wed Jul 03, 2019 7:20 pm

Реконструктор wrote:
Wed Jul 03, 2019 6:23 pm
Not sure if useful, but here is my 5 kopeek. :) The perfect launch occurs not where you are at max power, but on max torque. Which, in most engines, occurs around 4-4500 rpm. So the driver's goal is to work with the gas pedal in order to keep engine revving around it's max torque rpms. If you ever played Need For Speed Underground 2 or raced on drag strip, you know how it is. :) So the automatic launch control is control of the throttle. Fuel/spark cut which acts as rev limiter you guys (and most tuner shop boxes) have implemented is not a good idea. It is easy to implement one.

The another aspect of the launch control is that most of the cars does not have enough grip to send it's max torque adequately to the tarmac. Here you have to monitor all of the ABS sensors and if slippage is detected, start closing throttle, until the car no longer burn tires.
I understand it is hard to implement mechanically on many cars, it's just some theory.
Hi,

You are right the question is what do we do to get it starting. My implementation it is not the best, since it is simple, and not a lot of algo.
I would say it is good to start it simple and develop it by the time.

@Russian: i will look today in the git commit what you have prepared. i bought a new laptop to be able to set up the build environment, and to try to add module test :)

User avatar
kb1gtt
contributor
contributor
Posts: 3407
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: launch control

Post by kb1gtt » Wed Jul 03, 2019 8:50 pm

I wonder, if it would be a good approach to consider u in the equations. You want the engine to deliver as much power as possible with out slipping the tires. Once you slip you change from static friction to kinetic, which has a much different friction coefficient. The friction coefficient is also known as u (?meu?). We can calc how much HP the engine has, and we should know the typical u of the wheel. So we could calc if the engine has to much power, and we could limit accordingly. Then if the wheels slip, we could change the u slightly and then everything would updated per the max possible delivered calcs.

I'm not sure if that makes any sense to anyone other than me. It's a short blurb, with not enough time to write it better.
Welcome to the friendlier side of internet crazy :)

md_sanci
Posts: 28
Joined: Thu May 30, 2019 6:13 am
Soldering skill: yes
Coding skill?: yes

Re: launch control

Post by md_sanci » Wed Jul 03, 2019 9:21 pm

kb1gtt wrote:
Wed Jul 03, 2019 8:50 pm
I wonder, if it would be a good approach to consider u in the equations. You want the engine to deliver as much power as possible with out slipping the tires. Once you slip you change from static friction to kinetic, which has a much different friction coefficient. The friction coefficient is also known as u (?meu?). We can calc how much HP the engine has, and we should know the typical u of the wheel. So we could calc if the engine has to much power, and we could limit accordingly. Then if the wheels slip, we could change the u slightly and then everything would updated per the max possible delivered calcs.

I'm not sure if that makes any sense to anyone other than me. It's a short blurb, with not enough time to write it better.
It make sense, but to make it all work, we need to have abs or at least sensors on both wheels with traction, and then we can limit based on what is really happening, the big question is, it it really worth the effort, if i am not mistaken this topic once was "good way to bend valves" and this is true :))

Additional to that, if somebody really uses this, then it can adjust the window and rev limit. Ex we plan to go to a drag race, we do testing in front of my house, but i know from last year that the strip has waaaaay more grip then this asphalt. So we will really need to adjust it + it will differ from one set of normal tire to another set of "race" tires.

mck1117
running engine in first post
running engine in first post
Posts: 225
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish
Soldering skill: yes
Coding skill?: yes

Re: launch control

Post by mck1117 » Thu Jul 04, 2019 12:18 am

Реконструктор wrote:
Wed Jul 03, 2019 6:23 pm
The perfect launch occurs not where you are at max power, but on max torque.
I'd like to make a clarification here: This is not how you get an ideal launch. The ideal launch is when you ride the peak of the slip % vs. grip curve for your tire for as long as possible. If I tried to launch at peak torque in my Volvo (which has an upper-300hp v8 swap), I would incinerate my tires. However, if I roll in to it gently in first gear, it will hold, and be much faster.

What you're aiming for is the sweet spot with more RPM than will bog at the start, but not so much that you break the tires loose. On cars with lots of HP, not much grip or a stiff clutch, such a sweet spot may or may not exist.
kb1gtt wrote:
Wed Jul 03, 2019 8:50 pm
I wonder, if it would be a good approach to consider u in the equations. You want the engine to deliver as much power as possible with out slipping the tires. Once you slip you change from static friction to kinetic, which has a much different friction coefficient. The friction coefficient is also known as u (?meu?). We can calc how much HP the engine has, and we should know the typical u of the wheel. So we could calc if the engine has to much power, and we could limit accordingly. Then if the wheels slip, we could change the u slightly and then everything would updated per the max possible delivered calcs.

I'm not sure if that makes any sense to anyone other than me. It's a short blurb, with not enough time to write it better.
While that logic is sound, there are too many variables for it to work in a real car on a real road. mu is dependent upon a huge host of things, including tire loading, pressure, temperature, road surface condition, road surface temperature, vehicle loading, lateral loading, and tire slip angle.

There are two types of traction control:
  1. "naïve" launch control: This type helps the driver hold the engine at a point that's good to launch from (ie, one where the amount of kinetic energy stored in the crankshaft/flywheel will minimize tire slip but maximize acceleration upon brake release/clutch engagement). That means retarding timing and/or cutting spark so that the engine produces less power but still moves the same amount of air. This lets you build boost and get flow moving through the engine/exhaust so that it doesn't have to start moving all of a sudden when you decide to go.
  2. "smart" launch control. This is a set of addons to type 1):
    a) Progressive spark advance: When you decide to go (drop clutch and/or release brakes), slowly add timing and/or throttle back in, so that we don't smack the clutch/tires with a shitload of torque all at once. This lets some weight transfer (and the suspension do its job), increasing load on the rear tires, so you can then put more force through them without slip.
    b) Traction control. Dynamically change ignition timing/throttle position/boost to limit tire slip.
Methods 1 and 2a are completely internal to the ECU without any external sensing.

2b requires extra sensors, external to the ECU. The "right" way to do it is by comparing the driven and undriven wheel speeds. This difference gives the amount of slip at the driven tires, which is then controlled by twiddling the power output of the engine up or down. Too much slip -> reduce power. Not enough slip -> add power. The ideal amount of slip for radial tires is somewhere in the 5-10% range to give maximum grip.

Other options (usually only used in drag racing) include setting a maximum allowed angular acceleration vs. time, or a maximum allowed speed vs. time. The ECU then limits power to keep under/on that curve.

Реконструктор
Posts: 11
Joined: Mon May 13, 2019 11:22 am
Soldering skill: yes
Coding skill?: yes

Re: launch control

Post by Реконструктор » Thu Jul 04, 2019 8:21 am

mck1117 wrote:
Thu Jul 04, 2019 12:18 am
Реконструктор wrote:
Wed Jul 03, 2019 6:23 pm
The perfect launch occurs not where you are at max power, but on max torque.
I'd like to make a clarification here: This is not how you get an ideal launch. The ideal launch is when you ride the peak of the slip % vs. grip curve for your tire for as long as possible. If I tried to launch at peak torque in my Volvo (which has an upper-300hp v8 swap), I would incinerate my tires. However, if I roll in to it gently in first gear, it will hold, and be much faster.

What you're aiming for is the sweet spot with more RPM than will bog at the start, but not so much that you break the tires loose. On cars with lots of HP, not much grip or a stiff clutch, such a sweet spot may or may not exist.
Yes, I do mentioned that. :) Most of the cars are not able to launch at max torque without slipping. However, if the car is somehow able to send all it's power to the ground, launching at max torque is most optimal. But it looks like it is some theoretic ideal case.

Реконструктор
Posts: 11
Joined: Mon May 13, 2019 11:22 am
Soldering skill: yes
Coding skill?: yes

Re: launch control

Post by Реконструктор » Thu Jul 04, 2019 8:31 am

mck1117 wrote:
Thu Jul 04, 2019 12:18 am
2b requires extra sensors, external to the ECU. The "right" way to do it is by comparing the driven and undriven wheel speeds. This difference gives the amount of slip at the driven tires, which is then controlled by twiddling the power output of the engine up or down. Too much slip -> reduce power. Not enough slip -> add power. The ideal amount of slip for radial tires is somewhere in the 5-10% range to give maximum grip.
And if you have 4x4 vehicle? :) And worse, 4x4 with torque vectoring? :)
Here is one easy way to detect slip: inertial speed calculation with accelerometer (found in any phone, costs kopeiki) and comparing it with signal from gearbox output shaft (speedometer signal). Actually, I think adding accelerometer to the rusefi board is a good idea, it may serve in many ways.

mck1117
running engine in first post
running engine in first post
Posts: 225
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish
Soldering skill: yes
Coding skill?: yes

Re: launch control

Post by mck1117 » Thu Jul 04, 2019 8:45 am

The alternate answer for how 2b works is that it compares the second derivative of the speeds of all of the wheels. If a wheel starts to accelerate quickly, it's about to break loose (this is also how ABS works - since you have 4 wheel brake).

Using an accelerometer for traction control has a few issues. It might work okay for drag racing under very predictable conditions, but doesn't work great in the real world. A great "stage 1" would be to have normal "type 1" launch control, which works really well under a vast majority of conditions.

User avatar
kb1gtt
contributor
contributor
Posts: 3407
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: launch control

Post by kb1gtt » Thu Jul 04, 2019 11:26 am

Jumbo jets have an interesting brake system. It's doing the same thing as the traction control, but slowing down instead of speeding up. It hangs out at the peak braking force while never going into kinetic friction. If it ever went into a skid, even for 0.1 second, that's something like a 300ft (100M) skid, which would result in a popped tire and would not be good for the passengers. As well they want maximum braking as the run way has limited length, and it has to do it with a large variety of um conditions. Basically it modules the brake pressure constantly finding the peak breaking force. If um changes, then this brake pressure will self adjust. By constantly modulating the pressure looking for the peak, you basically constantly adjust for a variety of um conditions. A longer winded version is below.


Any how, we should know the nominal peak power, as well as the possible range of +/- and if we know those parameters, then we can typically hit an optimal power with out an non-driven wheel sensor.

How do we measure peak power without a non-driven wheel speed sensor? How do we measure the HP delivered to the chassis? I think we really need accelerometer data to know the energy delivered to the chassis. I recall once upon a time, some talk of a drive shaft torque sensor.

Would it make sense that as an incremental step, we first calculate engine force and calculate chassis force, then log it and display it in a TS graph?
Welcome to the friendlier side of internet crazy :)

Реконструктор
Posts: 11
Joined: Mon May 13, 2019 11:22 am
Soldering skill: yes
Coding skill?: yes

Re: launch control

Post by Реконструктор » Thu Jul 04, 2019 1:08 pm

Well, it turns out that stm32f4discovery board already have accelerometer on it! :D
So, here is even simpler design, it require some empirical data, though. Go some weekend at the drag strip and do some launches. Log the accelerometer stream. Then choose the best result you have. After that, launch control is just following the acceleration curve. :) Again, throttle control is best.

mk e
Posts: 70
Joined: Tue Dec 06, 2016 7:32 pm

Re: launch control

Post by mk e » Sat Jul 06, 2019 9:24 pm

Max torque is not a very useful thing to know or control too.....wheel torque is the important variable for acceleration and is engine torque times the trans and diff ratios a.d makes it so you usually have more wheel torque in 1st gear past both engine torque peak and engine hp peak and right to (or past :) ) redline than you have shifting to 2nd. As you go up the gears you'll usually be best off shifting at or slightly above hp peak. I have a dead sheet with my gear ratios and the measured engine torque curve to determine ideal shift points

Then is traction, the wheel torque isn't helpful with excess slip, launch and traction control help with this. I've not really tested mine yet, but it's a simple proportional control to close the throttle based on wheel slip %. I say close because it's only allowed to close, the driver should have the pedal to WOT if the plan is to let the ecu drive. I haven't written anything yet to have the ecu hold the engine at a launch rpm when the clutch is down.....I need to get the engine fixed and the traction control tested then I'll add a better launch setup.

960
contributor
contributor
Posts: 285
Joined: Mon Dec 10, 2018 1:22 am
Soldering skill: yes
Coding skill?: yes

Re: launch control

Post by 960 » Thu Jul 11, 2019 2:38 am

The most "important" part are to generate boost.

If you can implement ALS as well would be great.

Now with E-Throttle we dont need bypass-solenoid anymore.


One of my old air bypass setups :-)
DSC_0018.JPG
DSC_0018.JPG (2.1 MiB) Viewed 207 times

User avatar
russian
Site Admin
Posts: 9520
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: launch control

Post by russian » Sat Aug 03, 2019 9:49 pm

md_sanci wrote:
Wed Jun 26, 2019 4:25 am
As promissed here is the patch file, 25 lines of code :)))
@md_sanci are you still interested to add a unit test and get this merged into the official repository?
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

Post Reply