04-24-2023 10:18 AM
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!
04-24-2023 10:21 AM - edited 04-24-2023 11:09 AM
@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.