When you click on links to various merchants on this site and make a purchase, this can result in this site earning a commission. Affiliate programs and affiliations include, but are not limited to, the eBay Partner Network.
Crank the slider to at least 460. James (F/W writer) is already thinking about increasing the limit of sensitivity as many people are not getting enough.
Since my last postings, I have gone to P=165, I=200, D=30, and Slider = 460. The "lower" slider took some of the edge off and reduced the little ups and downs on output. Now I still get a lot of PID action, but not the jittery output. I did some experimenting running D all the way to 120, and saw no change in function (still about 6kPa overshoot).
I is what you want to force boost to target over time. Slider is what you want to get the PID loop to have enough effect.
Thanks. I'll give that a shot. It's tough for me to find time, and clear roads, to make safe pulls on the street.
This is a stupid question, but how do you set a range in Megalogviewer? A lot of logs I see have a set MAP range of 0-200kpa, where mine just sets the range at whatever my lowest and highest kpa was during the log. I can't find the setting anywhere even though it seems like that would be really obvious.
I bumped the slider up to 475 and that was definitely too much for my setup. You can see big changes in duty cycle now I'm getting a 11% swing in duty cycle (17-28%). At 360 sensitivity the duty cycle wouldn't move more than 3-4%. I dropped sensitivity to 440 for another shakedown run. I imagine finding the sweet spot here should really help with temperature variances.
I'm hoping to get some input from my post # 93.
Briefly,
It seems like this could be the answer to a lot of the problems Miata/Eunos turbo guys have with the current boost control.
Using the PID Logging found in the 1.5.3 beta on a DIY MSPNP Pro, I've been working with my closed loop boost control.
It appears common to have issues with I values that work pretty well on quick applications of throttle causing overshoot on longer pulls.
Where this is a problem is that the I will typically develop a larger contribution on a long pull as we are within our delta a while.
Once the boost target is hit, that larger I value persists and only slowly reduces its contribution as time goes by.
It seems like once the target boost level is attained, a reset of some sort would be in order.
At least a reset of the inflated Integral values, since any deviation from boost target should be a
fresh invocation of the algorithm as you have just met your previous goal.
There are some screen shots and more detail in post 93.
Anyone have an input?
Thanks.
That sounds like the integral windup issue a lot of us were having that is resolved by lowering your Max duty setting. My Max duty is currently set to 35%, where 26% will hold 220kpa. After that overshoots on long pulls went away. A max too high will cause massive overshoots, a max too low will cost you spool, so you've just got to find a happy medium.
Proportional gain for closed-loop control. Proportional control causes immediate changes to output duty with
changes in boost error.
Integral Gain (%)
Integral gain for closed-loop control. Integral control causes changes in duty with boost error over time. The
longer boost is off target, the stronger the reaction due to the integral term.
Differential Gain (%)
Derivative gain for closed-loop control. Derivative control causes larger reactions in boost duty with faster rate of
change of boost error. The faster error changes, the more duty will change to counteract.
These defintions helped me think about what PID does, if they help advanced tuning conversations.
The problem is it seems like the boost control doesn't follow the conventional PID logic. Then you throw in the sensitivity slider and it further complicates the issue. I need to get the commented code and really roll around in it.
I really think you need to get boost control working really well in Basic Mode before you're going to make any kind of relevant adjustments to PID in Advanced Mode. I've spent over a year messing around with PID settings making no progress at all because other settings were jacked up. Focusing Basic Mode until it's as good as it can be seems to be the key.
The problem is it seems like the boost control doesn't follow the conventional PID logic. Then you throw in the sensitivity slider and it further complicates the issue. I need to get the commented code and really roll around in it.
Come report back once you get that stuff all over you and in your head.
Idiosyncrasies I see are:
1) Loop frequency is tied to PWM frequency. Probably not a bad idea, but I don't know the relationship/
2) D seems to be highly suppressed, like dialing 50 is really 5.
3) At one time, P was more like proportional band, where smaller numbers were greater gains, but now it is larger numbers are greater gain.
4) There seems to be an inherent proportional band set up by the choosing of the Min and Max values, in addition to the P gain.
5) Yeah, what does "sensitivity" mean? Is that another universal gain factor, or is it an adjustment of the loop frequency?
In the end, I still think the output is % on time of the PWM, so I'm not sure what the additional gain factors mean.
Look at MSEXTRA discussions as well, if the raw code does not enlighten you.
control loop is tied to pwm frequency. This is because if you run it any faster you end up messing things up. It used to be separately controlled. But if you run the loop faster than the PWM frequency you get issues, the control loop is trying to make changes too fast, so it screws up lots of things.
AIUI the slider is an overall multiplier on the output of the control loop. That's why pdexta was seeing bigger changes with higher sensitivity. Ken told me what the slider did in one of the msextra threads.
control loop is tied to pwm frequency. This is because if you run it any faster you end up messing things up. It used to be separately controlled. But if you run the loop faster than the PWM frequency you get issues, the control loop is trying to make changes too fast, so it screws up lots of things.
AIUI the slider is an overall multiplier on the output of the control loop. That's why pdexta was seeing bigger changes with higher sensitivity. Ken told me what the slider did in one of the msextra threads.
Right. When I said I did not know the relationship, I did not mean that they were not related, but only I don't know the math as to how the relationship is implemented. 1:1 1:2 2:1 frequency, etc.
Yeah, I know the code is not commented. Still, if there is a FW guy that can add something, I'm all for it.
Thanks for keep your pulse on this. I know you have worked on it. Also, in the end, we don't want to publish what has worked for us but rather, Vlad's goal of creating an approach to success.
That sounds like the integral windup issue a lot of us were having that is resolved by lowering your Max duty setting. My Max duty is currently set to 35%, where 26% will hold 220kpa. After that overshoots on long pulls went away. A max too high will cause massive overshoots, a max too low will cost you spool, so you've just got to find a happy medium.
Agreed.
I guess this is the best we can do with the current code. That is the annoying part. If the code was more robust, we wouldn't have to sacrifice spool to keep from significantly overshooting our Target. It is what it is...a work in progress. We'll get there eventually. Info on this thread will get you close, although I bet we end up with winter bias tables.
I did some tests on long pulls with lower upper limit vs my previous upper limit of 55. It did cure the overshoot, although it took just under two seconds longer to hit target. Trade-off. I have enough headroom in my tune to handle the overshoot, so I don't hit boost cut. I'm staying at 55 upper limit for now.
aidandj, This is not a personal slam on the developers. They are amazingly civil and responsive. What we have is workable, but we are not there yet.
Megasquirt is always a work in progress. And its 2 guys doing it in their spare time. There are other ECU solutions that have full engineering teams behind them.
I think the switch to the bias table was the right idea, it just needs more work.
Honestly I had never bothered to pull up the code, but it does blow my mind that commented (even poorly) code isn't available for what I thought was an open source project.
Back when I messed around with 80's GM crap we all had some rather well commented code that some one in GM released, it was very enlightening to follow the logic and really opened my eyes to what was going on. It was one of the few times I was able to tie the theory mumbo jumbo I learned in engineering school to the real world.
The code is only licensed to run on official hardware.
"The source code of the firmware(s) are available to download for peer review and end-user modification, but the code and derivatives are only licensed for use on official Megasquirt hardware."
Tried the blend table and simply set that table to 0% in 1st gear and 100% in all subsequent gears..... Bingo boost by gear using the tables. Once I step up my power game I might make 2nd gear 50%.
Sooo I've been trying to get my ebc really working for the past month or two (takes a while since I only drive the car ~1/week)
I've got a bit of a stress test scenario since I live at 7300ft and drive down into a valley at 5500ft every time I drive the car. This elevation change is also often accompanied by a 20 degreeF shift during the winter months.
It was easy to get the car to hit a boost target at either of these environments but not both of them.
There were 2 things that really seemed to make a difference:
1. The bias table duty cycle numbers must be lower than needed to hit your boost target.
2. As Savington pointed out, the target table needs to have obtainable map numbers in it for every cell. This is really important in the spool-up area. The delta setting thing seems band-aidsy and just led to overshoot when the operating environment changed.
If you have my situation the target numbers should match the spool results from wherever the spool is slowest. I'm still tinkering here... hotter temps and lower elevation vs. cooler temps and higher elevation
The actual PID tuning really only comes into play after you have successfully spooled the turbo. It can help a little in controlling the overshoot between full boost and building boost scenarios but the tricks you play to achieve your goals probably won't work at a different operating environment.
Originally Posted by Savington
Seems like an easy problem to solve - just reduce your boost targets in the spoolup area so you don't have the PID controller trying to reach unobtainable targets. Set them maybe 10kpa above what you can reasonably obtain from a 1:1 2000rpm pull.
I thought this would be a good addition to this thread. Very nice, easy to follow video for helping set up your bias duty table. Cats to Chiburbian for putting this together.