LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulate a control of a sine wave signal

Solved!
Go to solution

Hi Xebe,

 

unfortunately I'm stuck at LV2014 here, so could you please resave your VI for LV2014 and attach it again?

Best regards,
GerdW


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

I hope I did it correct.

Thanks for keeping up with me.

0 Kudos
Message 12 of 18
(1,378 Views)

Hi Xebe,

 

wow, you did it the "hard" way using the simulation toolkit. (I don't have this toolkit installed and so cannot run your VI.)

I was talking about the PID toolkit, available for free with recent LabVIEW versions (atleast better than Base version)!

Best regards,
GerdW


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

So you just mean the PID block? 

 

I'll try to use that one instead and keep you updated

 

Edit: Something more like this (attachment)

0 Kudos
Message 14 of 18
(1,362 Views)

Hi Xebe,

 

I simplified your VI even more!

Keep in mind: this simple VI does not include any "plant simulation", so the PID controller has no chance to ever reach its setpoint as the "control system" does not react on the PID output signal…

 

In the example finder you will find VIs demonstrating PID with some plant simulation included!

Best regards,
GerdW


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

Thanks a lot, this was very helpful.

 

Do you perhaps know if there's a way so that the PID only works when the PV goes outside the set limits?

0 Kudos
Message 16 of 18
(1,352 Views)
Solution
Accepted by topic author XebeXUC

Hi Xebe,

 

a way so that the PID only works when the PV goes outside the set limits?

With "real" PID controllers (available as hardware block) you most often have a deadband setting which exactly does what you request now.

You can fake this in LabVIEW quite easily:

IF ABS(pv-sp) <= deadband/2 THEN
  pv:=sp
ENDIF
output := PID(pv, sp)

 You find other threads on this topic in the forum…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 17 of 18
(1,347 Views)

where exactly would i put in this code? 

And where do i fill in my high and low value between which it doesn't have to work? (I have little basic knowledge about code write programming)

 

 

Edit:

Found out a solution for the problem that seems to work.

 

Thanks a lot for your help and patience with me.

0 Kudos
Message 18 of 18
(1,339 Views)