Use of on/off valves as modulating

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

mezhan

Member
Joined
Feb 7, 2013
Messages
14
Reaction score
0
Location
Fort Wayne
Hey all,

Been wondering if its possible to use a standard on/off ball valve and by turning the power on and off to it quickly turn it into a regulating valve. Idea is that since the valve takes ~5s to shift, I could turn the power on and off at a frequency that would keep the valve at a certain position.

The application is for use on my plate heat exchanger. I'd like to regulate the water flow on the media side to produce a certain temperature of the wort as it goes into the carboy

Since there is no positioner, I'd have to use a temperature transmitter and regulate the valve position based on the temperature I see downstream. Alternatively I could use a cheap flow meter.

Has anyone else ever done something like this before? I'm driven to try this as real regulating valves is in the hundreds of dollars and I can get a brass or plastic on off valve for 10 to 20.

Thanks in advance for any help.
 
Hey all,

Been wondering if its possible to use a standard on/off ball valve and by turning the power on and off to it quickly turn it into a regulating valve. Idea is that since the valve takes ~5s to shift, I could turn the power on and off at a frequency that would keep the valve at a certain position.

The application is for use on my plate heat exchanger. I'd like to regulate the water flow on the media side to produce a certain temperature of the wort as it goes into the carboy

Since there is no positioner, I'd have to use a temperature transmitter and regulate the valve position based on the temperature I see downstream. Alternatively I could use a cheap flow meter.

Has anyone else ever done something like this before? I'm driven to try this as real regulating valves is in the hundreds of dollars and I can get a brass or plastic on off valve for 10 to 20.

Thanks in advance for any help.


Could be done, very slow response time though. If your temp controller puts out a pulse, then you could use it ( depending on voltage and current draw) to drive the valve open. You would need to figure out a way to shut the valve though, or get a valve that has a spring return.
 
I'm hoping to get an analog signal to my arduino, then have the output based on a calculation. Then have a current to open and current to close.
 
Can you forward some information on the actuator?

Its definately not a problem to do feedback control based on temperature. You don't need to know the valve position you're at, but you do need to be able to make small adjustments and hold position. Depending on the actuator you may be able to slow down the the slew rate by pulsing or just using a lower voltage. Ideally you could maintain a constant position just by de-energizing the valve.

I'm assuming you're using a 1 wire temp sensor on the arduino side?

The other thing to remember on the mech side is that the valve curve on most ball valves is very nonlinear. So basically it will go from a trickle to a torrent over just a few degrees of valve movement. Depending on your accuracy requirements and actuator performance, that valve may drive some smarter logic than simple PID control.

My plan was to control flow on the wort side(feed forward with pid trim), since I'll have flow control already to aide in recirc, etc. Unfortunately my build is still in progress so I can't provide any results yet. Just curious why you're throttling the water side?


Is this the type of valve you're talking about?

http://www.ebay.com/itm/1-2-To-1-DC...t=LH_DefaultDomain_0&var=&hash=item3ceb7d1dad
 
Thanks for the detailed response!

The valve is exactly the one you show, actually. I wish I could find a better control method (something like a V-port ball valve) as I believe you will be correct in that controlling will be a very tight range.

I've got this temperature sensor, which I've wired up before so that I can watch the fermentation temps in the center of my carboy. Was very simple and easy to get working.

I think your idea for operating it will be spot on. So just send a signal along the OPEN or CLOSE path for a very short amount of time (250ms or so) to move it? Depending on the different between the PV (present value) and SP (set point) I'll continue to send the signals until it gets where I need it, right? Or did you find a tighter control method?

As for why I'm doing the media side, my intention was to reclaim the water city water into a container for use in cleaning (or one day hopefully CIP) so I will get the hottest water possible. But it may be that I use one on the product side instead if I can't get the control I need. Also I've heard ball valves are hard to CIP but I intend to use them on the product side for routing so my logic is a bit flawed.

Do you have a PID controller or were you able to write one in arduino? I'd was entertaining the idea of utilizing one, but they are a out of my programming capabilities.
 
Have you considered coupling a stepper motor to a valve to achieve variable flow control? A medium sized stepper can be had for under $20. Then you could couple it to any valve and write an sketch to modulate it. I believe you would need a stepper driver board as well. Those can be had for just a few dollars on eBay.

I've been thinking about doing this myself, but have not had the motivation as my setup is all about simple right now. (5 gal BIAB with an immersion chiller)
 
