RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Sat Feb 21, 2026 10:00 pm

All times are UTC




Post new topic Reply to topic  [ 87 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: Rev matching on downshift
PostPosted: Sat Jan 27, 2018 9:45 pm 
Offline
Moderator

Joined: Thu Nov 23, 2006 2:23 am
Posts: 2565
Sooo..... it works? :)

_________________
2005 Legacy GT w/ ATP 3076, IWG, MBC, BCS, BC 272, LC, FFS, OMG
Please don't send questions via PM. Post a thread and send me a link to it instead. Thanks!


Top
 Profile  
 
 Post subject: Re: Rev matching on downshift
PostPosted: Sat Jan 27, 2018 10:54 pm 
Offline
Newbie

Joined: Sun Feb 06, 2011 10:12 pm
Posts: 41
NSFW wrote:
Sooo..... it works? :)
It does! I need to do some tuning on it still but it definitely functions as intended.

What are the different states as I've had 0, 1, 2 and 7?

Is there a way to disable without needing to turn the car off?

Is it normal for my gear parameter to not always be exact and sometimes not show the correct gear?


Top
 Profile  
 
 Post subject: Re: Rev matching on downshift
PostPosted: Sun Jan 28, 2018 2:38 am 
Offline
Moderator

Joined: Thu Nov 23, 2006 2:23 am
Posts: 2565
Here's the list of states:

Code:
enum RevMatchStates
{
   RevMatchDisabled = 0,
   RevMatchAlmostEnabled = 1,
   RevMatchEnabled = 2,
   RevMatchReadyForAccelerationDownshift = 3,
   RevMatchDecelerationDownshift = 4,
   RevMatchAccelerationDownshift = 5,
   RevMatchCalibration = 6,
   RevMatchExpired = 7,
};


It will be in the Disabled state after starting the engine (or any time RPM drops below 500).

It will be in AlmostEnabled while you're holding the cruise-cancel switch, then Enabled after you release the switch.

Brakes+Clutch puts you into DecelerationDownshift.
Tapping cruise-cancel gives you a 2-second window where pressing the clutch by itself will put you into AccelerationDownshift.

DecelerationDownshift and AccelerationDownshift are the states where it will take over throttle control. They will transition to Expired after 2 seconds.

After Enabled, it will stay in Enabled until RPM drops below 500, which basically means shutting off the engine. There isn't any other way to go from Enabled back to Disabled. It's reliable and consistent enough that I just didn't see a reason to add that.

There are a couple of gear parameters:

The "Gear Position" parameter was in the ECU before I started on this, and it compares RPM to wheel speed and picks whatever gear is closest. The only problem is it continues doing that even when the clutch is pressed, so you can make it show the wrong gear very easily. "Rev Match Current Gear" is exactly the same thing, I just gave it a new name to make it easier to find in the list.

The "Rev Match From Gear" parameter will hold the last-calculated value when the clutch is pressed. So if you drive in 3rd, put the clutch in, and rev up and down, the Current Gear parameter will go up and down (it's trying to guess what gear you'll be in when you release the clutch), but the From Gear parameter will continue to say 3 (its purpose is to remember which gear you shifted out of).

The Gear Position / Current Gear parameter should always be accurate when you're not using the clutch. If it isn't you need to adjust the values in the Gear Determination Thresholds table - it's part of the stock tune, and if you still have the stock transmission they're probably just fine.

_________________
2005 Legacy GT w/ ATP 3076, IWG, MBC, BCS, BC 272, LC, FFS, OMG
Please don't send questions via PM. Post a thread and send me a link to it instead. Thanks!


Top
 Profile  
 
 Post subject: Re: Rev matching on downshift
PostPosted: Sun Jan 28, 2018 3:05 am 
Offline
Newbie

Joined: Sun Feb 06, 2011 10:12 pm
Posts: 41
NSFW wrote:
Here's the list of states:

