Learn how to setup and tune a PID loop ion a GS4 Variable Frequency Drive (VFD) for a Tank Filling operation
aka and Integrating PID Process. This live demo walks you through the hardware setup, PID constants calibration and final test in a quick hands-on live demo.
Let’s use a GS4 variable frequency drive to automatically maintain the water level in this tank regardless of how much demand we create by opening this valve. Tank filling is an “Integrating” PID process. That is, the water level in the tank will continue to rise as long as the motor is driving the pump. A Self Regulating PID process will automatically level off and maintain the level as the motor runs. There is an example of that kind of PID process in this video where we use PID to maintain the pressure of a system. This test setup has water coming from a reservoir into a centrifugal pump. The pump is being driven by this AutomationDirect motor which fills the tank. Ignore these guys, they are for a different demo. We’re using this 4-20mA ultrasonic sensor to detect the water level and it has been setup to provide these levels back to the GS4 Drive on analog input 1. So a full tank is a big value, empty is a small value. That tells us we have a FORWARD acting PID system – as the motor runs, the returned signal gets bigger. In a reverse acting system, the sensor value would get SMALLER as the motor ran – like a cooling system for example. There is a Styrofoam float in the tank with LEDs on it to make it easier to see the water level in the video. It also gives the Ultrasonic sensor a uniform surface to detect. These are the basic parameters I setup in the drive. In particular, notice that I have LOCAL mode setup for manual operation and REMOTE mode setup for the PID stuff when we get to it in a couple minutes. So we’ll use LOCAL to do our measurements, and then switch to REMOTE to test the PID results I’m using this USB adapter to communicate with the drive from the free GSOFT2 application which you can download from the AutomationDirect website support page. Great, let’s find out what this thing can do. To get an integrating PID process working, we do the same steps we do for any PID process. Step 1: Test the system. All we need to know for tank filling is does the pump have the ability to fill the tank even under worse case load conditions? I have the GSOFT2 Scope function setup to monitor the Frequency Command and the sensor feedback signal on analog input 1. Let’s turn the Water Level LEDs on, Open the valve all the way to create the maximum demand, make sure the drive is in LOCAL mode, so we have manual control, and hit RUN. If I crank up the drive frequency to the max value, we see that the water level is rising. Perfect – we now know our system can fill the tank even under worse case load conditions – exactly what we want to see. If our system couldn’t do this, then we would have to go get a bigger pump and motor before proceeding. Step 2 – linearize the system. In other PID videos I made a big deal out of linearizing the system and how important it is to getting the most out of your PID performance. Truth is, that’s really only important if you need the system to automatically respond to disturbances quickly like in pressurized systems. Do we really care if our tank filling isn’t totally optimized? Usually? No. Tank filling and water level management are pretty lethargic by nature and we don’t usually care if the level varies a bit. As long as there is enough water to service the demand, we are good to go. So, we are going to skip the linearization step in this video just to emphasize the point that you don’t always need it. Could you do it if you want to? Sure? Won’t hurt anything and you might even get a little better performance. Step 3: Open Loop Measurements. I’m going to be using the PID Blueprint method to generate the PID constants. You can learn all about that here. This is not an AutomationDirect product, so PLEASE don’t call tech support asking questions about it. They won’t be able to give you any guidance on that product. The reason I like the PID Blueprint method is all of the measurements are open loop so you are always working in a stable environment which means you get stable consistent results. It’s easiest just to show you so let’s do an example. I still have the GSOFT2 scope function setup with the command frequency and sensor feedback on analog input 1, so let’s start that, make sure we are still in manual mode, open the valve all the way to create demand, and hit RUN. Now I’m going to manually play with the drive frequency until the pump is putting water back in the tank as fast as it is going out ... our goal is to get the system to a steady state. That looks pretty good – the yellow sensor value tells us the water level is holding at a constant level. Now we just bump the manipulated variable – the frequency command in this demo - to see what happens. Let that run for a bit and then stop the scope. Now we just measure a couple things. First we need this delay between the change in command to the sensor starting to react, which is this. We also need the change in frequency – also called the Manipulated Variable – which is 10 Hz or 16% of full scale. We need the slope of the response. Looks like over 10 seconds, the sensor value – or process variable - rose this much. So, given those values, we calculate the slope, then use that to calculate the process gain. Use those to calculate P and I, and in tank filling operations D will almost always be zero. You then take those and convert them to your controller’s algorithm. We told our GS4 drive to use the independent or parallel mode, so we use these. I have a spreadsheet setup to do all of that for me, so I’ll just enter the numbers we measured, and that creates the constants for both the parallel and series modes of the GS4 drive. So we just enter the constants for the parallel mode into parameters 7.13, 14 and 15. Step 4: Test it! Let’s switch over to REMOTE mode which is setup for PID. I entered a setpoint of 48 Hz which is 80% of full scale or an 80% full tank. Remember – when using PID this is no longer the frequency command – it’s the setpoint. I’ve setup the GSOFt2 Scope function with the PID Setpoint in green, the sensor feedback or Process Variable in yellow, the error in red and the PID Generated frequency command in blue. Hit RUN, and sure enough, PID told the drive to go to the maximum frequency to fill the tank, and as it approaches the setpoint PID slows the motor down and the process settles out within a couple percent of where we want to be – perfect. If I change the demand, PID adjusts the motor frequency accordingly and maintains the water level near the setpoint. Exactly what we want. And all we did was make a couple open loop measurements and plug them into a formula. Not bad at all. Click here to learn more about the GS4 drive. Click here to learn about AutomationDirect’s free award-winning support options and click here to subscribe to AutomationDirect’s YouTube channel so you will be notified when we publish new videos.