(Needs proofreading! Written by: Keshav)
Feedback vs Feedforward
Feedforward Control
Feedforward Control is using a mathematical model of a system to calculate voltage given a setpoint. Note how it doesn’t say error and it only says setpoint. That is intentional. Feedforward Control doesn’t rely on the state or measurements or error of the system. This means that if a system is being controlled using purely feedforward, the voltage applied as an input will always stay constant throughout - even when the system reaches its setpoint. Usually when you use this type of control the setpoints are almost always velocities. Keep in mind that feedforward models vary from system to system because each behaves differently. Theoretical Equations can be found through physics since all movement is caused by a force and motors are applying a force when voltage is applied for them. However, data collection is usually more accurate in reflecting a system as these equations are theoretical. When tuning feedforward we typically use the actual system and collect data on that to get our model.
Feedback Control
Feedback Control is using the setpoint and error of a system to calculate the voltage. This model uses the error which is why it is called feedback. These algorithms are reactive to error and are more powerful than most feedforeward algorithms because of that. The most commonly used and ubiquitous feedback algorithm used throughout FRC is the PID. It takes in a setpoint and measurement and uses the error to calculate an input for the system to reach it’s desired state. It can be used in places where you need to control velocity and position and we will go more into detail on PIDs later in this chapter. Keep in mind -> PID’s are not the only type of feedback control that we use even though they are the most common. We will also sometimes use bangbang controllers but the physical system, constraints, and goal for the controller will decide how we control it. For example: If we are programming flywheels and need them to get up to speed as fast as possible but don’t care about small differences since there is room for error then we might be more inclined to use a bangbang controller while if we wanted to control an arm that had hardstops and needs to be brought up and down safely without breaking the robot we might be more inclined to use a PID.