MEGAsquirt A place to collectively sort out this megasquirt gizmo

ITT: MS3 1.4.0+ and Closed Loop EBC

Thread Tools
 
Search this Thread
 
Old 10-08-2017, 08:56 AM
  #121  
Retired Mech Design Engr
iTrader: (3)
 
DNMakinson's Avatar
 
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
Default

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.
DNMakinson is offline  
Old 10-08-2017, 09:25 AM
  #122  
Elite Member
iTrader: (17)
 
pdexta's Avatar
 
Join Date: Aug 2007
Location: Knoxville, TN
Posts: 2,949
Total Cats: 182
Default

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.
pdexta is offline  
Old 10-08-2017, 10:20 AM
  #123  
Retired Mech Design Engr
iTrader: (3)
 
DNMakinson's Avatar
 
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
Default

EDIT for correct information

Off the top of my head: View/Calculated Fields. The newest
Version has a list that allows all variables to have min-max set

Calculated Fields / Field Min & Max Editor

Last edited by DNMakinson; 10-11-2017 at 08:21 AM.
DNMakinson is offline  
Old 10-10-2017, 10:43 AM
  #124  
Elite Member
iTrader: (17)
 
pdexta's Avatar
 
Join Date: Aug 2007
Location: Knoxville, TN
Posts: 2,949
Total Cats: 182
Default

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.

pdexta is offline  
Old 10-10-2017, 11:10 AM
  #125  
Junior Member
iTrader: (3)
 
fwman1's Avatar
 
Join Date: Mar 2008
Location: Alabama
Posts: 149
Total Cats: 5
Default

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.
fwman1 is offline  
Old 10-10-2017, 12:06 PM
  #126  
Elite Member
iTrader: (17)
 
pdexta's Avatar
 
Join Date: Aug 2007
Location: Knoxville, TN
Posts: 2,949
Total Cats: 182
Default

Originally Posted by fwman1
I'm hoping to get some input from my post # 93.
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.
pdexta is offline  
Old 10-10-2017, 04:19 PM
  #127  
Senior Member
iTrader: (2)
 
Lexzar's Avatar
 
Join Date: Nov 2013
Location: Redlands, CA
Posts: 953
Total Cats: 41
Default

Proportional Gain (%)

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.
Lexzar is offline  
Old 10-10-2017, 04:22 PM
  #128  
Senior Member
iTrader: (1)
 
Bronson M's Avatar
 
Join Date: Feb 2015
Posts: 1,104
Total Cats: 217
Default

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.
Bronson M is offline  
Old 10-10-2017, 04:29 PM
  #129  
Elite Member
iTrader: (17)
 
pdexta's Avatar
 
Join Date: Aug 2007
Location: Knoxville, TN
Posts: 2,949
Total Cats: 182
Default

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.
pdexta is offline  
Old 10-10-2017, 04:31 PM
  #130  
Retired Mech Design Engr
iTrader: (3)
 
DNMakinson's Avatar
 
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
Default

Originally Posted by Bronson M
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.

And Thanks.
DNMakinson is offline  
Old 10-10-2017, 06:10 PM
  #131  
SADFab Destructive Testing Engineer
iTrader: (5)
 
aidandj's Avatar
 
Join Date: Apr 2014
Location: Beaverton, USA
Posts: 18,642
Total Cats: 1,866
Default

Commented code? :ROFL: good luck.

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.
aidandj is offline  
Old 10-10-2017, 06:35 PM
  #132  
Retired Mech Design Engr
iTrader: (3)
 
DNMakinson's Avatar
 
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
Default

Originally Posted by aidandj
Commented code? :ROFL: good luck.

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.

DNM
DNMakinson is offline  
Old 10-11-2017, 11:54 AM
  #133  
Junior Member
iTrader: (3)
 
fwman1's Avatar
 
Join Date: Mar 2008
Location: Alabama
Posts: 149
Total Cats: 5
Default

Originally Posted by pdexta
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.

Last edited by fwman1; 10-11-2017 at 12:49 PM.
fwman1 is offline  
Old 10-11-2017, 12:00 PM
  #134  
SADFab Destructive Testing Engineer
iTrader: (5)
 
aidandj's Avatar
 
Join Date: Apr 2014
Location: Beaverton, USA
Posts: 18,642
Total Cats: 1,866
Default

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.
aidandj is offline  
Old 10-11-2017, 12:01 PM
  #135  
Senior Member
iTrader: (1)
 
Bronson M's Avatar
 
Join Date: Feb 2015
Posts: 1,104
Total Cats: 217
Default

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.

Back to the poke and hope method I guess.
Bronson M is offline  
Old 10-11-2017, 12:03 PM
  #136  
SADFab Destructive Testing Engineer
iTrader: (5)
 
aidandj's Avatar
 
Join Date: Apr 2014
Location: Beaverton, USA
Posts: 18,642
Total Cats: 1,866
Default

Its not open source. Common misconception.

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."
aidandj is offline  
Old 10-12-2017, 02:25 PM
  #137  
Senior Member
iTrader: (1)
 
Bronson M's Avatar
 
Join Date: Feb 2015
Posts: 1,104
Total Cats: 217
Default

That explains it.....makes criticising them a little easier then
Bronson M is offline  
Old 11-05-2017, 06:52 PM
  #138  
Retired Mech Design Engr
iTrader: (3)
 
DNMakinson's Avatar
 
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
Default

Originally Posted by Bronson M
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%.
Please explain, perhaps show screen shots.
DNMakinson is offline  
Old 02-05-2018, 11:27 AM
  #139  
Junior Member
iTrader: (1)
 
leboeuf's Avatar
 
Join Date: May 2013
Location: Sandia Park, NM
Posts: 451
Total Cats: 50
Default

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.
leboeuf is offline  
Old 06-27-2018, 09:53 AM
  #140  
Junior Member
iTrader: (3)
 
fwman1's Avatar
 
Join Date: Mar 2008
Location: Alabama
Posts: 149
Total Cats: 5
Default

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.
fwman1 is offline  
Reply
Leave a poscat -1 Leave a negcat


Quick Reply: ITT: MS3 1.4.0+ and Closed Loop EBC



All times are GMT -4. The time now is 03:42 PM.