View unanswered posts | View active topics It is currently Mon Oct 16, 2017 10:49 pm



Reply to topic  [ 106 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11
PID control discussion 
Author Message
LQFP112 - Up with the play

Joined: Sun Feb 03, 2008 9:30 pm
Posts: 120
Location: Chicago, USA
The one thing to consider is what Ken said. He calls it setting DC directly. What it needs to do is know the max and min output values and start its loop with these values. If there is a bias curve or if a known good value is used as a starting point is not really that important.

A portable PID loop could be written like this, IMO. Basically pass a SV, PV and the appropriate constants (Kp, Ki, Kd) and let it respond with a 'percentage' as ken calls it or a proportionality that is resolved back up in the main code to generate an output value that makes sense for the reason the loop is called.

One thing I learned from reading the Saab Trionic tuning guide and from some personal experimentation is that the Kp, Ki, Kd may not be 'constants'. Due to whatever else is going on, these may vary according to a separate variable (MAT or CLT for example). If these values are passed to a subroutine, this complication can also be accommodated if necessary.

Gearhead


Mon Nov 03, 2008 12:41 am
Profile
TO92 - Vaguely active

Joined: Fri Oct 28, 2011 3:30 pm
Posts: 1
Hey,
I think :oops: that there is some problems whith the implementation :
1) long constants should be long (L)...
2) it's better to do a center point derivative approximation to minimize the high frequency noise (ztrans_idle_error_array[0] - ztrans_idle_error_array[2] )
3) its not a good idea to have PID_SCALE_FACTOR = 125. 128 is better because the compiler optimize the divide whith shifts
4) it's better to apply the PID_SCALE_FACTOR after the final add, and if its possible, with a correct rounding...
5) i think that if tmp1 is a 16bit integer, there is no need to disable the interrupts


Fri Oct 28, 2011 6:44 pm
Profile
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14820
Location: Home sweet home!
Jean-Louis, sorry for the delay in approving your post! And, thanks for your feedback! :-)

_________________
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!


Fri Nov 04, 2011 10:57 am
Profile WWW
TO220 - Visibile

Joined: Thu Dec 22, 2011 6:52 pm
Posts: 4
AbeFM wrote:
The two places they use it, which are reasonable places if not great, are boost solenoid control and idle control.


All late model (1999+?) returnless fuel systems use PID control for the fuel pump.


Thu Dec 22, 2011 7:42 pm
Profile
TO220 - Visibile

Joined: Thu Dec 22, 2011 6:52 pm
Posts: 4
Fred wrote:
"dashpot" whatever the fuck that is


I believe the term was taken from an old mechanical device commonly called dashpot.
http://en.wikipedia.org/wiki/Dashpot

Based on my tuning experience dashpot delays IAC movement and causes the rpm to slowly settle in to it's idle setpoint when decelerating. Increasing dashpot also seems to increase the time required for rpm to initially start dropping to setpoint. I also notice, on Fords, it hovers about 500rpm higher then idle setpoint for a longer period of time before ultimately dropping to idle rpm setpoint. Frankly, IMHO, it sucks and works poorly, at least on the Ford engines I have played with. PID, without overshoot, would probably be a better solution as dashpot doesn't seem to work well or make any discernable difference except for adding time delay before settling into idle. Only problem is that you need to be an engineer to tune a PID properly. It isn't easy, those that can't tune it, just don't know, but it does work. I needed to enlist the help of an engineer at WeaponX, to help with PID for my aftermarket 255lph fuel pump after watching the wild fuel pressure swings after installing a Fuel Rail Pressure sensor, nightmare! His comment was, every loop will tune differently depending on the losses "feedforward tables" in the system. So some typical methods won't work 110% every time unless those feedforward loops are good and are set in stone.


Thu Dec 22, 2011 8:05 pm
Profile
LQFP112 - Up with the play

Joined: Sun Feb 03, 2008 9:30 pm
Posts: 120
Location: Chicago, USA
Faststang wrote:
AbeFM wrote:
The two places they use it, which are reasonable places if not great, are boost solenoid control and idle control.


All late model (1999+?) returnless fuel systems use PID control for the fuel pump.


Don't forget clo2 as well. Only when you use a wide band sensor, though.

Basically any control loop with a target can use pid. Sometimes all that is needed is pi. Sometimes pid is required.

Gearhead


Tue Dec 27, 2011 5:26 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 106 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF. ColorizeIt.