pwm fuel pump control and pid

Tuning concepts, methods, tips etc.

Moderators: jsmcortina, muythaibxr

Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

pwm fuel pump control and pid

Post by Yves »

Anyone try the closed loop pid control of the fuel pump ? I wonder how you actual set the pid parameters as there is no test feature for it and you can only test it during driving
billr
Super MS/Extra'er
Posts: 6828
Joined: Sun May 15, 2011 11:41 am
Location: Walnut Creek, Calif. USA

Re: pwm fuel pump control and pid

Post by billr »

I assume you are looking for input from somebody other than me...
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: pwm fuel pump control and pid

Post by Yves »

billr wrote:I assume you are looking for input from somebody other than me...
Not exactly. The question here is a bit different from the ms3 general.

If you want to share what you have used for pid factors that worked.
Speedy_G
Experienced MS/Extra'er
Posts: 195
Joined: Fri Aug 01, 2014 8:30 am

Re: pwm fuel pump control and pid

Post by Speedy_G »

yes a test mode for PWM fuel pump is really missing.

i will have to test it with the engine running, too.
Maybe i can start in a week. Then i could tell you my experiences.
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: pwm fuel pump control and pid

Post by Yves »

Speedy_G wrote:yes a test mode for PWM fuel pump is really missing.

i will have to test it with the engine running, too.
Maybe i can start in a week. Then i could tell you my experiences.
Thanks Speedy !
Rick Finsta
Master MS/Extra'er
Posts: 548
Joined: Fri Dec 10, 2010 4:41 pm

Re: pwm fuel pump control and pid

Post by Rick Finsta »

I'm running MS2 with my Fuelab and PWM control so no PID experience here, sorry.
Speedy_G
Experienced MS/Extra'er
Posts: 195
Joined: Fri Aug 01, 2014 8:30 am

Re: pwm fuel pump control and pid

Post by Speedy_G »

took a bit longer, but today i could run some tests on the bench.

For me at the moment P=15 I=20 and D=100 is working good.
Made a lot of tests, recording everything and then comparing.

But i have to say, that you will have make your own tests. Because the volumina between pump/ sensor and Injectors makes big differences.
And the pump itself too. And Injector data and so on.
Best is locate the sensor as near as possible to the injectors. Then your system can react faster
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: pwm fuel pump control and pid

Post by Yves »

Just a couple of questions come to mind :
- what type of sensor do you use ? absolute, relative,...
- what are the settings you have used in TS for the FP ?
Speedy_G
Experienced MS/Extra'er
Posts: 195
Joined: Fri Aug 01, 2014 8:30 am

Re: pwm fuel pump control and pid

Post by Speedy_G »

I have modded the firmware, so that i have a fuel pressure target table in closed-loop mode, instead of only a single target value like in the release firmware.
My sensor is relative. But i concerned that directly in the firmware. And the real Closed-Loop Target concernes also the MAP-Pressure.
So if you enter 3 bar its always 3bar above the MAP.

MAX PWM is 100
and Minimum is the percentage where the pump actually starts to deliver. Below that point the pump makes strange noise. I dont think its good to use a setting below.
But at very low load (so low injector pulsewidt) its possible that you get too high pressure. Because for example 15% minimum duty and only idling will give you 4 bar instead the 3bar target. Because that 15% Duty Cycle delivers more than you inject. But you can't go lower with Minimum Duty Cycle, because there the pump is not really good working. (Strange Noise and no delivery at all)
Normally the Megasquirt should also be able to output 0% Duty Cycle and the next step would bei the minimum Duty. And from that point on just normal.
But it can't!

But i have something in mind, to change inside the firmware. Because now it only checks if the output DutyCycle from the Closed-Loop term is below Minimum DC.
If no it will use this DC. If yes it will use Minimum DC! I could try to use Off-Duty (0%) instead of Minimum and see how its going. Maybe then its possible to achieve "low" 3 bar pressure when idling.
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: pwm fuel pump control and pid

Post by Yves »

Great if you can program firmware to your liking. Unfortunately I don't understand that part well enough.

Anyway, to combat the high pressure at low idle. I was thinking on using my FPR for that. Basically you can set the pressure so that with a certain pw (say 20%) it will have no return, above that it will have the fpr open the return so the pressure is limited. In effect the most amount of fuel return takes place during idle conditions.

I have to add one feature however and that is to prevent vapor lock and that is a fixed orifice return.
Speedy_G
Experienced MS/Extra'er
Posts: 195
Joined: Fri Aug 01, 2014 8:30 am

Re: pwm fuel pump control and pid

Post by Speedy_G »

yesterday i tested a different fuel pump. And this one needs complete different PID Parameters.
There i also had no problem with the minimum duty cycle. As the new (different) fuel pump had a different characteristic.
So there it was no problem with for example 2 bar target and very low duty cycle.

BUT its a very huge problem that there is no bloody testmode for a PWM fuel pump.
I thought maybe its possible to activate the Injector testmode when the engine is on the stim. So that you can measure Deadtimes, Flow-Rate with a PWM fuel pump.
But its not possible.

So its impossible to measure deadtimes and so on when you have a PWM fuel pump! Have criticized this in a few other threads here, ignored by devs!
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: pwm fuel pump control and pid

