Linear Control Theory - vanderbiltrobotics/RoboticsIntelligenceDatabase GitHub Wiki
What is Linear Control Theory?
Control theory in control systems engineering deals with the control of continuously operating dynamical systems in engineered processes and machines. The objective is to develop a control model for controlling such systems using a control action in an optimum manner without delay or overshoot and ensuring control stability.
(Wikipedia)
In more simple terms, control theory is about accurately and precisely controlling the state of dynamic systems. A dynamic system could be something as a simple as a motor or something as complex as an entire robot.
Figure 1: Block Diagram of a feedback loop (Wikipedia)
The controller is responsible for measuring the process variable (PV) and comparing it to a reference/set point (SP). The difference between the process variable and set point is called the error (or SP-PV error). The error is used to generate an input to the system, whose response is again measured by a sensor and fed back into the controller.
One example of a control system is the cruise control on a car. The cruise speed the driver sets is the set point. The cars ECU (electronic control unit) will constantly monitor the speed of the the car, which is the process variable (PV). The error is used to determine whether the car should increase the throttle, reduce the throttle, or brake.
This is an example of a single-input single-output (SISO) controller. More complicated systems may utilize multiple-input multiple-output (MIMO) controllers.
"Bang Bang" Controller
Bang bang controllers are one of the simplest types of controller. The controller simply switches to a constant control output until the set point is reached, after which is switches to zero control output. For example, take a motor that needs to turn exactly 360 degrees. The controller will first set a constant power output to the motor. Once the encoder reads 360 degrees, it will turn off the motor. In an ideal system with no inertia, this would result in near-perfect control. However, due to latency in the controller processing and the acceleration/deceleration of the motor, bang-bang controllers tend to overshoot past the reference point.
Figure 2: Position vs. Time graph of a typical Bang-Bang controller
Advantages
- Very simple control algorithm, not compute intensive
Disadvantages
- Tends to overshoot the set point
P.I.D. Controller
P.I.D. stands for proportional-integral-derivative. It is a more complicated type of controllers that applies three terms of input to determine the control output. The first term, proportional, calculates the control output using a single linear function modeled as follows:
Where u(t) is the control output, e(t) is the error, and kp is gain constant. Note that this function is akin to a simple harmonic oscillator. In an ideal system, such a feedback loop would result in a sinusoidal oscillation about the SP. However, in a physical system, a proportional control is often enough to achieve the behavior. If the proportional gain constant is too high, the system will oscillate.
In order to reduce the oscillations created by the proportional gain, the derivative control is introduced, modeled by the following equation:
The control output of the derivative function grows as the rate of change of the error increases. Since the gain for a derivative term is negative, the derivative function works to reduce the control output and "flatten" the error trajectory to reduce overshoot. If the derivative term is too high, the control output will likely become jerky.
The final term is the integral term, which sums the instantaneous error over time.
The integral term accelerates the movement towards the SP. It also helps eliminate steady-state errors. In other words, if the system stops at a position that is not the set point due to external forces/influences, the accumulation of the error from the integral term will cause the system to accelerate again to reach the set point. A large integral term can cause large oscillations.
All together, the P.I.D. function is as follows:
Figure 3: Position vs. Time graph of a typical P Controller
Figure 4: Position vs. Time graph of a typical PI Controller
Figure 5: Position vs. Time graph of a typical PID Controller
Tuning the P.I.D. Controller
The three gain constant for the P.I.D. loops are determined for a given system. They should be selected such that the system is critically damped.
Tuning P.I.D. is not something I [Swapnil] am well versed in. It would be awesome if somebody who knew more could write about this.