I typically just write the PID control myself and could certainly help out there if you get a sketch started. Probably only need PI (no D derivative) for this loop.

Hopefully someone will chime in on the best way to slow down the actuator motor as I'm a lowly mech eng that knows enough elec eng to be annoying. My assumption is that pulsing should give you full torque for a short period where lower voltage will provide a smooth response but reduce overall torque which could lead to the valve sticking. In the interest of robustness I'd probably try the pulse method first.

So if you want to try out this valve, here's how I'd take my first pass at it.

Step 1 - get it moving in a repeatable manner.

  • Write code to output a pulse train (square wave) with variables to tweak pulse width for on and pulse width for off.
  • determine min pulse that actually moves the valve, ideally this is 100ms or less. once you find the min, I'd double that value to give you some margin as things age.
  • Determine how many pulses it takes to fully stroke the valve.
  • If your real lucky and its fairly repeatable you can move a certain amount of pulses to get you in the ballpark prior to enabling your PI control.

Step 2 - setup your sensor.

  • I would run your sensor at 10 bit resolution. This will significantly speed up the data you receive from the sensor from 750ms to 190ms. This will help make your PI loop easier to tune. You will lose some fidelity .0625 degC vs 0.25 degC but I think that is still fine for beer.
  • sensors.setResolution( XXXXX , 10);

Step 3 - Test and tune

I would set up the basic PI controller such that:

  • Valve opens an initial number of "pulses" prior to PI loop active
  • PI control: Temperature SP(set point) - Temperature PV (process variable aka temp measurement) into the PI . The output would be the pulse rate / direction.
  • I would also want some clamps and anti-windup as part of the guts of the PI

There are many ways to solve this problem, I'm sure others will chime in with their thoughts.

Again if you get a sketch started I can certainly help out with the PI logic if you want to tackle it. Probably be easiest to just write a function for you to drop in to the code. I've thought about doing this myself, and always enjoy a new problem to solve. :)
 
Are you using the version of that ball valve with the position feedback sensor? If not I'd pony up the $25 and get the position feedback version. Then it would be a relatively straightforward programming exercise (not easy, but straightforward :)). I think trying to use PWM or the like to control the position of a standard ball valve will just end up being a exercise in futility.

Honestly, I'm amazed you can get a automated ball valve with a position sensor for $25 (stainless, no less!). That's mindboggling to me.
 
Are you using the version of that ball valve with the position feedback sensor? If not I'd pony up the $25 and get the position feedback version. Then it would be a relatively straightforward programming exercise (not easy, but straightforward :)). I think trying to use PWM or the like to control the position of a standard ball valve will just end up being a exercise in futility.

Honestly, I'm amazed you can get a automated ball valve with a position sensor for $25 (stainless, no less!). That's mindboggling to me.

could you provide a link for the one that has true position feedback? the only ones I've seen have limit switches at 0% and 100% but not full feedback.

in terms of control we don't really care what position the valve is at unless its at a stop. Rather we just need to be able to modulate it when we want to raise or lower the temperature. the key is how small a step can we move the valve at one time and is it repeatable.

if actual valve position is available then we can use the valve curve to help smooth out the PID response which would be nice but prob not necessary.
 
could you provide a link for the one that has true position feedback? the only ones I've seen have limit switches at 0% and 100% but not full feedback.

in terms of control we don't really care what position the valve is at unless its at a stop. Rather we just need to be able to modulate it when we want to raise or lower the temperature. the key is how small a step can we move the valve at one time and is it repeatable.

if actual valve position is available then we can use the valve curve to help smooth out the PID response which would be nice but prob not necessary.


I assumed the one linked had more granularity than "open" and "closed". I didn't really look too closely, though.

I'm not saying it would be impossible to do it without feedback, it just sounds like it's going to be a lot of time to get to something that kinda works.
 
I assumed the one linked had more granularity than "open" and "closed". I didn't really look too closely, though.

I'm not saying it would be impossible to do it without feedback, it just sounds like it's going to be a lot of time to get to something that kinda works.

I think the point is that there is feedback - in the temperature of the outflowing wort. Too hot open the valve a bit more, too cold close the valve a bit more. No need to know where the valve actually is.
 
I think the point is that there is feedback - in the temperature of the outflowing wort. Too hot open the valve a bit more, too cold close the valve a bit more. No need to know where the valve actually is.

Bingo:)
 
