Jump to content

PID Control Toolkit


Recommended Posts

For my senior design project, I have to give a 0-5 bar input signal.( set point).

Right now I directly connected it to set-point of "PID Advanced."

After simulating a Transfer Function and a pressure sensor, I am giving some value in between 0-5 bar as Process Variable to PID Advanced.

But the PID O/p shows up as follows:

When SP=5 bar, PV starts increasing towards 5 bar and PID O/P slowly increases to " 5 ".

When PV reaches 5 bar, PID O/p stays at 5 !!

I want the controller action to show that when SP=PV controller output is zero( at least approximately). This is not happening.

I then tried to give SP in terms of % between 0 to 100.

I then introduced a EGU to % VI in the feedback to convert the PV of 0-5 bar into %.

Now its the same story again.

When SP=100%, PV starts increasing from 0.

Similarly Controller output increases from 0%, but when SP=PV=100%, controller output shows 100% .

I want the controller ouput as follows:

if SP>PV then o/p>0 (increasing towards 100%)

if SP=PV then o/p=o%

if SP<PV then o/p= decreasing towards -100%)

The detailed help in labview did not help. Neither did the example in the examplefinder, since its too complex with a lot of other things.

Please help me.

Thank you.

Link to comment

I didn't really see a question in there, but if you're looking for PID help, search the example finder for PID and choose the General PID Simulator.vi. It has a model where you give a setpoint, and you can tweak the PID values along with any other settings like dead band.

This example VI uses the PID.VI as it's core, which takes the last output, setpoint, and PID values as inputs and generates a new output. You can find this VI by searching the palette for PID.

Link to comment

I want the controller ouput as follows:

if SP>PV then o/p>0 (increasing towards 100%)

if SP=PV then o/p=o%

if SP<PV then o/p= decreasing towards -100%)

The detailed help in labview did not help. Neither did the example in the examplefinder, since its too complex with a lot of other things.

Please help me.

The PID is doing exactly what it is supposed to do but you don't seem to have understood it fully. In order for the output to decrease once you reach the setpoint, the input needs to go above the setpoint to get rid of the integrated error. If you sit right at the setpoint, you'll never counteract the integrated error so there will never be any pressure on the PID to reduce the output level. The PID loop is trying to find the steady-state level at which the setpoint is maintained, and in your model that level is apparently 100%. See if you can improve your transfer function model.

Link to comment

Thank you for your replies!!

I am attaching a file here. This is an example VI.

if we run this VI and increase the setpoint and watch the horizontal slider(geen), we realise that as the PV nears the SP, the green bar goes from +100, towards 0. Also in the VI we can actually see that the controller is giving -100 to 100, and then a formula is used to make it 0 to 100.

I could not even get the Output to swing from -100 to 100.

This VI is exactly what I am trying to replicate.

Its my first time at LabVIEW and at a PID control project, so I am sorry if I cannot express the doubt in a correct fashion.

Hope the VI clears what I am trying to put forward.

Thank you again.

The PID is doing exactly what it is supposed to do but you don't seem to have understood it fully. In order for the output to decrease once you reach the setpoint, the input needs to go above the setpoint to get rid of the integrated error. If you sit right at the setpoint, you'll never counteract the integrated error so there will never be any pressure on the PID to reduce the output level. The PID loop is trying to find the steady-state level at which the setpoint is maintained, and in your model that level is apparently 100%. See if you can improve your transfer function model.

Manual-Automatic Control with Engineering Units.vi

Edited by srsnerdshack
Link to comment

Sorry.

Here is the code.

Its very plain and simple, but I would be glad if you can help.

I found an error.

There was a multiplication I was carrying out which was in error.

I have removed that now. I think now your explanation above is making complete sense with what is happening.

Still it is good if you can tell me how to implement % to EGU and vice versa.

Also if you run the VI, the VI itself runs very sluggish.

Can you help me out with the correct timing parameters for running VI?

Thank you.

It would be a lot more helpful if you post YOUR code, not NI's example code.

pidtrial.vi

Edited by srsnerdshack
Link to comment

Now I think I can clarify my problem:

When we run the VI and move the SP upto say a value of 2.

With P= 0.05

I=0.01

D=0

the PV slowly moves upto a value of 2.

But then the display named "PID output" also shows 2. When SP=PV I want it to show zero, so that I can signify to the examiner that error output is zero.

Since PID O/P is error= SP-PV, then it should show zero right?

Thank you.

Sorry.

Here is the code.

Its very plain and simple, but I would be glad if you can help.

I found an error.

There was a multiplication I was carrying out which was in error.

I have removed that now. I think now your explanation above is making complete sense with what is happening.

Still it is good if you can tell me how to implement % to EGU and vice versa.

Also if you run the VI, the VI itself runs very sluggish.

Can you help me out with the correct timing parameters for running VI?

Thank you.

Link to comment

But then the display named "PID output" also shows 2. When SP=PV I want it to show zero, so that I can signify to the examiner that error output is zero.

Since PID O/P is error= SP-PV, then it should show zero right?

NO! If PID was that simple, why would you need a separate function to compute it?

The proportional component is Pgain * error, which is, as you wrote equivalent to Pgain * (SP-PV). However, you are ignoring the integral component. The integral is a cumulative sum of the error over time, multiplied by the integral gain. For now I'll ignore the derivative component, but the output is the sum of the proportional, integral, and derivative elements. When you step up your setpoint, the integral value builds continuously until you reach your setpoint, at which point the integral value stops increasing and remains at a constant level. The only way to eliminate that integral value and drive the output towards 0 is to have a corresponding negative error.

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.