LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID tuning array instance

Hi there 

 

This is where we are at the moment with this beast. 

 

I have tried to make the changes you have suggested and this is the result. I have tried to tune the PID again with a new "transformation vector" and it started pushing the process variable (red line) away from the setpoint position (white line). Does anyone have any thoughts as to why this could be?

 

Best Wishes 

Andrew

 

0 Kudos
Message 21 of 65
(1,526 Views)

You might need a reverse action.

 

For instance if a dT has a positive error, the temperature should be increased. If a dP has a positive error, a release value should be decreased.

 

IIRC, you can reverse output min and output max to get that effect.

 

I think theoretically, negating P, I and D should do the same. There might however be checks in NI's PID implementation that check P, I or D <0...

 

 

0 Kudos
Message 22 of 65
(1,518 Views)

Hi 

 

Thank you for the reply. 

 

I will try to swap the sign (+/-) on the output max and min and see what happens. What is strange is that this does not happen all of the time. 

 

Best Wishes 

Andrew 

0 Kudos
Message 23 of 65
(1,515 Views)

Hi 

 

I just tried that and got half of them going to the setpoint and half of them were not moving towards it. All four need to go the setpoint. 

 

 

Best wishes 

Andrew

0 Kudos
Message 24 of 65
(1,512 Views)

@AndrewIons01 wrote:

I just tried that and got half of them going to the setpoint and half of them were not moving towards it. All four need to go the setpoint. 


Then check what causes this.

 

See if the loops that need inverse outputs have their process values reversed, or find any other relation, find the cause, then fix it.

 

We don't see any of your values, so we can't comment on that.

 

I don't know if you know, but you can put probes on wires while the code is running. That gives you run time information (that we don't have).

0 Kudos
Message 25 of 65
(1,508 Views)

Hi 

 

Thank you for the reply. 

 

I will check to see what causes this and let you know the result. Is there a way I can modify the code to enable you to run it if I send it to you?

 

(I apologise if that is a stupid question)

 

Best Wishes 

Andrew 

0 Kudos
Message 26 of 65
(1,501 Views)

Hi,

 


wiebe@CARYA wrote:

You might need a reverse action.

For instance if a dT has a positive error, the temperature should be increased. If a dP has a positive error, a release value should be decreased.

IIRC, you can reverse output min and output max to get that effect.


IMHO I would not swap the output min/max: you set a (logical) range for the PID output value.

To set a reverse action you "just" need to change your PID gains! And to make it even more easy: you just need to change the sign of the P gain!

 

It helps to learn about the "basic principle" of the PID gain parameters:

  • P gain describes the (linear) relation between error input and PID output value, like "when there is a temperature error of 10 K then I need to change the heater power by 25 %". P = heater power change / temperature error = 25%/10K = 2.5 (%/K)… (This is a very simple P gain estimation, even simpler than Ziegler-Nichols.)
  • I gain describes the time needed to get the same effect on PID output value like the P gain, when a constant error input is received…
  • D gain describes the time to react upon a change of error, but usually it is ok to start with a PI controller…
  • In NI's PID implementation an I/D gain of 0 means "no I/D action"…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 27 of 65
(1,500 Views)

@AndrewIons01 wrote:

I will check to see what causes this and let you know the result. Is there a way I can modify the code to enable you to run it if I send it to you?

In short, you should send something that doesn't have any dependencies to stuff we don't have.

 

You can replace everything that returns data with some sort of simulated values. These could be constants or controls with default values set to reasonable values...

 

I guess you can log values that enter and exit a VI by enabling database access on the VI (right click the VI, "Enable Database Access"). Then you can send the 'database' and the VI, and we should be able to play back the results. This option is staring in everyone's face, but it's hardly ever used (anymore). Never used it...

 

 

0 Kudos
Message 28 of 65
(1,495 Views)

Hi 

 

Here is a zip folder with the vis. I believe that this should be everything. If there is anything missing, please let me know. I was wondering if you would be able to try to run it and see if this helps us find a solution to the PID problem. There is probably something I have missed somewhere. 

 

Best Wishes

Andrew

0 Kudos
Message 29 of 65
(1,473 Views)

There is at least 1 VI missing.

 

More importantly however, we're missing the camera setup.

 

Even if we had all code, we wouldn't be able to run it.

 

If you suspect a VI is giving you trouble, all we need is that VI with realistic values. Everything else will just be distraction.

 

We need a MWE, AKA SSCLA.

0 Kudos
Message 30 of 65
(1,429 Views)