launch control

It's all about the code!
User avatar
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: launch control

Post by md_sanci »

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
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: launch control

Post by AndreyB »

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?
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
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: launch control

Post by md_sanci »

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: 56
Joined: Sat Apr 21, 2018 12:08 am
Location: Guadeloupe

Re: launch control

Post by Lyonz »

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... ;)
User avatar
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: launch control

Post by md_sanci »

Hello all,

As promissed here is the patch file, 25 lines of code :)))
Attachments
launch_control.patch
(2.56 KiB) Downloaded 729 times
Last edited by md_sanci on Wed Jun 26, 2019 5:59 am, edited 1 time in total.
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: launch control

Post by AndreyB »

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.
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
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: launch control

Post by md_sanci »

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 :)
User avatar
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: launch control

Post by md_sanci »

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
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: launch control

Post by AndreyB »

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"?
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
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: launch control

Post by AndreyB »

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/5bb016ef596eaf66454183b800346cc8c3d2c0c9
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?
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
Реконструктор
Posts: 11
Joined: Mon May 13, 2019 11:22 am

Re: launch control

Post by Реконструктор »

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.
User avatar
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: launch control

Post by md_sanci »

Реконструктор 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: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: launch control

Post by kb1gtt »

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 :)
User avatar
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: launch control

Post by md_sanci »

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: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: launch control

Post by mck1117 »

Реконструктор 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

Re: launch control

Post by Реконструктор »

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

Re: launch control

Post by Реконструктор »

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: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: launch control

Post by mck1117 »

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: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: launch control

Post by kb1gtt »

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

Re: launch control

Post by Реконструктор »

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: 486
Joined: Tue Dec 06, 2016 7:32 pm

Re: launch control

Post by mk e »

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: 336
Joined: Mon Dec 10, 2018 1:22 am
Location: Norway

Re: launch control

Post by 960 »

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 27632 times
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: launch control

Post by AndreyB »

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?
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
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: launch control

Post by md_sanci »

russian wrote:
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?
Hello,

Sorry for the late repose, i am a bit busy, yes i would be interested on doing this.

What i have as feedback till know.
- i did tests on the drag strip and it was working fine (used the hard cut for fun and try to "fuck up the engine")
- flat out shift is working over the revlimit, since ignition will be cut :)

@russian: do we have somewhere a starter guide for unit tests? or just search in the code and it will be alright
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: launch control

Post by AndreyB »

Things are pretty straightforward with unit tests, we can discuss this further at https://rusefi.com/forum/viewtopic.php?f=5&t=1243
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
Lyonz
kit assembler
Posts: 56
Joined: Sat Apr 21, 2018 12:08 am
Location: Guadeloupe

Re: launch control

Post by Lyonz »

Hi, what are the news?
There is no more development for Launch Control?
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: launch control

Post by AndreyB »

This long requested feature could be a good candidate for Feature Bounty Program https://rusefi.com/forum/viewtopic.php?f=5&t=1642
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
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: launch control

Post by md_sanci »

Lyonz wrote:
Wed Oct 02, 2019 12:18 pm
Hi, what are the news?
There is no more development for Launch Control?
Hello, if you really need it, the patch file will take you true the patching routin, i did some more modifications, but did not found the time to make module tests :(

Now i am really working on a stimulator, so i could do banch testing since on the car i cannot really do a lot of testing/logging in a way i would like to.
I really have to find a way to at least make the test so we could make it available on the sw.

I hope to receive the micro rusefi and set up my test bench, the holidays are coming and i hope to get rid of the kids for a few days to make up the last time :)))))
960
contributor
contributor
Posts: 336
Joined: Mon Dec 10, 2018 1:22 am
Location: Norway

Re: launch control

Post by 960 »

Currently testing out complete solution :-)

javaw_LRyVJaJlr4.png
javaw_LRyVJaJlr4.png (249.31 KiB) Viewed 26065 times
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: launch control

Post by AndreyB »

960 wrote:
Sat Feb 29, 2020 11:05 am
Currently testing out complete solution :-)
Ola, what does "testing" mean exactly?

I am concerned that you rarely (never?) post any log files. I believe you do not use automated testing approach either. So, what does "testing" mean _exactly_? Let's please be a bit more transparent about this since some people might consider trying this on real hardware eventually.
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