PDA

View Full Version : Subaru Drive By Wire and How to Improve it


williaty
06-14-2008, 07:53 PM
To Whom Does This Apply?
Overall, the ideas and thought processes here cover any Drive By Wire (DBW) car. The specific numbers and results here are for the USDM 2005 and 2006 Normally Aspirated Subaru Imprezas. However, the results should be VERY close for any of the DBW H4 Subarus (Impreza, Legacy, Forrester).

In General, What is the Problem?
In a DBW car, the accelerator pedal is not physically connected to the throttle. Instead, the accelerator pedal is just an input device, like a video game controller, to the ECU. The ECU looks at the position of the accelerator pedal, consults some tables, and determines where the throttle plate in the throttle body should be. Depending on the contents of those look up tables, the throttle response can be anything the engineers want it to be. This is how Si Drive is implemented, by the way.In the stock ROM, the DBW tables are set-up in a way that is good for moving the cars off the dealer's lot (they feel "peppy") but bad for performance driving.

In General, What is the Solution?
Via tuning with RomRaider, the contents of the DBW tables can be altered at will. In the case of the cars in question, the throttle response actually needs reduced to make the car easier to drive and more controllable at the limit or in a slide.

Hey, you spelled "accelerator" wrong in all your charts!
Congratulations, you get a cookie. They weren't worth fixing for that mistake.

The Dirty Details:
In Denso's (the company who makes the ECUs for Subarus) DBW system, there are two sets of tables. Roughly you can consider them input (Requested Torque) and Output (Target Plate Angle). The input tables take the position of the accelerator pedal (as percentage) and the current RPM and return a "Requested Torque" number. This Requested Torque number has NOTHING to do with the actual amount of torque the engine is making! It is simply an arbitrary value made up to make the programming possible. Changing the Requested Torque table will not make your engine stronger or weaker! The output tables take the Requested Torque from the input tables and the current RPM and return a Target Throttle Plate Angle (as a percentage). The ECU then moves the actual throttle plate to match the Target Throttle Plate Angle.

We'll start by looking at the 2005 USDM 2.5RS 5MT, ECU ID E2ZJ103G, since it is the simplest DBW setup I have yet encountered. Here is a screenshot of the Requested Torque (input) table. Remember that the values for the columns across the top are the Accelerator Pedal Angle as percent and the values for the rows down the side are engine speed in RPM.

http://farm4.static.flickr.com/3160/2579427664_89692ef0dc_o.png

As you an see, the setup is very simple. Basically, the table is just counting to ten. 10% Pedal Angle gets you 10 Requested Torque at all RPM. If we turn our attention to the Target Throttle Plate (output) table, we see the same thing. Again, Requested Torque is across the top and RPM is down the side.

http://farm4.static.flickr.com/3262/2579427718_c3e63cf28e_o.png

So, what does this mean? If you follow the numbers through the two tables, you'll see that the throttle plate is slaved to the accelerator pedal. In other words, the throttle plate does exactly what your foot does. While this sounds like a good thing, in reality it's a BAD thing. We can see why if we look at a chart that plots the position of the accelerator pedal (as a percentage) against the engine load (as a percentage of maximum load). Recall that engine load looks just like torque, so this also is a graph of pedal angle vs. torque.

http://farm4.static.flickr.com/3136/2579435092_2f795ab73d_o.png

As you can see, the relationship is not a straight line! With the first tiny bit of movement of the accelerator pedal, the engine's output increases dramatically! Then, the last half of the pedal travel does almost nothing. This is very bad for a number of reasons. First and foremost, it means that almost half of our available pedal travel isn't being utilized to good effect. if you'll look, 80% of peak torque is available at just 40% of pedal travel! Second, it means that it is very difficult to precisely control the torque going to the wheels to either avoid spinning them or to finely control a slide. Third, it violently exaggerates the bouncyness of the driveline at low speeds near idle (such as in stop-and-go traffic or in a drive-thru). Fourth, because the deepest part of the travel of the pedal does almost nothing, when trying to shift quickly, you have to move your foot a very long way before the drivetrain unloads, slowing down the shift dramatically.

So, how do we approach solving this problem? Ideally, the accelerator pedal is a representation of the output of the engine NOT the position of the throttle plate. After all, it's the output we actually care about, isn't it? Graphically, what this means is that we'd like to take that curved/humped plot of pedal angle vs load and turn it into a straight 45* line. We do this by finding the inverse function of the plot we have now. I'll save you the details of how to do it and just show it to you.

http://farm4.static.flickr.com/3155/2579427772_01eb7bee3a_o.png

