Skip to content

Commit

Permalink
CHT/EGT fixes
Browse files Browse the repository at this point in the history
MP scaling fix
  • Loading branch information
tomcourt authored and tomcourt committed Jul 25, 2017
1 parent 8faabe2 commit 21bcaf0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
9 changes: 5 additions & 4 deletions enguino/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define TACH_DIVIDER 4

// Exceed any of these and engine will be considered 'running'. Hobbs time will accumulate and engine alerts will appear. Setting to 0 will ignore that sensor
// Exceed any of these and engine will be considered 'running'. Hobbs time will accumulate and engine alerts will appear. A 0 value will cause that sensor to be ignored.
#define RUN_VOLT 130
#define RUN_OILP 10
#define RUN_TACH 200
Expand Down Expand Up @@ -38,12 +38,12 @@ const Sensor voltS = { st_volts, 0, 1, 0, SCALE(.200),
const Sensor fuelpS = { st_v240to33, 3, 1, 0, SCALE(.150), 0, SCALE(150./100.), 5, 20, 60, 80 };
const Sensor fuellS = { st_v240to33, DUAL(4), 1, 0, SCALE(.160), 0, SCALE(1.), 25, 50, 9999, 999 };
const Sensor tachS = { st_tachometer, 15, 0, 0, SCALE(1.), GMIN(0), GRNG(3000), -1, 500, 9999, 2700 };
const Sensor mapS = { st_volts, -1, 1, 31, SCALE(.32811), GMIN(210), GRNG(25/32.811), -1, -1, 9999, 9999 };
const Sensor mapS = { st_volts, 9, 1, 102, SCALE(.32811), GMIN(210),GRNG(1000*25/32.811), -1, -1, 9999, 9999 };
const Sensor chtS = { st_k_type_tcF, 16, 0, 0, SCALE(.25), GMIN(100*4), GRNG(400*4), -1, 150, 400, 500 };
const Sensor egtS = { st_k_type_tcF, 20, 0, 0, SCALE(.25), GMIN(1000*4), GRNG(600*4), -1, -1, 9999, 9999 };

// Labels
// ------
// Label and gradations
// --------------------
string oilpLV[] = { "80", "60", "40", "20" };
const int oilpLP[] = { VSEG(80./100.), VSEG(60./100.), VSEG(40./100.), VSEG(20./100.) };
string oiltLV[] = { "200", "150", "100" };
Expand Down Expand Up @@ -111,5 +111,6 @@ AuxDisplay auxDisplay[] = {
AUX(A,L,t, , voltS, voltS),
};

// number of pages shown on startup
#define AUX_STARTUP_PAGES 1

17 changes: 8 additions & 9 deletions enguino/printGauges.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void printHorizontal(const Gauge *g, int count) {
s = e;
}

printGaugeValue(0, offset+550, g->sensor, count);
printGaugeValue(0, offset+550, g->sensor, n);

int mark = scaleMark(g->sensor, readSensor(g->sensor, n)) << 3;
if (mark != FAULT) {
Expand Down Expand Up @@ -164,17 +164,17 @@ void printAuxHoriz(const Gauge *g, int count) {
#endif
int offset = 0;
for (int n=0; n<count; n++) {
int val = readSensor(g->sensor, n);
int val = scaleValue(g->sensor, readSensor(g->sensor, n));
if (leanMode && val != FAULT) {
if (val > peakEGT[n])
peakEGT[n] = val;
if (val+12 < peakEGT[n]) // minimium of 5 deg. F drop before showing negative
if (val+5 < peakEGT[n]) // minimium of 5 deg. F drop before showing negative
val -= peakEGT[n];
}

printGaugeRawValue(9200,offset+550,g->sensor,val,n);

int mark = scaleMark(g->sensor, val) << 3;
int mark = scaleMark(g->sensor, readSensor(g->sensor, n)) << 3;
if (mark != FAULT) {
print_P(F("<use xlink:href='#xmark' y='"));
print(offset + 800);
Expand Down Expand Up @@ -229,19 +229,18 @@ void printVerticalPair(const Gauge *g) {
}
}

// round gauge is
// round gauge sweeps is
// 3000 wide (centered at 1500)
// 2650 or so high
void printRound(const Gauge *g) {
#ifdef BOUNDING_BOX
print_P(F("<rect x='0' y='0' width='3000' height='2650' fill='none' stroke='orange'/>\n"));
#endif

// gauge sweeps 2400 units (-30.0 to 30.0 degrees)
print_g_translate(1500,1800); // center of the dial
print_g_translate(1500,1800); // center of the dial is origin
// border sweeps from -31 to 31 degrees, use code below to figure out magic x,y values in path
// logValue(ARCX(-.004),"x -");
// logValue(ARCY(-.004),"y -");
// logValue(ARCX(-.004),"x -");
// logValue(ARCY(-.004),"y -");

// all dimensions are multiplied by 10 for arc drawing because even small integer
// truncation errors in sub-arcs cause them to not align well with the black backdrop arc.
Expand Down
18 changes: 9 additions & 9 deletions enguino/sensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ int simulate1[24] = {
1000L*10/16, // 10 gal
1000L*2/16, // 2 gal
0, 0,
0, 0, 0, 0, 0, 0, 0, 2800,
310*4,320*4,330*4,340*4, // CHT
1010*4,1020*4,1030*4,1040*4 // EGT
0, 1000L*(30-3.117)/32.811, 0, 0, 0, 0, 0, 2800,
310*4,320*4,330*4,340*4, // CHT
1100*4,1200*4,1300*4,1400*4 // EGT
};

int simulate2[24] = {
Expand All @@ -61,9 +61,9 @@ int simulate2[24] = {
1000L*10/16, // 10 gal
1000L*5/16, // 5 gal
0, 0,
0, 0, 0, 0, 0, 0, 0, 2300,
310*4,320*4,330*4,340*4, // CHT
1010*4,1020*4,1030*4,1040*4 // EGT
0, 1000L*(20-3.117)/32.811, 0, 0, 0, 0, 0, 2300,
310*4,320*4,330*4,340*4, // CHT
1100*4,1200*4,1300*4,1400*4 // EGT
};

int simulate3[24] = {
Expand All @@ -74,9 +74,9 @@ int simulate3[24] = {
1000L*10/16, // 10 gal
1000L*5/16, // 5 gal
0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
310*4,320*4,330*4,340*4, // CHT
1010*4,1020*4,1030*4,1040*4 // EGT
0, 1000L*(10-3.117)/32.811, 0, 0, 0, 0, 0, 0,
310*4,320*4,330*4,340*4, // CHT
1100*4,1200*4,1300*4,1400*4 // EGT
};

#endif
Expand Down

0 comments on commit 21bcaf0

Please sign in to comment.