I need help with PID controllers

Hello everyone!

I am Luke - one of the team members on 323X. We are a first year team, and no one on our team has even seen vex prior to this season. I say that only to emphasize how much of noobs we are. I just started coding a couple weeks ago, and I feel like I’ve been picking it up pretty well.

At the last few meetings, I’ve been talking with the rest of my team about what we want to do before the world championship. We all agreed that we need some sort of straightening code. We also agreed that we need to have some sort of code that will keep the lift from falling, even when there is pressure applied to it. I have been reading some threads and seen that people have used PID controllers for those two things as well as several other things that we would like to do.

I have a vague understanding of what PID controllers do, but I have no clue how to use them. What I’m looking for is an in depth explanation of what they do, how they work, what they can be used for, and how to correctly use them.

We are using RobotC and the Vex Cortex, so please only reply with answers regarding that. We have potentiometers and integrated motor encoders. Thanks in advance for your help!

P.S. I did write code that did what we wanted it to…sorta. It didn’t work as well ascode that some teams, who I know for a fact are using PID controllers, have written. If you would like, please comment and I can include both functions that I wrote.

For future reference, this particular question was answered in this thread: https://vexforum.com/showthread.php?p=349397#post349397