Shortest PID sample and output periods?

Suggestions, Problems, Availability, etc. Everything is up for discussion.
Post Reply
BrunDog
Posts: 96
Joined: Wed Mar 25, 2015 6:56 am
Bot?: No

Shortest PID sample and output periods?

Post by BrunDog »

Hi,

I am implementing the BCS to do some real-time H20 heating for sparge, so a quick responding PID loop is required.

1. What is the smallest practical sample period that I can use? I have it currently set for 0.1 seconds but I don't know really how fast it is drawing readings into the algorithm.

2. What is the shortest output period that I can use? I noticed that and output period of 1 second and a duty of 90% means the output actually stays on 100%, which leads me to believe the controller cannot switch output for windows as low as .1 seconds, therefore short output periods trade off accuracy.

Probably questions for the engineer team but asking publicly. Any data on the PID measurement/calculations/control speeds are appreciated.

-BD
brahn
Posts: 543
Joined: Thu Dec 13, 2012 11:01 am
Bot?: No

Re: Shortest PID sample and output periods?

Post by brahn »

Each temperature probe gets updated every .8 seconds on a rolling basis. The ADC is triggered every .1s, but it requires too much calculation to update all 8 probes every .1s. This is a holdover from 3.x and something I would like to look at going forward.

The outputs are updated every .1s. It's possible there's a race condition that's causing the issue you're seeing with a 1s output period and a 90% duty cycle.
BrunDog
Posts: 96
Joined: Wed Mar 25, 2015 6:56 am
Bot?: No

Re: Shortest PID sample and output periods?

Post by BrunDog »

Trying to acknowledge and see if I understand you correctly...

Regarding temp sampling and Sample Period: I understand the update rate on the screen may be slower than how fast the logic can read and process the value, but with respect to the PID algorithm, are you saying that inputting anything less than 0.8 will have no effect, and this is the lowest value I should enter?

Regarding the output period, I am quite confident that there is no "race condition" that I induced. With just one state running, no ladder logic, no funky browser used... setting 90% duty cycle and a 1s output period results in the output being on 100%. This is verified by the SSR as well as the element LED it is tied to, not by a scope, but I am pretty certain the SSR can switch faster than .1 sec. (specs say on-off time <=10ms). I am not really certain if 90% can be achieved with a 1s Output Period in PID mode as there is no direct report of the calculated value and visually it is impossible to tell. If you cannot validate this, I can test it again, but I did try this several times already. In that case, please let me know if you want any specific parameters to test it.

-BD
brahn
Posts: 543
Joined: Thu Dec 13, 2012 11:01 am
Bot?: No

Re: Shortest PID sample and output periods?

Post by brahn »

I haven't run extensive tests on this. I don't currently have a system that I can effectively test the PID with, especially with such tight parameters.

What I can tell you is that the internal temperature values for each probe update every .8s. The displays in the UI are a little slower than this. As far as I know, this is how it's worked since the introduction of the BCS-462 with 8 temperature probes. This number could be brought down in a situation where you're not using 8 probes. I haven't done these optimizations since it's worked this way for quite a while. If you'd like to try these optimizations we could work on it and see if it helps. The PID calculations use these internal temperatures for it's calculations, so I would think that using a sample period < .8s would probably not help.

If you've got a 90% duty cycle with a 1s output period the expected behavior would be that the output is off for .1s every second. The output status is updated and the PID calculations are performed every .1s. Those numbers being the same, combined with the issue you're seeing, is what makes me believe there may be a race condition. I don't believe you are "inducing" a race condition, but these settings may trigger a race condition (bug!) that exists in the code and isn't seen with longer output periods or lower duty cycles. I will have to see if I can find a way to test for this condition. One thing you might try is slightly changing the values. For example, an 89% duty cycle rather than 90. That might expose the issue.
BrunDog
Posts: 96
Joined: Wed Mar 25, 2015 6:56 am
Bot?: No

Re: Shortest PID sample and output periods?

Post by BrunDog »

Hi,

Was this "issue" addressed in the 4.0 release? I did not see any documentation referencing it, but I did notice fairly fast "blink" rates on my elements during a brew this weekend... Please let me know any changes related to my original issue/post. Thanks!

-BD
brahn
Posts: 543
Joined: Thu Dec 13, 2012 11:01 am
Bot?: No

Re: Shortest PID sample and output periods?

Post by brahn »

No, nothing was changed in regards to the output periods or temp sampling in the 4.0 release.

In my testing it seems to work as expected down to the .1s that's supported based on the way the system was designed. I don't have a scope to do detailed monitoring of the output at this time. Just some basic logging capability.
clearwaterbrewer
Posts: 383
Joined: Wed Feb 09, 2011 3:43 pm
Bot?: No
Location: Clearwater, FL
Contact:

Re: Shortest PID sample and output periods?

Post by clearwaterbrewer »

I had no problem heating a rims tube to 1 degree with the BCS, but that was heating 30 degrees or less.. you will be heating around 100 degrees in one pass...

one solution for real time h20 heating for sparge could be a pump pumping a rims-type tube in a self circulating loop and portion of that loop is drawn off, the rest is directed back to the inlet of the pump and through the heating tube. The very fast flow rate could help you achieve that temp increase by allowing you to drive the element harder....... this would work especially well with a pressurized supply, but could work with a tank also.. but do the math to see how many watts you will need for your flow rate before building... if you want to heat the same water in one-tenth the time, you will need ten times the power....

then again, you could buy an off the shelf commercial grade on-demand water heater and do the same...
BrunDog
Posts: 96
Joined: Wed Mar 25, 2015 6:56 am
Bot?: No

Re: Shortest PID sample and output periods?

Post by BrunDog »

Thanks. I have no problem heating almost 2 qt/min from 80 to 170 with a 5500 W element. The problem is PID tuning and response time.

-BD
Post Reply