Mixing Water to Desired Temperature - PID?

redtortoise

Member
Join Date
Feb 2010
Location
Melbourne
Posts
4
Hello,

We have two supplies of water: City Water at 15 degrees Celsius and Chilled water at 2 degrees Celsius. Both supplies have proportional valves on them. Further along we have a temperature probe which measures the temperature of the mixed water. We need to adjust the proportional valves until the desired water temperature is being supplied. Until the water reaches the required temperature, a dump valve will dump the water. There is a flow meter further along the pipeline to measure the volume of water supplied. Both proportional valves will need to close when the required volume has been supplied.

We are using a CompactLogix PLC. Should a PID instruction be used for this application? Any help appreciated.

Thanks.
 
You didn't say heat or cool. I'll assume cool. You have 2 control loops.
1) PID to control the chilled (2C) valve. Temp probe input.
2) Fixed ratio format to control the other valve. Flow meter input. You could use a PID in this loop too, but I don't see a need.

This might be enough.
If you have problems with the PID, you might need to subtract 2C command position from 15C command position.
To understand this, start with the cooling at 0%. Adjust 15C valve until you have proper flow. Next, as cooling valve opens, close 15C valve by the same amount. Pressures and lines sizes are assumed to be the same.
 
Last edited:
Hi guys,

Keithkyll: At this stage, the customer would like water supplied at 9C, so I would think cooling would be most suitable. So with your suggestion, the 15C valve would begin fully open and then the 2C valve would gradually open until the desired temperature was reached? This would not allow the supply of water at 2C would it? Although it has not be explicitly requested, I would ideally like to be able to supply water at any temperature between 2-15C. Maybe I'm making life too dificult?

Thanks again.
 
Hi guys,

Keithkyll: ...the 15C valve would begin fully open and then the 2C valve would gradually open until the desired temperature was reached? This would not allow the supply of water at 2C would it? ...
Fully open doesn't take in to account the flow meter. I thought you needed to control flow as well.
Now I see the flow meter just measures amount, and you don't need to control flow.

Back off on the 15C valve as you opened the 2C valve. Lets shift temps a bit for sake of discussion. 0C and 12C. For 9C, the positions would be 0C=25%, 12C=75%. 6C would be 50-50.
This maintains flow equal to one valve fully open. It's the same as your shower. You increase the hot a little, and back off on the cold to maintain the same pressure. A single handle makes it easier. For your 2 valves, you slave them together. The PID opens the cool valve, and the inverted output drives the heat valve (or vice versa).
 
Last edited:
Actually, this might be a great program for feed forward control.

