PID problem...

taz3m

Member
Join Date
Apr 2008
Location
St pierre
Posts
23
In fact me is working on a project, which consist of heating water through solar panels and to be stored in a hot water tank at about 65 c , there is a cold water tank as well. the problem is that i got to mix water @ a temperature of 40 c in a 1 metre cube mixing tank. this process should be automated.

I know that i should use a PID block in my program, the problem is that i do not know much about PID block, can say i dont know anything...

I have read the help in simatic, but its not enough for me to sort this out...

I would appreciate help indeed...

Thanks......

the plc being used is siemens S7 300...

The control output will be the poump itself.. by using an inverter..

my feedback will be temperature and level...

If there is some way out.. pls let me kno..

if some1 has another solution other than using a PID, will be appreciated as well..;)

Thanks....
 
Do you even have enough sunshine to deliver sufficient BTU to meet your BTU demand?

What is flow rate of water heated to 65 C. What is volume of your thermal reserve ie tank? What is flow rate and time duration of 40C water?

What is temperature tolerance of the 40C water?

I really think you need to sit down and take a look at your thermodynamics before you start designing controls.

Dan Bentler
 
Dan makes a real good point about the hot water source. Are confident the hot water source will be at least 40o C? If not there is no way to make the system work.

Will the water in the mixing tank be continually used or is it a batch type process? This will make a difference in whether a PI loop is the best choice or how you may want to use the PI loop.

Are you sure the water in the tank will be used before it can cool? If not you will need to keep the mixing tank level low enough the you can add more hot water as needed. You will also need to know the true temperature of the hot water as that will determine how much water you need to add to change the temperature in the mixing tank. Also, the longer the 'cold' water sits in the pipes the warmer it will get. This will change it's cooling effect per unit mass.

As Dan said, the allowable error in the 40o C water temperature will probably be the factor that lets you know if you can do this. If you need to keep it within a degree it will rpobably be pretty tough. If you have 5 degrees to play with it will be quite a bit easier.

Keith
 
You also are going to need to know the temprature of your cold water.

If you have 65C hot water and 10C cold water then the mix ratio is .830L cold water to 1L hot water to obtain a 40C mix. But if the cold water is 5C then the mix ration is .710L to 1L.
 
Advanced Control. Controlling both water level and temperature at the same time

I am working now so I don't have much time. I told taz3m that this can't be done with a simple PID.

I got a previous PM and this application looks like is a continous process where someone is going to use water at varying rates and it must be at 40 degrees C. This means that there will be two control outputs. One for the hot water flow control and one for the cold water flow control. The sum of the flows must match the demand by keeping a level constand AND still keep the temperature at 40 degrees C.

Pandiani is working on the same problem. I hope he posts his model because he has already got a lot of the defining the problem done.

This is a MIMO ( mulitple input, multiple output ) problem.
Temperature feed back.
Level feed back.
Control out to the cold flow control
Control out to the hot flow control.
A simple PID will not work.
Fuzzy logic will but Pandiani wants to try LQR control so we will try that first.

It is impossible to control impossible to control two items exactly but I think we can get it close enough. I have a pretty good idea of how to approach this but I don't want to just present the answer. It is best if there is a little learning along the way.

I was told that the hot water pump can pump 4.2L/s.
What about the cold water pump?
What is the cold water temperature?
The sum of the cold and hot water pump needs to be equal to the demand to maintain a level.
What is the highest demand?

I was also told the mixing tank is 1 cubic meter.
Yes, there have been some PMs in the background.

Hopefully the usual group of people will get involved.

One more thing. Look at where taz3m is located. There should be plenty of sunshine.
 
OK to ruff out the numbers
40 C is about 104 F
65 C is about 150
4.2 L / S is about one gallon per second
delta T across solar heater is 46

Hourly he will need around 1,349,460 BTU

Ruffly on a solar collector the sun delivers 900 BTU per sq ft so if the collector is ideal he will need about 1500 sq ft of collector.

I think this is a large system which is going to be expensive. More emphasis and work is need on desired operating parameters and mechanical design before even starting on controls. I guess the controls are going to be cost wise a drip in the bucket compared to mechanical.

Dan Bentler
 
Hello guys,

In attachments you can find .pdf file that shows my process and current model.
Basically there are two equations:
one for level and one for temperature. There are different ways to write these equations. I used this:
Area*dh/dt = FL1+Fl2-Fl3

Now, for second equation I have some doubts. At first I used this:
V*dT/dt = Fl1*T1+Fl2*T2-(FL1+FL2)*T

Peter suggested to use following equation:
V*dT/dt = Fl1*T1+Fl2*T2-FL3*T
Where FL3 is flow out of the tank.
I'm not sure which equation for temperature is more appropriate and which equation describes the process better.
In the model I have, I used former equation.

That's all for now, I'll post more later...

model.jpg
 
Alaric's post got me thinking

There may be a way to do this with two PIDs. Use one PID to control the level. The output would be 0-100% flow. As Alaric said there will be some ratio between the hot and the cold water flows. The second PID would control the ratio ratio of the hot to cold water. The ratio be use to compute the what percent of the flow that would be hot and what percent would be cold.

tsz3m, are there flow meters to make for hot and cold water flow or this this done open loop?
 
Calculating the mix ratio is the easy part.