I think the point is that there is feedback - in the temperature of the outflowing wort. Too hot open the valve a bit more, too cold close the valve a bit more. No need to know where the valve actually is.

My point was if you don't know the current position then you can't predict what the effect of the input will be. Depending on the position of the valve a small input could make a small change or a big change.

Again, not saying it can't be done, but my guess is the amount of effort to get it to work properly is not going to be worth it.
 
I agree w/ Matt and BigBlock. The PID loop will take care of the control based on the temperature error. The feedback does look to only indicate limits, but that could do wonders to limit power draw in the PID loop when full open or closed just isn't enough.

Getting the right coefficients is the key. Whatever the control curve looks like, the proper coefficients should hammer the whole thing out. Warning though, I only have read and theorized. I have read that tweaking PID coefficients is a bit of an art, but the net should give some tips.

Here's a good read and possible code you can leverage:
http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/

I kind of agree with the stepper motor idea, but if you're stuck on the valve, I see two approaches. One is to pulse it, like you are talking. The other is to give it an analog nudge. Either way you'll need a full H-Bridge to reverse direction. That ends up a more complex PID as well. An analog H-bridge would likely be more costy.

The other concern with either approach is the motor will have a transient response and a steady one. That is, you'll have to hit it w/ a lot of current to break it loose, but once it's moving if you keep up that current, it's going to move faster than you wanted. With the slow nature of a temperature change down stream, I think you're asking for a lot of headache. Probably best to just dial in a "nudge PW" that works to tweak the valve a bit. Have a slow PID update rate. Nudge it. Wait. Nudge it again. etc.

Only thing to really do is buy one and experiment. Tell us how it works.

You might look at something like this, too:
http://www.alibaba.com/product-detail/2-way-stepper-motor-ball-valve_60104146643.html
 
I agree w/ Matt and BigBlock. The PID loop will take care of the control based on the temperature error. The feedback does look to only indicate limits, but that could do wonders to limit power draw in the PID loop when full open or closed just isn't enough.

Getting the right coefficients is the key. Whatever the control curve looks like, the proper coefficients should hammer the whole thing out. Warning though, I only have read and theorized. I have read that tweaking PID coefficients is a bit of an art, but the net should give some tips.

Here's a good read and possible code you can leverage:
http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/

I kind of agree with the stepper motor idea, but if you're stuck on the valve, I see two approaches. One is to pulse it, like you are talking. The other is to give it an analog nudge. Either way you'll need a full H-Bridge to reverse direction. That ends up a more complex PID as well. An analog H-bridge would likely be more costy.

The other concern with either approach is the motor will have a transient response and a steady one. That is, you'll have to hit it w/ a lot of current to break it loose, but once it's moving if you keep up that current, it's going to move faster than you wanted. With the slow nature of a temperature change down stream, I think you're asking for a lot of headache. Probably best to just dial in a "nudge PW" that works to tweak the valve a bit. Have a slow PID update rate. Nudge it. Wait. Nudge it again. etc.

Only thing to really do is buy one and experiment. Tell us how it works.

You might look at something like this, too:
http://www.alibaba.com/product-detail/2-way-stepper-motor-ball-valve_60104146643.html

Just to clear things up a bit, while there are a lot of people including controls techs and engineers who treat tuning as an art, its not magic. For SISO (Single input single output) systems like this we can quantify system response and stability margins of the loop. For most of what we do in brewing, its quicker just to do a quick tune using a zeigler nichols method or good old step and guess.
For my real job we make sure the tune is right before the equipment is even built.

If the valve can be moved in a repeatable manner with a reasonable min step size then we could tune a stable loop and quantify the stability as well as bandwidth(speed of response).
 
Just to clear things up a bit, while there are a lot of people including controls techs and engineers who treat tuning as an art, its not magic. For SISO (Single input single output) systems like this we can quantify system response and stability margins of the loop. For most of what we do in brewing, its quicker just to do a quick tune using a zeigler nichols method or good old step and guess.
For my real job we make sure the tune is right before the equipment is even built.

If the valve can be moved in a repeatable manner with a reasonable min step size then we could tune a stable loop and quantify the stability as well as bandwidth(speed of response).


That's the problem as I see it. Repeatability is likely to be crap.
 
Could be, won't know until someone tries.

I need to get a couple of these anyway so maybe ill order them this week and do some testing when they get here.
 
@BigBlock - yes, if you can model the switch than stability calculations can be done. (Not by me, but yes... :eek: )

