LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change setpoint automatically to a PID control

Solved!
Go to solution

Hi, I want to change the setpoint to my PID control, wait until the process is stable (PV is within + - xx% of SP in YY time), write data to a file, insert a new SP in PID controller, and so on .
How can I make it automatic, I can not use The PID Setpoint Profile VI, since it uses a fixed time for each step
.

 

Thank you in advance

0 Kudos
Message 1 of 26
(5,505 Views)
Solution
Accepted by topic author TBN

I would use a state machine, with states something like "Update Setpoint", "Wait until Stable," and "Write to File."  You might also need states for initialization, cleanup, and error handling.  In parallel with the state machine (in the same while loop, but outside the case structure) run your PID loop and data acquisition.  You'll want to save the current setpoint in a shift register, and you may need to save the latest PID data in one as well.  If you don't understand the state machine concept, there are many examples on this forum and included with LabVIEW.  Have you written any code yet?  If so, upload it.  If you're not sure where to start, a good place might be to write a VI that determines whether your process is stable, then build from there.

Message 2 of 26
(5,502 Views)

Thanks, now I have an idea to start from

0 Kudos
Message 3 of 26
(5,492 Views)

hi, I saw your answer and I have a wuestion to you if you can help. I set the temperature to the specifik point then wait till it stable. here STABLE is problem for me.  I couldn't do that. that can be like PID structure. I can send my vi to you and you can have an idea and give me feedback if possible.

 

Best.

0 Kudos
Message 4 of 26
(5,413 Views)

Hi

 

Attach your *.vi and I'll try to look at it

 

TBN

0 Kudos
Message 5 of 26
(5,400 Views)

Hello,

 

I have attached my "stability" vi. Is is working but as you can see the vi is not efficient. What I want can be seen in attached screenshot.  Step by step inrecaing the temperature. When the temperature stable, it will make a measurement. Here in this vi I described a tamperature range as 0.2K and when it is in this range I set it to wait for 3 or 5 min to make it stable. this is not a very nice programming. May be avarage or standart deviation can be used but I couldn't do that.

 

I am looking forward your response and thank for help.

 

Best.

Download All
0 Kudos
Message 6 of 26
(5,395 Views)

What is this VI supposed to do?  What is the purpose of the "OK/NOT" terminal with the strange wiring of an AND and a true constant?  It looks like you're just trying to run loop until the reading for one of the two units is within some range of the setpoint; is that what you actually want to do?  That's not stability, it's just reaching a target value once.

0 Kudos
Message 7 of 26
(5,385 Views)

It is not stability control. İt is what I create a temprorary solution. now I need originally stability program.

 

this program works, when there is tability it sends comman OK/NOT to the slave structrue where I make analysis.

 

stability program also should be like this. when there is temperature stability, OK command should be send.

 

there are two temperature values, stability should work for both but seperatelly. each of them should be stable, then measurement /analysis will be done.

 

I found a structure, may it will an example

 

best.

0 Kudos
Message 8 of 26
(5,376 Views)

That looks like a reasonable start.  Personally I'd avoid the dynamic data and the express VI, and just use "Standard Deviation and Variance" from the Mathematics->Probability and Statistics palette.

0 Kudos
Message 9 of 26
(5,370 Views)

How can I insert it to my vi?

 

0 Kudos
Message 10 of 26
(5,367 Views)