Announcement

Collapse
No announcement yet.

PID control on Productivity 1000 for Home Brewing

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts


  • PID control on Productivity 1000 for Home Brewing

    New to the forum and first time posting. I am currently switching my propane home brewing system to an all electric PLC controlled system. I have no previous experience with PLC's or HMI's, so Ladder logic is pretty new to me.

    I recently purchased a Productivity 1000 CPU with a P1-15CDD2 Combo Discrete card and a P1-04ADL-1 Analog 0-20mA card. To start with, I will only have a total of 8 I/O in the system for now. Four Analog Inputs for my PT100's. Two Discrete Outputs for relay control of circulation pumps. Two Discrete Outputs for relay control of 5500 watt heating elements. In the future (no hurry till I get the present figured out) I would like to add a couple level switches in my kettles, a few solenoid valves and maybe a load cell for measuring volumes of kettles.

    So far I have been able to setup the four Analog PT100's by simply wiring them to the card and setting up the scale function to convert the 0-8191 value to Fahrenheit (nice feature on this series) then using another rung to give me an average over a half second so I don't get so much bounce on the reading. Done this on all four. I also have the two rungs complete for the relays that will control my small Chugger Pumps. Those were simple Out Coils with a NO and NC contacts using another NO to read the coil to maintain power to the coil. I am using AdvancedHMI as my interface. Once I figured out how to assign the Modbus addresses, it went pretty smooth. I tested out all the inputs with this HMI and they all seam to work well. Temps read accurately and I can energize and de-energize my relays though the simple HMI I have set up.

    Now we get to the point of where I am having problems. The last two discrete outputs to control my elements. One of the reasons I chose this controller was that it had built in PID function. Assigning tags and numbers to the PID has been very confusing to me. I printed out the document from the Help tab on the PID parameter entry box and have read through it, but still seems Greek to me when putting in the numbers and tags or assigning where they come from. The example that is provided at the end of the document lost me very quickly. It started with a "Time Proportioning Control" setup with good detail of the steps and layout, but I still have trouble understanding the tags assigned in the example. The last page shows the PID loop with no explanation on any of it (the way I see it)

    I've been searching since I got this PLC, but have not had good luck finding much (literally nothing) out there for the 1000 series PLC.

    Curious if anyone has any suggestions on the best way to fill in parameters and write the rung (or rungs) that will be needed. I want to be able to put in (where is it assigned from?) a set point (and manually adjust it), and let the PID do its thing to fire the relay controlling the heating element to hit and maintain temperature from the feed back of my RTD sensors. I will have two of these PID's. One for my Hot Liquor Tun to get to a temperature range of 175 strike water to pump over to my Mush Tun, then used again to maintain a temperature of about 155 for recirculating mash through a HERMS coil. The second will be to boil the wort in my Boil Kettle. This one may not need to be a PID, but more of a timer that turns off and on for a set amount of time once the boil is reached. Might be easier this way. Accuracy is not as important on this one other than not wanting to boil over.

    Any help on this would be greatly appreciated.


  • #2
    When you set up the PID just use the value from the analog input ( or your scalled value if you like) as your Process Variable. If you want to use the HMI to enter the setpoint create an input object and direct it to an address in the plc. Then kust make sure you have values in your input and output range min and max values and upper and lower output limits and enable the pid and make sure it is in manual and do an auto tune from the PID tuning in the Application tools menu.

    I usually do the following steps to set one up quickly:

    1) Enter PID instruction
    2) Select Use Structure and give it a name such as PID.( Keeps you from having to enter all the fields manually.)
    3) uncheck use structure ( This will populate all the fields with structure tags)
    4) Enter a Loop name
    5) Replace the Setpoint field tag which is now PID.setpoint with teh tag I want to be the setpoint. So this is where you would put the tag you are changing in the HMI.
    6) Replace the Process Variable field tag with the tag I wish to use as my feedback. In your case it would be your scaled value from your analog input.)
    7) enter a constant for the input range max and input range min. Usually 100 and 0 for testing, but would ultimately be your max and min values you wish to set something.
    8) Enter a constant for the output range max and output range min. usually 100 and 0 for 100% and 0%
    9) Enter a constant for Output Upper limit and lower. Usually 100 and 0 for testing.

    You should then be able to down load and try doing a PID tuning.


    Comment



    • #3
      Thanks for the reply PSeries_Eng. I think I got it covered using your information and after looking back at the example in the help section of the controller. My ranges are all in degrees Fahrenheit since that is what is coming in out of my averaging rung for the process variable. I think this is correct. I tested it on my desk and it seams to be working. Do have a big overshoot when just heating up the RTD with my hand, but I need to play around with the gain and reset to work that out. Never tuned a PID, so that may be a challenge too.

      I was having a hard time inputting my set point from my HMI which was keeping me from testing this. I couldn't get the controller to let me manually input a Modbus address to the 3xxxx0's when setting the tags. The way I was reading the table, that is where you have to assign write addresses. It kept auto assigning 4xxxx0's to the tag. I finally read somewhere in that document that a 16-bit tag was read/writable in the 4xxxx0's. I was using the auto assigned tag which defaulted to 32-bit. Once I changed the tags I want to manually set from HMI to 16-bit, inputting set points works fine know.

      I am still a few weeks or more from having my kettles set up (still need to weld additional fittings in them), but hope to maybe start that this weekend if it warms up, so the tuning will be on hold for a little while. Main thing for me is to get the program set up and all the components purchased and know that they all talk for now.

      These are the rungs I wrote for the PID that include the timer functions for it (the top average rung is for something else). I didn't realize I had to link the PID with timers separately to make it work. Guess I always assumed they where built in somehow to the PID shortcut. Don't know if there is a simpler way.

      Click image for larger version

