Skip to content
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

PID (P on Input) cannot follow background, gets stuck at particular temperature #1744

Open
3 of 4 tasks
jkfrfr opened this issue Nov 18, 2024 · 9 comments
Open
3 of 4 tasks

Comments

@jkfrfr
Copy link

jkfrfr commented Nov 18, 2024

Problem Description

I have been successfully using the PID function to control the Inlet Temperature (IT) on a small fluid bed roaster (using the 'P on Error' algorithm and various Phidgets). This last week, I have been trying to tune the PID system, using the 'P on Input' algorithm, to follow the BT curve. I think I am fairly close to having it tuned, but keep encountering something that I assume is a bug. This happens both when following a background BT curve and when setting the SV manually. I believe I was not encountering this bug previous to updating to 3.0.2 a few days ago, but am not totally sure. In the last two days, all my roasts encounter this bug.

I start a roast with a background curve, and things start off looking good, but within the first few minutes of a roast, the PID seems to stop working. It gets stuck at a particular, and random, value. In the picture attached, it is at 135C at about 57 seconds, but it has happened a couple times at about 70C, and again at 90 and 95C.

What is curious is that the SV continues to follow the curve - it will continue to display the correct SV at the top of the slider based on the background curve, as time goes on. And one can see the PID adjusting the heat, but always trying to stay at the same 'stuck' value. If I turn the PID off and on again, it stays stuck at that temperature. If I turn the PID off, and adjust the burner manually, the hardware responds appropriately. If I change PID values while running at a 'stuck' temperature, the PID and heat output do not change.
artisan-settings1.6.aset.txt
BT PID tuning flat 1.alog.txt
pid values BT 1 3 okay 1 2 maybe better
Screenshot BT PID tuning flat

Steps To Reproduce

  1. load background curve
  2. load PID values as shown in screenshot
  3. start roast
  4. issues should start within a couple minutes

Artisan Version

3.0.2

Computer OS and Version

Windows 11 Home

Connected devices or roasting machine

Phidget HUB0002

Files

  • A sample profile *.alog file, renamed to *.alog.txt is attached.

  • A settings file (Help>> Save Settings) *.aset, renamed to *.aset.txt is attached.

  • Screenshots are attached.

  • No files are attached.

@jkfrfr
Copy link
Author

jkfrfr commented Nov 18, 2024

Tonight I rolled back to verson 2.10.4, and the issue persisted - when the PID is set to 'P on Input', it gets stuck pretty quickly. Without changing any other PID settings, I switched to 'P on Error', and the roast runs reasonable (not well tuned, but the machine is doing what it is supposed to). So I can only assume there is some bug in the 'P on Input' section.

@jkfrfr
Copy link
Author

jkfrfr commented Nov 20, 2024

So I've spent about 15 hours trying to get the PID to function with "P on Input", but it seems really broken. Here is the data from trying to roast by manually setting the SV. I turn the PID on at about 60 seconds, and you can see it tries to drop the temperature to about 25C, although the SV is 90. Then at about 120 seconds, I change the SV to 180, and the PID then brings the temperature up a few degrees. The value that the PID is targeting may be a function of the starting temperature, Kp and Ki, but overall I can't predict it.
Screenshot BT PID tuning flat 3
Screenshot BT PID tuning flat 2
artisan-settings1.7.aset.txt
BT PID tuning flat 2.alog.txt

@jkfrfr
Copy link
Author

jkfrfr commented Nov 20, 2024

The 'P on Input' PID function would be especially valuable to me because it doesn't overshoot the target temperature (ideally). My roaster is a small fluid bed with a batch size of 50-100g, and my roasts tend to be fairly short, about 6-7 minutes. This means that DE happens at about 2 minutes ideally. The problem for me is with the normal "P on Error" PID function, the overshoot at the beginning of the roast hits the beans with way too much heat at the beginning, and DE happens at about 1 minute. This is too much heat, and drastically alters the roast plan and results overall.

@beanoccio
Copy link

beanoccio commented Nov 20, 2024

It looks like the PID is reacting to the step response (setpoint change).
You probably need to develop suitable PID parameters.

Where did you get the PID parameters? (kp = 20, ki=4, kd=20). Did you guess?

@jkfrfr
Copy link
Author

jkfrfr commented Nov 20, 2024

I've spent about 15 hours trying different combinations of Kp, Ki and Kd. I've tried a huge range of values, and the behaviour is consistently very far off.

@beanoccio
Copy link

Did you just try without a plan or strategy?
There are several methods for successfully tuning PID parameters.

Have you tried 1; 0.1; 1? If not, why?

@jkfrfr
Copy link
Author

jkfrfr commented Nov 23, 2024

Here is the roasters attempt to follow a background profile with the settings you suggest (1, 0.1, 1) with the PID set to P on Input. It continues to show the same behaviour of setting itself to an arbitrary temperature value, and then ignoring the background curve and SV (taken either from the background or manually input).
photo_2024-11-23_15-38-50

I have tried hundreds of combinations, and they all seem to show this behaviour. I can only assume that something is working not as intended.

@jkfrfr
Copy link
Author

jkfrfr commented Nov 23, 2024

I've also tried with 3.1.0 and the behaviour remains the same

@beanoccio
Copy link

I don't understand. You have already successfully tested the PID on Error setting. The result looks really good. (Picture in the first post).

Then why do you want to use PID on Input?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants