MEGAsquirt A place to collectively sort out this megasquirt gizmo

DIYPNP install: inital tuning

Thread Tools
 
Search this Thread
 
Old 08-26-2011, 11:17 AM
  #321  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

Originally Posted by Greg G
I also noticed that because it ramps up early, it doesn't need to open the valve as much.
A stitch in time saves nine. This is what D can do.

And notice how it resembles what I said D should do:
https://www.miataturbo.net/showpost....&postcount=165

Last edited by JasonC SBB; 08-26-2011 at 11:44 AM.
JasonC SBB is offline  
Old 08-26-2011, 11:37 AM
  #322  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

BTW the shift left is still less less than 45* which implies still not enough D relative to P. If you have enough D there should be no or almost no sign of sine waves.
See my simulation examples in my earlier post:
https://www.miataturbo.net/showpost....&postcount=165


Because your D is maxed out, try an experiment, keep D maxed, and reduce P by 30%, and by 50%. See if the sinusoids reduce.

In control system parlance, too much P means there's too much gain in the system that the D (the phase-lead compensator) cannot damp out.

In a suspension, that is akin to your bought the stiffest dampers (highest D) you could find and the spring rate (P) is still too high for the dampers. So it oscillates after a bump. You need to soften the springs.
JasonC SBB is offline  
Old 08-26-2011, 11:44 AM
  #323  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

BTW not to toot my own horn but those interested in control loop theory and design should pay attention to my lessons.
Control loop design is part of what I do for a living.
JasonC SBB is offline  
Old 08-26-2011, 06:24 PM
  #324  
Junior Member
Thread Starter
 
Greg G's Avatar
 
Join Date: Jun 2007
Posts: 411
Total Cats: 0
Default

Well d is only maxed out as 1600 because that's what I put in the ini file. Just how much more do I need?
Greg G is offline  
Old 08-26-2011, 08:35 PM
  #325  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

2x more
JasonC SBB is offline  
Old 08-26-2011, 11:47 PM
  #326  
Junior Member
Thread Starter
 
Greg G's Avatar
 
Join Date: Jun 2007
Posts: 411
Total Cats: 0
Default

I reduced P to 15 and the dips just worsened. Reduced to 5 (ghost graph), car flat out stalled.
Name:  827p155i12d1600.png
Views: 58
Size:  88.8 KB

I tried raising p to 50...just started an oscillation that the D couldnt control!


