rpm
May 6, 2020, 8:54pm
6
Here are two topics in which I helped @JD6 and @Micah_7157X work through @Connor PID code tutorial. I don’t have much time now for interactive guidance, but I’m sure you’ll have the same questions as they did.
Hey guys, now that worlds is cancelled, along with school and sports, I have a bit of free time. I’m not an incredibly experienced programmer, as you are about to see, but I have been trying to teach myself more. My team had a great robot for tower takeover, but the main flaw was that our autonomous programs were not always consistent, and we have not been using a PID. This year we just used the rotatefor command in vexcode, using the internal encoder to measure. However, as I said, this was not…
For some time I have been trying to develop a PID. I took a look at @anon4126930 ’s video on how to make one. I understand some parts of it, but cannot seem to get it working in autonomous. If someone could tell me what’s wrong with the code, and maybe help me a little with the changes, that would be amazing.
double kP = 1; // Error
double kI = 0.001 ; // Last, Increase Precision
double kD = 0.01; // To Fast or Too Slow
double turnkP = 1 ;
double turnkI = 0.001;
double turnkD = 0.1;
// Auton S…
Just be sure to start with @Conners PID tutorial.
I will be allocating this thread to answering any questions in regards to the tutorial
[C++ VEXCode V5 Text Tutorials - Autonomous PID and Multitasking]
Fair Warning: I am unsure if I have the positive and negative motor values correct, as this is all done on the top of my head. So If the robot is continuing to go even after the lateral position is reached, change
error = averagePosition - desiredValue;
to
error = desiredValue - averagePosition;
If the robot continues to go even a…