Name:	PID Rung.png
Views:	139
Size:	30.9 KB
ID:	110384

      Comment



      • #4
        You should really have contacts on the enable and the manual /auto rungs. You need one on the enable rung because there are certain parameters in the PID instruction that do not take effect unless the instruction is disabled and re enabled( See range max and limits). The manual/auto branch needs a contact so you can put the PID loop in manual to be able to auto tune it. Also you would need a contact on the manual/ auto branch if you wish to control the output manually.

        Comment



        • #5
          Littlecellar, I have all ready done (almost, needs a little more) what you are looking for. P1k t/c input card and dc out. Manual and auto on three PID loops with time base output. HLT, mash and boil. If I could get AD to add auto tune on the pid thru code I could sell them. PM me and maybe I can help.





          Click image for larger version

Name:	20180118_092414.jpg
Views:	93
Size:	128.3 KB
ID:	110434
          Attached Files

          Comment



          • #6
            Click image for larger version

Name:	20180118_093836.jpg
Views:	97
Size:	128.2 KB
ID:	110436

            Comment



            • #7
              Littlecellar I am also wondering how you are getting temperature using a RTD and a current module? Please explain. I know it can be done but how are you doing it?

              Comment



              • #8
                Simple filter for temps. Temp Filter 0-1. 1=no filter.


                Click image for larger version

Name:	Capture1.JPG
Views:	96
Size:	15.4 KB
ID:	110441

                Heater lockout w/ pump control and all that is needed to set up and run the PID

                Click image for larger version

Name:	Capture2.JPG
Views:	101
Size:	111.5 KB
ID:	110442

                Time base output to SSR heater relay

                Click image for larger version