Measure the temp and flow of the cooling water and the process water. It is a simple calculation (method of mixtures in your Physics 101 text) to determine the relative proportions of the two water flows to get the desired final temp. Measure it, and you could use a PID (or else just a "finagle factor multiplier on the proportion) to fine tune the proportions to get the exact temp.
 
Did you consider use of split range PID loop? Then you would only need one PID loop to control both valves. One valve would operates if cooling is necessary and another for heating. Pretty simple
 
Hi guys,

Thanks for your suggestions. Unfortunately I don't have a lot of knowledge of the PID instruction or the physics principles mentioned. Looks like I will have to do some study. If you have any recommended information sources, they would be greatly appreciated.
 
Don't make this hard. NO PID REQUIRED

If you don't care about flow, only temperature then
Assume Flow=100%
Open the hot valve F*(SP-2)/(15-2)
Open the cold valve F*(15-SP)/(15-2)
This will give you the flow equivalent to 100% flow from one valve. You can ramp F, flow, from 0% to MaxF. MaxF=100%*(15-2)/max(15-SP,SP-2)
If you want you can start by limiting MaxF to 100% for now.
This is open loop control and assumes the flow is proportional to the control signal to the valve and the temperatures of the incoming water is really at 2 and 15 degrees C. Start there. This will get you very close with little effort. Come back when you have this working. By then you will have more questions and more know what information is important to share with us. Then we can add a PID to correct for temperature errors.
 
Thanks Peter. That's a great and logical starting point for me. I think it will be useful to set initial valve positions for later adjustment by the PID(s) as well.
 
I think there is a better way to do it.
1. Create a one PID loop.
2. Assign PID loop output to first valve (does not really matter witch one)
3. Assign same PID loop output to another valve inversly - ( 0% PID output = 100% valve position and 100% PID loop output = 0% valve position or Valve Position = 100- PID out)
4. At first point when PID starts it will open one of the valve to 100%, but eventually PID loop will drive both valves to a position when you process temp. equal your set point.
 
I think there is a better way to do it.
1. Create a one PID loop.
2. Assign PID loop output to first valve (does not really matter witch one)
3. Assign same PID loop output to another valve inversly - ( 0% PID output = 100% valve position and 100% PID loop output = 0% valve position or Valve Position = 100- PID out)
4. At first point when PID starts it will open one of the valve to 100%, but eventually PID loop will drive both valves to a position when you process temp. equal your set point.

EDIT: Nevermind...I misread your post...Yours would deliver equivalent of 100% flow rate of one line.

I would think you'd want to fully open the valve that's closest to the setpoint and let the PID control the other one. If it can't get within tolerance, then begin ramping down the fully open valve until it does.

I think Peter's math is even better since it will start out very near setpoint and not have to dump water until the PID gets good control.
 
Last edited:
I think there is a better way to do it.
1. Create a one PID loop.
2. Assign PID loop output to first valve (does not really matter witch one)
3. Assign same PID loop output to another valve inversly - ( 0% PID output = 100% valve position and 100% PID loop output = 0% valve position or Valve Position = 100- PID out)
4. At first point when PID starts it will open one of the valve to 100%, but eventually PID loop will drive both valves to a position when you process temp. equal your set point.

That doesn't take into account ramping up and down the flow. Think about this. A 1% change in a valve will affect the temperature MUCH more when the total flow is 10% than when it is 100%. This is a factor of 10 to 1. This means the PID gain needs to be scaled as a function of flow too. Otherwise the gains may be too high at low flows.

First redtortoise should get the open loop control working as good as he can. Then we will add a simple P gain control and do something similar to what you suggested. Simply add the control output to the hot and subtract from the cold but this value must still be scaled by the flow.
CO=Kp*(SP-PV) // PID Control Output
Open the hot valve F*((SP-2)/(15-2)+CO)
Open the cold valve F*((15-SP)/(15-2)-CO)
You can see that the control signal is still scaled by the flow and because the P gain doesn't care about sampling at even intervals this too should be very simple to implement and no PID block required,,,,,, yet. If this is good enough we can stop here. It should be very close. If not then it is probably best to use a PID block and use an integrator to calculate the control output, CO.

You can see this method will control temperature even when ramping flow up and down. There will be no sudden valve openings to 100% and hunting to reach the set point. Everything should be smooth and stable.

An issue that hasn't been brought up yet is where is the temperature sensor. If it is far down stream there will be a dead time inversely proportional to the flow.
DeadTime=VolumeBetweenValvesAndSensors/Flow

I was too long winded. OkiePC got his post in first.
 
Last edited:

Similar Topics

We have a system using a Omron G5 Servo. The motor has failed and Omron has advised the delivery time 4 months for a new motor! I'm not overly...
Replies
3
Views
1,634
HI, In a mixing vessel tank, it was maintained with a product temperature of 70 degree. When vacuum applied to the tank, the product and jacket...
Replies
27
Views
5,294
Hi all, about to set up a flow loop in our garage that will be mixing oil and water for some water cut testing. In the past we've basically put a...
Replies
5
Views
1,487
Hello This is my first post on this forum, so bear with me. I'm working with a DeviceNet system where there needs to be a transition on the trunk...
Replies
5
Views
2,507
Is it against code to mix voltages within one force guided relay? I have a force guided relay with a 24 VDC coil. This relay has five normally...
Replies
9
Views
3,619
Back
Top Bottom