Using PID in VEX IQ

Has anyone used PID with VEX IQ robots? Is there a tutorial somewhere? Can it be done in a simple enough form that a fourth grader can understand?

I was working with a team last night, they are trying to get four balls off of the fence, score them, and then ramp. They have a gyro sensor on their arm. They have a light sensor under the robot. They have a gyro sensor on their drivetrain. The gyro senor on their arm is to set the arm at the exact height to get the balls off. They use the light sensor to find the lines on the table. They use the gyro sensor on their drivetrain to make exact turns. The program was working **perfectly **every time, with the exception of ramping. It didn’t want to balance the ramp. We took a break to eat dinner. When we came back, the arm wouldn’t position itself correctly, and the turns were wrong (but it balanced the ramp?!?). It doesn’t make any sense. Needless to say, the team was EXTREMELY frustrated. I don’t know what to say to help them. They’re going to attack it again tonight. But, I don’t know what I can do as a coach to help them.

It was suggested to me, by someone who is an expert in VEX EDR, to use PID. I’m afraid that I don’t know how, and I don’t know how to teach my students.

PID is already built into the VEX IQ smart motors. So if you tell it to go to a position it will stay there. Why not just tell the arm motor to move a certain number of degrees?

You describe 2 gyro sensors. I assume the one on the arm is to set it at an angle? The problem with this is that they are designed to operate horizontally, not vertically, so they will drift the whole time that they are vertically oriented.
To look at these things, open your debugger window for sensors and watch the values change and your robot stands still.

Couple other things with gyro’s. When you mount them, keep them as far away from motors and electromagnetic fields as you can. Also, make sure you reset the gyro at the beginning of you program or when you know where you are on the field. Gyro’s drift.