How do you structure timers in Vexcode IQ blocks for pid control?

Hi,
Our team just learnt about pid control and we wanted to implement it on our robot for autonomous. We had some problems calculating delta time using a timer in vexcode iq blocks.

We ended up with 3 diffrent ways to calculate delta time. All work well but we want to know which one is the correct way of doing auton

Don’t worry there is a section for reverse operation aswell ( you just can’t see it)
Thanks

What were the problems ?

I don’t see a delay (wait) in any of the screen shots, delta may be very small.

4 Likes

As all of the solutions worked, it isn’t as much a problem as a desire for the best solutions. All the solutions worked but we want to find the one that is the best but from our observations we can’t tell. To calculate delta time we decided to use timers in our scipt to calculate it. We decided to do that so we can take more readings (as we don’t have an extra delay) and therefore have a more accurate PID controller. The problem is that we don’t really know where we should add in our timer blocks (if we should at all) so we decided to ask here whether any of our tries are the correct option to do and if not find what the correct solution is.

Sorry for not making this clear on my post. I am still quite new to the forum. I will do that in future posts.

Thanks