Jump to content

Converting PID simulation to actual testrig


Recommended Posts

Hello all,

For my work I'm trying to convert the example simulation "Simulation - Tank level.vi" to a real testrig. The simulation does exactly what we want students to do with the P, PI and PID control theory they have had. My problem is that I do not have a any experience with labview, or any other programming language. So I'm learning as I go along with this project.

In my estimation this simulation I have to insert my DAQ's somewhere to get the level measurement and valve control. But I have no idea where they go, what they should replace or how to connect them to the PID node.

Any help, pointers examples would be appricated

Kind regards,

Ivo Overmars

My setup consists of

Labview 2010 sp1

PID&Fuzzy logic toolkit

NI9203

NI9265

PID trial 16 Folder.zip

Tank Level Example.vi

Link to comment

Hi,

I have been looking at your VI. I would completely remove the "plant.vi" simulator. That is where your DAQ calls could go. (That's the simple approach) The LabVIEW example finder will help you with the DAQ calls. You need to output your pid value. and get the level. I wouldn't personally use this single loop approach because it is not scalable, and would not be responsive enough if the output valves have to be driven more slowly. There are a lot of examples in LabVIEW, and on Google to get you started there.

Link to comment

Thank you!! I got it working now. The problem was indeed that I had to set the 0-20mA as limits in the PID.

Hi,

I have been looking at your VI. I would completely remove the "plant.vi" simulator. That is where your DAQ calls could go. (That's the simple approach) The LabVIEW example finder will help you with the DAQ calls. You need to output your pid value. and get the level. I wouldn't personally use this single loop approach because it is not scalable, and would not be responsive enough if the output valves have to be driven more slowly. There are a lot of examples in LabVIEW, and on Google to get you started there.

Link to comment

Another question about this VI. The way I've wired this together my output seems to be either 0 or 20mA, nothing in between. Does anyone have any suggestions?

Wiring looks OK. Have you tuned the PID at all? What is the possible input range? If your input is a level from 0-100 and your output is only 0.004 to 0.02 A, you'll need very small gains in order to get the response you want. For example, say your setpoint is 75 and your level is 70, with the proportional gain set to 2.5 (as you have on the front panel) your output just from the Proportional component will be 2.5 * (75-70) = 12.5, which is several orders of magnitude larger than your possible 0.016 A range. You could also solve part of the problem by setting your PID output range to be in mA rather than A, and dividing by 1000 before setting the output on the DAQ device.

Link to comment
  • 2 weeks later...

Wiring looks OK. Have you tuned the PID at all? What is the possible input range? If your input is a level from 0-100 and your output is only 0.004 to 0.02 A, you'll need very small gains in order to get the response you want. For example, say your setpoint is 75 and your level is 70, with the proportional gain set to 2.5 (as you have on the front panel) your output just from the Proportional component will be 2.5 * (75-70) = 12.5, which is several orders of magnitude larger than your possible 0.016 A range. You could also solve part of the problem by setting your PID output range to be in mA rather than A, and dividing by 1000 before setting the output on the DAQ device.

Thank you. With the tips you gave I got it to work perfectly. I made the mistake to use the values given to me whithout questioning them, since I have an analytical chemistry background and not chemical engineering. I tuned the device now using the Ziegler and Nichols method.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.