PID problem...

Taz3m, if you want I can send you my STEP7 process simulator with implemented FB41. It is process+controller, all in one STEP7 program. I think it would be usefull. You can search the board for SOPDT simulator. I will just add FB41...

Peter Nachtwey said:
I am starting on Pandiani's state space model.

I wasn't able to find smart way to avoid that nonlinearity. I never has example of how this things are done. Most used approach is to make some model, perform simulation and adjust PID's gains in such way to obtain acceptable response. In fact, in practice PID gains are adjusted by trial and error on real object.
I can't wait to see what Peter will do...
 
Pandiani said:
Taz3m, if you want I can send you my STEP7 process simulator with implemented FB41. It is process+controller, all in one STEP7 program.
I think that would be good because taz3m needs help with the basics too.

I think it would be usefull. You can search the board for SOPDT simulator. I will just add FB41...
Did you get that working? I haven't touched a S7 since we worked on that.

I wasn't able to find smart way to avoid that non-linearity. I never has example of how this things are done. Most used approach is to make some model, perform simulation and adjust gains in such way to obtain acceptable response. In fact, in practice PID gains are adjusted by trial and error on real object.
I can't wait to see what Peter will do...
There is no way to get rid of the non-linearity. All we can do is tune the system well enough so that the level doesn't change from the assumed level of 1 meter.
ftp://ftp.deltacompsys.com/public/NG/Mathcad%20-%20LQR-Pandiani.pdf

I will update this file when I work on it more. Right now the sun is out and it is a crime to site in front of a computer when one can be out in the sun.

I am going to use my optimizer technique to calculate the PI gains and I will not assume the system is linear. Pandiani, just because you see something in a book does not mean it works in reality, but you are finding that out. My differential equation approach with optimizer is much more general.
 
Peter Nachtwey said:
Did you get that working? I haven't touched a S7 since we worked on that.

Yes, I remember I have changed that project. There are two function blocks: FOPDT and SOPDT. I have used discrete aproximation of continuous system. Bilinear (Tustin) for FOPDT and last difference method for SOPDT. I think it works well. I'll find it somewhere in my archive and add FB41 to test it...
 
Now, now, here i am at the start point agian... :) I dont know where to head..

I will try to discuss this matter once more with Senior, and see to that..

Ok Pandiani, send me the Step7 process simulator, i will make an effort to understand it.. thanks

.....
 
taz3m, here is process simulator. It is in Bosnian, because I didn't have time to translate it. I think that doesn't really matter because you're interested in using FB41. I hope you won't have problems trying to open the project because of different regional settings in Windows. This simulator is different from SOPDT that were created by Peter and me. This one uses different algorithms. As you'll see it is not complicated using FB41 at all.
If there are more people interested in process simulator itself, I'll translate the source code to help better understanding.

All you need to do is to set up gains you want, download to PLCSIM or real PLC. Start CPU, set M3.0 and M3.2 to 1, set MD40 (setpoint) to value you like and watch how process output MD20 is changing (all for First order system, it's similar for SOPDT). I hope, you'll find it useful.

Asim Vodencarevic
 
Last edited:
I have updated my transfer function and corrected a few errors

I had two errors. The first is that the temperature would cool down to 0. Obviously the temperature will only cool down to ******t temperature. I assumed that ******t temperature is the same as the cold water temperature. The second error was that I was dividing by level of the equation for the flow.

I added the equations that convert the flow and temperature control outputs to two separate hot and cold control outputs.

ftp://ftp.deltacompsys.com/public/NG/Mathcad%20-%20LQR-Pandiani.pdf

Notice that when I convert the control output for the temperature and flow that I take into account the level of the tank. This almost linearizes the transfer function from the point of view of the two PIDs. It is close enough where level changes will barely affect the performance.... I hope. We will see when I get the simulation done.

taz3m said:
Now, now, here i am at the start point agian... :) I dont know where to head..

I will try to discuss this matter once more with Senior, and see to that..
You are not at the starting point. What did you plan to do with just one PID? You now have some plans as to how to approach this problem. I warned you when you first PMed me that this was not a trivial problem. I also said that this problem envolve much more than getting a PID working. Getting the PID to go is the easy part. There are many here that can tell you how to do that.

I don't expect non-engineers to model a system like this and figure out how to merge the two PID's control output. I do expect that anyone that is 'senior' should be able to get a FB41 block to run. It is his job to train his people if the title 'senior' is to have any meaning rather than just being old.

You are lucky that some of us like the challenge and solve these kind of problems just like other solve Sudoku puzzles.

Now to do the simulation and find the PI(D) gains tha minimize errors or the cost function. I may just start with proportional only control. This will remove the FB41 issue and I think it may be good enough.
 
Peter-

I took a look at the PDF you posted and have a question. I still have a hard time reading state-space system representations because I'm so weak in linear math so I may be missing something. It looks like your disturbance matrix has the demand affectine temperature? Am I reading this correctly? And if I am why is this true? I can see that the demand will have an indirect affect on temperature (potentially) by changing the water level in the tank. But from an open loop standpoint, taking water away from the tank doesn't change the tank temperature.

tas3m, take a look at thins link for a SimApp manual:
http://www.simapp.com/downloads.php

