Skip to content

Introduction to Control Systems

Quote

Control systems is the science of making machines behave the way we want them to behave as opposed to how they would naturally behave.

Systems have input and output signals and a behavior that evolves over time. Systems can be broken down into components, which are something that we think we understand. In physical systems, inputs are generated by actuators. For example, DC motors or LEDs. Outputs are measured by sensors, for example, cameras or wheel encoders. These sensors produce observations.

The figure shows these parts in a chain. The blue words are an example of each part: one of the robot's wheels, which a motor drives and a wheel encoder measures.

A system: actuators give inputs to the process, and sensors turn its outputs into observations Actuators motor driver and motor inputs torque on the wheel Process and environment wheel, robot and ground outputs wheel speed Sensors wheel encoder observations measured wheel speed Blue: an example, the speed of one of the robot's wheels
A system from its actuators to its sensors. Read the figure from top to bottom. In the example, the measured wheel speed comes about like this: the wheel turns, the encoder's two Hall sensors give pulses, the Teensy counts their edges, and the firmware computes the angular velocity from the change of the count and the time it took.

In the case of a mobile robot, the system is the real physical robot and its environment around it. This system receives inputs from the robot's actuators, which results in an observable output by the robot's sensors. For example a change in the camera viewport of the environment or a change in encoder ticks because of rotating wheels.

Controlling a system means to design a logical component that will output, at every instant in time, the commands for the plant actuators so that the output of our system follow a given plan.

Need for Control Systems

The main objectives of the controller are the following:

  1. Stability
  2. Performance
  3. Robustness

Stability

Mathematically, stability can be formalized as Bounded Input Bounded Output. The output of a system will be bounded for every input to the system that is bounded.

TODO

Add stability image

In other words, if finite energy is provided to the system, then finite energy should exit the system.

TODO

Add stability I/O image

According to the definition of stability provided (BIBO stability), a system goes unstable when an output of the system diverges (always continues growing in time), when provided with a finite energy input. When defining the output as "distance from the center of the lane", driving outside of the road would be an example of instability.

Performance

Beside being stable a system needs also to perform well. Performance can be measured in several ways:

  • Time before reaching the target state: How quickly does the system converge to the plan
  • Tracking error: how closely a reference signal is followed or how precisely does the system converge.
  • Maximum acceptable error at any point in time
  • Disturbance rejection: the ability to compensate for external stimuli. How well can the system recover from unexpected external stimuli, such as the noise in the measurements or disturbances, like a sudden gust of wind or hitting a bump on the road.
  • Noise attenuation: the ability to minimize the effect of high-frequency signals added to the measurements or inputs.

These are all good examples of performance criteria for controller design.

TODO

Add performance image with direct path to target and max acceptable error

Robustness

Robustness, is the ability of the controller to provide stability and performance even in the presence of uncertainty in the mathematical model of the plant.

TODO

Add model uncertainty image

Model uncertainty can mean that the wheels of the robot are slightly of different sizes or the disposition of mass is different than what's assumed. Also the parameters parameters of the system might just change over time because of wear and tear. A robust controller would handle these cases well despite the uncertainty. Robustness and performance are trade offs and striking the right balance is a challenge that really depends on the application.

Model uncertainty is defined as a "bounded variation" of the parameters describing the controlled system's model. Choosing completely different sensors (e.g., a camera instead of the planned pressure sensor for altitude control of a hot air balloon) might induce a completely different structure in the plant's model, which wouldn't not therefore be a "bounded" variation.

"Bounded variation" in the system behavior of a mobile robot could count as:

  • Wear and tear of components over time.
  • Slight imperfections in the assembly.

Controller Structure

TODO

Add stability, performance, robustness images

With the mentioned objectives in mind, stability, performance, and robustness, it is important to think about the structure of the controller.

  • Open Loop Control
  • Close Loop Control

The simplest approach is for the user to send a predetermined sequence of commands directly to the actuators, which is called open loop control.

TODO

Add open loop image

Open Loop Pros

  • it can't make a stable process unstable: a bounded, preset command keeps the response of a stable process bounded, because no measurement is fed back
  • it is convenient
  • works when the model of the system is good

Open Loop Cons

  • everything must be planned in advance
  • it can't make an unstable process stable or correct a slowdown, because it doesn't observe the output

If our understanding of the platform response is good, we will obtain the desired outcome. If it is not good or if something unexpected happens during the execution, then the end result will diverge from the plan. In open loop control, information flows only in one direction, from the controller to the plant.

To enable the controller to take into account the actual execution, it is possible to close the loop by feeding the sensor measurements back to the controller, creating a feedback loop.

The figure shows a closed loop around the system of the first figure, with the wheel's speed as the example again.