I agree with all that you just have to get one and see.

Anyone have any input on how big (and linear or otherwise) the contribution of flow rate in a heat exchanger is?
 
Anyone have any input on how big (and linear or otherwise) the contribution of flow rate in a heat exchanger is?

Not sure exactly what you're asking, but this should get you started...

http://www.brighthubengineering.com/hvac/61166-preliminary-heat-exchanger-design-example/

Side note, re-read my last reply on tuning and realized I sounded like a bit of a DB. Was multitasking and work emails were making me grumpy :)

I started out working mechanical systems and controls was always a black box to me and most others I worked with. We also had a very poor controls team that didn't share info or knowledge. I went back to school for an MS with the mechatronics dept and it all came together. No more black box and I can design and understand the system from the operator input to the process output. Life is good.
 
Say this post last light, this morning I was ordering some components and I saw this valve. Would this work for what you want? It appears that you can control the flow incrementally better than a ball valve. Just a thought.

http://www.onlinecomponents.com/datasheet/7500383.aspx?p=44318802

The ones you linked to are solenoid valves (on\off) that can be sized to provide a given flow when open. I did find a different group of valves on that website that will take a 200hz PWM signal to control flow but they need 40psi+ supply pressure and max out at about 0.8gpm. Interesting find though.

http://www.deltrol-controls.com/sites/default/files/brochures/DPV1N 090512.pdf
 
Instead of making due with a ball valve, how about using one of the PWM solenoids that are used in Arduino robotics to operate the valve mechanism?
 
Since this is for the cooling water and also since a large varience would be acceptable (between min / max temps out of the wort side as it will all mix together in the fermented) it would be possible, and easier, to build a valve tree to give you step control of the water flow.
With the solenoid valves listed you could get approx 0.25 gpm steps. I don't know the cost for them so that might blow the idea right out of the water:D
 
Side note, re-read my last reply on tuning and realized I sounded like a bit of a DB. Was multitasking and work emails were making me grumpy :)

I didn't think you were being a decibel at all. :tank:



That website does help...and raise a whole bunch more questions for some other time.

What I was asking is if you change your flow rate by operating the discussed valve, what will the actual change be in temperature out of the cooler. IE. if you double the flow, will your temperature change double?

I see from that link that to double your flow, it will double your Heat Transfer Rate, Q. But then if you want to solve for what that will do to your temperatures, you get into the Log Mean Temperature Difference, which is a whole bag of algebraic cats.

Does that make sense?

I started out working mechanical systems and controls was always a black box to me and most others I worked with. We also had a very poor controls team that didn't share info or knowledge. I went back to school for an MS with the mechatronics dept and it all came together. No more black box and I can design and understand the system from the operator input to the process output. Life is good.

It's always better to go study something after you've worked with it. Context makes it all gel, doesn't it?
 
That website does help...and raise a whole bunch more questions for some other time.

What I was asking is if you change your flow rate by operating the discussed valve, what will the actual change be in temperature out of the cooler. IE. if you double the flow, will your temperature change double?

I see from that link that to double your flow, it will double your Heat Transfer Rate, Q. But then if you want to solve for what that will do to your temperatures, you get into the Log Mean Temperature Difference, which is a whole bag of algebraic cats.

Does that make sense?

Its been many years since I looked at sizing a heat exchanger and even then I never tired to model flow transients, so someone else may be able to chime in and correct any errors here....

So the calc can be done buts its a kind of a pita :(.

As you increase the water flow rate, the inlet temp - outlet temp for that flow will decrease since the water spends less time in the exchanger. That means that the average water temperature will be colder and therefore will provide more cooling to the wort. In addition the heat transfer coefficient is affected by water velocity and will increase as well, again providing additional cooling of the wort.

Trying to calculate this is a bit tedious the first time through and often inaccurate. If you have the exchanger its easier to collect some flow and temperature data (both inlets and outlets) at different flow rates and back calc heat trans coef for those flows.

Its definitely good to understand the physics but I don't think you need to run this kind of analysis for the problem you're trying to solve. If you know your system has the physical capability to cool the wort, then simple temp feedback should be good enough to control the water side flow and maintain you're target wort temp.

you might also want to look at some belimo control valves on ebay. They have valve/actuators with slower slew rates(60 seconds+) and some also have a 4-20ma positioner. Usually can be found for under $50. There are plenty of other valves on there as well, the Belimo's seem to consistently be available and relatively cheap.
 
Back
Top