Post by Yves »

As for the low pwm control : can you try out what i proposed ?

I intend to mount a fitting into the pressure sensor port what a predrilled .5 mm hole to bleed off some pressure to the return ( if needed you can drill a different hole to suit your needs).
The set the pwm at the minimum speed you want to run the pump at.
Adjust the fpr so that with the minimum pwm you get your desired pressure.
From there on let pid control pump speed to maintain the pressure at the correct value

As for development : why not program a test procedure yourself.
I think the main issue is to get an rpm signal.
Speedy_G
Experienced MS/Extra'er
Posts: 195
Joined: Fri Aug 01, 2014 8:30 am

Re: pwm fuel pump control and pid

Post by Speedy_G »

makes no sense for my purpose with a FPR.
Because i want for example 3 bar at idling and 5 bar at high Load.
So i cant install a 3 bar FPR, i would have to use a 5 bar, and then i would have the same problem like before.

But like written, its no problem with the other fuel pump. It has a different characteristic which makes that possible.
I can set it to 2 bar with only a few percent duty cycle and its working with FP-Duty cycle above Minimum Duty cycle.

And rpm signal for me is no problem. I already did all the tests with a LabView VI, where i can set the rpm i want and output that to the megasquirt.
Without that its not possible to test the PWM Fuel Pump at all !!

Concerning the Injector test mode... its more complicated than it seems at first. It seems like MS uses a different pin/portlayout in testmode.
I managed to get the PID structure running in testmode and give me the right fuel pump duty cycle. But MS does nothing with this Duty Cycle, because its in Testmode.
You cant compare Testmode with Engine running, its complete different thing.
But i dont know yet how i can apply this duty cycle to the right output port. This is a bit more complicated.
Its no problem to turn on/off a port, but with PWM its difficult.


But you have to consider, in the release firmware there is a PWM fuel Pressure function and a Injector Test function.
So normally you suppose "hey its both there, then you should be able to use the injector test mode with a pwm fuel pump".
But its not possible, thats ridiculous.
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: pwm fuel pump control and pid

Post by Yves »

I would think you will still can set 5 bar in other ranges ; the fpr is set at your min pressure at idle with min pump speed. A higher pump speed will result in a higher press that way. The way you get the pressure higher at idle is by employing more pressure on the spring diafragm. However since at the same time pump speed is low you have a fair amount of pressure on it. If you then crank up pump speed it will create a higher pressure
Speedy_G
Experienced MS/Extra'er
Posts: 195
Joined: Fri Aug 01, 2014 8:30 am

Re: pwm fuel pump control and pid

Post by Speedy_G »

oh and FP37 isnt working when youre using PWM Fuel Pump Mode :lol:

Cost me a few hours to find that out.
Could cause some problems when you convert from normal mode to PWM fuel pump mode. (Depending on your wiring)
Had to change the firmware to fix this.
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: pwm fuel pump control and pid

Post by Yves »

FP37 = Fuel pump output on the DB37 ?

Found that out right away when I installed mine.
Speedy_G
Experienced MS/Extra'er
Posts: 195
Joined: Fri Aug 01, 2014 8:30 am

Re: pwm fuel pump control and pid

Post by Speedy_G »

yes fuel pump output 37.

Didnt know that and in some other thread somebody claimed that FP37 is always active (Priming and Engine running) No matter if you use Open or Closed Loop.
Just wanted to say this, to help others for their wiring.

Today i could finally test the PWM on the bike. But after maybe around 8 minutes i get troubles with the fuel pump.
Its possible that i never had the pump running for this time on the bench (without interuption)

Then the pump begins suddently to make strange noises. Then it gets louder and finally the amperage starts to swing and so the fuel pressure does.
But the PWM output of MS3 and also of the Solid-State-Relais looks fine, there is no change. I checked it with the o-scope.

At first i added a flyblack diode. Because without that diode i had voltage spikes of over 100V because the inductivity of the fuel pump.
With the diode it was reduced to around 2-5V !

But this didnt help with the problem. I think a higher PWM-Frequency could help as the Megasquirt has very low frequencies.
I'll have to see if i can change this in the firmware easily?

Apart from that problem it was running good.
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: pwm fuel pump control and pid

Post by Yves »

Sounds like a cavitation issue or vapor lock.
Speedy_G
Experienced MS/Extra'er
Posts: 195
Joined: Fri Aug 01, 2014 8:30 am

Re: pwm fuel pump control and pid

Post by Speedy_G »

spoke to a few people, which have much experience and knowledge with such stuff.
And they both said, that the output PWM frequency of the Megasquirt is too low, and this leads to this problems.
But of course this depends on the fuel pump you use.
billr
Super MS/Extra'er
Posts: 6828
Joined: Sun May 15, 2011 11:41 am
Location: Walnut Creek, Calif. USA

Re: pwm fuel pump control and pid

Post by billr »

I have had no joy trying to use the FP pressure control function, but really doubt it is because the PWM frequency is too low. I can smoothly set pressure using the 78 Hz in "test mode". And, my gut tells me that a FP armature has a lot of inductance; raising the frequency much above the inherent frequency due to commutation isn't going to do much besides increase losses due to inter-winding capacitance and eddy-currents in the laminations.
Post Reply