Change request, Modification to Fuel Pressure control code

Testing and development of Megasquirt 3

Moderators: jsmcortina, muythaibxr

Post Reply
hardline
Master MS/Extra'er
Posts: 503
Joined: Mon Sep 08, 2008 8:37 pm
Location: Peoria, IL

Change request, Modification to Fuel Pressure control code

Post by hardline »

Original code:

} else if ((ram5.fp_opt & 0x03) == 0x02) { // closed loop
long tmp1;
int tmp2;
unsigned char flags = PID_TYPE_B;


Suggested Code:

} else if ((ram5.fp_opt & 0x03) == 0x02) { // closed loop
long tmp1;
long tmp2;
unsigned char flags = PID_TYPE_C;

Would these changes cause major problems? If not, I'd like to test this code. I have difficulty maintaining fuel pressure with the existing code, and my PID simulations show that Type C would be significantly more stable

Changing tmp2 from int to long, would this provide better resolution on the fuel pressure output, or is it just a waste of memory? The resolution on the existing code is quite poor, looking for increased control resolution.
2000 ZX2 : Sequential COP, MS3 + MS3X + TinyIOx, PWM Returnless Fuel, Flex Fuel, Variable Geometry Intake Manifold, Garrett GTX2863R .82AR housing @ 15 psi
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Re: Change request, Modification to Fuel Pressure control co

Post by muythaibxr »

Type C might work better, but changing tmp2 to long won't give the output more resolution.
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
Post Reply