LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I controller (based on a PID controller) in Labview vs PID in Simulink

Solved!
Go to solution

Good day,

 

Was checking the forum trying to find something similar but came across only a couple of topics that were not helpful.

I need to design an I-controller (from a PID block) to implement in hardware my Matlab/Simulink code. In one of the older threads I noticed that the current PID block (in 2012) did not allow to use only an integral part (when P=0). On top of that, the PID implementation in Labview and Simulink is a little bit different. The standard PID block in Simulink does not require to have a set-point port (even though it is possible to implement). Whereas in Labview, this port is presented by default in all possible PID variations.

So now I stuck the PID controller that can’t operate as an I-controller. Since this PID controller works with two different systems, it is impossible to have any set-points as the input. Already not the best start. A couple of other differences that I’ve noticed trying to tackle this issue.

Simulink PID controller (the as in the C&S toolkit http://www.ni.com/white-paper/6440/en/) based on the PID gains K-coefficients. The Simulink controller is defined by the proportional K-gain and time constants for the integral and derivative inputs (http://www.ni.com/white-paper/3782/en/).

I am more than aware about the use of the Standard PID controller in Labview (with P and I components), but this I-controller makes my tasks are quite challenging (even though the controller is more straightforward). I’ve tried to simulate a PID controller in a Mathscript node as a transfer function, but it is hard to judge how correct its behavior.

Does anybody know what can be done to solve this issue? Thank you.

0 Kudos
Message 1 of 6
(3,480 Views)

Hi Michael,

 

can't you create a copy of the PID function coming with LabVIEW and rework that copy to implement your "I-controller"?

Or implement that algorithm in a fresh vi?

 

What's the point of a controller when you don't have a setpoint?

(How does the I part calculates and integrates the error, which usually is defined as difference of pv and sp?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,477 Views)
Solution
Accepted by topic author MichaelAsh

GerdW wrote:

What's the point of a controller when you don't have a setpoint?

(How does the I part calculates and integrates the error, which usually is defined as difference of pv and sp?)


It's been a while since I looked at Simulink, but I believe it accepts the error (rather than a setpoint and process variable) as the input, and tries to drive that error to 0.

 

To implement a pure integrator controller, I would use the Integral x(t) PtByPt function (point-by-point integration). Integrate the error and multiply by the desired gain.

0 Kudos
Message 3 of 6
(3,459 Views)

Hi nathand,

 

Yep exactly what I did after I had a look at the code again. So obvious. I've tested it over the last day or two and found perfectly suitable for my application. Cheers.

 

GerdW,

Yeah it is doable, but I was looking for smth less bulky than the standard PID block (since I needed only the integral part). Thank you for your tips.

0 Kudos
Message 4 of 6
(3,430 Views)

what r the advantages of PI controller in labview compared to matlab for switch reluctance motor

 

0 Kudos
Message 5 of 6
(2,811 Views)

Hi padmashree,

 

what r

See this excellent thread

 

the advantages of PI controller in labview compared to matlab for switch reluctance motor

As long as the same implementations are used there will be no advantage…

A PI controller is a PI controller, no matter which programming IDE is used!

Best regards,
GerdW


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