v5 Flywheel PID Code

#1

Hello vex teams of the world,
Recently we have completed our flywheel and have trouble with the velocity PID control for it. Here is the code that we currently use: Can anyone assist us in this problem?
PILONS HELP.PNG

0 Likes

#2

You seem to be confusing your P, I, and D with your kP, kI, and kD. Presumably you defined kP, kI, and kD globally elsewhere. But then topFinal only depends on those and not upon error at all. Also, the same type of issue, if you set kI to 0, do you have any way of recovering kI?

Finally, I would note that the integral part can go crazy at times, so you may end up preferring PD over PID.

0 Likes

#3

could you send some sudo code to go off please, that would help alot thanks in advance.

0 Likes

#4

What he means is that you are setting your “topFinal” output to the sums of the constants kP kI and kD, not the actual values for P, I, and D. You also may want to set the I value to 0 when you reach the target instead of changing the kI constant.

0 Likes

#5

I was under the impression that the v5 system has velocity PID built in, is this coming soon or do i just not have reliable sources?

0 Likes

#6

@Joey The Great it has built in pid but it is pretty bad for consistent velocity control

0 Likes

#7

oh, good to know, i think i’ll stick with cortex for now…

0 Likes

#8

@Joey The Great i would not recommend that since the advantages of v5 far out weigh the disadvantages, even if the pid is not the best i would still say it is worth it to stick with v5

0 Likes

#9

Let’s not turn this into another discussion about Cortex and V5, but I support @Joey The Great in sticking with Cortex for now. Sure, V5 may have more advantages, but we all know Cortex better than V5. And I’m taking the emphasized words “for now…” to draw my conclusion. Eventually, yeah, we should all change over later in the season. But now, you can be competitive with Cortex.

0 Likes

#10

I mean I used it for my ri3d flywheel and it still seems to out preform most flywheels I have seen.

0 Likes

#11

We have been using a v5 flywheel for over a month, and the built in PID seems to be very consistent.

0 Likes

#12

@tabor473 i mean it might just be an error on my part (not finding correct value) so i’ll try to do some more testing.

0 Likes

#13

well, its also the fact that my team is not extremely well-off enough to invest that much money in a system like that

0 Likes