EGO PID BEST WAY TO SET UP?

General support questions and announcements for MS3. See also MS3 manuals.

Moderators: jsmcortina, muythaibxr

Post Reply
maych87
Helpful MS/Extra'er
Posts: 62
Joined: Sun Feb 26, 2017 2:19 pm

EGO PID BEST WAY TO SET UP?

Post by maych87 »

Hi

I am trying to correctly set up my ego PID. I have done some research to find a huge difference in the way people do this. I am wondering which person is correct if any from the three choices below. All of them have a different approach.

1.Tuning PID is the same general process regardless what you're trying to control. If you happen to own the boost control course then there is a complete module on this and how to tune it which is very valuable.

With closed loop fuel control I'd start by getting the main fuel table close as this means the closed loop system isn't going to be chasing huge errors - The less work any closed loop system needs to do, the better it will work.

Start by adding some proportional gain only and measure the effect. I start with a small amount and then begin doubling it until the system becomes unstable and oscillates. This let's you know the range of usable values and you need to back the P gain off again. I aim for a little oscillation/overshoot and then add some derivative gain which has the effect of slowing the system down and preventing overshoot. Too much D gain will result in slow response while too little can result in oscillation. Lastly you can add a little integral gain to correct any remaining error.

In essence I try and use the minimum gain possible. The biggest mistake I see is people trying to use closed loop fuel control to fix a poorly tuned fuel map. The results you'll get in this instance are likely to be poor.

2. PID control of anything is tuned basicly the same. You should tune Proportional control first, then add Integral control, after that add Derivative control if needed.

Proportional control is how fast the system reacts on measured unit change. Too big coefficient - you will see huge oscillations until measured unit reaches target. Too small - it will take a lot of time.
Integral control based on summing errors through past time. Too big coefficient will increase oscillations more and more until system fails.
Derivative control usually not needed. This control is an attempt to predict the unit change in near future.
Try to make engine running on steady AFR on minimum RPM you can hold steady AFR with closed loop control on and all coefficients dropped to zero. Slightly increase Proportional coefficient, change target AFR and measure delay between target change and system stabilized on that AFR using your logger, increase coefficient and repeat the procedure until you see overshooting (oscillations around new target). Step back and this should be the minimum time to reach the target hence the optimal P coefficient. Integral control tuned after Proportional, which should be on. The target is the same - to drop the delay between Target AFR change and wideband signal reaches that target. Usually that's enough.

3. Here's what I found during testing... "I" is the most important to tune and should be tuned first with P set to a low number and with D set to zero. Not enough "I" will not allow the AFR to reach it's target during steady state operation. If you notice that you are not reaching your target you need more "I". To much "I" will cause overshooting, and oscillation. I think "P" is how fast it responds when the AFR is changing, but I could never really notice P's effect during testing. D is a damper to prevent overshooting, but Ken recommends not to use it.



--
Regards


Sent from my iPhone using Tapatalk Pro
DHH
Helpful MS/Extra'er
Posts: 76
Joined: Mon Feb 27, 2017 12:19 am

Re: EGO PID BEST WAY TO SET UP?

Post by DHH »

I had a big explanation for you, but I didn't post it in time, got logged out and the system lost it.
This one will be much shorter.
I can't really help you with the EGO specifically, because I haven't got to the tuning stage with my build yet.

I noticed there was a misunderstanding of how a PID works. P does not react to the speed of change, it reacts "proportionally" to the amount of change. For a set monitored amount, it will change the controller a proportional amount. The actual amount it changes is dependent on the P value.

"I" is Integral and reacts to the amount of error/offset over a period of time. "P" alone (in any situation) will rarely get you the exact amount you desire. There will always be a bit of error. "I" will watch the error and after a period of time, it will influence the controller to try and pull the value closer to the desired amount. The amount of influence it has, and the period of time it waits to react, depends on the amount of the I value

"D" is derivative and reacts to the speed/rate of change. D is probably the trickiest of the 3 to master. D is used in controlling spikes and oscillations, but too much D can make things worse. Too much P or I can also cause spikes/oscillations, but D is much more susceptible.

I use to program PID's as part of job and for every situation I would always try and get as good control as possible with P first. (I and D would be zero).
Usually, I would move to "I" next, then D. Occasionally (on very rare instances) I would program D before I.
Once I started adding "I", I would always have to go back and tweak "P". Then once I felt I had as good control as possible with PI, I'd move to D. Then once I started adding D, I'd have to tweak PI....and sometimes I'd lose total control and start all over again. It's never a 1,2,3, done process.

I'd suggest doing a bit of research/reading on PID's. It's very important to understand the 3 distinct components of a PID controller to be able properly use one. Plus you'll be setting up the PID because you know how to set one up.
6.2L LS3, Procharged, MS3X V3.0
22' Donzi Classic
Not yet running...
http://www.donzi.net/forums/showthread. ... 502-to-LS3 (Disclaimer: Contains naive info :D )
Dennis_Zx7r
Experienced MS/Extra'er
Posts: 374
Joined: Thu May 26, 2016 1:25 pm
Location: Germany

Re: EGO PID BEST WAY TO SET UP?

Post by Dennis_Zx7r »