So going back to the theory that I needed a stronger D term (see Jason's link top of the page)....I edited the ini to allow up to 5000D!

p25 i 12 d3000-- noticeable improvement


p25 i 12 d4000-- kills it dead. No dip! Look at the PWM idle duty shoot straight up to kill it!


p25 i 12 d5000-- also good, but around target the PWM duty value is constantly changing- dunno if this is bad for the valve?


The sweet spot, I believe, is somewhere near 4000D. Jason was spot on with the 2x suggestion!
Attached Thumbnails DIYPNP install: inital tuning-827p25i12d3000.png   DIYPNP install: inital tuning-827p25i12d4000.png   DIYPNP install: inital tuning-827p25i12d5000.png   DIYPNP install: inital tuning-827p30i20d5000nosolenoids.png   DIYPNP install: inital tuning-827p50i12d1600.png  


Last edited by Greg G; 08-27-2011 at 12:09 AM.
Greg G is offline  
Old 08-27-2011, 01:07 AM
  #327  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

duty cycle chattering isn't bad for the valve.
I do this **** for a living. [/drunk post]
JasonC SBB is offline  
Old 08-27-2011, 01:27 AM
  #328  
Junior Member
Thread Starter
 
Greg G's Avatar
 
Join Date: Jun 2007
Posts: 411
Total Cats: 0
Default

OK, but even the MAP looks smoother in the 4000 D graph. Will see if I can still fine tune it. Maybe it could use a bit more I. Post back when sober
Greg G is offline  
Old 08-27-2011, 02:03 AM
  #329  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

By definition, PWM is already chattering the valve. [/drunker post]
JasonC SBB is offline  
Old 08-27-2011, 02:05 AM
  #330  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

The D=4000 and D=5000 plots show a pretty nice damped response. Now it looks like it could use more I, like maybe 2-4x.
JasonC SBB is offline  
Old 08-27-2011, 02:46 AM
  #331  
Junior Member
Thread Starter
 
Greg G's Avatar
 
Join Date: Jun 2007
Posts: 411
Total Cats: 0
Default

Here's 4500 D-- looks closer to the 5000 graph. I will look closely at the 4000-4500 range next week.



And I did try adding some I...
p30 i20 d5000
Attached Thumbnails DIYPNP install: inital tuning-827p25i12d4500.png  
Greg G is offline  
Old 08-27-2011, 11:26 AM
  #332  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

10% changes in P I or D is splitting hairs. 30% changes is more than fine enough.

Look into increasing P until increasing D doesn't stop oscillation, then back off P by 50%. Increase D until you get crazy high frequency oscillation, then back off by 50%.

Keep P and D.
Increase I until it oscillates, then back off by 50%.
JasonC SBB is offline  
Old 08-27-2011, 03:26 PM
  #333  
Junior Member
Thread Starter
 
Greg G's Avatar
 
Join Date: Jun 2007
Posts: 411
Total Cats: 0
Default

Got it. Think 5000 d is is enough, or should I explore the stratosphere?
Greg G is offline  
Old 08-27-2011, 06:26 PM
  #334  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

Go ahead and try more to go with increased P, as per my previous post.
JasonC SBB is offline  
Old 08-27-2011, 07:35 PM
  #335  
Elite Member
iTrader: (1)
 
richyvrlimited's Avatar
 
Join Date: Jun 2006
Location: Warrington/Birmingham
Posts: 2,642
Total Cats: 42
Default

Greg/Jason top work, I look forward to reaping the benefits :-D
richyvrlimited is offline  
Old 09-01-2011, 06:53 AM
  #336  
Junior Member
Thread Starter
 
Greg G's Avatar
 
Join Date: Jun 2007
Posts: 411
Total Cats: 0
Default

I finally gave in and added another extra air solenoid triggered by the headlights. Worked like a charm and settled it down.

P25 i15 d5000, 3rd solenoid


* I attached the log, could someone please take a look and help me figure out the weird spike in RPM/PWM idle duty after I turn off the lights? It was a one off, didn't happen again but I can't explain why...

Then I tried finding the upper limit of P.

Note: I closed the idle screw by 1 turn, so the PID code would bring down the RPM rise from the idle solenoids.
P90 i15 d5000


P160 i15 d5000


The duty curve doesn't look good- too much P/too little D.

Looks like 90 is the upper limit for now, to get the desired response. Will try even more D to see if I can dampen it some more/kill the dip faster.
Attached Thumbnails DIYPNP install: inital tuning-91p25i15d50003rdsolenoid.png   DIYPNP install: inital tuning-91p90i15d5000idlescrew1cw.png   DIYPNP install: inital tuning-91p160i15d5000.png  
Attached Files
File Type: msl
2011-09-01_11.27.32acsol.msl (615.9 KB, 92 views)

Last edited by Greg G; 09-01-2011 at 07:54 AM.
Greg G is offline  
Old 09-01-2011, 08:46 PM
  #337  
Junior Member
Thread Starter
 
Greg G's Avatar
 
Join Date: Jun 2007
Posts: 411
Total Cats: 0
Default

Found this to practice on while I'm away from the car. This is becoming a disease

http://www.engineers-excel.com/Tools...escription.htm

Attached Thumbnails DIYPNP install: inital tuning-example.jpg  
Greg G is offline  
Old 09-02-2011, 05:44 AM
  #338  
Junior Member
Thread Starter
 
Greg G's Avatar
 
Join Date: Jun 2007
Posts: 411
Total Cats: 0
Default

Apparently the upper limit for D is 6500! It won't accept anything more, even if I edited the ini to allow 9500 D. It just puts in weird values if I enter anything more than 6500.

Anyway, the max P I could run without oscillating is 100.

P100 I75 D6500


Added I, ended up with
P100 I140 D6500


Felt right, but looking at the curve in retrospect, I may have a touch too much P and/or I.

Out of curiosity, I disconnected all the solenoids to see if the optimized code could handle it alone...


Not bad!
Attached Thumbnails DIYPNP install: inital tuning-92p100i75d6500.png   DIYPNP install: inital tuning-92p100i140d6500.png   DIYPNP install: inital tuning-92nosolenoids.png  
Greg G is offline  
Old 09-02-2011, 10:29 AM
  #339  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

Good work. The solenoids seem undersized; if they were big enough, the duty it settles to after a load turns on, should be the same as before the load.

Looks like you're approaching the upper practical limit of D - the duty is starting to look jitery, which is due to D amplifying any "noise".
JasonC SBB is offline  
Old 09-02-2011, 11:46 AM
  #340  
Junior Member
Thread Starter
 
Greg G's Avatar
 
Join Date: Jun 2007
Posts: 411
Total Cats: 0
Default

Am using the egr solenoid plus a Toyota idle up solenoid for the AC, and a bigger (physically) Toyota solenoid for the headlights. Can't find anything bigger/stronger here....

Should I back down on the d?

One thing that has me stumped is the rpm rise after the AC turns off and the solenoids go off. The rpm rises, but the idle duty also rises for a bit before going down, instead of trying to bring it down immediately. Weird.
Greg G is offline  


Quick Reply: DIYPNP install: inital tuning



All times are GMT -4. The time now is 02:11 AM.