DIYPNP install: inital tuning
#321
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
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.
#322
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
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.
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.
#326
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
I reduced P to 15 and the dips just worsened. Reduced to 5 (ghost graph), car flat out stalled.
![Name: 827p155i12d1600.png
Views: 62
Size: 88.8 KB](https://www.miataturbo.net/attachments/megasquirt-18/187111d1501215947-diypnp-install-inital-tuning-827p155i12d1600.png)
I tried raising p to 50...just started an oscillation that the D couldnt control!
![](https://www.miataturbo.net/attachments/megasquirt-18/23574-diypnp-install-inital-tuning-827p50i12d1600.png?dateline=1314417739)
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!![](https://www.miataturbo.net/images/smilies/smile.gif)
p25 i 12 d3000-- noticeable improvement
![](https://www.miataturbo.net/attachments/megasquirt-18/23566-diypnp-install-inital-tuning-827p25i12d3000.png?dateline=1314416831)
p25 i 12 d4000-- kills it dead. No dip! Look at the PWM idle duty shoot straight up to kill it!![Idea](https://www.miataturbo.net/images/smilies/sign0184.gif)
![](https://www.miataturbo.net/attachments/megasquirt-18/23567-diypnp-install-inital-tuning-827p25i12d4000.png?dateline=1314416831)
p25 i 12 d5000-- also good, but around target the PWM duty value is constantly changing- dunno if this is bad for the valve?
![](https://www.miataturbo.net/attachments/megasquirt-18/23568-diypnp-install-inital-tuning-827p25i12d5000.png?dateline=1314416831)
The sweet spot, I believe, is somewhere near 4000D. Jason was spot on with the 2x suggestion!
![Name: 827p155i12d1600.png
Views: 62
Size: 88.8 KB](https://www.miataturbo.net/attachments/megasquirt-18/187111d1501215947-diypnp-install-inital-tuning-827p155i12d1600.png)
I tried raising p to 50...just started an oscillation that the D couldnt control!
![](https://www.miataturbo.net/attachments/megasquirt-18/23574-diypnp-install-inital-tuning-827p50i12d1600.png?dateline=1314417739)
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!
![](https://www.miataturbo.net/images/smilies/smile.gif)
p25 i 12 d3000-- noticeable improvement
![](https://www.miataturbo.net/attachments/megasquirt-18/23566-diypnp-install-inital-tuning-827p25i12d3000.png?dateline=1314416831)
p25 i 12 d4000-- kills it dead. No dip! Look at the PWM idle duty shoot straight up to kill it!
![Idea](https://www.miataturbo.net/images/smilies/sign0184.gif)
![](https://www.miataturbo.net/attachments/megasquirt-18/23567-diypnp-install-inital-tuning-827p25i12d4000.png?dateline=1314416831)
p25 i 12 d5000-- also good, but around target the PWM duty value is constantly changing- dunno if this is bad for the valve?
![](https://www.miataturbo.net/attachments/megasquirt-18/23568-diypnp-install-inital-tuning-827p25i12d5000.png?dateline=1314416831)
The sweet spot, I believe, is somewhere near 4000D. Jason was spot on with the 2x suggestion!
Last edited by Greg G; 08-27-2011 at 12:09 AM.
#332
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
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%.
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%.
#336
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
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
![](https://www.miataturbo.net/attachments/megasquirt-18/24084-diypnp-install-inital-tuning-91p25i15d50003rdsolenoid.png?dateline=1314874396)
* 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
![](https://www.miataturbo.net/attachments/megasquirt-18/24085-diypnp-install-inital-tuning-91p90i15d5000idlescrew1cw.png?dateline=1314874396)
P160 i15 d5000
![](https://www.miataturbo.net/attachments/megasquirt-18/24086-diypnp-install-inital-tuning-91p160i15d5000.png?dateline=1314874396)
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.
P25 i15 d5000, 3rd solenoid
![](https://www.miataturbo.net/attachments/megasquirt-18/24084-diypnp-install-inital-tuning-91p25i15d50003rdsolenoid.png?dateline=1314874396)
* 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
![](https://www.miataturbo.net/attachments/megasquirt-18/24085-diypnp-install-inital-tuning-91p90i15d5000idlescrew1cw.png?dateline=1314874396)
P160 i15 d5000
![](https://www.miataturbo.net/attachments/megasquirt-18/24086-diypnp-install-inital-tuning-91p160i15d5000.png?dateline=1314874396)
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.
Last edited by Greg G; 09-01-2011 at 07:54 AM.
#337
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
Found this to practice on while I'm away from the car. This is becoming a disease ![Laugh](https://www.miataturbo.net/images/smilies/laugh.gif)
http://www.engineers-excel.com/Tools...escription.htm
![Laugh](https://www.miataturbo.net/images/smilies/laugh.gif)
http://www.engineers-excel.com/Tools...escription.htm
![](https://www.miataturbo.net/attachments/megasquirt-18/24099-diypnp-install-inital-tuning-example.jpg?dateline=1314924423)
#338
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
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. ![Giggle](https://www.miataturbo.net/images/smilies/gay.gif)
Anyway, the max P I could run without oscillating is 100.
P100 I75 D6500
![](https://www.miataturbo.net/attachments/megasquirt-18/24118-diypnp-install-inital-tuning-92p100i75d6500.png?dateline=1314956692)
Added I, ended up with
P100 I140 D6500
![](https://www.miataturbo.net/attachments/megasquirt-18/24119-diypnp-install-inital-tuning-92p100i140d6500.png?dateline=1314956692)
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...
![](https://www.miataturbo.net/attachments/megasquirt-18/24120-diypnp-install-inital-tuning-92nosolenoids.png?dateline=1314956692)
Not bad!
![Giggle](https://www.miataturbo.net/images/smilies/gay.gif)
Anyway, the max P I could run without oscillating is 100.
P100 I75 D6500
![](https://www.miataturbo.net/attachments/megasquirt-18/24118-diypnp-install-inital-tuning-92p100i75d6500.png?dateline=1314956692)
Added I, ended up with
P100 I140 D6500
![](https://www.miataturbo.net/attachments/megasquirt-18/24119-diypnp-install-inital-tuning-92p100i140d6500.png?dateline=1314956692)
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...
![](https://www.miataturbo.net/attachments/megasquirt-18/24120-diypnp-install-inital-tuning-92nosolenoids.png?dateline=1314956692)
Not bad!
#339
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
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".
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".
#340
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
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.
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.