View Full Version : open source tuning (RomRaider = free)

Justin 05 Sti
07-23-2009, 10:45 AM
This thread will be for the new and improved, super-duper open source tuning sticky. I will outline the hardware and software needed to get started, and try to describe basic ECU operation and tuning theory.

Could I get a mod to sticky this? The old one was also locked so only I could edit / reply. It would be nice if we could set that up again.

Justin 05 Sti
07-23-2009, 11:10 AM
A cable is needed for your PC to communicate to the ECU with. The guy that makes them is Colby Boles, who runs the OpenECU and Tactrix websites.

The newest cable available is the OpenPort 2.0. It is needed for the newer cars that support CAN. It is available from the Tactrix site for $169:

Previous versions of the Tactrix cable were 1.0, 1.2 and 1.3. They had fewer features and cost a little less. The 1.3 cable is still available through Tuner Tools for $149.50:
http://tunertools.com/proddetail.asp?pr ... enPort1.3U (http://tunertools.com/proddetail.asp?prod=TAC-OpenPort1.3U)

For those nerdy cheapskates who like a challenge, the schematics for the 1.x OpenPort cables were made available so you can roll your own:




Tactrix cables are the only cables that support flashing the ECU. Other cables can be used to log with, but that's only half the fun. It is also worth noting that the OpenPort cables support other vehicles as well. For example, I am able to use my 1.2 cable on my wife's VW Jetta with the VAG-COM software.

Justin 05 Sti
07-23-2009, 11:35 AM
There are two major pieces of software you need to start tuning. They are ECUFlash and RomRaider. Both are freely available, and while they require the Tactrix cable above for complete functionality, can be installed and run without it. Doing this is a great way to get your feet wet and learn prior to purchasing the cable.

ECUFlash is used to read from and write to the ECU. It can dump the contents of the ECU to a ROM image (binary file), or flash the ECU with a modified ROM.

RomRaider is used to manipulate ROM images. It lets you see the tables for boost, timing, etc. and change the values within the tables. It also lets you log the output of the various engine sensors so you can determine the results of the changes you've made. This cycle of change-flash-log is the essence of tuning.

Keeping any software up to date is important. With beta / open software it is absolutely critical. It is important to note that new XML definition files are released separately from the core software. I will keep these links updated with the most current versions:

ECUFlash 1.42.2595 6/27/09
direct download (http://openecu.org/downloads/ecuflash_1422595_win.exe)

ECUFlash definitions 10/07/09
direct download (http://www.romraider.com/forum/download/file.php?id=9917)

RomRaider 0.5.4 beta RC1 10/28/11
direct download (https://www.assembla.com/spaces/romraider/documents/abxUwCaAGr4z4BacwqjQXA/download/abxUwCaAGr4z4BacwqjQXA)

RomRaider ECU definitions 10/07/09
direct download (http://www.romraider.com/forum/download/file.php?id=9915)

RomRaider Logger definitions 0.3.5b 10/02/09
direct download (http://www.romraider.com/forum/download/file.php?id=9893)

You might notice the release dates above are slightly, uh, dated. And if you compare them to the supported model years in the first link of the post below, it can get downright confusing.

The official definitions are a collection of everything that was tested as working right before Cobb hired Bill / merchgod / Tea Cups. Since then the official package has not been updated, but that doesn't mean your car isn't supported! It just means you have to do a bit more looking for your specific definitions.

If the packages above don't work for you, search for your car in the experimental definitions section:


dschultz has been grouping experimental logger defs together to make things a little easier:


But, the definitions for the editor look like they're being kept separate. Obviously, model years after 2009 will need to do this. But there are also model years before 2009 that have been added. Here is a short list I put together after some quick searching:

2006 USDM Legacy 2.5i MT CAL ID: E2VG204B (4512184106)

2007 USDM Impreza 2.5i MT CALID: E2UG002L (4D12088006)

2008 USDM Legacy 2.5i MT CAL ID: EZ1D301A (52221A7207)

2004 USDM Baja Turbo AT CAL ID: A2WC50 (371240A006)

2005 USDM Baja Turbo MT CAL ID: A2WC400L (3F12484006)

2011 USDM WRX Sedan (CALID AE5I910L | ECUID 7412587007)

2012 USDM Impreza WRX MT CAL ID: AE5K500L (8112585007)

2010 USDM STi SE CAL ID: AZ1G702I (7212786107)

2011 USDM Impreza STi 6MT CAL ID: AE5IB00V (7412597207)

2011 USDM STI Sedan (CALID AE5I910V | ECUID 7412597007)

2012 STi USDM CAL ID: AE5K500V (8112595007)

Justin 05 Sti
07-23-2009, 12:51 PM
Here is a list of all the ROMs supported by RomRaider:

http://www.romraider.com/Documentation/ ... dECUs#toc1 (http://www.romraider.com/Documentation/SupportedECUs#toc1)

ROM images are model AND model year specific. There are often multiple releases for any one model / year, as Subaru releases fixes for various driveability issues. It is a good idea to be running the most current ROM for your vehicle. It is a VERY BAD idea to try to use a ROM from a dissimilar model / year. For example, my 05 STi came from the factory with ROM version A2ZJB10J. I am now running the newer A2ZJB11J version.

Subaru has two different styles of OBD-II ECUs, 16 bit and 32 bit. 16 bit ECUs were used roughly up through 2003 on cars with cable-operated throttle bodies. 16 bit ROM images are 160 or 192 KB in size. 32 bit ECUs started showing up around 2004 on cars with drive-by-wire (DBW) throttles. 32bit ROM images are 512 KB or 1 MB in size.

Quite a lot can be learned from simply opening a stock ROM and looking at all the tables. There is a good collection of stock ROMs at Scoobypedia:

http://www.scoobypedia.co.uk/index.php/ ... yList#toc2 (http://www.scoobypedia.co.uk/index.php/Knowledge/ECUVersionCompatibilityList#toc2)

If you have a Tactrix cable you can obviously download your stock ROM and look at it too, but this collection is a nice way to get started if you don't have a cable.

Justin 05 Sti
07-23-2009, 02:45 PM
The open source tuning community has put together a variety of tools to aid with tuning.

Far and away the biggest tool is the logger built into RomRaider. It uses the Subaru Select Monitor (SSM) protocol to communicate with the ECU. It allows you to monitor the car after you've made changes to the tune. You can select from a host of sensors or ECU functions to monitor, and watch them in real time or write to a comma separated value (.CSV) file for later analysis. One important thing to note is the more inputs you select, the lower resolution (data values per second) you get. So the key is to only log data that is relevant to what you're tuning. There are also MAF and injector scaling tools built into the logger.

There is a complete sub forum dedicated to various other tuning utilities:

I will highlight some below:

Learning View 1.0 RC3 7/5/11
direct download (http://www.romraider.com/forum/download/file.php?id=14215)
Learning view was created to view the knock and air / fuel learning parameters stored in the ECU. It also has the ability to read trouble codes (CELs) and clear them (reset the ECU).

Airboy's Spreadsheet 4p0z1 9/14/09
direct download (http://www.romraider.com/forum/download/file.php?id=9689)
This is the granddaddy of all spreadsheets. Unfortunately with the macros that are utilized it can only be used in Microsoft Excel. It is used to create graphs based on log data.

MAF tab instructions
http://www.romraider.com/forum/download ... hp?id=5305 (http://www.romraider.com/forum/download/file.php?id=5305)
The MAF tab in the RomRaider logger is used to scale the MAF in closed loop. Instructions for use can be found in the .PDF download link above.

Justin 05 Sti
07-23-2009, 03:17 PM
An ECU's ROM is little more than a collection of tables that interact with each other. If you are familiar with relational databases the thought process is similar. An easy way to learn what a table does is to open the table in the RomRaider editor and click View | Table Properties. It will give you a description of what the table does, and how the values in it are calculated. This is an important bit to note. The values in the ROM itself are in machine language. RomRaider applies formulas to these values to put them in human-readable format in the editor.

There are two basic types of tables in the ECU. The first are very small tables that set constant values to be used in the ECU elsewhere. An example of this is the table for the injector scalar.

Injector Scalar

The second are tables with two axes that do lookups based on the values of each axis. Examples are the tables for controlling boost, fueling, and timing. There are also compensation tables that make adjustments based on boost error, or air and coolant temperature.

Boost Tables

Open Loop Fuel Table

Timing Tables

There are three big parameters that are used as table axes. These are throttle opening angle, RPM, and Load. The first two are self explanatory. Load is a calculated value the ECU determines based off of input from the MAF (which is why MAF scaling is so important) and RPM. The calculation is (MAF*60)/RPM, where MAF = the amount of air in grams. The ECU is constantly looking at the values for these axes and as driving conditions change, the targets in the various tables (boost, fuel, timing) change.

The ECU operates in two basic fueling modes - Closed Loop and Open Loop. Closed loop means the ECU is targeting an air fuel mixture of 14.7:1 (stoich), and receiving feedback from the O2 sensors. Closed loop is used in light throttle scenarios to maximize fuel efficiency. Open loop means the ECU is ignoring the O2 sensors and targeting air fuel mixtures defined in the open loop fueling table. Open loop is used in heavy throttle scenarios where a richer AFR is needed to safely create more power. The switch between closed and open loop is defined in detail in this post:


Boost control tables are based on throttle angle vs. RPM. There are tables for boost target, wastegate operation, and turbo dynamics. Turbo dynamics is basically changes applied to wastegate duty cycle based on boost error (both instantaneous and over time). There is an excellent description of how these tables interact here:


Timing values are achieved by combining a value in the base table with a value in the advance table. Knock control is achieved by lowering the amount of advance that is being added. This is explained in detail in this post:


Justin 05 Sti
07-24-2009, 10:48 AM
Tuning is both a science and an art. There is a methodology to follow but the trick is to understand how the changes you make to individual parameters will affect the system as a whole. The key to this is knowing what results to realistically expect. The general goal and order of precedence is that you want an air to fuel ratio and exhaust gas temperatures that are safe, while running a proper amount of boost, with the most timing you can safely get away with. There are a few tools that can help you get there.

A wideband O2 sensor is crucial to performance tuning. The narrow band OEM sensors are only used in closed loop operation when the AFR target is stoich (14.7). They cannot accurately measure AFRs lower and higher than stoich. Wideband sensors on the other hand can measure anywhere from high 8s (very rich) to low 20s (very lean). RomRaider has the ability to integrate wideband sensor output into its logs. Sensors that are supported are the Innovate LC-1 and LM-1, and the AEM UEGO. Safe AFRs under heavy load are in the neighborhood of 11.0. Safe maximum EGTs are in the neighborhood of 1600* for short bursts.

There are limits to the amount of boost a turbo can efficiently create. You need to know these limits in order to pick realistic boost targets. There are many factors that influence a turbo's performance including engine displacement, RPM, exhaust and compressor wheels and housings, wastegate spring tension, and so on. People normally compare turbos by comparing their compressor maps. This has been taken a step further by overlaying RPM graphs in this spreadsheet:

direct download (http://www.romraider.com/forum/download/file.php?id=3307)

The last part of the tuning equation is timing. Timing refers to how soon before the piston reaches top dead center that the spark is given to begin the combustion process. The amount of timing advance needed changes with operating conditions. At low RPM and light load you can run a lot of advance for better throttle response and efficiency. At high RPM and high load you need less timing advance because of how much faster each combustion event is occurring. The goal is to run as much timing as you can without causing pre-ignition. Pre-ignition / detination / pinging / knock is when the air and fuel mixture ignites too soon in the combustion process. Either the spark was given too early (timing targets are too high) or the mixture self-ignites before the spark is given (too much heat). The result is the mixture is burning as the piston is still traveling upwards in the compression stroke. The engine is working against itself and damage occurs quickly. The pistons actually rattle and this rattle is what the knock sensor detects. When this happens the knock sensor removes timing to bring the combustion process back towards optimal. The knock control strategy is outlined in detail in a link above, and you can monitor knock history with Learning View. Heat (intercoolers) and fuel (AFR and octane rating) are the other factors involved in avoiding knock.

Some people prefer lower boost targets with higher timing values. Others prefer high boost with less timing. There are trade offs and every car responds differently. The point to take away is that fuel, boost and timing are all on the same sliding scale and interrelated.

Justin 05 Sti
07-24-2009, 11:55 AM
The whole idea behind open source tuning is DIY and sharing information. As with anything there is constant room for improvement and with anything open source it is easy to take what's there and add to it. There have been a couple guys that have done just that and written patches (hacks) to add specific functionality to the ECU they were looking for. To give a high level overview to a very complicated procedure, what these guys are doing is finding unused sections of code in the ROM, and re-writing things to operate differently.

The most widely known are the tinywrex patches, adding launch control, flat foot shifting, and boost and wastegate switching. He offers launch control for 16 bit ECUs for free. Other 16 bit patches, and all 32 bit patches must be purchased. They can be found here:


Another patch that is slowly gaining ground is Freon's speed density hack. High HP cars can use more air than what the stock MAF can see. Speed density replaces the function of the MAF with pre-calculated airflow values. The limitations of the stock MAF are history. Currently the only code Freon has released is for the '04 STi, but others are working on SD patches for other ROMs. Info on this hack can be found here:


07-26-2011, 11:02 AM

Justin 05 Sti
03-01-2012, 09:53 AM
Updated the software section with info on finding experimental defs.