Code:
enum RevMatchStates
{
   RevMatchDisabled = 0,
   RevMatchAlmostEnabled = 1,
   RevMatchEnabled = 2,
   RevMatchReadyForAccelerationDownshift = 3,
   RevMatchDecelerationDownshift = 4,
   RevMatchAccelerationDownshift = 5,
   RevMatchCalibration = 6,
   RevMatchExpired = 7,
};


It will be in the Disabled state after starting the engine (or any time RPM drops below 500).

It will be in AlmostEnabled while you're holding the cruise-cancel switch, then Enabled after you release the switch.

Brakes+Clutch puts you into DecelerationDownshift.
Tapping cruise-cancel gives you a 2-second window where pressing the clutch by itself will put you into AccelerationDownshift.

DecelerationDownshift and AccelerationDownshift are the states where it will take over throttle control. They will transition to Expired after 2 seconds.

After Enabled, it will stay in Enabled until RPM drops below 500, which basically means shutting off the engine. There isn't any other way to go from Enabled back to Disabled. It's reliable and consistent enough that I just didn't see a reason to add that.

There are a couple of gear parameters:

The "Gear Position" parameter was in the ECU before I started on this, and it compares RPM to wheel speed and picks whatever gear is closest. The only problem is it continues doing that even when the clutch is pressed, so you can make it show the wrong gear very easily. "Rev Match Current Gear" is exactly the same thing, I just gave it a new name to make it easier to find in the list.

The "Rev Match From Gear" parameter will hold the last-calculated value when the clutch is pressed. So if you drive in 3rd, put the clutch in, and rev up and down, the Current Gear parameter will go up and down (it's trying to guess what gear you'll be in when you release the clutch), but the From Gear parameter will continue to say 3 (its purpose is to remember which gear you shifted out of).

The Gear Position / Current Gear parameter should always be accurate when you're not using the clutch. If it isn't you need to adjust the values in the Gear Determination Thresholds table - it's part of the stock tune, and if you still have the stock transmission they're probably just fine.
Thanks for the code snippet and explanation. It's been working very well so far. Superb job!


Top
 Profile  
 
 Post subject: Re: Rev matching on downshift
PostPosted: Sun Jan 28, 2018 6:52 am 
Offline
Moderator

Joined: Thu Nov 23, 2006 2:23 am
Posts: 2565
Thanks!

I added a wiki page with information about the new logging parameters:
https://github.com/LegacyNsfw/EcuHacks/ ... v-Matching

The main wiki page is here:
https://github.com/LegacyNsfw/EcuHacks/wiki

I keep forgetting to mention that the rev match hack integrates with flat-foot-shifting. When FFS is active, it should target the right RPM for a relatively smooth upshift. I haven't tested this very much yet, but it seems to work. In the Fuel Cut table group, there is a Flat Foot Shifting table with fuel-cut and fuel-resume offsets. The cut and resume RPM will be calculated from the rev-matching RPM plus these offsets.

The table description states that the cut offset must be positive and the resume offset must be negative, but that's not exactly accurate. The cut offset just has to be greater than the resume offset. I need to change the table description to be clearer about that.

_________________
2005 Legacy GT w/ ATP 3076, IWG, MBC, BCS, BC 272, LC, FFS, OMG
Please don't send questions via PM. Post a thread and send me a link to it instead. Thanks!


Top
 Profile  
 
 Post subject: Re: Rev matching on downshift
PostPosted: Sun Jan 28, 2018 7:54 pm 
Offline
Moderator

Joined: Thu Nov 23, 2006 2:23 am
Posts: 2565
I wrote the code last night to allow consecutive brakeless downshifts, and I hope to test it in my car this afternoon.

Hang on to your un-patched ROM files - applying the next patch to one of those might be easier than removing the patch. Un-patching is kind of a pain because in order to remove a patch you first have to return all of the patch-specific tables to the default values. If course you'll then have to update all of the patch-specific tables after applying the patch, but I still think that might be the least tedious way to upgrade to the next patch.

This really makes me want to extend the patch format (and of course the patch tool) so that removing a patch will work even after modifying tables. It should be pretty easy to do, but it could take me a while to get around to it.

