Introduction to Closed Loop Control
Introduction to feedback control in FTC
What is Closed Loop Control?
/*
* Bang Bang Controller
*/
reference = someValue;
while (referenceIsNotReached) {
// obtain the encoder position
encoderPosition = armMotor.getPosition();
// calculate the error
error = reference - encoderPosition;
// if too low, move up, if too high then move down
if (error > 0) {
armMotor.setPower(-1);
} else {
armMotor.setPower(1);
}
}


Practice Exercises
Last updated
Was this helpful?
