StillDragon® Community Forum


Be part of our community & join our international next generation forum now!

In this Discussion

My PID Experiments

After reading about the PID's and wanting to have a tool at hand with which I could control my RC temp better, I ventured out to build my own.

Here's my setup



  • 50L milk can boiler
  • 5500W heating element w/ SD controller
  • 4 x 4" ProCap plates (max)
  • 4" RC
  • 4" copper packed section above RC (catalyst)
  • 2" PC


  • Johnson Control valve VG1241AE+906GGA 1/2" operated either 0-10V or 4-20mA
  • Automation Direct PID Controller SL4848-CR 4-20mA output
  • Auber Ins 1/2" NPT threaded PT100 1 1/2" length

My sensor location is in the RC about in the middle (height) and 90 degree rotated from the inlet/outlet. A friend milled and welded a 1/2" port to it and I could install the sensor without touching the pipes. The valve is plumbed between my coolant supply (municipal water) and the PC. PC and RC and in series (I know, it can cause issues but I'm getting to this part later). Power for the valve is coming from an old AC brick that I had laying around. I bought a small housing for the PID so the wiring can be neatened up at the end. Wiring up was relatively easy with the help already provided by @CothermanDistilling and @grim. Before putting everything together, I made sure that I could open and close the valve in manual mode. So far, so good...

