How the red box thinks/works


Staff member
477 Owner
Nov 1, 2022
1. October 2022, 10:50

This comes from SaSa:

The TPS is the foundation upon which the whole red box software is constructed! It's one of the coordinates of every table, and that gives you a hint of the importance of setting that parameter correctly! @dool is right, the timing is based off that but the INJ VE table is as well, and these are the two utmost important tables for running the bike.
Unfortunately that is not a range per se, meaning that 0.54 to 3.66 isn't the same as 0.6 to 3.72, you cannot move it up or down as you like because that value is given off by the TB and corresponds to a certain opening of the butterfly valve, which corresponds to a certain air flow, etc. The values given off by the TB don't change (or not in a short span of time or drastically, for our sake we can consider them fixed) because they are related to the variable resistor (it's a potentiometer) that is linked to the butterfly valve.
It works like this: the ECU generates a 5V that passes through the TPS in the TB, which is a variable resistance, and then the ECU reads the voltage from the "information wire" that comes from the TB. When the TB is shut (idle) the resistance is high and the ECU reads a low(er) voltage, e.g. 0.6V. When you twist the throttle the resistance decreases linearly (it's a rotary linear potentiometer to be exact) and the ECU reads an increasing voltage on the "information wire", up to a max which is let's say 3.7V. These are the values of the TB, nothing can change that, as long as you don't mess manually the sensor on the TB or corrosion doesn't increase the resistance, but that happens with time (a carelessness). These values are also BIKE SPECIFIC, meaning that every bike will have slightly different numbers and ranges. This is due to tolerances in variable resistance manufacturing, assembly etc. So my bike could be 0.63 to 3.69, yours 0.54 to 3.75 etc...
Now we know that these values are an ID card of the TB. How do we communicate these values to the red box? Here comes the "Learn throttle valve" procedure. What the red box does is this: while you twist the throttle three times the red box monitors the voltage on the "information wire". You do it three times because the red box then makes an average of the three results. The red box then picks the lowest value and writes it in the "TPS Voltage (min)" cell in the option table, while the maximum value is written in the "TPS Voltage (Max)" cell in the same table.
Now: if you know the values of your bike you can simply write them somewhere and use these values every time you load a new map file. You don't need to go through the whole procedure. Simply load a new map file in the ONX software, got to the Option table, write those values in the proper cells, save the file and then click "send all" when the red box is connected. Voilà!
Now let's explore what might happen if you use the incorrect values in the software. Let's make some examples, like my previous post.
REMEMBER: the red box reads "live" from the TB, the values in the table will establish a range (or curve) associated to the various value of tps of the table (0, 2, 5, 8, etc...)
Let's make this example:
  • The correct values from TPS are: 0,6V to 3,7V
  • Case 1: in the cell are input these values: 0,55V to 3,72V (so a lower value than correct for idle and a higher value than correct for WOT)
  • Case 2: in the cell are input these values: 0,66V to 3,65V (so a higher value than correct for idle and a lower value than correct for WOT)
These are the resulting ranges and their effect!
TPS position (%)Correct values range from TPS (V)Incorrect values range (case 1)Incorrect values (case 2)
Let's discuss these results.
Case 1: you said to the red box that the minimum was 0,55V and the maximum was 3,72, then it "pings" the values of the third column to the corresponding TPS values,what happens now? At idle the red box "reads" 0,6V, it doesn't know the butterfly valve is fully shut because it thinks that when the butterfly valve is shut the value should be 0,55V. So the red box reads 0,6 and thinks: well I'm approx at 2% and applies the corresponding values for IGN, INJ etc, according to the RPM range (remember always two coordinates, RPM and TPS). So with less air (butterfly valve shut) is giving off more fuel, maybe too much! The same applies if we go further: at 5% TPS the real value is 0,755V but the red box thinks it's in between 5% and 8%, so it gives off more fuel than it should for that set of coordinates! At 70% the values are identical, but that is a coincidence, given the numbers we've taken for the example. Above that the trend reverts: at 90% the real value is 3,39 but the red box is expecting 3,40, hence it will provide a little less fuel than necessary, leaning the mixture a bit. Same goes for 100%.
Case 2: we inserted 0,66V for minimum and 3,65V for maximum, the values of the TPS are "pinged" to the values in the fourth column. At idle the TPS gives off 0,6V and the red box thinks that since the value is lower than the minimum, then the 0% value applies. Correct. But when you go to 2% the TPS reads 0,66V, the butterfly valve is partially open and a bigger flow of air is coming to the engine, but the red box thinks you're still at idle and gives you off less fuel than needed! So the bike is running leaner! On the opposite side when you're at 95% TPS the value will be read as 100% and the mixture will be enriched!
So if the value inserted is lower than the real one, the mixture will enrich, if it's higher the mixture will be leaner.
The same goes for the timing table. The risk is to shift upward or downward the cell of the map you're considering, hence screwing up all the table values!
So it is of paramount importance to nail those two values. If the bikes runs differently then it's a problem with the table (or map) itself, but you cannot patch it changing the min and max by sentiment, because it might fix that specific point but the implications might go beyond what you consider in that moment.
1. October 2022, 11:50

This comes from SaSa:


About idle: the number on the INJ VE table have to be changed ONLY on warm engine. Warm up the bike (go for a 10 minutes ride or something) and then change those values if you want. IF you're operating on cold engine you have to operate on the ECT INJ compensation table!!!

Here is how the red box calculates the final injection value.

The ECU reads many parameters (IAT temperature, ECT temperature, TPS position, RPM etc) then what it does goes like this:

  • With RPM and TPS (two coordinates) reads the cell of the INJ VE table, lets say we are at 0%TPS and 1000RPM: it reads 2.5ms
  • Then the ECU goes to the ECT INJ compensation table and reads RPM and ECT temperature (again two coordinates, see the pattern?) and isolate the cell where you're at, let's say 1000RPM and 28°C: it reads 21% (or 22% can't remember by heart). What it does then it adds 21% to the initial value of 2.5ms, so it becomes 3.025ms.
  • Then the ECU reads the IAT sensors (only one coordinate) and goes to the IAT temperature compensation table (more like a single row than a table, it's under "option" tab if I recall correctly) and it finds the corresponding cell, say 18°C, where the compensation values is 0.13ms. This value is added to the previous number, so it becomes 3.025+0.13= 3.155ms. This is the final value of injection that is applied
All these things happen in a split second of course.

So why not change the IDLE value of INJ VE table on cold engine??? Because this base value it's multiplied by different coefficients according to different temperatures, so if you change the base, the results (which compose a curve) are going to be different. The whole ECT curve will be affected!!! Let's make an example:

For 1000RPM column in the ECT INJ compensation map we have these coefficients (if I recall correctly)

Temperature ECT INJ compensation mapValue ECT INJ compensation mapResults with 2.5ms in INJ VE tableResults with 2.4ms in INJ VE table
As you can see the results in the two columns are quite different and that could make the difference between a decent idle and a bike that bogs down and die. The second curve is leaner at all temperature, while you probably wanted to lean the mixture only at say 14°C!

So, when acting on cold idle (eg if you think it's too rich or you smell unburnt fuel) go to the ECT INJ compensation table and change (lower to lean, increase to enrich) the cell corresponding to the situation (i.e. the ECT temp) your engine is in!

Whenever you're in a situation "in between" two cells, remember that the ECU will make a weighted average between the nearby cells.