
RonC1952 (Customer) asked a question.
I am having trouble getting my PID output to work using the simulator. If someone will take a look at this test program and let me know what I am doing wrong it would be appreciated. I am using a P1000 in my shop for testing purposes.
The output remains on zero no matter what I do to the PID
Output upper limit is set to zero. Output range max and output upper limit cannot be zero.
Thank you I seen that after I sent it. I am trying to learn how to do PID control using the productivity software. But I have attached another file with where my test program is going. I have built in a way to try to calibrate the sensor through programming as the sensor ages.
p1000 Air Washer Test
This just looks the same as your original program. To make analog where you can calibrate them online then do this. To initalize the analogs on PLC startup run below in RUN FIRST SCAN ONLY. Once the values have initialized (like on new program download) they can then be edited from and HMI.
This will process the analog reading with some averaging for stability.
In your PID, the Output Range max and Output Upper Limit should be 65535 to give you the maximum control range in the output of the PID. I then normally follow the PID instruction with a SCL instruction like below.
Mike
Since your new to programming these PLC's I'm attaching an example program of how I have done stuff over the years that might give you some ideas. This has a lot of stuff you may not need but it might give you some ideas on how to write a program that's easy to maintain in the future.
Single Unit Triplex 8-13-21
Thank You for being patient with my requests. I am new to the productivity family software and I am developing a test bench with a P1000 as my training PLC. I have written program using only ladder logic but never PIDs and for me it is a struggle since my chemo which has wiped my engineering thinking process clean. I am trying to relearn how to program plc's again and the PID is kicking my butt. This program will help but my struggle is taking what input my sensor is sending and converting it into a number on the output for a 4-20mA I/P to open and close dampers for temperature control. My background is in HVAC engineering including controls and mechanical operations. The control of valves and dampers through I/P's is what a washer survives on. Again think you when I get this to workout I will move on to using ultrasonics for level control lol.
Super simple, take output of PID (scaled as 0-65535 as I suggested) use CPD instruction to copy PID.output directly to analog output module which takes 0-65535 as input. PID output = 0 is 4ma output, PID.Output - 65535 is 20 ma.. Go into hardware setup and set the tagname of the CH1 Analog output to Analog1_Out and use the CPD command like this PID1.Output -> Analog1_Out. Done.
Mike
Thanks after looking at the spec sheet for the P1-4ADL2DAL-1 Current Analog Input/Output module which I am using to develop the PID program the Input data range is 0–8191 counts. Also the output data range is 0–4095 counts. Do I need to scale my input to bring the number up to the 65535 number you mentioned above for the input? I have tried several ways but the output will not come on in the PID. I have ordered a P2000 system also that has the numbers in the data range you mentioned. When it get's here I will go back at it again using your information. But I can't figure out what I am doing wrong in the P1000 system and that frustrates me.
I normally leave the output of the PID to output a maximum of 65535 for the control resolution in the PID calculations but then follow the PID with a scale instruction to scale the PID output to what ever I need to go out. In this case the scale instruction will have an input maximum of 65535 and an output maximum of 4095. The output of the scale instruction will be the name of the analog output channel you want it to go to.
Adjust your analog input scaling for an input maximum of 8192, minimum of 1638, output maximum is the full scale value of your sensor and the output minimum is 0.
Your PID had two issues, the first was you have it set as reverse acting when it should be direct acting. The way to look at this is - If you raise the setpoint do you want the output to raise, that is direct acting. The second issue was PID.Output range maximum and PID.Upper limit both have to be non zero. Your example had the output upper limit at 0 so the output of the PID will never exceed 0. Don't know why you went with the 2000 unless you needed more than 7 modules.
Mike
Mike