... (more to come in future posts) ...



  • Hope it runs as you expect, be good to get your feedback once tuned in. I have the same valve plus a different PID and temp probe sitting ready for me to put together, I struggle with the control the pid via water temp in the condenser, my head has been telling me to use the vapor temp after the RC, same as the location of the basic temp sensor thermowell. But appears everyone is doing it the other way and achieving results. I may need to test both methods and work it out one way or the other.

    I will need 2 holes drilled and threaded, plus a plug to fix what does not work!


  • Vapour temp is a fantastic way to go of doing neutral just make sure its not at the top of the column. A foot of packing above the probe is the way to do it.

  • edited December 2015

    @fadge - Give it a try on the vapor temperature - I had the same thought, because it really does make sense. In a typical heat exchanger scenario, you'd absolutely measure the fluid flow out on the product side and adjust the coolant side accordingly with the PID to get your target product temp. Easy peezy.

    I tried running it once, on the little rig, and it didn't work at all as expected. Maybe my probe position wasn't ideal, or my PID settings were all off, but from what I saw, the way it reacted was beyond just tweaks. It would do all sorts of nonsensical things trying to control the vapor temp (I'll get to this later).

    I did think about it for a while, and really, lots of variables come into play to determine the vapor temperature and the speed of change of the vapor temperature, which will impact the ideal PID settings. Drove me nuts for a while since I was convinced this was the right way to go.

    Where this model differs from the traditional heat exchanger approach is that the primary control variable of the reflux condenser isn't the temperature of the vapor stream, it's the ratio of condensate returned as reflux, which alters the distillation parameters, which results in a lower vapor temperature passing through. I think this is the crux of getting it to work correctly. This is where the heat exchanger control analogy breaks down.

    I would imagine to get this to work over a wide range of operating temperatures - higher/lower boiler input power, higher/lower coolant temperatures, higher/lower wash abv, you would need to put a number of operational guardrails in place on the control system that are beyond the ability of a simple PID to handle.

    For example, you would STILL need reflux condenser coolant side temperature control. You need to be able to control the RC coolant temperature to operate only in a narrow band around the setpoint. This is the issue I ran into above. The PID would start demanding more flow through the RC to drop the vapor temp, pushing the reflux temperature deep into sub cooling. Well past 100% reflux, shutting the column down, no vapor flow, but the temp at the top of the column still holding relatively stable, falling slowly. PID is completely running blind, thinking it needs to try harder to drop the PV. It's not seeing a change in vapor temp because we've eliminated the flow through the RC entirely.

    Every system would be a little different, but to handle for this, you would need a way to put a rule in place that says:

    "The reflux coolant temperature should never be more than X degrees below the vapor temperature set point".

    Then you would need to introduce dead time for the column to equilibrate at the new temperature setting before allowing the system to attempt to make additional changes. Another area where PID falls short, you can't program for dead time or delay. You'd also want to introduce a control on the speed of change, for example: "Do not allow the RC temperature to change more than X degrees in Y minutes".

    You'd have a kind of cascade control where the vapor temperature control is controlling the reflux condenser control setpoint within a set of defined bounds.

    Maybe I'm overthinking it, I never got around to trying it again, as the way I saw it, would require a big investment in money and time to get a PLC system up and running. Seemed way easier to just control RC temp and allow the operator to adjust as necessary.

  • edited December 2015

    Or another option that might be easier to manage, use an LM style setup, use a single external condenser collecting reflux, have the primary control PID control a 3 way diverting valve to control for reflux ratio (I don't think you can use a simple overflow model with a 2 way). The three way can directly control reflux ratio from 100% reflux to 0% (active) reflux. Measure the temp directly below the condenser (with a shield) or at the column top.

    Use a second PID (not cascade) to control the reflux temperature to prevent sub cooling. However, keep in mind that this will be set HOT in comparison to where we'd typically set it.

    Use a product cooler on the distillate take off to drop the distillate temperature into the range you want to collect at.

    To maintain a specific vapor temp setpoint through the run, the system will need to increase the reflux ratio through the run to keep it constant. From an operational standpoint, would manifest as a slowing of the product output through the run.

  • edited December 2015

    Sorry to keep going, but I will. Like I said, I spent a long time agonizing over this.

    If you look at the LM model example, you'll see what I think is the big difference. You can control for reflux ratio and reflux temperature independently. You can't do this in a CM model still. You are attempting to do the same exact thing in both systems, but with the CM you need to INFER the reflux ratio based on the reflux coolant temperature.

    The other difference is that in the LM model as I describe above, the power input into the boiler will not impact the reflux ratio. In the CM model, higher power will reduce the reflux ratio (as vapor speed increases the reflux condenser becomes less effective). Also the impact of the reflux coolant temperature is minimized as well and can be controlled independently.

    So, to get this to work in the same way in a CM setup, you need some level of guardrails and some amount of predictive intelligence, doable, but more complex than just a single PID on the vapor temp.

  • edited December 2015

    To get this back on track:

    @Unsensibel said: My sensor location is in the RC about in the middle (height) and 90 degree rotated from the inlet/outlet.

    This is a good position (middle/50%) - I would not go towards the top. Our temp sensor is mounted slightly below our outlets - at the top - and it is not ideal. I would say the max is 1/3rd from the top, but half way is better.

    This is especially the case if you live in cold climates, and have cold coolant. With very low flow rates, you may create a temp gradient in the RC. Measuring at the tippy top, or the outlet, may not be accurate. If you have warmer coolant and thus higher flow rates, you might not notice this, but with 50F coolant, you'll see it.

    That said, I wouldn't go much below 50%, as you risk doing nothing but measuring inlet temperature.

  • I am at about 2/3 the way up the RC...

    let me know if you need any input on the RC setup...

    Oh, and I tell ya what, when you separate RC and PC, or at least run them parallel, and use a danfoss mechanical thermostatic valve for PC, you will never go back...

  • Cotherman's PID numbers are a good starting point - just make sure you convert the settings to ones appropriate for your controller.

  • start with default PID (other than making sure it is set to 'cool', not 'heat', and the things like probe type... and make changes one at a time, test response by cutting the element and turning it on a minute or two later and also by moving the temp several degrees... do not try to get it to move to fast at first...

    Also, you may or may not want to program the lower limit to always allow a tiny bit of flow... my controller is set to 77(7.7mA) minimum for my johnson valve, if I want it completely off, I shut off the pump or shut off the PID and manually move the valve to the closed position.

  • I am thinking I want a separate switch for the valve that does closed/PID/open basically, it sends 0v/PID/10V based upon a 3-way switch position.... but first I have bearing to replace in the washing machine that sounds like cross between a jet engine and punkins washer, and a garage door spring to wind.... :-)

  • edited December 2015

    We have a 2-way, one selection is 100% flow rate (open valve 100%) - the other selection passes control to the PID. For 0% flow, we have another switch that turns off the pump.

    The Johnson manual has the wiring diagram, it's pretty simple.


    Screen Shot 2015-12-30 at 7.40.30 PM.jpg
    237 x 407 - 12K
  • @grim, I'm on a phone so can't write lengthy explanations but have a think about my previous post.
    A probe halfway up a 2m column with a set point of 85 degrees.
    Solves the lack of over shoot issue but will maintain a still head temp (at the top of the column) of 78 degrees.
    Bang, auto az @ max thoughput.

  • edited January 2016

    PID Parameters

    In general, a PID has 3 main tuning parameter:

    • Gain
    • Integral Time
    • Derivative Time

    One thing to note about the parameters is that literature and manufacturers are using either the values straight (factor, minutes or seconds) or their reciprocal value (proportional band, Hz). This means that if you're trying to apply a tuning algorithm like Ziegler-Nichols (ZN), you need to be aware what the rule is asking for. Example: ZN calls for increasing Gain until the system oscillates. If your controller has a Proportional Band (= loosely the reciprocal of the Gain) then you need to decrease instead.

    My journey so far wasn't really that successful in finding a set of stable parameters. My first goal was to find a tuning set that works for 100% reflux mode. I'm not expecting any influence from the PC yet as nothing is going to condense yet. Here's what I've tried so far:

    • ZN Tuning: Boiled water at 70% power and decreased P-Band until I got a stable oscillation. Oscillation time peak-to-peak is at 49s with a P of 20% and a SV of 40C. I then applied various ZN tunings (robust, aggressive and normal) to the parameters. In short, all caused oscillation and none were able to keep the temp close to the SV (+- 40C swings)
    • Autotune: Here, I actually switched PID controllers as the one I bought off eBay turned out to be a piece of junk (myPin brand, horrible documentation & no usage of them other than for boil control but no one seems to use 4-20mA output). The one from AutomationDirect is pretty nice and I got a little dongle that allows for RS485-to-USB connection.
    • Various reductions in pipe diameter: I tried with reducing pipe size before and after the valve down to 1/4". This helped limiting the max flow that I'm getting through but didn't do anything to change the response of the valve (and having thought about it a little more, it also makes sense as the municipal pressure is constant)

    After that, I tried to manually create a step-function to record the changes. Doing that, I noticed the following:

    In a stable state (constant power, constant water flow), I see temperature swings as high as +-1C from my probe. I'm chalking this up to the eddies forming in the condenser but with that amount of a band, it's going to make it hard to control the temp exactly. I don't see the swings in the heat-up before a significant amount of steam is generated, so I'm sure that they're not artifacts.

    Looking back in the documentation of the valve and seeing how it changes, I think that for my set-up, the valve is too big. Cv of 1.9 = 1.9 gal of flow per minute. Eyeballing, I need the working point to be more somewhere in the 1/4 - 1/2 gallon per minute range. :(

    From stepping through in manual mode, observed the following - valve opens at 17% with small increments until about 22% and then a rush of water. Unfortunately, the water flow needs to be somewhere >22% for there to be any take-off and <22% is not enough cooling...

    Next steps / thoughts:

    Looking at eBay for a smaller valve body. Based on documentation, there's a body with smaller Cv of 1.2 available. That's about a 40% reduction in max flow which could push the operating point more towards my range.

    Chatting with some folks, I have an idea about pumping from a reservoir through the condenser. It will be certainly an interesting contraption as the thought is to keep the reservoir filled using a toilet fill valve, run a submersible pump at full flow with a return line to prevent the pump from burning up (see attached sketch).



    bucket idea.png
    389 x 426 - 5K
    Equalization Temp Plot.jpg
    595 x 427 - 24K
  • @Unsensibel said: One thing to note about the parameters is that literature and manufacturers are using either the values straight or their reciprocal value.

    biggest thing people miss.... if you change it and it does the opposite of what you think it should, RTFM!

  • Be careful with Integral too, it can be defined in either seconds or minutes.

  • @CothermanDistilling said: biggest thing people miss.... if you change it and it does the opposite of what you think it should, RTFM!

    And even if you do RTFM, then my initial controller had a shitty M and RTF didn't help ;)

  • @grim said: Be careful with Integral too, it can be defined in either seconds or minutes.

    I think it applies to both I and D. Added into my post. Thanks!

  • edited January 2016

    Omega, Honeywell, Watlow

    All good, use them all.

    Favorite - Omega CNI16D53 with Ethernet

    Rolls Royce - Watlow F4T

  • reading the rest of your post, and having experience in this, I am confident that you can get the 1.9cv to work...

    what are your numbers for P, I ,D?

  • edited January 2016

    I have the 1.2cv 1/2" right here, what's your address? This was the valve I used on municipal water.

    However, you should have no problem with the 1.9 though.

    The orifice on this valve is TINY, you better have some high pressure for it.

  • edited January 2016


    600 x 800 - 96K
  • edited January 2016

    @grim - Thanks a ton! PM'ed you back

    @CothermanDistilling - Greatly appreciate it! I'll pull my latest parameters out tonight and post. I'm also planning on doing some plotting of the values to show how badly the swing is. I stopped fiddling around with it as I hit my wall and also had some request from friends that had to be run...

  • Just post up your thoughts on the two different valves, and if one works any better than the other.

  • In order for the CV of the valve to have any meaning at all, you must maintain a constant pressure on the valve. Doesn't matter whether its its 50kpa or or the the full pressure rating of the valve. The way you have it piped the pressure will never be constant. Just my mexican pesos worth.

  • My sledge hammer engineering approach is to pipe up a proportional valve with a flow meter.
    It won't make any difference what the feed pressure is or does, the valve will just control the flow rate which is ultimately all we're interested in.
    To really over-complicate things we could cascade that with what ever else we trying to control.

  • @Mickibohi not sure what set-up you're referring to. Currently it's piped to municipal water which is around 40psi/275kPa. The reason I'm trying to rig a pump is that with current pressure the flow is increasing to quickly.

    @jacksonbrown what do you mean with cascading? On the sledgehammer approach - that's kinda my plan B. Instead of a flow meter, I'm planning a pint, stopwatch and my eyes

  • Using the output of one PID as the set point for another.
    I think my valve controller has one built in too (for the PWM valve position control) so I'd actually have three levels.

    Try this for quick calcs.
    For town pressure on a small still, an orifice over 2mm is getting too big IMO.

  • edited January 2016

    The orafice of the valve I sent (more of a slot) is absolutely tiny. Maybe @Unsensibel can post a photo of the characterizing disc of both, side by side.

    I originally got that valve because it was the smallest that Johnson made, and I intended to use 55psi municipal.

  • @Unsensibel said: -snip- ..... the one I bought off eBay turned out to be a piece of junk (myPin brand, horrible documentation & no usage of them other than for boil control but no one seems to use 4-20mA output). The one from AutomationDirect is pretty nice and I got a little dongle that allows for RS485-to-USB connection.


    @grim said: Omega, Honeywell, Watlow

    All good, use them all.

    Favorite - Omega CNI16D53 with Ethernet

    Rolls Royce - Watlow F4T

    I am just quoting these so maybe someone else will see it more readily... mypin should be pretty easy to search on should someone bring it up in the future...

    I am happy with Sestos for the money, but C only, no farenheit!

Sign In or Register to comment.