# What is Control Theory?

Let’s get some perspective and think about the world in terms of dynamical systems, whose state can be mathematically described through systems of ordinary differential equations (ODE’s). This has been a very effective way of modeling real-world phenomena such as the fluid flow over a wing, the population dynamics in a city or the spread of disease, the stock market climate or the movement of planets around a solar system. Treating all these as dynamical systems with data from the real world allows us to build predictive models.

Often we want to go beyond just describing the system of interest, and we want to actively manipulate the system of interest by changing its behavior. This could be done by imposing a certain preplanned control logic aiming to manipulate it or actually using sensors to measure the system and make decisions based on how the system is responding.

There are two main types of control.

## Open Loop

Open loop control consists of a preplanned trajectory. There is no feedback from the state of the system, so you’re just trusting that things are working out. In the image above, this means that we have no sensors.

A sprinkler system that turns on for 10 minutes each morning to water your plants is open loop control. It’s not trying to maintain a measured moisture value; it’s just trusting that 10 minutes per day is good enough. It still turns on if its raining.

Stepper motors are often controlled open loop. You drive the coils to complete a certain number of steps, and trust that the motor got there. If you know the loads in your system, and sized your motors correctly, this can be a pretty safe assumption.

## Closed Loop

Closed loop control introduces feedback. First and foremost, feedback allows us to deal with uncertainty and error. We can’t predict very far in advance when it’s going to rain. So if you want your sprinklers to not waste water during a rainstorm, you need some feedback to know when it rains. If you want to know when your stepper motor skips a step and output another to make it up, that’s also feedback. As we will see, a deeper result of feedback is that we can change the effective dynamics of the system, so that it more quickly and reliably steers toward the outcomes we want.