512 kB main loop reference
Re: 512 kB main loop reference
I was hoping that the triggering was something as simple as using the existing measured engine speed. There could be a need for an external trigger too, like a 2 step, but to keep things easy, how about just a simple engine speed target.
Re: 512 kB main loop reference
I did a 2-step rev limiter for Subaru without ever finding the main loops. The process went something like this:
0) Find the clutch and brake switch flags in RAM, and confirm with a data logger.
1) Find the existing rev limiter, by finding code that references the fuel-cut / fuel-resume RPM parameters in ROM, and compares them to an RPM value in RAM.
2) That code sets a flag that tells other code to skip the injectors, so find that flag (and confirm that flag with a data logger)
3) Write new code that compares RPM to some new cut/resume values in unused ROM, depending on the state of the clutch and brake flags, and patch that code into the bin.
4) Find the JSR that points to the code in (1), and change it to point to the code in (3).
5) Hooning!
Easier said than done of course, but you get the idea.
Changing from fuel-cut to spark-cut would be slightly more work... I didn't do it myself but I suspect that you could do it by finding the JSR to the code that triggers the spark, and have it JSR into a function that checks the fuel-cut flag and either returns immediately or just JSRs into the original spark function.
The general technique of tweaking the JSR to the code that does the thing your interested in has worked pretty well. I did something similar to implement speed-density for Subaru, by hooking the JSR to the function that calculates load (MAF/RPM) and having my new function do a lookup in a VE table.
I also suggest writing the new code in C rather than assembly. We can use the same compiler that was used to create PCM Hammer's kernel. We'll just need some tweaks to the linker options to put the generated code and variables into the right address ranges. Rev limiters are simple enough to write in asm without too much difficulty, but after we demonstrate patching our own C code into the OS, then we can more easily add all sorts of other hacks much more easily than if we were sticking with asm. For me, the holy grail is rev-matched downshifting for manual-transmission cars.
0) Find the clutch and brake switch flags in RAM, and confirm with a data logger.
1) Find the existing rev limiter, by finding code that references the fuel-cut / fuel-resume RPM parameters in ROM, and compares them to an RPM value in RAM.
2) That code sets a flag that tells other code to skip the injectors, so find that flag (and confirm that flag with a data logger)
3) Write new code that compares RPM to some new cut/resume values in unused ROM, depending on the state of the clutch and brake flags, and patch that code into the bin.
4) Find the JSR that points to the code in (1), and change it to point to the code in (3).
5) Hooning!
Easier said than done of course, but you get the idea.
Changing from fuel-cut to spark-cut would be slightly more work... I didn't do it myself but I suspect that you could do it by finding the JSR to the code that triggers the spark, and have it JSR into a function that checks the fuel-cut flag and either returns immediately or just JSRs into the original spark function.
The general technique of tweaking the JSR to the code that does the thing your interested in has worked pretty well. I did something similar to implement speed-density for Subaru, by hooking the JSR to the function that calculates load (MAF/RPM) and having my new function do a lookup in a VE table.
I also suggest writing the new code in C rather than assembly. We can use the same compiler that was used to create PCM Hammer's kernel. We'll just need some tweaks to the linker options to put the generated code and variables into the right address ranges. Rev limiters are simple enough to write in asm without too much difficulty, but after we demonstrate patching our own C code into the OS, then we can more easily add all sorts of other hacks much more easily than if we were sticking with asm. For me, the holy grail is rev-matched downshifting for manual-transmission cars.
Please don't PM me with technical questions - start a thread instead, and send me a link to it. That way I can answer in public, and help other people who have the same question. Thanks!
-
- Posts: 81
- Joined: Sun May 11, 2014 6:36 pm
- cars: Z06
Re: 512 kB main loop reference
I thought the function was already there or is that on the E38s? BUt even then.. why would you want a spark cut? I think the only time you would need spark cut is for anti-lag function? and that what it actually needs is timing retard.
Last edited by Highlander on Thu Apr 23, 2020 9:22 am, edited 1 time in total.
-
- Posts: 81
- Joined: Sun May 11, 2014 6:36 pm
- cars: Z06
Re: 512 kB main loop reference
I think the easiest way is: save a rev limit option somewhere else on the cal. Hijack the Coil Dwell table to compare rpm and set dwell to 0 if over it.... should be pretty simple... I am going to work on it.NSFW wrote:I did a 2-step rev limiter for Subaru without ever finding the main loops. The process went something like this:
0) Find the clutch and brake switch flags in RAM, and confirm with a data logger.
1) Find the existing rev limiter, by finding code that references the fuel-cut / fuel-resume RPM parameters in ROM, and compares them to an RPM value in RAM.
2) That code sets a flag that tells other code to skip the injectors, so find that flag (and confirm that flag with a data logger)
3) Write new code that compares RPM to some new cut/resume values in unused ROM, depending on the state of the clutch and brake flags, and patch that code into the bin.
4) Find the JSR that points to the code in (1), and change it to point to the code in (3).
5) Hooning!
Easier said than done of course, but you get the idea.
Changing from fuel-cut to spark-cut would be slightly more work... I didn't do it myself but I suspect that you could do it by finding the JSR to the code that triggers the spark, and have it JSR into a function that checks the fuel-cut flag and either returns immediately or just JSRs into the original spark function.
The general technique of tweaking the JSR to the code that does the thing your interested in has worked pretty well. I did something similar to implement speed-density for Subaru, by hooking the JSR to the function that calculates load (MAF/RPM) and having my new function do a lookup in a VE table.
I also suggest writing the new code in C rather than assembly. We can use the same compiler that was used to create PCM Hammer's kernel. We'll just need some tweaks to the linker options to put the generated code and variables into the right address ranges. Rev limiters are simple enough to write in asm without too much difficulty, but after we demonstrate patching our own C code into the OS, then we can more easily add all sorts of other hacks much more easily than if we were sticking with asm. For me, the holy grail is rev-matched downshifting for manual-transmission cars.
Re: 512 kB main loop reference
Yes, the Gen IV ECM's have spark cut. The older LS1 PCM's are setup with just fuel cut.Highlander wrote:I thought the function was already there or is that on the E38s? BUt even then.. why would you want a spark cut? I think the only time you would need spark cut is for anti-lag function? and that what it actually needs is timing retard.
Reason for spark cut is mainly for boosted / N2O applications. Fuel cut leads to a lean condition, spark cut does not. Additional reason would be for 2 step. That would require an input channel, but could be very useful.
Re: 512 kB main loop reference
Yeah, spark cut is what you want to use. I see no advantage to using fuel cut for anything.
I wired in a stand alone 2-step that cuts power to the ignition coil (which is essentially the same thing as making the dwell zero). I have it activated on the brake pedal (Automatic transmission) and it uses the TPS Voltage Threshold for activation as well.
It has added functionally for manual cars to do FFS (Flat Foot Shifting) when you have the activation input connected to the clutch.
If the activation input is active before the TPS threshold is reached then it goes into 2-Step.
If the TPS threashold is reached before the activation input then it goes into FFS.
I wired in a stand alone 2-step that cuts power to the ignition coil (which is essentially the same thing as making the dwell zero). I have it activated on the brake pedal (Automatic transmission) and it uses the TPS Voltage Threshold for activation as well.
It has added functionally for manual cars to do FFS (Flat Foot Shifting) when you have the activation input connected to the clutch.
If the activation input is active before the TPS threshold is reached then it goes into 2-Step.
If the TPS threashold is reached before the activation input then it goes into FFS.
LS1 Boost OS Version 5 Available Here. For feature suggestions post in here Development Thread.
Re: 512 kB main loop reference
Fuel cut builds less boost than spark cut, but I still get 7-8psi in my Subaru. I like the cat in my downpipe, and I don't think spark cut would be good for it.
I used vehicle speed to decide between 2-step vs. flat-foot-shift, and I'm sure we can do the same in GenIII PCMs.
Also, the FFS rev limit is based on the vehicle speed and the gear you're shifting into, so the shift is relatively smooth. Not what you'd want for racing, but it's still way better than lifting off the throttle so it's fun on the street. There are no good aftermarket axles for my car, so I want the ones I have to last.
I used vehicle speed to decide between 2-step vs. flat-foot-shift, and I'm sure we can do the same in GenIII PCMs.
Also, the FFS rev limit is based on the vehicle speed and the gear you're shifting into, so the shift is relatively smooth. Not what you'd want for racing, but it's still way better than lifting off the throttle so it's fun on the street. There are no good aftermarket axles for my car, so I want the ones I have to last.
Please don't PM me with technical questions - start a thread instead, and send me a link to it. That way I can answer in public, and help other people who have the same question. Thanks!
-
- Posts: 81
- Joined: Sun May 11, 2014 6:36 pm
- cars: Z06
Re: 512 kB main loop reference
how do you figure you get a lean condition?turbo_bu wrote:Yes, the Gen IV ECM's have spark cut. The older LS1 PCM's are setup with just fuel cut.Highlander wrote:I thought the function was already there or is that on the E38s? BUt even then.. why would you want a spark cut? I think the only time you would need spark cut is for anti-lag function? and that what it actually needs is timing retard.
Reason for spark cut is mainly for boosted / N2O applications. Fuel cut leads to a lean condition, spark cut does not. Additional reason would be for 2 step. That would require an input channel, but could be very useful.
-
- Posts: 81
- Joined: Sun May 11, 2014 6:36 pm
- cars: Z06
Re: 512 kB main loop reference
There are huge advantages:bubba2533 wrote:Yeah, spark cut is what you want to use. I see no advantage to using fuel cut for anything.
I wired in a stand alone 2-step that cuts power to the ignition coil (which is essentially the same thing as making the dwell zero). I have it activated on the brake pedal (Automatic transmission) and it uses the TPS Voltage Threshold for activation as well.
It has added functionally for manual cars to do FFS (Flat Foot Shifting) when you have the activation input connected to the clutch.
If the activation input is active before the TPS threshold is reached then it goes into 2-Step.
If the TPS threashold is reached before the activation input then it goes into FFS.
not washing the rings... you are dumping HUGE amounts of unburnt fuel going through everywhere which is not a good idea. Even for building boost its still a lot better to have a very retarded mixture than no combustion at all.
I have never ever seen the benefit of spark cut. Hence why the factory never uses it.
If there is fuel cut, there is ZERO fuel going in, thus you have no problems. Your wideband MIGHT read lean but it doesn't mean its "lean" to be lean or rich there needs to be combustion. No combustion, no problem.
The ONLY time you want spark cut is if you have wet nitrous as the nitrous fuel will keep pouring in and this could be enough fuel to really combust lean. Even then you shouldn't be spraying over your limiter. Spark or fuel cut it will just wreck havoc.
Re: 512 kB main loop reference
Yeah, you make a couple good points.
I guess I was thinking mostly from the 2-step point of view where I want that unburned fuel to spool a turbo in my case.
Ideally I would love to have a 2-step that was able to do both spark retard and spark cut. Something that was able to have a launch/spool spark table similar to the standalone pcm's have. Perhaps the dream would be to have all three available (spark retard, spark cut, and fuel cut), but that would be quite the ask since I'm not a programmer.
I hacked mine into using the idle spark table to do something similar, but the only issue with it is that it's based on the VSS going above a threshold. It causes the retarded timing to stay active until I get up to a small speed.
I guess I was thinking mostly from the 2-step point of view where I want that unburned fuel to spool a turbo in my case.
Ideally I would love to have a 2-step that was able to do both spark retard and spark cut. Something that was able to have a launch/spool spark table similar to the standalone pcm's have. Perhaps the dream would be to have all three available (spark retard, spark cut, and fuel cut), but that would be quite the ask since I'm not a programmer.
I hacked mine into using the idle spark table to do something similar, but the only issue with it is that it's based on the VSS going above a threshold. It causes the retarded timing to stay active until I get up to a small speed.
LS1 Boost OS Version 5 Available Here. For feature suggestions post in here Development Thread.