A closed control loop: reference, comparison, controller, actuators, process, sensors, and the observations fed back to the comparison 1 reference target wheel speed + − 2 error target minus measured Controller PID in the firmware 3 commands motor command Actuators motor driver and motor 4 inputs torque on the wheel Process and environment wheel, robot and ground 5 outputs wheel speed Sensors wheel encoder 6 observations measured wheel speed Blue: an example, the speed of one of the robot's wheels A closed control loop: reference, comparison, controller, actuators, process, sensors, and the observations fed back to the comparison 1 reference target wheel speed + − 2 error target minus measured Controller PID in the firmware 3 commands motor command Actuators motor driver and motor 4 inputs torque on the wheel Process and environment wheel, robot and ground 5 outputs wheel speed Sensors wheel encoder 6 observations measured wheel speed Blue: an example, the speed of one of the robot's wheels
A closed loop. Start at the reference (1) and follow the numbers around the loop, back to the comparison in the circle.
  1. The reference is the value that the output should have. In the example, it is the target speed of the wheel.
  2. The comparison subtracts the observation from the reference. The result is the error: how far the wheel's speed is from its target.
  3. The controller computes the commands from the error. In the example, a PID controller in the robot's firmware computes a motor command. When the measured wheel speed falls below the target, the error grows, and the controller raises the motor command.
  4. The actuators turn the commands into inputs of the process. The motor driver and the motor put a torque on the wheel.
  5. The process reacts with its outputs. The wheel turns at a speed that also depends on the robot's weight and on the ground.
  6. The sensors measure the outputs. The wheel encoder gives the measured wheel speed. This observation goes back to the comparison.

Without the path of the observations (6), the loop is open, and the controller has no measured speed to subtract. An open loop controller for the same wheel could apply a fixed motor command for a fixed time. If the wheel slows down under a load, for example on a carpet, that command stays the same, and the wheel turns less far than planned. The closed loop measures the slowdown, and the controller raises the motor command. If the motor has enough torque, the wheel gets back to its target speed. If even the largest motor command supplies too little torque for this load, the wheel stays below its target speed, and the measured speed shows by how much. PID Controllers describes this controller for the robots.

Closed Feedback Loop Pros

  • it adapts to circumstances

Closed Feedback Loop Cons

  • it is less convenient
  • it can destabalize a stable system

Feedback control is very powerful because it allows the whole system to adapt to circumstances as they are unfolding and apply corrections on the fly. The measurements themselves, though, generally need to be processed before being fed back to the controller. This is required because the raw measurements might include a lot of redundant data straight out of the sensors.

How to structure this agent is up to the designer, to us.

TODO

Add closed loop empty agent image

We could use different approaches, for example, a deep neural network trained from real data or a simulation to translate the images from the camera directly into commands to the wheels to keep the robot following a desired plan.

Traditionally, agents are designed with three main components, perception, planning, and control: to see, to plan, and to act. In the figure, the agent is everything between the observations and the commands. In the closed loop figure, that is the comparison and the controller, and the reference comes from outside. In the agent, the planner supplies the reference. The agent's controller compares the reference with the estimate that perception computes from the observations.

An agent: perception turns the observations into an estimate, the planner makes a reference path from it, and the controller computes the commands Sensors observations Agent Perception estimate Planner estimate reference path Controller commands Actuators
An agent between the sensors and the actuators. Perception gives its estimate to the planner and to the controller, and the planner gives the reference path to the controller.

Perception

TODO

Add closed loop empty agent image: perception highlighted

The perception block is responsible for transforming the data from the sensors into actionable information for the robot. This passage is sometimes called filtering or estimation. These estimates of relevant quantities, for example, the position or the orientation of the robot's reference frame with respect to the world and the other objects in it, represent what is the robot's belief of his current state. This belief might be more or less corresponding to the truth depending on the quality of the measurements and the perception solution used.

Planner

TODO

Add closed loop empty agent image: planner highlighted

The planner instead provides a reference path for the robot to follow. For example, between two navigation points in a more general task of reaching a goal position while avoiding obstacles on the road. The planner receives the state estimate as input so it can adjust the nominal plan on the fly.

Controller

TODO

Add closed loop empty agent image: controller highlighted

The plan and the state estimate are finally fed into the actual controller, which uses them to compute a decision applying a certain logic. For a mobile robot, the decision of the controller will be a sequence of commands which will be sent to the motors, finally closing the loop.

Summary

  • Systems are input/output relations we can formalize
  • Control is about making the system's output follow a given plan
  • The control objectives are stability, performance and robustness
  • The traditional feedback control architecture includes perception planning and control steps

Designing a controller allows to have systems behave in a desired way, rather than following their natural dynamics. Although we can measure quantities of interest and drive the system through actuators, not all systems are controllable. Some systems simply can't be controlled.

Systems have their natural dynamics, fundamentally dictated by the laws of physics. More often than not, just "letting the system go" will not meet the user's requirements. Control systems leverage our abilities to measure quantities of interest and to actuate (or influence the physical world through devices), to drive the system where we want, and how we want.

In practice a controller consists of lines of code or one or more mechanical devices. A controller is typically a logic, that outputs decisions. These decisions are translated to the real world through actuators. It is actually possible to create control logics with analog devices too.

Stability is the first design objective for most controllers because unstable systems are potentially unsafe. An unstable system might lead to overshooting driving behaviour, not following a reference path and even driving outside of the road without heading back. There are very few instances in which sending a system unstable might be desirable (exceptions being, e.g., acrobatic flight or selected military/destructive applications). An unstable system will behave unpredictably, potentially with catastrophic results.

References

Comments

Comments are GitHub Discussions, shown with giscus. Loading them connects to giscus.app (hosted by Vercel, USA) and GitHub (USA); you need a GitHub account to comment.