How to use a PIDE loop to verify simulation

Remember81

Member
Join Date
Jun 2018
Location
Houston
Posts
2
Ok, so first let me say I am a complete beginner, so I probably will misuse some words but bear with me. How do I use an Enhanced PID block to simulate values to verify that it is working? background info: its supposed to be a PID loop that open and closes a valve, but Im not too sure how to simulate this on RSLogix 5000
 
Simulation is for inputs

You generally wouldn't use a PID / PIDE block to to simulate, especially if the response that you're looking for is the result of a PID. Not saying that it's impossible, just not how I would approach it

The PID block monitors an analog input, and produces a 0-100% signal to drive an analog output (or the time-slice of a discrete input). In theory, you could reverse the concept, feeding another PID's output and using it to drive that other's PID's AI, by inhibiting the input module and writing to the Local:x.I address.

But there are other, perhaps better ways.

Method 1:
If you are only interested in checking if the valve opens when the AI goes high and closes when the AI goes low, then you can simply force the raw AI value (using either forces or inhibiting the I/O module). This gives you complete manual control, and you can simply enter in various numbers and watch the result.

This method can be modified to use internal registers and expose them to the HMI, and have an InSimulationMode bit that enables the logic and provides the end-user the ability to drive the simulation themselves. Handy for FAT.


Method 2:
If you want to get fancy, you can write some code that writes to the AI address. I typically build an AOI that can be configured to work with fairly complex responses.

It's based on the equation
Code:
        (PV + k[sub]a[/sub]*PV[sub]a[/sub] + k[sub]b[/sub]*PV[sub]b[/sub] + k[sub]c[/sub]*PV[sub]c[/sub] .... )
PV' =   ---------------------------------------
              (1 + k[sub]a[/sub] + k[sub]b[/sub] + k[sub]c[/sub] .....)
where

PV is the most recent PV (code triggered on a timer)
PV' is the new PV.
PVa, PVb, etc. are various PVs determined by the current process (see below)
ka, kb, etc. are weighing factors for how much each PV component affects the current one.

For example, PVa could be the PV that the PID is trying achieve be it's current CV. I generally linearize this, so that at CV = 100%, the PVa will equal some max, at CV = 0, PVa will either be some minimum value (ambient temperature, or 0 PSI, 0 GPM, or whatever whatever seems appropriate, OR it could be PV', if the CV only adds energy but does not remove it.

PVb could be set up as a load, which may be constant or which may depend on other process conditions. The "load" can also just be "ambient" (22°C; 0 PSIG) to simulate radiant cooling or leaks.

PVc might be an upstream condition, like in temperature recirculation loops. I'll often put the upsteam PV in a time-driven FIFO to simulate process lag. The same can be done with the PV from a PID output.

And so on. If the k value = 0, the contribution of that PV is disabled, which means I can build a complex AOI, yet only use the number of factors that are needed for a particular process.

With this, you can get as creative as you want / have time for, and make the system appear as realistic as you need.

Good luck!
 
This is a very advanced topic. Getting a model for a valve requires some advanced mathematics ( differential equations ).
If you just need a model, any model then a first order filter will do.
K = exp(-Δt/τ)
y(n) = (1-K)*y(n+1) +K*u(n)
When
Δt is the update rate
τ is the time constant of the valve
Y is the position of the valve 0-100%
u is the control signal 0-100%

I model servo valves that have pretty fast response.
Some valves are not linear. That complicates the modeling.
 

Similar Topics

There is a chilled water cooling loop in our process cooling a roller. It has been about impossible to tune. this is in a tertiary loop. From the...
Replies
6
Views
3,217
Hey guys, I'm in need of some expert knowledge to assist in some RsLogix 5000 programming, FBD. I currently have PIDE Loop 1 and PIDE Loop 2...
Replies
8
Views
4,144
Hi erverybody. My question is related on how to use Feedforward to add a value to the CV of a PIDE intruction. I think is not easy and it is not...
Replies
3
Views
8,168
Greetings ... someone sent me a request for some student handsouts that I developed ... turns out that I had this hosted on my business website...
Replies
0
Views
130
Have a logix controller and I'm using the PIDE block for the autotuner. I've got the hang of doing it for direct control things like pressure...
Replies
21
Views
1,765
Back
Top Bottom