LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID output half of setpoint

I am attempting to implement a PID. It seems pretty straight forward, I read a flow rate from a flow meter send it to the process variable input, pick my setpoint, connect the output to the control... 

 

Don't get me wrong it is working, except that the setpoint has to be double what I want the actual setpoint to be. Say I want the flow to be set to 8ml/min the setpoint has to be 16. If I try to set it it to 8 the output of the PID only ever gets to ~4. Never outputs an overshoot value just stays pinned at 4. What am I missing here?

 

TheWolfmansBrother_1-1587380611716.png

 

The control works fine, I pass an 8 to it and the flow moves to 8ish not 4. I pass a 16 and the flow rate changes to ~16. I just thought I would use the PID to get the flow to move more exactly where I wanted it, rather than being just close I was hoping to be able to tune the PID to get it exact.

 

I guess I could just always double my setpoint, seems kinda nonsense though.

 

0 Kudos
Message 1 of 8
(4,035 Views)

Hi Brother,

 


@TheWolfmansBrother wrote:

I am attempting to implement a PID. It seems pretty straight forward, I read a flow rate from a flow meter send it to the process variable input, pick my setpoint, connect the output to the control... 

 

Don't get me wrong it is working, except that the setpoint has to be double what I want the actual setpoint to be. Say I want the flow to be set to 8ml/min the setpoint has to be 16. If I try to set it it to 8 the output of the PID only ever gets to ~4. Never outputs an overshoot value just stays pinned at 4. What am I missing here?


You miss: the output value of the PID doesn't need to be the same as pv/sp! The output of the PID needs to be the value, that is needed to drive the connected actuator in a way it can set a working point needed to reach pv=sp (aka error=0)!

And you need to adapt your PID gains (and output range) according to your actuator needs…

 

Example:

You want to reach a sp of "8" (ml/min). Your actuator (pump?) receives a voltage signal of 0…10V: to reach a pv of "8" (ml/min) the pump needs a voltage signal of "4" (V). Even though the PID output is only half of input value (because you forget their units!) the PID control still is able to reach pv=sp…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(4,023 Views)

I understand that, but if the setpoint is set to 16, wouldn't the PID attempt to drive the output to 16 before it came down slightly below 16 and started settling? With the setpoint at 16 the PID output never exceeds ~8. Right now the output value is not getting anywhere close to the value needed to drive the connected actuator to the setpoint. The PV never matches or comes close to the SP, in fact the PV is always about half the SP which is the issue. 

 

With the SP @ 16 I can get an output and flow rate of 8:

 

TheWolfmansBrother_0-1587383435431.png

 

The thick blue is sensor flow rate, thin line is the PID output

 

0 Kudos
Message 3 of 8
(4,006 Views)

The output of the PID is sent to the controller via rs485, it is not a voltage value. There is no engineering unit conversion that needs to be done. You send it an 8, it sets the flow to ~8. You send the controller a 40 it sets the flow to ~40. 

0 Kudos
Message 4 of 8
(4,002 Views)

Hi Brother,

 


@TheWolfmansBrother wrote:

The output of the PID is sent to the controller via rs485, it is not a voltage value. There is no engineering unit conversion that needs to be done. You send it an 8, it sets the flow to ~8. You send the controller a 40 it sets the flow to ~40. 


Then why do you need a PID when the controller already does its own control loop?

What exactly do you want to control with your own PID?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(3,981 Views)

This program will be for a production process.The particular UUT I have does already go to the correct flow rate and has been calibrated, the unit has a flow sensor inside of it and a valve that sets the flow rate. The flow rate is controlled by a PID inside the unit, but to get the flow rate accurately set a calibration has to be done. If I were to clear the calibration values of the unit I have the flow would be much less accurate. 

 

The program I am (trying) to write will do a two point calibration of the UUTs internal flow to an external, high accuracy, flow meter. A new unit for instance when you set the flow to 8.5 mL/min will be off, maybe +/- 2mL/min. So to fix this and calibrate the flow sensor I will set the UUT flow valve to the the external flow meter at two points. If I want an 8ml/min flow I need the LV PID to adjust the flow rate until the external flow meter is reading 8, then I set the flow to another point and repeat. Taking the two readings from the external flow meter and from the internal I can calculate an adder and multiplier to apply to the UUT flow rate sensor (which will be written to the unit internal mem). The flow sensor inside will then accurately go to the desired flow rate when set. 

0 Kudos
Message 6 of 8
(3,979 Views)

Hi Brother,

 


@TheWolfmansBrother wrote:

So to fix this and calibrate the flow sensor I will set the UUT flow valve to the the external flow meter at two points. … Taking the two readings from the external flow meter and from the internal I can calculate an adder and multiplier to apply to the UUT flow rate sensor (which will be written to the unit internal mem). The flow sensor inside will then accurately go to the desired flow rate when set. 


Usually you just read external and internal flow values for a given setpoint to calculate correction factors for your unit. You could even use more than 2 setpoints. This way you don't need a PID control, but just some math afterwards…

 

When you really want to use this PID you need to change its PID gains. Atleast I gain should be larger than zero to minimize/cancel the error, P gain alone will not achieve this!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 8
(3,953 Views)

Right I could use any two points, but we have a nominal flow rate for the UUT operation with very tight limits so we try and set the flow to two exact points on either side of the nominal value and do the calibration that way. I have accomplished what I set out to do with the temperature auto tuning PID. I basically just modified the example to suit my needs, I had to replace the "Plant" in the example with my own VIs.

 

TheWolfmansBrother_0-1587395051464.png

 

TheWolfmansBrother_1-1587395118817.png

Thanks for the help

 

0 Kudos
Message 8 of 8
(3,940 Views)