Welcome, Guest. Please Login or Register
MyECU main site
  Welcome to our forum.
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
The colourize map explained (Read 9816 times)
YaBB Administrator
YaBB Administrator
*****
Offline


I love YaBB!

Posts: 679
The Land of YaBB
The colourize map explained
09/08/11 at 11:46:05
 
There are a couple of ways this feature can be used and a whole spectrum of colours produced so this post it to try and explain a little about how it works.

First lets start with the colours themselves. The spectrum produced roughly reflects the colours of the rainbow so we have red at the start, green in the middle and blue at the end.

To get specific the software produces a number , cidx, between 0 and 1 and the following code is used to produce the colour. 0 is the red side and 1 is the blue.

The next post will talk about how cidx is produced.

                       int r, g, b;
                       if (cidx < 0.25)
                       {
                             r = 255; g = (int)(255 * 4 * cidx); b = 0;
                       }
                       else if (cidx < 0.5)
                       {
                             r = (int)(255 - 255 * 4 * (cidx - 0.25)); g = 255; b = 0;
                       }
                       else if (cidx < 0.75)
                       {
                             r = 0; g = 255; b = (int)(255 * 4 * (cidx - 0.5));
                       }
                       else //if (cidx < 0.25)
                       {
                             r = 0; g = (int)(255 - 255 * 4 * (cidx - 0.75)); b = 255;
                       }
                       COLORREF color= RGB( r,g, b);
Back to top
 

The Administrator.
WWW  
IP Logged
 
YaBB Administrator
YaBB Administrator
*****
Offline


I love YaBB!

Posts: 679
The Land of YaBB
Re: The colourize map explained
Reply #1 - 09/08/11 at 12:27:08
 
When running in closed loop mode the o2 correction value is used to generate the colours. Ideally this value is 100%.

First off the range is bounded to +-10% correction, ie 90 to 110.

This range of 20 is then mapped to the 0 - 1 range to generate the colour.

If the map is too rich you will get an o2 correction < 100 and this will produce  red colour.

The colours can be thought to mimick the colourtune diagnostic tool. If rich you get a res/yellow flame and when lean you get a blue flame.

The following code fragment is used.
      
     double o2adj0 = (O2Adjust0 * 100.0 )/1024.0;
     if ( o2adj0 < 90.0 ) o2adj0 = 90.0;
     if ( o2adj0 > 110.0 ) o2adj0 = 110.0;
           cidx = ( o2adj0 - 90.0 ) / 20.0;


Current limitation is only one o2 sensor is used.
Back to top
 

The Administrator.
WWW  
IP Logged
 
YaBB Administrator
YaBB Administrator
*****
Offline


I love YaBB!

Posts: 679
The Land of YaBB
Re: The colourize map explained
Reply #2 - 09/08/11 at 15:25:13
 
For open loop I've made some lazy assumptions. If the target is negative I assume it's an LC1 in default configuration and bound it to between 1 and 3 volts. This is then mapped into a colour value.

If the target is positive I assume its a standard 0 to 1V sensor and use its value as is.

Like the closed loop above, rich mixture results in red.

           if ( O2Targets[1] < 0 )
           {
                 if ( O2V < 1.0 ) O2V = 1.0;
                 if ( O2V > 3.0 ) O2V = 3.0;
                 cidx = (3.0 - O2V) / 2.0;
           }
           else
           {
                 if ( O2V > 1.0 ) O2V = 1.0;
                       cidx = O2V / 1.0;
           }

Bug - I've been recently told I may have the open loop colourise the wrong way around. This will be fixed on the next release.
Back to top
 

The Administrator.
WWW  
IP Logged
 
Luhbo
Full Member
***
Offline


I Like My15M!

Posts: 186
Germany
Re: The colourize map explained
Reply #3 - 09/08/11 at 16:14:37
 
Thx for the info.
What if you don't make any assumptions in open loop but instead take the difference between target voltage and real voltage as the indicator?
What if people try to take advantage of the target map feature and try to establish maps lean here and rich there?
What if you have a closed loop log with 100% compensation values (might happen). Will these be treated as open loop results?

Wouldn't it make the whole project easier if you wouldn't care about open or cosed loop at all and instead only compare target and real values?

Hubert
Back to top
 
 
IP Logged
 
YaBB Administrator
YaBB Administrator
*****
Offline


I love YaBB!

Posts: 679
The Land of YaBB
Re: The colourize map explained
Reply #4 - 09/08/11 at 16:33:22
 
That's the not so lazy approach.

Most of what you ask for can be done with the current simpler approach.
Instead of trying to get it all green like for closed loop, you aim for a particular colour. For different targets you aim for different shades in different areas.

I know what you mean though and don't think it would be too difficult to add.
Back to top
 

The Administrator.
WWW  
IP Logged
 
Luhbo
Full Member
***
Offline


I Like My15M!

Posts: 186
Germany
Re: The colourize map explained
Reply #5 - 09/09/11 at 01:14:50
 
I'd still go for green dots, I'd just change the way cidx is defined in open loop. If you change o2Adjust0 to the result of a comparison between o2Targ0 and o20 you'd be there, I guess.
Basically it's the same as when running closed loop. But as the compensation factor is the result of a probably rather sensible feedback control process, dealing with oscillating, overcompensating, problems like that, and therefore is rather time dependend, the direct approach based on simple arithmetics might deliver results wich can be a bit easier to interpret.  In any case it's worth a try I'd say.
Talking about the time constant or lag in the closed loop compensation let me mention that the 1.60a version offered the very nice feature of displaying lines between the dots and, even nicer, the possibility to show only certain lines of the log file. This helped a lot with bigger log files where areas were red AND blue at the same time. You could look whether the color was valid for accelerating or decelerating. It's a pity that it has gone.

Hubert
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print