It will give you some idea of what all the blocks are. Most of them are basic math blocks(adds, multiplies, divides, etc. The three that are more complecated are the sender/receivers (blocks with text inside like 'Fhot'), first order response blocks (the blocks with the curves drawn inside, used for valve response) and the PI blocks which inplement the controllers.

I am pretty much bowing out since you are in very good hands with Peter and Pandiani. They will be able to help much more than I can. I suggest you listen to their advice carefully.

Keith
Keith
 
kamenges said:
Peter-

I took a look at the PDF you posted and have a question. I still have a hard time reading state-space system representations because I'm so weak in linear math so I may be missing something. It looks like your disturbance matrix has the demand affectine temperature? Am I reading this correctly?
And if I am why is this true?
The demand shouldn't directly affect temperature as long as there is no infeed. The demand will decrease the heat stored in the tank. The heat or energy in the tank is proportional to the volume X temperature. I will look at this again to make. The heat is divided by the volume. This way the heat goes down as the tank is drained. It is this fact that makes the system non-linear. Any hot water added to a small volume will have a bigger affect on temperature than if the same amount of hot water is added to a full tank.

I can see that the demand will have an indirect affect on temperature (potentially) by changing the water level in the tank. But from an open loop standpoint, taking water away from the tank doesn't change the tank temperature.
I will look at it again. The demand should not change the temperature all by itself but it is removing heat. The out flow is also reducing volume in the same proportion so the temperature should be the same.

It is nice to know that someone is paying attention.

I am pretty much bowing out since you are in very good hands with Peter and Pandiani. They will be able to help much more than I can. I suggest you listen to their advice carefully.
I would hope that you would continue to update your simulations as tweaks are made here.

Pandiani, did you see what I did to almost linearize the system. I believe the system can be linearized with a little more effort. I was just looking for something quick that would get me 90% there with only 10% of the effort.
 
Oops, I stand corrected

kamenges said:
Peter-

I took a look at the PDF you posted and have a question. I still have a hard time reading state-space system representations because I'm so weak in linear math so I may be missing something. It looks like your disturbance matrix has the demand affectine temperature? Am I reading this correctly? And if I am why is this true? I
I have changed my simulation around a few times. I had a version that kept track of heat but I can see that this is not necessary if just keeping track of temperature.

I am glad someone is watching. I am writing my version of the simulator and gain optimizer now. I will use Scilab.

I updated the .pdf file
 
Last edited:
Peter, I have same question like Keith, I would expect that demand(t) which is flow out of the tank exists in open loop transfer function. But since original equation is dTemp/dt = (FLh*Th+FLc*Tc-FLout*Temp)/Volume, I expect to see that in disturbance vector. You said you updated your .pdf file, but there is still vector [0; -1] as disturbance, Not really sure about this, maybe I'm missing something here....
 
Last edited:
Pandiani said:
Peter, I have same question like Keith, I would expect that demand(t) which is flow out of the tank exists in open loop transfer function. But since original equation is dTemp/dt = (FLh*Th+FLc*Tc-FLout*Temp)/Volume, I expect to see that in disturbance vector. You said you updated your .pdf file, but there are still vector [0; -1] as disturbance, Not really sure about this, maybe I'm missing something here....

The -1 is there because the demand subtracts from the water in the mixing tank.

There is a lot to this simulation so I might not get done till Tuesday.
 
That is OK, but I thought that first element should be different from zero. Output flow in subtracted in both equations, so it is little unclear to me why it is not accounted in the open transfer function.

I see how you approach to linearize the system. I was thinking to use Taylor's approximation around Level0. When you said that we can assume level is little changing around Level0, first that crossed my mind was first approximation using Taylor series (substitute 1/Level with -1/Level0^2 (Level -Level0). Maybe to use this in order to obtain complete linear system?
 
Last edited:
Also i dont know how to programme (just on a thinking spree) this since ive never done PLC in my life but im doing this one project whihc might need,
"Cant you install a differntial pressure sensor or something of the sorts to calculate the demand. now basically you need to maintain the flowrate for that differntial pressure and the 2 valves need to be complementary. i.e
FL1 + FL2 = FL total.
thus ,
FL1/FLtotal + FL2/FLtotal = 1.
therefore
Signal to FL1 + Signal to FL2 = 1.
and hence compliemtary, Obviosuly im guessing the 2 proportional valves arent linear. thus you need to scale and change the values a bit. but it should work. also if instant control isnt of too much concern, you can use a multitude of parallel if and else if statements to bring the input signal (mixed temp) to the desired setpoint temp.
 
Im sure you are right Keith, i should listen to their advice carefully,...

Thanks for the manual it will be of great help im sure...

peter to tell you the truth, i have take a look to your pdf.. hmmm, nice... hope you understand me..

I will try to understand it, but i will have a lot of questions..

Firstly how do we know that a system is linear or non-linear..???

surely the LInear one is more easy to work with, since you are trying to linearize the system.

I will keep in touch since i learn much from you... thanks,, im reallly fortunate...

taz....
 

Similar Topics

Dear all . I made a program for boiler tank using TIA V15 , the program consists of 2 PID blocks in OB30 . but the PID didn’t work automatically...
Replies
3
Views
2,678
Dear all . I made a program for boiler tank using TIA V15 , the program consists of 2 PID blocks in OB30 . but the PID didn’t work...
Replies
1
Views
1,134
Hello Friends; I am working on a GE Funac LM 90-30 software. I face the problem to set the CV value when PID in auto mode. The parameters are set...
Replies
13
Views
3,056
I had a problem on a hydraulic servo controlled cylinder, which I believe was caused by the PID loop and the cylinder reaching a hard stop at one...
Replies
10
Views
2,460
We have a machine we're trying to commission. It's a web converting machine. It takes webs of foil, wicking paper & a label and creates a chemical...
Replies
1
Views
1,313
Back
Top Bottom