The red line represents the inverse function of the plot. In other words, the red line and the black dots are "reflections" of each other across a 45* line through the middle of the graph. To put this in numerical terms, here's a screenshot of the Requested Torque (table) that represents that red line. As before, Accelerator Pedal Angle (as a percentage) is across the top while engine speed (in RPM) is down the side:

http://farm4.static.flickr.com/3048/2578596729_7de5a78acd_o.png

The values in this table are the same as they were stock, however, I rearranged them to make the execution faster. See the section below on how the ECU reads tables.

http://farm4.static.flickr.com/3324/3282316186_890b512c8b_o.png

Now, I'm also including the USDM 2006 Impreza 2.5i 5MT, ECU ID E2VH112C, as another example because the stock mapping is very different. First, let's take a look at the stock Requested Torque and Target Throttle Plate Position tables.

http://farm4.static.flickr.com/3090/2579427852_afc379ff9a_o.png

http://farm4.static.flickr.com/3052/2579427942_1a69f11e55_o.png

Wow! Something very different is going on here! The throttle is NOT linearly slaved to the accelerator pedal angle in this car! In fact, the relationship between the plate and pedal varies with both pedal position and RPM AND there are 3 Requested Torque tables and seven Target Throttle Plate Angle tables for the ECU to pick from! With something this complicated, the only way to attack it is to log the car. A lot. The plot of Pedal Angle (as a percentage) vs engine load (as a percentage of maximum) that appears below is the result of filtering out the reliable data from about 50,000 lines of logs.

http://farm4.static.flickr.com/3013/2579427994_7e1174a5fd_o.png

So, that looks nothing like the nice simple plot we got from the 05. In some respects, it's better. I doesn't open quite as fast at the low end. However, it has the throttle plate fully open by 65% pedal travel, leaving the last 35% of pedal travel totally useless. Within the range that it's actually using, the relationship between the pedal and the engine output is constantly changing. In other words, it's as bad as the 05, but just in a totally different way.

To confirm that the 06 would respond to the same fix as the 05, I also took logs to make a Throttle Plate Angle (as a percentage) vs the percent of maximum load. Sure enough, I got a familiar looking graph!

http://farm4.static.flickr.com/3271/2579428024_c4a1265658_o.png

Now, the 06 had to get it's fix implemented slightly differently. First of all, it has all those extra tables. Each of the 3 input tables had to be set to contain the same values. Each of the 7 output tables had to be set to contain the same values. Additionally, the owner of the 06 wanted just a little more punch to the first bit of throttle movement, so used an inverse function that made the lower end pop a little bit. Now, to make things simpler on myself, I made the output table look just like the 05 output table (which had some unexpected benefits, more on that later) and made all the alterations to the input tables. So, here are the modified tables, Requested Torque (input) first and then Target Throttle Plate Angle (output) second. Again, notice how I re-arranged the tables for fastest ECU execution, read about that below.

http://farm4.static.flickr.com/3432/3281533793_61f9d4e62d_o.png

http://farm4.static.flickr.com/3324/3282354448_ee893f7427_o.png

A Note On Not Dying
While, in theory, we can plug just about any value we want into either of these tables and make the math work, we probably shouldn't. The DBW system is not 100% understood. It's highly likely that other parts of the ECU's programming perform "sanity checks" on the values coming out of the DBW system. If the other programming sees a value that it knows isn't allowed to exist in the DBW system, god only knows what will happen. To avoid any potential issues, always use values in the tables that are not larger than the largest value occurring in the stock table. In other words, if the stock table doesn't have any values larger than 100, don't use any values larger than 100. If the stock table's largest value is 232, don't use a value larger than 232.

A Note On ECU Execution Speed
The ECU reads tables backwards of the way you and I do. The ECU reads tables from right to left, bottom to top. I would guess that this is to ensure the ECU can find values the most rapidly under high load, high RPM conditions. What are the practical implications of this? We should stick the important values in the bottom right corner of the table. This first table is done "wrong". The ECU has to read through all those columns of 100's on the right before it ever gets to the important data. It has to read all those columns every. single. time. the DBW code executes.

http://farm4.static.flickr.com/3144/2578596907_120df15b40_o.png

Here is exactly the same table "fixed" so the ECU gets to the important values first. It will actually never even read all those columns of 0's on the left because, if the input is 0, it would just stop on the first 0 column.

http://farm4.static.flickr.com/3324/3282354448_ee893f7427_o.png

