LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID setpoint time addition

Solved!
Go to solution

Hi all,

 

I'm trying to run 2 instruments concurrently using the PID setpoint profile but I'm having trouble setting up the time to work properly. In the time column, if I want the program to change values every 5 seconds, I have to set each value in ascending order as 5,10,15,20, etc.

 

What I'd like to do is just input 5,5,5,5,etc. in the column as I need second precision and changes in the order of 100k seconds. Having to add all of the previous values up and add them to the next row is a massive pain. I know there will likely be some simple way to programatically add the time together as the loop runs but I'm just not LV enough to see it.

 

Any help would be appreciated.

LV-2017
0 Kudos
Message 1 of 7
(2,880 Views)

Hi Potticary,

 

your current VI will iterate of all elements of the "Setpoint" array - and will wait for 1s for each element.

After all that waiting the loop outputs two arrays, fed into those PIDSetpointProfile functions.

 

Whats the point of waiting all that long in the FOR loop?

Best regards,
GerdW


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

No point of the wait whatsoever. I was trying something just before I posted and forgot to remove it.

 

Sorry.

LV-2017
0 Kudos
Message 3 of 7
(2,855 Views)

Hi Potticary,

 

What I'd like to do is just input 5,5,5,5,etc. in the column as I need second precision and changes in the order of 100k seconds.

What is a "second precision"? What are "changes in the order or 100k seconds"?

 

Having to add all of the previous values up and add them to the next row is a massive pain.

I don't know what you are trying to "add up" and "add to next row"…

 

The PIDSetpointProfile expects an array of clusters, consisting of a time and a setpoint. Nothing to "add up"…

Best regards,
GerdW


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

What is a "second precision"? What are "changes in the order or 100k seconds"?

I need the profile to change with second precision, e.g. I may need a step to be 3487 seconds (i.e. I can't break it down into minutes or hours). I also need to make steps of the order of 100k seconds, e.g. a step may be 246099 seconds.

 

I don't know what you are trying to "add up" and "add to next row"…

If I'm running a temperature controller with which I need a 1 hour ramp to 55 degrees and then a 5 min decrease to -5 degrees and a hold of 30 mins. Currently those three rows work if they read:

55 | 3600

-5 | 3900

-5 | 5700

The time values have to be the sum of all values before it + the new value. What I'd like to be able to do is:

55 | 3600

-5 | 300

-5 | 1800

 

Unless I'm missing the point altogether.

LV-2017
0 Kudos
Message 5 of 7
(2,843 Views)
Solution
Accepted by topic author Potticary

Hi Potticary,

 

so you want to use shift register in that FOR loop to sum up the "Time" values?

Why don't you use a shift register then?

 

(This is pretty basic LabVIEW stuff, but I guess you already know that Training section in the header of this LabVIEW board!?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(2,841 Views)

Everythings basic to those that know how to use it, huh?

No problem, most of the language used in context help and the training resources fly straight over my head, so are no good to me without weeks to read manuals. At least I can look up shift registers now!

I apologise for being too beginner to be on the forums and deserve the belittling, but I'm sure it would have taken me weeks to find what I was looking for on my own.

 

Thanks.

LV-2017
0 Kudos
Message 7 of 7
(2,833 Views)