From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PIID Auto tuning

Hi All 

 

I have been trying to tune a PID by varying the gain , integral and  derivative terms.  I am  not having a lot of luck with this so I have decided to investigate auto tuning. 

 

The setpoint and Process variable are both a 1D array of values (X and Y Image centroids).

 

This will therefore make the output a 1D array too. 

 

Are there any array instances  of the auto tuning vis?

 

I have tried putting the PID vi into a while loop and then using auto-indexing for the inputs and have also debated having four auto-tuning PID vis but this sounded like a really inefficient way of doing this.

0 Kudos
Message 1 of 17
(1,818 Views)

Hi Andrew,

 

did you start the other way around?

I typically measure the response of the system on a step-wise change of the output value to determine the needed PID gains…

 

Can you attach such measurement data?

Best regards,
GerdW


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

Hi GerdW

 

I have only measured the Process variable vs setpoint. The reason I did this was because the output is then used in a calculation to communicate with some picomotor mirrors. I don't have any data to send unfortunately.

 

I can try to send the code if this helps in any way 

0 Kudos
Message 3 of 17
(1,800 Views)

I Cannot attach the file is there another way we can solve this problem?

0 Kudos
Message 4 of 17
(1,777 Views)

Hi Andrew,

 

you should be able to attach typical LabVIEW files (like VI, CTL) directly, as well as images (JPG, PNG).

You should also be able to put all your files into a ZIP and attach that ZIP…

Best regards,
GerdW


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

AndrewIons01_1-1620738355593.png

here is an image of the PID section (its probably painful to look at) if this is unclear please do let me know 

 

0 Kudos
Message 6 of 17
(1,755 Views)

@AndrewIons01 wrote:

 

here is an image of the PID section (its probably painful to look at) if this is unclear please do let me know 

 


Very painful indeed! Also completely useless to answer your original question!

 

(did you know that index array is resizeable? How many time do you think you need to index out the same element in parallel? Wouldn't it make more sense to branch the wire afterwards? Why is there a stacked sequence at all?)

0 Kudos
Message 7 of 17
(1,741 Views)

Hi Altenbatch 

 

I apologise if this is painful to look at. I am still learning. 

 

Ok so at lest I know that this way is wrong. 

 

I did not know that the array index is resizable. How do I do this? 

 

The Stacked sequence is there because the output of the PID goes to a vector calculation to make a set of mirrors move. 

 

as for questions three and 4, i am unsure as to what you mean by these, can you clarify? 

0 Kudos
Message 8 of 17
(1,735 Views)

If you move your mouse over an Index Array, two little dots should appear on the top and bottom. Those are handles you can click and drag to create more outputs so you only need one Index Array that can output all the indices you're trying to use (0,1,2, and 3). I would do that and try to clean up those wires a bit because it's very hard to follow, almost impossible from an image. 

 

I too thought you were indexing the same array twice (two index 0's, two index 1's, etc), but I see those are actually two different arrays you're indexing, one on the top of the page 4 times, and the other on the bottom 4 times. It's just so crowded it's hard to tell! It really helps to make your VI's look pretty. 

0 Kudos
Message 9 of 17
(1,724 Views)

Hi,

 

you don't need IndexArray at all when you use the "array"-instance of the polymorphic PID function...

Best regards,
GerdW


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