Recently, I’ve been trying to incorporate a PID loop into my code for smooth and accurate turning. I have been using http://georgegillard.com/documents/2-introduction-to-pid-controllers as a guide to learn what to do, and other various resources on the web and this forum. However, I’ve run into a problem.
Gillard’s guide states that, when first adjusting kp, you should change it until the machine oscillates only a little bit. It does this by using “motor power” in RobotC and other languages similar to it, so that when it overshoots the motor power turns negative and turns the other way, so it oscillates. In Vex Code, it seems like any type of running of the motors requires you to input a directiontype before putting in any other parameters, whether it’s percent or voltage.
Because of this, the robot cannot oscillate once it overshoots, because it only has a directiontype of forward, and not just a motorpower value where direction doesn’t matter. I was wondering if anyone has created a turning PID loop in Vex Code V5 and would care to share what they did, or if someone could guide me towards the correct way to do it? Thanks!