šŸ¤–
Introduction to ROS2 and Robotics
  • Introduction
  • ROS2
    • Index
    • IDE and CMake Setup
      • How to add additional include search path
    • ROS2 Building Blocks
      • ROS Workspace and Package Layout
      • Launch File
      • tf2
      • Quality of Service
      • Configurations
        • Rviz Configuration
      • Built-in Types
        • Built-in Message Type
    • ROS Architecture
      • Intra-process Communication
    • Navigation and Planning
      • Navigation Stack and Concepts
      • Navigation2 Implementation Overview
        • šŸ—ļøCost Map
        • Obstacle Avoidance and DWB Controller
      • DWB Controller
      • Page 5
    • How to launch the Nav2 stack
    • ROS2 Control
      • Online Resources
      • Overview of Codebase
    • šŸ³Cookbook
      • Useful Commands
      • How to specify parameters
      • How to build the workspace
      • šŸ—ļøHow to publish message to a topic from command line?
      • How to inspect service and make a service call
      • How to properly terminate ROS and Gazebo
      • How to add and remove models in Gazebo simulation dynamically
      • 🚧How to spin nodes
    • šŸ›’Tutorials
      • Services and Communication between ROS2 and Gazebo
      • Subscription and Message Filters Demo
      • Executor and Spin Explained
      • Lifecycle Node Demo
      • Robotic Arm Demo
      • āš’ļøMultiple Robotic Arms Simulation Demo
      • 🚧Introduction to xacro
    • Page
    • šŸŗTech Blog
      • Difference between URDF and SDF and how to convert
  • Gazebo
    • Index
    • Terminology
    • GUI
    • World Frame and Axis
    • Cookbook
    • Page 1
  • Programming in Robotics
    • C++
      • CMake
    • Python
    • Rust
  • Mathematics in Robotics
    • Linear Algebra
    • Matrix Properties
    • Probability
      • Expectation-Maximization Algorithm
    • Multivariable Function and Derivatives
  • Physics in Robotics
  • Control of Dynamic Systems
    • Dynamic Response and Transfer Function
    • Block Diagram
    • PID Controller
  • Robot Modeling and Control
    • Rotation and Homogeneous Transformation
  • Probabilistic Robotics
    • Bayes Filter
    • Kalman Filter
    • Particle Filter
    • Discrete Bayes Filter
    • Motion Model
    • Perception Model
    • Localization
    • SLAM
  • Miscellany
  • Concept Index
    • Quaternions
Powered by GitBook
On this page
  1. Control of Dynamic Systems

PID Controller

PreviousBlock DiagramNextRobot Modeling and Control

Last updated 1 year ago

For the purpose of completeness, we provide a brief description of PID Controller.

In the time domain, a PID controller has the following equation:

u(t)=Kpe(t)+KI∫0te(Ļ„)dĻ„+KDeĖ™(t)u(t) = K_pe(t) +K_I\int_0^{t}e(\tau)d\tau + K_D\dot{e}(t)u(t)=Kp​e(t)+KIā€‹āˆ«0t​e(Ļ„)dĻ„+KD​eĖ™(t)

where KpK_pKp​, KIK_IKI​, and KDK_DKD​ are parameters for proportional control, integral control, and derivative control respectively.

In the state domain, a PID controller has the following transfer function:

H(s)=KP+KIs+KDsH(s) = K_P+\frac{K_I}{s} + K_D sH(s)=KP​+sKI​​+KD​s

This is a direct application of the Laplace transform

The integral control helps to remove the steady state error; the combination of integral and derivative control helps to reduce the overshoot and improve the transient response to make it faster. There is a very nice video () that explains the intuition behind these terms.

The general idea is the following: suppose we want to track a variable, say a car. By tracking, it means we drive side-by-side with the tracked car. Initially, we are behind, in this case, the error is the distance between our car and the tracked car. The proportional term means if the distance is long, we should make more effort (i.e. press the gas pedal more). Imaging we are able to reduce the distance. This means our car is driving faster than the tracked car. At the moment when we catch up the tracked car, the distance is zero, which means the error is zero. At this particular moment, we are not making effort. However, during the catch-up process, our car drives faster. The speed of the car is continuouse so even if we stop making efforts anymore, our car is still faster than the tracked car, which means it will go beyond the tracked car. This is overshoot. To deal with the overshot, a derivative term is added as an offset. In our case, as the distance is reduced, we should make less efforts. The integral term is used to improve the control in steady state. For example, based on the distance, we apply the proportional control, this may make our car drive at the exact same speed as the tracked car. In this case, there is no change in the distance between the two cars so the derivative term is zero and the two-car system is in a steady state and the distance will remain the same forever. The intergral control term represents the accumulation of the error. In our example, the distance and the error remain constant and the error is accumulated. Thus the integral term will instruct the car to be faster and make it escape the steady state.

https://www.youtube.com/watch?v=XfAt6hNV8XM