Name:	Capture3.JPG
Views:	109
Size:	48.2 KB
ID:	110443

                Comment



                • #9
                  I don't want to hijack the thread, but littlecellar and bsinkovich may have some insight on this.

                  My step Dad not to long ago asked me to design him an automated system with HMI for his home brew setup (though it's really more small scale commercial as he's working with a local winery). Initially I was going to do it off of a P2K, but since the P1K is now available, I'm going to go that route.

                  The issue I'm having is finding automated pilot valves to handle his burners (direct fired system) Growing up with him, I know fair amount about brewing and automation, but LP valves is a bit out of my realm of expertise. The winery that he's in does not have the power necessary to run an electric setup (all of his tanks are 55 gal or larger) so he has some large banjo and jet burners (high pressure on the jet's, low pressure on the banjo) to do the work for him. Do either of you have any pointers on what valves I should look at to not only control the LP, but also to ignite and detect ignition as well as flame out? I assume something along the lines of a furnace valve with thermocouple, but again this isn't my expertise.

                  Comment



                  • #10
                    Brandon, to make a LP system with all the safety, ignition and a valve can be done with aftermarket parts. Cost might be the factor here. Between a way to ignite the gas and valves, saftey. Direct ignition or pilot light w/safety. A hot surface igniter, flame sensor and solenoid valve. The other way is to use an all-in-one system. A control voltage tells the system fire is needed and all is taken care of, the lighting gas, safety etc. Look at this Honeywell site, both in residential and commercial areas. With a little thinking I am sure you can come up with a system. Please do not underestimate the safety. Don't use just a manual pilot light and solenoid valve. I just looked at this idea last week but have not had a lot free time to go down this road yet.

                    https://customer.honeywell.com/en-US...&catpath=1.2.7

                    Comment



                    • #11
                      Here is a gas valve w/ pilot control and 24vac control. Done!

                      https://customer.honeywell.com/en-US...uct.Rank&asc=1

                      Comment



                      • #12
                        The valves with pilot and main control are like what you would find in your furnace. 24vac signal tells the valve fire is needed. It will energize the pilot and ignitor, when flame present (using the sensor) it will energize the main. If you need to modulate the flame, you will need other valve/pressure control to control the flow of gas.

                        Comment



                        • #13
                          Appreciate all the input from you guys.

                          The missing contacts for the enable and auto/manual on the PID were an oversight on my end. Saw them in the example, just forgot to put them in. My question on those two contacts is now, how do I enable them? Do I just add buttons on my HMI and address them to the tags through Modbus to trigger them? bsinkovich, it looks like that is what you did.

                          I am using the following logic to read my pt100's. I seen it in one of the video's AD has. The Analog module will automatically assign a value of 0-8191 based off of a 0-20ma scale range. The 8191 number was throwing me off at first because all the videos from AD were saying 0-65535. It wasn't till I realized that this module was a low res 13-bit and not the 16-bit they give in there examples. Thought something was broken. My pt100 is the garden variety you find on Amazon and EBay in the $10 range along with the puck style 4-20ma RTD sensor. Using the Scale function I converted it over to Fahrenheit (0-400 C sensor). In order to keep the number more smooth, I then put that into an average function so it doesn't jump around so much. Seems to be working pretty well.

                          Click image for larger version

Name:	Temp Rung.PNG
Views:	100
Size:	5.4 KB
ID:	110497

                          Brandon, I am not going to be much help on the gas valve subject. I too, was using propane with those same banjo burners, but everything was manually done. It wasn't until I decided to move my brewing inside, that I started to delve into the automation side of it. bsinkovich mentioned the Honeywell set up that I have seen in other systems online. It seems to be widely used by those who automate their LG systems.

                          Bsinkovich, it's going to take me a while to look at what you have in the code you showed above and understand it all. I am still pretty green at this. Been throwing around the idea of something like it using simple SS tank level float switches so I can't dry fire my elements.

                          Like the HMI, too.

                          Comment



                          • #14
                            The enable and auto/manual outs will depend on your system. For instance, you don't want them on if the system is off, and if not calling for heat you would not want them on either. I would suggest that you think about when you want to have heating applied in an automatic way (you can just make a list in normal readable words) then when you are satisfied, code that.

                            An example:
                            When the system is on and the water is full and the hlt needs to be heated and the pump is already running, then we want heat.


                            You also may want to say that when the loop is not enabled, then you should force the output off.


                            Attached is a pic of some PID loops and interlocks that I have on a system controlling a parallel refrigeration rack.
                            Click image for larger version

Name:	PID_screen.png
Views:	119
Size:	916.7 KB
ID:	110501

                            Comment



                            • #15
                              Little, i see now how the rtd was being red with a current module, using a rtd to current converter. If you use the average function to smooth the temp reading you will have to reset the output tag to zero. Take, say 10 raw temp readings, sent to average input tag, use the output tag as the current smoothed temp, reset the output tag to zero and start again. If you don't reset the output tag to zero you will have a average temp over the hours of running. The filter I posted above works well if you can't get the average function working. Try this:

                              Click image for larger version

Name:	Capture4.JPG
Views:	102
Size:	58.1 KB
ID:	110503

                              "Do I just add buttons on my HMI and address them to the tags through Modbus to trigger them?"

                              Yes set HMI to toggle the bit and use a coil for auto/man. If bit is true-in auto, if false-in manual. When in manual you can use a copy block to poke in a number into the PID.Output to set manual power.

                              Click image for larger version

Name:	Capture5.JPG
Views:	88
Size:	41.6 KB
ID:	110504

                              Comment

                              Working...
                              X