The Results
The cars have been absolutely transformed! I strongly prefer this throttle mapping, but I'm going to address the negatives first because they might put someone off. First, the car feels slower when you first jump into it. This is simply because it lacks that "pop" when you first touch the throttle and you have to move your foot a little farther to get the same surge from the engine. It is absolutely not slower than before, but it is VERY hard to get over that psychological impression of having to move your foot farther. I suspect this is exactly why the cars are programmed the way they are. It makes the engine feel stronger on a test drive. Second, due to the fact that you have to move your foot a little farther, you're going to stall the car for the first few days. Just like getting a lightweight flywheel, you're going to have to move your foot a little farther to move away from a stop smoothly.

The benefits? Well, they're pretty nice! First, because you're using the entire range of pedal motion to select from the engine's entire output, it is MUCH easier to finely control the power to the wheels. This makes it MUCH easier to accelerate right at the limit of traction on a slippery surface and makes it MUCH easier to steer the car with the throttle in a slide/drift. This is the biggest single improvement I've ever made to my car for Rallycross. Second, because the engine's output changes much more slowly at the beginning of the pedal travel, it becomes much easier to smoothly move the car at very low speeds near idle, such as in stop-and-go traffic or in a drive through. No more looking like a student driver! Third, when you start to pull your foot out of the gas for a ****, the driveline unloads right away. This makes it possible to shift MUCH faster once you get used to the timing and eliminates some of that "the car isn't listening" feeling the DBW causes.

The 06 saw an additional, surprising, benefit. The 06's cruise control had always been a little flaky. Frequently, when you would set it, it would floor the car, gain about 8-10MPH and then settle back down to the target value. It also had trouble dealing with any change in the angle of the ground (hills) at all. Altering the DBW tables (and I strongly suspect it's specifically related to simplifying the Target Throttle Plate Angle tables) has completely eliminated the problem with hills and reduced the surge on set to 1-2MPH. A win all around!

What problem still remains?
Sadly, there appears to be one flaw in the DBW system that we do not have the tools to fix. The system appears to be unable to give a truly smooth transition away from idle. Significant testing with some VERY strange maps revealed that there is a small range just above idle that the system WILL NOT use. When you move the accelerator the smallest amount the ECU can detect, the engine instantly jumps from idle to an output about 70-90% above idle without passing the values in between. This is accompanied by a small lurch since the power doesn't come on smoothly. Dropping back to idle sees the same jump in the other direction. So, the bouncyness when trying to drive right above idle isn't totally eliminated due to this small gap in the programming. However, you can ease down to this point very smoothly, greatly improving drivability.

strat
06-14-2008, 08:44 PM
VERY good information. I assume this would work on the turbo dbw cars as well??

I've driven a few and hated how the car holds revs for a brief second after you let off the gas.

MConte05
06-14-2008, 08:47 PM
Basically willaty.... I love you.

<3

williaty
06-14-2008, 08:55 PM
VERY good information. I assume this would work on the turbo dbw cars as well??

I've driven a few and hated how the car holds revs for a brief second after you let off the gas.
This same system is in the DBW turbo cars. The feeling of holding the revs comes from 2 places. One is a mode where the ECU actually deliberately holds the revs at a given point. The assumption is that this it to make blipped downshifts easier. However, no one has ever figured out how to trigger it reliably, so it's useless. The other place the feeling comes from is that dead travel at the bottom of the pedal's travel. You pull your foot up 1/2 way before the engine even starts to react which makes it feel like it's hanging there for no good reason.

The other interesting idea with a turbo car is to make the columns vary with RPM to "simulate" not having a turbo. Basically, open it faster/farther before the turbo spools, and then close it down as boost builds. This would give the car the feel and immediacy of an NA car and you could hold a given amount of power to the wheels as the revs change (as opposed to surging) and the boost builds. That would be a huge advantage on dirt. Obviously, you'd want phase that "equalization" out as you approach full pedal travel to make sure you get the power when you stick your foot in it.

williaty
06-14-2008, 08:57 PM
Basically willaty.... I love you.

<3
Thanks. I've got about 2 dozen small topics to write up like this, not to mention the HUGE HUGE HUGE (literally will probably be dozens of printed pages) post about my suspension setup and the theory behind it, but they only get written when I get bored or too tired to do anything else.

Today is a too tired day. I was out partying until 2am and then I was up at 7am for an exam. I'm now a FCC-licensed Technician Class in the Amateur Radio Service.

williaty
02-15-2009, 11:17 AM
First post is updated with critical information that you MUST go read

williaty
02-16-2009, 01:24 PM
Jesus, I was a dumbass on that last edit and only pasted in half the article. It's fixed now.