Start Simple
kamenges said:
I think the biggest deterent to using the plc PID instruction is system modelling. Unless we can hook it up to a true external process the output of the PID instruction won't do us much. We could develop a reasonably simple system model in the plc. But we wouldn't be able to handle anything real complex.
Now, if you could tie the output into something running VisSim or something like that...
Keith
How complex do you think those web PID simulations are? We have no idea how they implemented their plant, but what is worse is that we can't change the plant. We can only change the PID gains. We can make our own plant equation and as long as it is kept simple we should be able to implement it in one compute block. Do to this we should review the simple first order filter. To make a simple 'plant' with this simple filter, one only needs to do this:
PV
= PV(n-1)*(1-K) + CV
*(K)
Where K is a fraction close to 0.0 like 0.001.
My documentation says that the CV on a SLC PID only goes to 16383 so we should probably multiply CV
by two if we want the PV to cover the full range of -32768 to 32767.
Here is something to think about....
We might have a plant where we are measuring the temperature but there might be ( almost certainly ) a time constant between the true temperature and measuring device. In this case we need two equations.
True Temp
= True Temp(n-1)*(1-K1) + CV
*K1
Meassured Temp
= Measured Temp(n-1)*(1-K2) + True Temp
*K2
PV
= Meassured Temp
K2 and K1 are small constants close to 0.
More to think about..
We are assuming the heat added to the system is CV
*K1. However, this certainly will not be true as the plant temperature reaches the heater temperature. The heat flow will slow down as the temperature gradient decreases. Another equation is required to compute the true heat transfered from the heating elements to the plant. I will leave this to later if anyoneis interested. Some of my other posts have info on computing the coefficients K1 and K2 given you know the time constants.
Other items we can add are heat transfers due to product entering and leaving the plant. OK, so we are up to 5 equations now. No big deal.