LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID controller

Hi All,

 

I Have to design a PID controller based on standard Labview 8.2 and I've tried to do so but still facing problems with it. I think there might be a mistake in one of the connections in the PID controller. Even when I tried to simulate it with a simple transfer function, I could not get any response.

 

please have a look on the attach files and tell me what wrong with it .

 

Regards,

 

saed

Download All
0 Kudos
Message 1 of 18
(4,533 Views)

Is it that much difficult ? Or I suppose to write my question somewhere else ?:manindifferent:

0 Kudos
Message 2 of 18
(4,497 Views)
It would help a lot if you rewrite your code so that it fits on one screen and contains only a single while loop.  It's very difficult to determine what your code is doing and what it's supposed to do.  See if you can clean it up, and if you don't have it working after that, post again.
0 Kudos
Message 3 of 18
(4,485 Views)

Hi saed,

 

as Nathan already said: clean up! I looked at the code yesterday and gave up...

 

For instance:

in "final pid2.vi" in the Ki-loop you have completely non-sense (aka Rube-Goldberg): all this loop does is just copy control "Ki" to indicator "Ki", all the rest is useless as you wire a FALSE constant to that selector node...

Best regards,
GerdW


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

(Assuming you're running on Windows...) Have you considered using the PID Control Toolkit?

0 Kudos
Message 5 of 18
(4,473 Views)

Thank you all for the reply .

 

I worked on removing the while loops and with assist I have this one. Please have a look . And for the PID toolkit, I don't have it and I can't use it. Using the toolkit is not required and I have to build it based on the standard one.

 

please see this one.

0 Kudos
Message 6 of 18
(4,456 Views)

Hi saed,

there still is Rube-Goldberg in it Smiley Wink See comments in attachment...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 18
(4,447 Views)

Hi all,

 

when I put my equation I've got nothing. I use matlab script to do that. Which simply Pz=(1/z+1) the simple formula for inner loop of DC motor.

 

 

thank you .

0 Kudos
Message 8 of 18
(4,437 Views)

You should build this up one step at a time.  Start by implementing a purely proportional (P) controller and demonstrate that it works, then add the I component, and finally the D.  As you do that you may discover errors in your math.  For example, I'm pretty sure that you should be multiplying KI * dt * error, instead of adding them.

 

There's still more you can clean up as well.  There's no need for the interior while loop that calculates dt, nor do you need two separate, parallel wait functions.

0 Kudos
Message 9 of 18
(4,421 Views)

Hi GredW,

 

thank you for the comments. I've just saw it. you're right about the time delay I should put only one and that is enough but for the selector I don't think it work without it.

 

but how about the equation ??

 

thanks

 

0 Kudos
Message 10 of 18
(4,420 Views)