GWFXT wrote:
Overall a very nice piece of work. Just a few issues with the Throttle tables and incorrect values I'm getting.
EG. RPM 1600, accel pedal % 17.5, Req Torque is 117.7812, RT Base (RPM) is 245.1.
The TP versus Accel output returns the incorrect value as 14.4774. Should be 11.9 in this example.
The Calc needs to be RQ Value / RT Base (RPM).
For my example, the RQ Accel table at 1600 rpm is 117.7812. Divide this by 245.1 from the RPM Base to get 0.4805. Look up Target Throttle plate position for 0.480 and 1600 RPM to get the throttle plate opening value. For me this it results in a TP opening of approx 11.9, not the incorrect value of 14.4774.
Also the whole 800 RPM row has very low TP values returned. TP opening is 1.76 at 98 accel. For me this should be nearly 100% TP.
From greater than 21 Accel pedal the TP opening angles are returning max values for most RPMs. Again this is probably a misalignment reference to the RT Base (RPM) table. The TP opening for me is more gradual and doesn't call for full TP until 65 % accel and above as per Airboys Throttle tables Tab spread sheet.
RT Base at 800 RPM (First column) does not show decimals. Would be good if you could allow manual entry into each input table values and then recalc on new values. Then we could copy back into Romraider.
Hi, the calculations are described in usage tab. I cant figure out what you mean from your 'exempli gratia' unless I see the tables you have (particularly all 3 tables axis and values) and confirm the calculations. When you click on cell in "Requested Torque - Accelerator Pedal" which is the base table you will see all axis cells and value cells which were used in calculations. Also, when you write "Look up Target Throttle plate position for 0.480 and 1600 RPM to get the throttle plate opening value. For me this it results in a TP opening of approx 11.9, not the incorrect value of 14.4774" you're not actually saying how you do the "Look up". I use this 2D bilinear interpolation formula for value calculation (because most of the time the value to look up X-axis from "Target Throttle Plate Position" will not be I direct match, and sometimes the RPM (Y-axis) value may not be a direct match):
/**
* Method returns a value interpolated from 2D grid
* (3D RomRaider tables) using bilinear interpolation
* @param x is X value you want to interpolate at
* @param y is Y value you want to interpolate at
* @param x0 is nearest x-axis value less than X
* @param x1 is nearest x-axis value greater than X
* @param y0 is nearest y-axis value less than Y
* @param y1 is nearest y-axis value greater than Y
* @param x0y0 is the table value at x0 and y0
* @param x0y1 is the table value at x0 and y1
* @param x1y0 is the table value at x1 and y0
* @param x1y1 is the table value at x1 and y1
* @return
*/
double bilinearInterpolation(double x, double y, double x0, double x1, double y0, double y1, double x0y0, double x0y1, double x1y0, double x1y1) {
double t1, t2;
if (y1 == y0) {
t1 = x0y0;
t2 = x1y0;
}
else {
t1 = (y - y0) * (x0y1 - x0y0) / (y1 - y0) + x0y0;
t2 = (y - y0) * (x1y1 - x1y0) / (y1 - y0) + x1y0;
}
if (x1 == x0)
return t1;
return (x - x0) * (t2 - t1) / (x1 - x0) + t1;
}
Please PM me all 3 of your input tables so I could check the calcs.