How do you use the PID loop for a flywheel? I want to be able to just give it a ticks per second and have it stay at that speed. I’m using easyC but using the text aspect. I know what a PID loop is I just want to know how to actually implement the commands…
how does changing the variables such as tolerance, ticks, and pid change how it will behave? How should I use define PID? How should I use all of them?
DefineIntegratedMotorEncoderPID( a,p,i,d,t) ;
x = OnTargetIntegratedMotorEncoderPID(a);
I managed to get a functional pid using easy C earlier in the season. The pid functions native to easy c were confusing so I decided to make my own. First I went with creating a program that measures and displays the rpm speed at which the flywheel is turning. We found a good speed for that to be around 1800 rpm.
Here’s a source that actually explains the pid rather well:
What my team did was only stick with the proportional part of the pid and this allowed for some basic speed correction. This was enough to get us to score 145ish in programming skills at a tournament. Easy C is confusing and restrictive when it comes to complex math functions and sometimes it would process a calculation as a float, sometimes it would round numbers… it was all up in the air. I suggest you go with a different programming platform. If you are not able to, a proportional correction program should work fine.
Someone linked to this yesterday which I had completely forgotten about.