_________________
2005 Legacy GT w/ ATP 3076, IWG, MBC, BCS, BC 272, LC, FFS, OMG
Please don't send questions via PM. Post a thread and send me a link to it instead. Thanks!


Top
 Profile  
 
 Post subject: Re: Rev matching on downshift
PostPosted: Mon Jan 29, 2018 2:45 am 
Offline
Moderator

Joined: Thu Nov 23, 2006 2:23 am
Posts: 2565
This version of the patch enables consecutive brakeless downshifts. Here's how that works:

* You're cruising in 5th gear, and you want to accelerate.
* Tap the cruise-cancel switch.
* Downshift from 5th to 4th. You'll get rev-matching.
* Release the clutch in 4th, just for an instant, so the ECU knows you're now in 4th.
* Downshift from 4th to 3th. You'll get rev-matching again.
* Floor it to accelerate. (This tells the ECU that you're done downshifting.)
* Shift from 3rd to 4th. You will not get rev-matching.

"Floor it to accelerate" really just means "press the accelerator more than 50%." There's a new value in the definition XML to set that threshold. That 50% value could probably be lower, but it's not a bad place to start.

In addition to that threshold, there is also a two-second window - if the driver in the example above just stayed in 3rd for two seconds, the next shift would also not get rev-matching.

Note that if you don't exceed that throttle threshold, the ECU will continue to think you want to downshift if you press the clutch within two seconds of . If you don't actually want to downshift, either wait two seconds or poke the throttle above the threshold. If you do neither of those things (perhaps you change your mind about accelerating) your RPM will jump up. But don't worry, it'll return to normal no matter what you do:

You could just hold the clutch down and wait two more seconds. Rev matching will deactivate and RPM will return to normal.

You could also just let the clutch out. You'll lurch forward for an instant (mostly due to flywheel momentum), but rev matching will deactivate when you're off the clutch.


You do not have the required permissions to view the files attached to this post.

_________________
2005 Legacy GT w/ ATP 3076, IWG, MBC, BCS, BC 272, LC, FFS, OMG
Please don't send questions via PM. Post a thread and send me a link to it instead. Thanks!


Top
 Profile  
 
 Post subject: Re: Rev matching on downshift
PostPosted: Tue Jan 30, 2018 7:37 pm 
Offline
Newbie

Joined: Wed May 18, 2016 3:15 pm
Posts: 4
I really need to get this into my car.
Hopefully I'll get around to it this weekend.


Top
 Profile  
 
 Post subject: Re: Rev matching on downshift
PostPosted: Thu Feb 01, 2018 5:47 am 
Offline
Newbie

Joined: Sun Feb 06, 2011 10:12 pm
Posts: 41
I just flashed the new version and will be driving tomorrow.

I also updated my post earlier in the thread with updated romraider xml files. They now include FFS, LC and RM.


Top
 Profile  
 
 Post subject: Re: Rev matching on downshift
PostPosted: Thu Feb 01, 2018 10:51 pm 
Offline
Newbie

Joined: Sun Feb 06, 2011 10:12 pm
Posts: 41
Happy to report that everything still works well.

I changed my gear determination tables based on my tire size and a spreadsheet found on romraider. This seems to have helped with my car knowing what gear it is in.


Top
 Profile  
 
 Post subject: Re: Rev matching on downshift
PostPosted: Tue Feb 20, 2018 10:05 am 
Offline
Newbie
User avatar

Joined: Thu Jun 30, 2016 8:09 pm
Posts: 4
Location: Russian Federation
Hello! It turns out autoblip (static revolutions or automatically)?
What should I do to install this patch on firmware AZ1G202G?


Top
 Profile  
 
 Post subject: Re: Rev matching on downshift
PostPosted: Wed Feb 21, 2018 1:05 am 
Offline
Moderator

Joined: Thu Nov 23, 2006 2:23 am
Posts: 2565
I don't understand your first question.

The best way to port this patch to other ROMs would be to integrate it with MerpMod first... I started to look into that but didn't do any real work in that direction yet. After that, then for each of the ROM and RAM addresses used in the patch, you'll have to find the corresponding addresses in your ROM. You'll probably need to open my ROM and your ROM in IDA Pro. There is an IDC file for my ROM in my GitHub repository, so that will give you a head start. See the A2WC522N.idc file here:

https://github.com/LegacyNsfw/EcuHacks

I also wrote some notes here about what's needed:

https://github.com/LegacyNsfw/EcuHacks/ ... v-Matching

Some of the memory locations used in the patch are already part of the RomRaider logger definitions, so those will go pretty quickly, but there are a few new things as well.

_________________
2005 Legacy GT w/ ATP 3076, IWG, MBC, BCS, BC 272, LC, FFS, OMG
Please don't send questions via PM. Post a thread and send me a link to it instead. Thanks!


Top
 Profile  
 
 Post subject: Re: Rev matching on downshift
PostPosted: Wed Feb 21, 2018 1:10 am 
Offline
Moderator

Joined: Thu Nov 23, 2006 2:23 am
Posts: 2565
While driving around with this patch enabled today, it occurred to me that it might be a good idea to make rev-matching activate only when the driver presses the accelerator while the clutch pedal is pressed.

The current approach assumes you want rev-matching every time you press the brake and clutch together, and that works pretty well, but not perfectly. Sometimes the revs jump up when you don't really want it. However, pressing the accelerator while holding down the clutch pedal would be a very explicit signal that the driver wants rev matching.

I might make that the default in a future version, but I don't have much free time these days so it could be a while before I get around to it.

_________________
2005 Legacy GT w/ ATP 3076, IWG, MBC, BCS, BC 272, LC, FFS, OMG
Please don't send questions via PM. Post a thread and send me a link to it instead. Thanks!


Top
 Profile  
 
 Post subject: Re: Rev matching on downshift
PostPosted: Wed Feb 21, 2018 9:58 am 
Offline
Newbie
User avatar

Joined: Thu Jun 30, 2016 8:09 pm
Posts: 4
Location: Russian Federation
NSFW wrote:
I don't understand your first question.

The best way to port this patch to other ROMs would be to integrate it with MerpMod first... I started to look into that but didn't do any real work in that direction yet. After that, then for each of the ROM and RAM addresses used in the patch, you'll have to find the corresponding addresses in your ROM. You'll probably need to open my ROM and your ROM in IDA Pro. There is an IDC file for my ROM in my GitHub repository, so that will give you a head start. See the A2WC522N.idc file here:

https://github.com/LegacyNsfw/EcuHacks

I also wrote some notes here about what's needed:

https://github.com/LegacyNsfw/EcuHacks/ ... v-Matching

Some of the memory locations used in the patch are already part of the RomRaider logger definitions, so those will go pretty quickly, but there are a few new things as well.

Is it auto-reset for a given engine speed or does the ECU automatically determine which engine speed to throw based on the vehicle speed and transmission gears?
What version of Ida Pro to use, what plugins?


Top
 Profile  
 
 Post subject: Re: Rev matching on downshift
PostPosted: Wed Feb 21, 2018 10:24 pm 
Offline
Moderator

Joined: Thu Nov 23, 2006 2:23 am
Posts: 2565
With this code, the ECU calculates the correct RPM for the next gear, and uses a new table to determine how much to open the throttle to achieve that RPM. Some tuning is required to set the gear ratios and to set the throttle opening table.

I have added some links to the wiki page to information about IDA and HEW (another tool you'll need). I don't use any plugins for IDA, but I have a utility (XmlToIdc) that uses information in EcuFlash / RomRaider XML files to label tables and RAM addresses in IDA, and that makes it a lot easier to understand the code.

https://github.com/LegacyNsfw/EcuHacks/ ... v-Matching

_________________
2005 Legacy GT w/ ATP 3076, IWG, MBC, BCS, BC 272, LC, FFS, OMG
Please don't send questions via PM. Post a thread and send me a link to it instead. Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 87 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subsilver by phpBBservice.nl