LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to integrate data?

Hello!

 

I have a code where I read potentiometer data in order to have a position measurement. I use this measurement to create a controller and send this to a servomotor. Right know I have a simple P-controller and it works.

 

I want to have a more advanced controller and for this I want to integrate my data. But in order to use the numerical integrate block i need an array of 2, 3, 4 or 5 elements depending on the integration method. But since I use a timed loop I only get 1 measurement per loop. How do I handle this in the best way? Is there another way to integrate?

 

Thanks in advance!

 

BrittClaus_0-1682349499876.png

 

0 Kudos
Message 1 of 2
(747 Views)

@BrittClaus wrote:

I want to have a more advanced controller and for this I want to integrate my data. But in order to use the numerical integrate block i need an array of 2, 3, 4 or 5 elements depending on the integration method.


 

I haven't looked at your code but it sounds like you could use a ptbypt method. It would be easy to adapt it to higher orders.

0 Kudos
Message 2 of 2
(744 Views)