From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control and Simulation toolkit

Hi everyone,

 

I added a few screenshots of a simple PID feedback system. I programmed it twice with different blocks but I am not getting the same results. Can anyone spot the cause?

 

Thanks in advance

Download All
0 Kudos
Message 1 of 7
(2,669 Views)

Hello KF2,

 

This does not seem to be exactly the same.

One of them is second order.

The other one is first order.

Also it's kind of unusual that:
- integral time and integral gain are equal to eachother and to 1.

- derivative time and derivative gain are equal to eachother and to 1.

 

This page already gives some feedback on the conversion that wasn't done at your side:

http://digital.ni.com/public.nsf/allkb/6E76EC47B831FAED86256E4E007347DC

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 2 of 7
(2,622 Views)

Hello Thierry,

 

Thanks for your reply.

 

It should be exactly the same. Both are first order with tau equal to 3. The graphic with overshoot is the closed loop response with the PID.

 

The PID algorithms are not the same but all settings equal to 1, should give the same PID settings for both algorithms. But both closed loop responses are not the same. Also I cannot find a stable closed loop response for the first one with an active derivate gain.

 

Best regards

 

KF2

0 Kudos
Message 3 of 7
(2,610 Views)

Hello KF2,

 

Can you share your VI?

This will allow me to do some tests, see where the issue derives from and (hopefully) fix it.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 4 of 7
(2,590 Views)

Hello KF2,

 

First:

I had indeed overlooked the link between front panel and block diagram.

I was a bit too fast and that's my fault.. 🙂

I always find it difficult to troubleshoot code without the code.

 

For completeness:

I did see the "teller" and the "noemer" you specified (I'm Dutch speaking so that part seems "normal" to me).

 

But what still stumbles me is that all the PID parameters seem to be 1.

I don't directly see any practical case where this would be like that.
How did you define/calculate Ti,Td,Kd,Ki,Kp ?

 

 

If you can share the VI, then I'll do some tests at my side.

It's always easier to test code when you have it available 🙂

Also, the utmost right part seems to be missing in the screenshot of the BD.

 

I'm especially curious to see which discrete TF you have at the output of the Academic PID VI  and .
I thought (at first glance) that you had shown that comparison in the block diagram/FP.

 

My first guess would be that something has gone wrong in the crossing between different "domains" (eg. Laplace TF vs discrete TF),
but I would need to test the code to be sure about this.

 

 

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 5 of 7
(2,585 Views)

Hello Thierry,

 

I will upload the VI as soon as I am back (on Friday). But the academic PID is just Kc*(e+Ti/s *e+e*s/Td), the parallel PID is Kp*e+Ki/s*e+Kd*s*e, so setting Kc, Ti and Td to 1 for one controller and setting Kp, Ki and Kd to 1 for the second controller should give the exact same algorithm.

 

The part of the BD you can't see has no effect on the grpahs, but I will upload it on Friday. Normally the 'create model block' creates a continuous model, which is fine for the academic block since it's continuous to. For the discrete parallel PID I converted the continous model to discrete with sample time 0,5s.

 

Best regards

 

KF2

0 Kudos
Message 6 of 7
(2,575 Views)

Hello Thierry,

 

I was also to fast, I have the VI with me on USB, here it is

 

Best regards

 

KF2

0 Kudos
Message 7 of 7
(2,573 Views)