-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New tuning rules, peak detection method, etc. #11
base: master
Are you sure you want to change the base?
Conversation
Add Pessen, Some Overshoot, and No Overshoot PID modes
Add Pessen, Some Overshoot, and No Overshoot PID modes
Conflicts: PID_AutoTune_v0/PID_AutoTune_v0.cpp
…expanded range of simulations in example sketch
…e option, removed dither
Hej nice commit. I need to change the controller value to this to get it to compile. Is it just typo? How long will a run of AMIGOF_PI take? |
Thanks, can you do a pull request? I'm not exactly sure what the issue is because the firmware compiled OK for me without this. AMIGOF takes longer than the default Ziegler Nichols because there is an additional step to estimate K_process which can take a while to converge under some conditions. But in my experience the results are far more robust (i.e. remain close to optimal when the process parameters change slightly). |
Sure I can! I first tried aTune.SetControlType(PID_ATune::AMIGOF_PI); Am I doing something wrong or am I missing something? I have cloned your latest git repo! |
Added missing "PID_ATune::" to get rid of compile error "was not declared in this scope" on Arduino v 1.0.5
AMIGOF has an extra stage and under certain conditions it fails to converge. (Usually very sluggish processes, in which case Tyreus Luyben PI is probably a good starting point.) You can experiment with the simulations to see which is likely to work best for your process. |
Update AutoTune_Example.ino
Oki but you are supposed to see output changes in the same way as the other? On the serial monitor? |
Aha so first you want to hold the process steady at baseline then steady after step up. I turned out debug and it made sense! |
Can this be merged then? |
I guess that is up to @br3ttb |
Just wanted to say "Great work @t0mpr1c3 " |
Great work, @t0mpr1c3 ! But I'm having problems to compile it on newer Arduino IDE (1.6.x). `C:\Users\Acer\Documents\Arduino\libraries\PID_AutoTune_v0\PID_AutoTune_v0.cpp:20:58: error: variable 'tuningRule' must be const in order to be put into read-only section by means of 'attribute((progmem))' PROGMEM Tuning tuningRule[PID_ATune::NO_OVERSHOOT_PID + 1] = I tried searching for this error message and I think it's because from IDE 1.0.x to 1.6.x they changed how to use PROGMEM; the code should be adapted (I tried but can't get it to work):
Anyone having the same problem? How to get it to work? And congratulations for the great work again! |
Got it to work simply by adding "const" before PROGMEM:
|
Hi, just tried to compile this in the latest Arduino IDE and got errors resulting from: |
Brett, there's a lot here so if you want to pull in just a specific feature let me know and I can create a new fork with just that change that you can pull from. The peak detection I think is an improvement because it uses information from both minima and maxima, instead of maxima only, so it potentially converges half a cycle sooner as well as being more accurate if the minima are variable. Lots of variations on Ziegler-Nichols. Slightly different but still a relay tuning method is AMIGOf, a robust algorithm for tuning PI controllers, although the tuning is slower to complete than other methods. Relay bias is useful sometimes so I have put it as a compile option.
in array peakTime[] and longer array peaks[]
amplitude over last 1.5 cycles rather than levels of recent maxima
so that peaks are not called before lastInputs[] has been filled
state of algorithm
instead of waiting until next sampleTime
to indicate autotuner state
(although this can easily be fixed)
as lastInputs[], etc.
local to Runtime()
can be local to Runtime()
used instead of difference between most extreme values ever observed
state response to a step up in output
which is tuned by the AMIGOF_PI algorithm
have converged to values within noiseBand of each other
private variables avgStep1 and avgStep2
to calculate offset in process variable over last 2 relay cycles
after timing out (too long since last peak identification or relay step)