The big problem here is that EGO PID isn't a "standard" PID but a type C.
The I-term seems to behave like the classical P-term, and the D like the classical I-term iirc. For my setup some I-term plus a little D-term seems to be all that's needed, P didn't seem to make any noticeable difference.
My project: Link
maych87
Helpful MS/Extra'er
Posts: 62
Joined: Sun Feb 26, 2017 2:19 pm

Re: EGO PID BEST WAY TO SET UP?

Post by maych87 »

These use a type “C” loop, and the P part doesn't get the system to converge on its own. So the third approach is the recommended one – you'll want to focus mostly on the “I” term. This is also what the team who wrote the software recommends – see section 4.8.3 of the manual at this link:

http://www.msextra.com/doc/pdf/html/Meg ... .5-88.html

Matt Cramer DIYAutoTune Support


Sent from my iPhone using Tapatalk Pro
DHH
Helpful MS/Extra'er
Posts: 76
Joined: Mon Feb 27, 2017 12:19 am

Re: EGO PID BEST WAY TO SET UP?

Post by DHH »

Well I wish I would have waited for you guys to respond before posting.
I’ve never dealt with a type C controller before. Looks as if I’m going to have to relearn my tuning strategy.
6.2L LS3, Procharged, MS3X V3.0
22' Donzi Classic
Not yet running...
http://www.donzi.net/forums/showthread. ... 502-to-LS3 (Disclaimer: Contains naive info :D )
maych87
Helpful MS/Extra'er
Posts: 62
Joined: Sun Feb 26, 2017 2:19 pm

EGO PID BEST WAY TO SET UP?

Post by maych87 »

Does anyone have a specific method they use when applying what I learned above?

Do you hold an rpm and make your adjustments while holding the rpm steady or does the vehicle have to be under load. Sorry if this is a dumb question.


Sent from my iPhone using Tapatalk Pro
megamind
Experienced MS/Extra'er
Posts: 155
Joined: Wed Dec 04, 2019 7:21 am
Location: scotland

Re: EGO PID BEST WAY TO SET UP?

Post by megamind »

Sorry to drag up an old thread, but it would be good to see general opinions on the subject, especially as RC11 firmware allows better control
EFi source MS3 Goldbox, Peugeot 306 Rallye XU10J4RS turbo 316bhp 295ftlb on stock internals
Microsquirt V3 Peugeot 205 GTi 2.0 8v turbo 202 bhp 240 ftlb
'Megasquirt can do everything'....no one has instructions for it to do everything!
Djovani_jr
Experienced MS/Extra'er
Posts: 343
Joined: Wed Jun 19, 2019 12:21 am
Location: Sakhalin Island

Re: EGO PID BEST WAY TO SET UP?

Post by Djovani_jr »

What is the best strategy for tune up an Ideal PID type B?
- I => P
Or
- P => I

FW 1.5.2 RC12
Toyota Caldina GT-Turbo Type 5MT
3S-GTE Gen4
jamies
Master MS/Extra'er
Posts: 525
Joined: Tue Apr 07, 2009 12:22 am

Re: EGO PID BEST WAY TO SET UP?

Post by jamies »

depends on firmware version but later ones ive found P & I somewhere around 50% is a good starting point. Earlier firmware P at 30 and I at 40 was my initial numbers and fine tuned by looking at datalogs
thats just my initial settings obviously theres going to be some variables that affect thi between different engines, wideband controllers etc
Djovani_jr
Experienced MS/Extra'er
Posts: 343
Joined: Wed Jun 19, 2019 12:21 am
Location: Sakhalin Island

Re: EGO PID BEST WAY TO SET UP?

Post by Djovani_jr »

jamies wrote:depends on firmware version but later ones ive found P & I somewhere around 50% is a good starting point. Earlier firmware P at 30 and I at 40 was my initial numbers and fine tuned by looking at datalogs
thats just my initial settings obviously theres going to be some variables that affect thi between different engines, wideband controllers etc
What latest or earlier fw is?
Toyota Caldina GT-Turbo Type 5MT
3S-GTE Gen4
kikkegek
Master MS/Extra'er
Posts: 435
Joined: Thu Jan 14, 2016 12:14 am
Location: Netherlands, The Hague
Contact:

Re: EGO PID BEST WAY TO SET UP?

Post by kikkegek »

Cool topic. I'd love to see some log files of people that really have got this down!

I have my tuning topic
viewtopic.php?f=131&t=74475

I share my tunes and log files in there. Im tuning a LPG injection system on my Big Block Chevy and I have only enabled 10% I for now. No P and no D yet. If I add mode I then the AFR at idle will start oscilating. And what I see in my log files is that during cruise and idle the EGO control does a nice job. But when I change load, so start driving or increase throttle during driving I see big (relatively) oscilations in my AFR and no quick response. So I think I need to add P to have it respond proportional. But just curious of what a log file of somebody looks like that has the EGO controlled dialed in correct and what settings he used.

that way I could check what it looks like compared to mine. especially cause I want to add boost later and too lean AFRs on load changes could potentially hurt my engine...dont want that ;-)
my project page, BBC 454 with LPG vapour injection:
my BBC 454 LPG vapour injection tuning story 8)

my Facebook projectpage:
My 1977 GMC C15 Suburban "Storm" 8)
Post Reply