PID to control a strategy variable

Hi there

I am new to working with PID loops and I’m wondering if my project will work well for one. I am looking to program a control strategy for a blower system which moves grain from one bin to another. I have a pressure sensor in the system to monitor the pressure in the pipe, and an electric slide-gate which controls how the rate of flow of the seed entering the system. The gate is controlled by a forward-reversing contactor. The gate movement is controlled and its position is calculated in the strategy.

My question is, can I use a PID loop to calculate the desired gate position based on pressure reading of the blower system? The desired pressure setpoint would be user defined from the HMI.

Hi Jegar. Welcome to the Opto forums.

Just to be clear, analog input (pressure sensor), digital output (slide-gate)?

Thanks, good to be here!

Yes, you’re correct. Pressure input is analog and the gate control is digital forward/reverse motor control.

Cool.
The other keyword you already mentioned is ‘strategy’.

So with that, yeah, we can dive in a bit and give some overview…

The digital output means you are going to run the PID as a TPO. Time Proportional Output.

In PAC Control you need to configure your slide gate digital output with the TPO feature.

Then you can add your PID loop and select the pressure sensor as its input and the slide gate as the PID output. The setpoint will be ‘from host’, which means HMI (groov view or PAC Display is my guess).

Then in your strategy, you need to setup your PID and in a looping chart (with a delay of course) you need to use the command Set PID setpoint every loop as needed.

As far as tuning and scan rate, it’s hard to say from here since there are a ton of variables that you will be well versed in.
Hopefully, you can play around a bit before a bunch of grain ends up somewhere it shouldn’t.

Of course, drop any questions here in the thread, bunch of folks are kicking around to help out.

Hi Jegar, I’ve attached a PAC Control strategy that has a PID using a TPO output. The ParkingLotHeater chart has an example of the looping strategy logic that Ben mentions. It’s a starting point, good luck.
CStore.R10.2b.BasicArchive.COMPLETE.v1.3.zip (14.3 KB)

1 Like

Ok, I see what you mean, thank you! If I understand correctly, the TPO controls the output using something like pulse-width modulation. My situation is a little different, but I think the concept could still work. My original description was unclear, so I’ll clarify. I am using 2 digital outputs to operate a forward/reverse contactor to control the gate motor. The position of the gate is determined by calculating travel time, as a percentage of a known maximum.

Instead of using the PID to operate the output directly, I theorize I could take the output value and assign it to a process variable to control desired gate position. That variable will be used in a different chart which is responsible for handling gate movement/timing. Does what I’ve described sound like it would work, or is there something I’m missing?

Ah, yes, rather different, but as you point out, easier.

So yes, your idea is the correct way.
Set up the PID, and point the output to the host. Use the PAC Control command Get PID Output and drive your gate from that as needed.

The chart delay that gets the PID output should take into account the PID scan rate you end up using.

Ok, right on! Thanks for the feedback!