If the flow regulation can be very good then we need only control the hot and cold flow rates to achieve the desired temperature. Sounds simple enough when you say it, but when we add level control then we start to get interaction between the loops - that's when it gets over my head.

And all of this assumes well insulated tanks and pipes with neglibile heat loss before the fluid makes it to the process.

I'll be watching this thread for a bit of learning myself.


Peter Nachtwey said:
One more thing. Look at where taz3m is located. There should be plenty of sunshine.
Supposedly Mark Twain said that when Heaven and Earth were created Mauritius was created first and then Heaven was copied from Mauritius.
 
Last edited:
Originally posted by Alaric:

Sounds simple enough when you say it, but when we add level control then we start to get interaction between the loops - that's when it gets over my head.

That's the beauty of the ratio idea. The loops become reasonably isolated. There is only one flow command based on the required level setpoint. The ratio determines the relative contribution. If this were a truly continuous flow case (regulating flow not level) this would be pretty straightforward. The fact that the mixing tank feed water temperature changes for a given temperature error based on the mass of water currently in the mixing tank adds a level of complexity. The thing we have going for us is that required feed temperature can be calculated based on the temperature of the water currently in the mixing tank and the current level of the tank.

Keith
 
kamenges said:
That's the beauty of the ratio idea. The loops become reasonably isolated. There is only one flow command based on the required level setpoint. The ratio determines the relative contribution. If this were a truly continuous flow case (regulating flow not level) this would be pretty straightforward. The fact that the mixing tank feed water temperature changes for a given temperature error based on the mass of water currently in the mixing tank adds a level of complexity.
Yes, I pointed that out to Pandiani that the temperaure gain changes with the level this morning. The gain of the system is the change in output divided by the change in input at that current state. This means we need to calculate the derivative of the output with respect to level as a function of the level. This info may be necessary if we want almost perfect control at all water levels. We can change the PID gain on-the-fly if necessary but I think it is best just to get the information from tsz3m first, decide on a control method, and then worry about the implementation.

The thing we have going for us is that required feed temperature can be calculated based on the temperature of the water currently in the mixing tank and the current level of the tank.

Keith

d PVTemp/dt=(FL1(t)*T1+FL2(t)*T2-FL3*PVTemp)/Volume;
Volume= Area*PVLevel;
d PVLevel/dt=(FL1(t)+FL2(t)-FL3(t))/Area;

FL1 and FL2 are the hot and cold flow. FL3 is the out flow.

Note that the units match. Also, the system gain changes with the level. The higher the level or volume the lower the system temperature gain is.
These are the equations that can be used to simulate our control system once we get more information.

Pandiani, now I think your example is too simple and LQR isn't necessary but we can do it anyway and compare the results.

Fun!!!.
 
Last edited:
Very fun indeed....
Ok, I agree we should use following equations:
Area*PVLevel*dPVTemp/dt =FL1(t)*T1+FL2(t)*T2-FL(3)*PVTemp
Area*dPVLevel/dt = FL1(t)+FL2(t)-FL3(t)

Now, I was trying to figure out how to make linear state space model, but we have produce of two variables in the first eqution. Not really sure what to do next.
Peter, this is maybe simple example, but it is good to lear from simple things. Later I would add time consta of actuators - control valves Ka/(sTa+1) to make thing even more fun. But we need to make way to present this system in linear form in order to able to make state space representation...
 
Pandiani said:
Very fun indeed....
Ok, I agree we should use following equations:
Area*PVLevel*dPVTemp/dt =FL1(t)*T1+FL2(t)*T2-FL(3)*PVTemp
Area*dPVLevel/dt = FL1(t)+FL2(t)-FL3(t)
Why do you insist on removing the divisor from the right hand side? Yes, ths system is non-linear. We can't use state space UNLESS we assume the level is constant at some level like 1 m. Taz3m said the mixing tank is 1 m^3. This is why differential equations are preferred to state space. A system of non-linear equations is easy to solve too. Just use RK4. The problem is that all the LQR formulas go out the window and you end up solving for the gains using a optimizer like I did in my first response to your post on sci.engr.control.


Now, I was trying to figure out how to make linear state space model, but we have produce of two variables in the first eqution. Not really sure what to do next.

d PVTemp/dt=(FL1(t)*T1+FL2(t)*T2-FL3*PVTemp)/Volume;
Volume= Area*PVLevel; // This was a hint and assume it is constant
d PVLevel/dt=(FL1(t)+FL2(t)-FL3(t))/Area;

obviously we can't be dividing by one of the state variables.

Peter, this is maybe simple example, but it is good to lear from simple things. Later I would add time consta of actuators - control valves Ka/(sTa+1) to make thing even more fun. But we need to make way to present this system in linear form in order to able to make state space representation...

I have been very busy the last few days and I haven't had time to do much with this and I probably won't until the weekend. Where is taz3m.
 
Originally posted by Peter Nachtwey:

Where is taz3m.

This is his first post. I suspect he figures this is like many other automation forums where you post something and wait two days for a response. Won't he be surprised when he comes back?

I'm going to toss together a quick SimApp worksheet based on what Pandiani posted. I'll drop it in here when I am done.

Keith

Edit: I added the SimApp worksheet.
 
Last edited:

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,628
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,114
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
2,985
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,423
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,306
Back
Top Bottom