these videos i have found really helpful in my tuning journey, I greatly appreciate it and am excited to keep learning about megasquirt and how things work and why.
Cheers for the vid man, I did try closed loop idle on my 1.6 turbo'd mx5, but for some reason I couldn't get it to idle as well as the open loop.. Looks like I'll just have to keep tinkering. This vid gave me a bit more understanding on PID though!
Keep trying! I think it's worth it, closed loop and especially with PID can keep everything very smooth in basically all conditions and also keep you from getting lean accidentally in boost.
thanks for the videos man. I can't wait for spring to start putting them to use, but I feel like allot of this information will really help. My idle is garbage (it idles, but not like it should) and I can't wait to reference your videos over and over and get The Perfect Idle TM
First I want to say thank you for making the video. I currently use 20/5/0. And it gets really close but it never quite gets there... which I'm ok with. For the first 14yrs of using megasquirt I didn't even use a ego control. The main reason for that was because I was using a NGK powerdex wideband and it has roughly a 1 second delay and it made it really hard to use at least with my ECU. I have a v2.2 upgraded to megasquirt 2. I recently within the past year or so started using the innovative wideband boost controller (scg-1) and it works really well with ego and pid. I wasn't going to go with Innovative but I got a really good deal on it 100 bucks they didn't know how to use it and it works great. The only problem I run into is when I use more than 8% Authority gain it oscillates really bad up to that point it's fine it doesn't oscillate at all... any ideas? My gut feeling is that my ECU just doesn't have the computing power to handle it and that I really need to go to a 3.0 or a 3.57 board.
Thanks for the support, I appreciate it. 8% authority is actually a good number to shoot for, your fuel table should do the main work with ego just tweaking to adjust for conditions. Sometimes it's good to turn it off and drive for a while with autotune running to verify your main fuel table. With that good you can stabilize your PID numbers without it fighting you. Your numbers seem fine but if you get occilation you'll want to back off the P term a bit until it's mostly gone and then add in some I to speed up reaching target.
I've got a pretty dialed in. For some reason ego control works way better if I'm pulling fuel rather than adding fuel. The only problem that I'm having with megasquirt is noise filtration... anytime I turn it on the car won't run. The way I turn it on is I have the car off but ECU on turn noise filtration on Burn power cycle the ECU turn it back on verify that everything is the way I want it and then try to start and it won't. To get the car running again sometimes I just going to load my last tune and will get it to run and other time I've had to reload firmware along with an old tune. I've been driving this car for 10-12 years I've put almost a 100k miles on my megasquirt and they're hard miles. I'm just really tired of it misfiring at idle and just off idle. If I watch the data logs it goes to 66000 RPM when it misfires. It only does it under 2,000 RPM once in a blue moon it'll misfire above that. Any ideas?
@@alltheboost5363 Put a resistor in line with the crank sensor 10k. Put a diod in between the power and ground wires on the iac valve. No more misfire. No more pulsing in the ground planes.
I finally got noise filtering to work but only if ego is off. I do need to get my fuel map a little more dialed in and I think that may have something to do with it. I just switched from 100ll back to 93. I think the 100ll was a little much with water meth. Lol in a couple days I'm going to an open test and tune. Excited to get the top in tuned well. Thanks for the advice
Yeah it's important to get the fuel ve table fairly close before really dialing in the PID tune via ego control. You can keep the authority fairly low like 10%. If you see that the EGO control is trying to add fuel or subtract fuel a lot then you should go back to the fuel table and adjust it.
1:32 - the Simple algorithm is not PID control. When using simple, it compares reported AFR to target AFR. If it's richer, it decreases EGO Correction by the Controller Step Size %, if it's leaner, it increases EGO correction by the Controller Step Size %. You will notice that Controller Step Size % is disabled when you select the PID algorithm. 8:34 - MegaSquirt uses a type C PID controller for nearly all PID loops; the P term is uncoupled from the SP and cannot correct error. If you only use the P gain and zero out the other gains, it will only react to changes in the PV, but it cannot reduce error except by accident. The I gain must be used for any error correction to occur. Note that in a beta release of MS3 firmware there was an attempt to use a type B controller but based on the latest MS3 firmware release notes (1.6.0) I don't believe that change was used in production. Additionally in MS3, the Generic Closed-Loop options lets you choose between type B and type C, but you cannot make this choice for idle/EGO/boost PID loops.
Great videos! What can I do help with AC running? I have the idle AC set up but maybe it's not aggressive enough. After I blip the throttle the rpms drop below my 850 target and stay low.
Hey man i have tried to reproduce this. I first tested my setup (MS2) with the simple Algorithm to see if everything worked. It did, ego correction followed target but veeery slowly. After that i switched to PID and and started with P 2. Opened the AFR target table and switched the cell from 12 to 16 up and down with 20 seconds in between. I could clearly see the the step change in the target graph in the Logger view in TS and MLV. But EGO correct kept flat 100%. So is started going to P10, 20, 40, 80, 160, 200. But i never got oscilation or overshoot in the 20 second AFR 12-16 switching. What am i doing Wrong?
If the ego correction gauge stays at 100 it's not adding or subtracting fuel. It may mean the incorporate afr target is not turned on on the basic/load general settings screen. Also on the ego control screen it means the parameters to allow ego control are not being met so it never enters EGO. Hope this helps!
@@OGPedXing yes might help. My theory was to turn incorp. Target AFR off because if I don't the afr will immediately follow the target when i change something in target afr table because the target AFR are in the fuel calculation when incorp is on. And then EGO correction does not do anything because there won't occur an error between target and measured AFR and so you cant test the response of the EGO algorithm. In my understanding incorp AFR target and EGO correction are 2 different things. Incorp AFR target is just a factor in the fuel calculation. EGO is a algorithm that responds to the difference between afr target and measured afr. Does this make any sense?
@@robbedoes1985 you can do it like you're saying with ve analyze live (autotune) but for EGO control it needs incorporate afr. The ve table represents exactly the fuel to be added at a given rpm and load (kpa). It's never wrong relative to itself (unless your injectors aren't working), it just squirts that amount regardless. To be wrong, the afr needs to be inspected. If your ve entry says 40 at a point and the desired afr is 14.7 but observed afr is 14.0 then ego knows to subtract fuel. It will then do this in line with your PID configuration up to the level of authority it has. So 10% means it will subtract up to 4 from that ve entry in real time. Good PID configuration helps it do that quickly without overshooting and going lean.
Yoy. Tried again. Turned on incorp. AFR Target. And reduced ego delay after start. Re-did the 2,10,20 etc P settings change. And toggled AFR target. EGO correction followed the changes nice, the higher P the faster the response but it never started oscillating. Also not with a prop gain of 200. Any idea why no oscillation is happening? What do you use for Lambda averaging lag factor in general settings and ignition events per step in ego settings?
ahh... yes, integration: the area under the curve between 2 limits... brings back college engr math. Calculus: the language of physics and engineeering. Anywho... pretty good video. Does the EGO correct the VE table?? or the VE value is just the starting point for all the math?? Just got mine running the other day, this tuning stuff is expansive, thanks again
The ve table is the starting point and then the ego process tries to compensate for things happening like temperature by adding or pulling fuel so you hit your afr target. Ideally EGO only needs to modify the ve table by 2-3% max at any given time. So you want to aim to get the ve table as optimized as possible. This makes further tuning a lot easier.
Indirectly... Tip in / Accel Enrichment settings will override normal EGO temporarily. It will squirt in some extra fuel to deal with the burst of air from the throttle. However this is completed quickly and then normal EGO and PID takes over after that trying to make your AFR match what you set in the table. Getting Accel Enrichment tuned can help EGO come back more quickly. This is because getting the right amount of fuel in will keep it from stumbling and will keep PID from having to compensate too much.
Hmm.. ok well in tuning you want to reach various targets as quickly as possible but without overshooting. This is what a PID algorithm does. When done with an understanding of the fundamentals, it will be far superior to basic modes in your tuner app.
Still the best group of tuning videos on yt for tunerstudio. And for general explanation! Cheers!
This was incredibly informative and helpful! Thank you!
these videos i have found really helpful in my tuning journey, I greatly appreciate it and am excited to keep learning about megasquirt and how things work and why.
@Yael Preston yeah nice try, not falling for that
@Brantley Vihaan yeah nope
Really great info. I'm learning a lot. Wish it wasn't winter here so I can run the car and play with the tune more. Keep up the good work!
Cheers for the vid man, I did try closed loop idle on my 1.6 turbo'd mx5, but for some reason I couldn't get it to idle as well as the open loop.. Looks like I'll just have to keep tinkering. This vid gave me a bit more understanding on PID though!
Keep trying! I think it's worth it, closed loop and especially with PID can keep everything very smooth in basically all conditions and also keep you from getting lean accidentally in boost.
thanks for the videos man.
I can't wait for spring to start putting them to use, but I feel like allot of this information will really help.
My idle is garbage (it idles, but not like it should) and I can't wait to reference your videos over and over and get The Perfect Idle TM
Thank you for the video. I need to play with EGO. Mine isolates wildly, does not hit the target. Runs better with EGO disabled... need more videos :)
I plan to add a deeper dive into ego pretty soon actually...next up is e85 though!
First I want to say thank you for making the video. I currently use 20/5/0. And it gets really close but it never quite gets there... which I'm ok with. For the first 14yrs of using megasquirt I didn't even use a ego control. The main reason for that was because I was using a NGK powerdex wideband and it has roughly a 1 second delay and it made it really hard to use at least with my ECU. I have a v2.2 upgraded to megasquirt 2. I recently within the past year or so started using the innovative wideband boost controller (scg-1) and it works really well with ego and pid. I wasn't going to go with Innovative but I got a really good deal on it 100 bucks they didn't know how to use it and it works great. The only problem I run into is when I use more than 8% Authority gain it oscillates really bad up to that point it's fine it doesn't oscillate at all... any ideas? My gut feeling is that my ECU just doesn't have the computing power to handle it and that I really need to go to a 3.0 or a 3.57 board.
Thanks for the support, I appreciate it. 8% authority is actually a good number to shoot for, your fuel table should do the main work with ego just tweaking to adjust for conditions. Sometimes it's good to turn it off and drive for a while with autotune running to verify your main fuel table. With that good you can stabilize your PID numbers without it fighting you. Your numbers seem fine but if you get occilation you'll want to back off the P term a bit until it's mostly gone and then add in some I to speed up reaching target.
I've got a pretty dialed in. For some reason ego control works way better if I'm pulling fuel rather than adding fuel. The only problem that I'm having with megasquirt is noise filtration... anytime I turn it on the car won't run. The way I turn it on is I have the car off but ECU on turn noise filtration on Burn power cycle the ECU turn it back on verify that everything is the way I want it and then try to start and it won't. To get the car running again sometimes I just going to load my last tune and will get it to run and other time I've had to reload firmware along with an old tune. I've been driving this car for 10-12 years I've put almost a 100k miles on my megasquirt and they're hard miles. I'm just really tired of it misfiring at idle and just off idle. If I watch the data logs it goes to 66000 RPM when it misfires. It only does it under 2,000 RPM once in a blue moon it'll misfire above that. Any ideas?
@@alltheboost5363 Put a resistor in line with the crank sensor 10k.
Put a diod in between the power and ground wires on the iac valve.
No more misfire.
No more pulsing in the ground planes.
I finally got noise filtering to work but only if ego is off. I do need to get my fuel map a little more dialed in and I think that may have something to do with it. I just switched from 100ll back to 93. I think the 100ll was a little much with water meth. Lol in a couple days I'm going to an open test and tune. Excited to get the top in tuned well. Thanks for the advice
thanks man, very helpfull and very clear video
Thank you só much for this vídeo , it’s amazing !
Thanks for the lesson
Any where that I have missed VE fuel table adjustment? Just installed megasquirt in my daily driver! You have saved me so much headache!
Yeah it's important to get the fuel ve table fairly close before really dialing in the PID tune via ego control. You can keep the authority fairly low like 10%. If you see that the EGO control is trying to add fuel or subtract fuel a lot then you should go back to the fuel table and adjust it.
1:32 - the Simple algorithm is not PID control. When using simple, it compares reported AFR to target AFR. If it's richer, it decreases EGO Correction by the Controller Step Size %, if it's leaner, it increases EGO correction by the Controller Step Size %. You will notice that Controller Step Size % is disabled when you select the PID algorithm.
8:34 - MegaSquirt uses a type C PID controller for nearly all PID loops; the P term is uncoupled from the SP and cannot correct error. If you only use the P gain and zero out the other gains, it will only react to changes in the PV, but it cannot reduce error except by accident. The I gain must be used for any error correction to occur. Note that in a beta release of MS3 firmware there was an attempt to use a type B controller but based on the latest MS3 firmware release notes (1.6.0) I don't believe that change was used in production. Additionally in MS3, the Generic Closed-Loop options lets you choose between type B and type C, but you cannot make this choice for idle/EGO/boost PID loops.
Great videos! What can I do help with AC running? I have the idle AC set up but maybe it's not aggressive enough. After I blip the throttle the rpms drop below my 850 target and stay low.
you need a idle air valve.
Hey man i have tried to reproduce this. I first tested my setup (MS2) with the simple Algorithm to see if everything worked. It did, ego correction followed target but veeery slowly. After that i switched to PID and and started with P 2. Opened the AFR target table and switched the cell from 12 to 16 up and down with 20 seconds in between. I could clearly see the the step change in the target graph in the Logger view in TS and MLV. But EGO correct kept flat 100%. So is started going to P10, 20, 40, 80, 160, 200. But i never got oscilation or overshoot in the 20 second AFR 12-16 switching. What am i doing Wrong?
If the ego correction gauge stays at 100 it's not adding or subtracting fuel. It may mean the incorporate afr target is not turned on on the basic/load general settings screen. Also on the ego control screen it means the parameters to allow ego control are not being met so it never enters EGO. Hope this helps!
@@OGPedXing yes might help. My theory was to turn incorp. Target AFR off because if I don't the afr will immediately follow the target when i change something in target afr table because the target AFR are in the fuel calculation when incorp is on. And then EGO correction does not do anything because there won't occur an error between target and measured AFR and so you cant test the response of the EGO algorithm. In my understanding incorp AFR target and EGO correction are 2 different things. Incorp AFR target is just a factor in the fuel calculation. EGO is a algorithm that responds to the difference between afr target and measured afr. Does this make any sense?
@@robbedoes1985 you can do it like you're saying with ve analyze live (autotune) but for EGO control it needs incorporate afr. The ve table represents exactly the fuel to be added at a given rpm and load (kpa). It's never wrong relative to itself (unless your injectors aren't working), it just squirts that amount regardless. To be wrong, the afr needs to be inspected. If your ve entry says 40 at a point and the desired afr is 14.7 but observed afr is 14.0 then ego knows to subtract fuel. It will then do this in line with your PID configuration up to the level of authority it has. So 10% means it will subtract up to 4 from that ve entry in real time. Good PID configuration helps it do that quickly without overshooting and going lean.
Yoy. Tried again. Turned on incorp. AFR Target. And reduced ego delay after start. Re-did the 2,10,20 etc P settings change. And toggled AFR target. EGO correction followed the changes nice, the higher P the faster the response but it never started oscillating. Also not with a prop gain of 200. Any idea why no oscillation is happening? What do you use for Lambda averaging lag factor in general settings and ignition events per step in ego settings?
ahh... yes, integration: the area under the curve between 2 limits... brings back college engr math. Calculus: the language of physics and engineeering. Anywho... pretty good video. Does the EGO correct the VE table?? or the VE value is just the starting point for all the math?? Just got mine running the other day, this tuning stuff is expansive, thanks again
The ve table is the starting point and then the ego process tries to compensate for things happening like temperature by adding or pulling fuel so you hit your afr target. Ideally EGO only needs to modify the ve table by 2-3% max at any given time. So you want to aim to get the ve table as optimized as possible. This makes further tuning a lot easier.
@@OGPedXing so the ve table is not changed by ego control, correct??
Correct. Its values stay the same during EGO. Autotuning/VE analayze on the other hand will change the ve table directly.
so what values did you end up putting in your final tune for PID? Did you keep PID at 0%?
For my ego PID, I've been running p=15, I=6, d=2
Would the tip in settings have an influence on the PID
Indirectly... Tip in / Accel Enrichment settings will override normal EGO temporarily. It will squirt in some extra fuel to deal with the burst of air from the throttle. However this is completed quickly and then normal EGO and PID takes over after that trying to make your AFR match what you set in the table. Getting Accel Enrichment tuned can help EGO come back more quickly. This is because getting the right amount of fuel in will keep it from stumbling and will keep PID from having to compensate too much.
As someone who has never messed with PID, I learned nothing
Hmm.. ok well in tuning you want to reach various targets as quickly as possible but without overshooting. This is what a PID algorithm does. When done with an understanding of the fundamentals, it will be far superior to basic modes in your tuner app.