COM2009-3009 Robotics: Lecture 6 PDF

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Document Details

DiplomaticUvite

Uploaded by DiplomaticUvite

The University of Sheffield

2023

null

null

Tags

pid control robotics control systems engineering

Summary

This document provides a lecture on PID control within robotics, including its history, operation, and limitations. It also discusses the inverted pendulum problem and considerations for compliance. The document is from the University of Sheffield.

Full Transcript

© 2023 The University of Sheffield COM2009-3009 Robotics COM2009-3009 Robotics: Lecture 6 slide 1 1 © 2023 The University of Sheffield COM2009-3009 Robotics Lecture 6 PID Control COM2009-3009 Robotics: Lecture 6 slide 2 2 1 © 2023 The University of Sheffield Negative-Feedback Control D...

© 2023 The University of Sheffield COM2009-3009 Robotics COM2009-3009 Robotics: Lecture 6 slide 1 1 © 2023 The University of Sheffield COM2009-3009 Robotics Lecture 6 PID Control COM2009-3009 Robotics: Lecture 6 slide 2 2 1 © 2023 The University of Sheffield Negative-Feedback Control DiStefano III, J. J., Stubberud, A. R., & Williams, I. J. (1990). Feedback and Control Systems (2nd ed.). New York: McGraw-Hill. COM2009-3009 Robotics: Lecture 6 slide 3 3 © 2023 The University of Sheffield Negative-Feedback Control Proportional Integral Derivative (PID) Controller 𝑢 𝑡 = 𝐾! 𝑒 𝑡 + 𝐾" ' 𝑒 𝑡 𝑑𝑡 + 𝐾# COM2009-3009 Robotics: Lecture 6 𝑑𝑒 𝑡 𝑑𝑡 slide 4 4 2 © 2023 The University of Sheffield PID Control Proportional 𝐾!𝑒 𝑡 + 𝑟 𝑡 ∑ + 𝑒 𝑡 Integral 𝐾" ∫ 𝑒 𝑡 𝑑𝑡 - + ∑ 𝑢 𝑡 Actuator + Derivative $% 𝐾# $& 𝑡 Sensor 𝑢 𝑡 = 𝐾! 𝑒 𝑡 + 𝐾" ' 𝑒 𝑡 𝑑𝑡 + 𝐾# COM2009-3009 Robotics: Lecture 6 𝑑𝑒 𝑡 𝑑𝑡 slide 5 5 © 2023 The University of Sheffield History of PID Control Proportional • 1911: first developed Elmer Sperry • 1933: the Taylor Instrumental Company (TIC) introduced the first pneumatic controller with a fully tuneable proportional controller • 1930s: control engineers discovered that they could eliminate the steady state error found in proportional controllers by integrating, giving rise to the proportionalintegral controller • 1940: TIC developed the first pneumatic controller with a derivative action to reduce overshooting issues • 1942: Ziegler-Nichols tuning rules introduced • 1950s: PID controllers became widely adopted in industry "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% - + ∑ + Derivative ") *+ *, % . % Actuator Sensor COM2009-3009 Robotics: Lecture 6 slide 6 6 3 © 2023 The University of Sheffield PID Control • The three ‘gain’ terms have different effects … Proportional "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% + - ∑ . % Actuator + *+ ") *, % Derivative Sensor – KP influences the short-term error – KI influences the long-term error – KD influences the rate-of-change of error • Control is possible using … – KP only (known as a ‘P’ controller) – KP and KI (known as a ‘PI’ controller) – KP, KI and KD (a full ‘PID’ controller) • Optimal control requires appropriate values for KP, KI and KD 𝑢 𝑡 = 𝐾! 𝑒 𝑡 + 𝐾" ' 𝑒 𝑡 𝑑𝑡 + 𝐾# COM2009-3009 Robotics: Lecture 6 𝑑𝑒 𝑡 𝑑𝑡 slide 7 7 © 2023 The University of Sheffield Operation of a ‘P’ Controller Proportional "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% - + ∑ . % Actuator + Derivative ") *+ *, % Sensor Reference Input error Controlled Output Time COM2009-3009 Robotics: Lecture 6 slide 8 8 4 © 2023 The University of Sheffield Operation of a ‘P’ Controller Proportional "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% + - ∑ . % Actuator + *+ ") *, % Derivative Sensor Reference Input Controlled Output Time Kp = 0 COM2009-3009 Robotics: Lecture 6 slide 9 9 © 2023 The University of Sheffield Operation of a ‘P’ Controller Proportional "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% - + ∑ . % Actuator + Derivative ") *+ *, % Sensor Reference Input Controlled Output Time Kp = too small COM2009-3009 Robotics: Lecture 6 slide 10 10 5 © 2023 The University of Sheffield Operation of a ‘P’ Controller Proportional "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% + - ∑ . % Actuator + *+ ") *, % Derivative Sensor Reference Input Controlled Output Time Kp = too large COM2009-3009 Robotics: Lecture 6 slide 11 11 © 2023 The University of Sheffield Operation of a ‘P’ Controller Proportional "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% - + ∑ . % Actuator + Derivative ") *+ *, % Sensor Reference Input Controlled Output Time Kp = wrong sign! COM2009-3009 Robotics: Lecture 6 slide 12 12 6 © 2023 The University of Sheffield Operation of a ‘P’ Controller Proportional "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% + - ∑ . % Actuator + *+ ") *, % Derivative Sensor Reference Input Controlled Output Time Kp = OK COM2009-3009 Robotics: Lecture 6 slide 13 13 © 2023 The University of Sheffield Operation of a ‘P’ Controller Proportional "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% - + ∑ . % Actuator + Derivative ") *+ *, % Sensor Reference Input Controlled Output Time Kp = better COM2009-3009 Robotics: Lecture 6 slide 14 14 7 © 2023 The University of Sheffield Quality of Control overshoot Proportional settling time "# $ % equilibrium error + - % + ∑ $ % Integral "& ∫ $ % (% + - ∑ . % Actuator + *+ ") *, % Derivative Sensor rise time Controlled Output Time COM2009-3009 Robotics: Lecture 6 slide 15 15 © 2023 The University of Sheffield Operation of a ‘PID’ Controller Proportional "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% - + ∑ . % Actuator + Derivative ") *+ *, % Sensor http://www.inpharmix.com/jps/PID_Controller _For_Lego_Mindstorms_Robots.html 𝑢 𝑡 = 𝐾! 𝑒 𝑡 + 𝐾" ' 𝑒 𝑡 𝑑𝑡 + 𝐾# COM2009-3009 Robotics: Lecture 6 𝑑𝑒 𝑡 𝑑𝑡 slide 16 16 8 © 2023 The University of Sheffield Operation of a ‘PID’ Controller Proportional "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% - + ∑ . % Actuator + Derivative *+ ") *, % Sensor https://en.wikipedia.org/wiki/PID_controller 𝑢 𝑡 = 𝐾! 𝑒 𝑡 + 𝐾" ' 𝑒 𝑡 𝑑𝑡 + 𝐾# COM2009-3009 Robotics: Lecture 6 𝑑𝑒 𝑡 𝑑𝑡 slide 17 17 © 2023 The University of Sheffield Demo: A ‘PID’ Controller 𝑢 𝑡 = 𝐾! 𝑒 𝑡 + 𝐾" ' 𝑒 𝑡 𝑑𝑡 + 𝐾# COM2009-3009 Robotics: Lecture 6 𝑑𝑒 𝑡 𝑑𝑡 slide 18 18 9 © 2023 The University of Sheffield Tuning a PID Controller 1. Manual adjustment – no maths – online – requires experience Proportional "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% - + ∑ . % Actuator + Derivative *+ ") *, % Sensor 2. Computer simulation – automatic – offline 3. The ‘Ziegler-Nichols’ Method – some maths – online COM2009-3009 Robotics: Lecture 6 slide 19 19 © 2023 The University of Sheffield The ‘Ziegler-Nichols’ Method Proportional • KP is increased from 0 until the control system has stable and consistent oscillations • This value of KP is referred to as the ‘ultimate gain’: KU • The oscillation frequency is designated as FU Hz (where TU = 1/FU secs) • Values for KP, KI and KD are calculated as follows … "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% - + ∑ . % Actuator + Derivative ") *+ *, % Sensor Ziegler, J.G & Nichols, N. B. (1942). "Optimum settings for automatic controllers". Transactions of the ASME. 64: 759–768. COM2009-3009 Robotics: Lecture 6 slide 20 20 10 © 2023 The University of Sheffield The ‘Ziegler-Nichols’ Method • KP is increased from 0 until the control system has K = 4.0 U stable and consistent oscillations • This value of KP is referred to as the ‘ultimate gain’: KU • The oscillation frequency is designated as FU (where TU = 1/FU) Ziegler-Nichols • PID-ZN FU = 1.2 Hz Values for KP, KI and KD are calculated … COM2009-3009 Robotics: Lecture 6 slide 21 21 © 2023 The University of Sheffield Alternative Formulations Proportional • Parallel (ideal) form … "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% - + ∑ . % Actuator + Derivative ") *+ *, % Sensor 𝑢 𝑡 = 𝐾! 𝑒 𝑡 + 𝐾" ' 𝑒 𝑡 𝑑𝑡 + 𝐾# 𝑑𝑒 𝑡 𝑑𝑡 • Standard (industrial) form … 1 𝑑𝑒 𝑢 𝑡 = 𝐾! 𝑒 𝑡 + ' 𝑒 𝑡 𝑑𝑡 + 𝑇# 𝑡 𝑇" 𝑑𝑡 Mathematically equivalent, but more intuitive where TI is the integral time TD is the derivative time COM2009-3009 Robotics: Lecture 6 slide 22 22 11 © 2023 The University of Sheffield Alternative Formulations 𝑢 𝑡 = 𝐾! 𝑒 𝑡 + 𝐾" ' 𝑒 𝑡 𝑑𝑡 + 𝐾# Proportional "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% - + ∑ . % 𝑑𝑒 𝑡 𝑑𝑡 Actuator + Derivative *+ ") *, % Sensor 𝑢 𝑡 = 𝐾! 𝑒 𝑡 + COM2009-3009 Robotics: Lecture 6 1 𝑑𝑒 ' 𝑒 𝑡 𝑑𝑡 + 𝑇# 𝑡 𝑇" 𝑑𝑡 slide 23 23 © 2023 The University of Sheffield Demo: PID Control in Action Maze-Runner COM2009-3009 Robotics: Lecture 6 slide 24 24 12 © 2023 The University of Sheffield PID Control in Action Proportional "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% - + ∑ . % Actuator + Derivative *+ ") *, % Sensor http://youtu.be/nYsA6tuEK3U COM2009-3009 Robotics: Lecture 6 slide 25 25 © 2023 The University of Sheffield PID Pseudo Code Maze-Runner The aim is to stay equidistant from the sides Kp = 3.6 Ki = 15.12 Kd = 0.21 speed = 50 integral = 0 last-error = 0 derivative = 0 dt = 0.01 PID While True: start = time() left-distance = READ-ULTRASOUND-SENSOR(1) right-distance = READ-ULTRASOUND-SENSOR(2) error = left-distance – right-distance integral = integral + error derivative = error – last-error turn = Kp*error + Ki*integral*dt + Kd*derivative/dt WRITE-MOTOR(1, direction=forward, power=speed+turn) WRITE-MOTOR(2, direction=forward, power=speed-turn) last-error = error end = time() dt = start - end COM2009-3009 Robotics: Lecture 6 slide 26 26 13 © 2023 The University of Sheffield The ‘Inverted Pendulum Problem’ Balance Balance-2 https://youtu.be/a4c7AwHFkT8 COM2009-3009 Robotics: Lecture 6 slide 27 27 © 2023 The University of Sheffield The ‘Inverted Pendulum Problem’ COM2009-3009 Robotics: Lecture 6 slide 28 28 14 © 2023 The University of Sheffield The ‘Inverted Pendulum Problem’ • A single PID controller is hard to calibrate • An alternative is a hierarchical arrangement of P controllers (as in Perceptual ControlTheory) – the bob’s angular position error is corrected by varying the angular velocity reference signal – the angular velocity error is corrected by varying the angular acceleration reference signal – the angular acceleration error is corrected by varying the cart’s position reference signal (with gravity providing the acceleration) – the cart’s position error is corrected by varying the cart’s linear velocity reference signal – the cart’s velocity error is corrected by varying the cart’s linear acceleration reference signal – the cart’s linear acceleration is varied by varying the motor torque COM2009-3009 Robotics: Lecture 6 slide 29 29 © 2023 The University of Sheffield The ‘Inverted Pendulum Problem’ Ben Hawker Hierarchical Perceptual Control Theory (HPCT) solution COM2009-3009 Robotics: Lecture 6 slide 30 30 15 © 2023 The University of Sheffield Compliance https://www.densowave.com/en/robot/ product/function/C ompliance-controlfunction.html • In many robot applications (e.g. handling soft/delicate materials), the actuators needs to have some ‘give’, i.e. they shouldn’t be completely stiff • However, as we have seen, a good PID controller would render an actuator highly resistant to any disturbance, hence it will be stiff by design (high Kp → high stiffness) • A low value of Kp will simply mean weak control (i.e. it might drop whatever it’s holding) • So, we want an actuator to be ‘compliant’ rather than ‘floppy’ • Also, robot actuators tend to be rigid/stiff, not just because of the controller, but because of gear wheels • Soft materials (e.g. on a gripper) have a natural compliance, but compliance can also be programmed into the controller • This can be done by sensing the actuator position and using that to modify the controller, e.g. by altering the reference/setpoint COM2009-3009 Robotics: Lecture 6 slide 31 31 © 2023 The University of Sheffield Compliance PID-2 PID-1 Semini, C, Barasuol, V. & Boaventura, T. (2016) “Is active impedence the key to a breakthrough for legged robots?”, Robotics Research, pp. 3-19. COM2009-3009 Robotics: Lecture 6 slide 32 32 16 © 2023 The University of Sheffield Compliance https://youtu.be/sbhiNNIxMNQ COM2009-3009 Robotics: Lecture 6 slide 33 33 © 2023 The University of Sheffield Limitations of PID Control • Constant parameters Proportional "# $ % + - % + ∑ $ % Integral "& ∫ $ % (% - + ∑ + Derivative ") *+ *, % Sensor . % Actuator • No direct knowledge of the process • Linear • Symmetric • Derivative term is sensitive to sensor noise • Integral term can lead to ‘integral windup’ • Single-layer solutions can be hard to optimise COM2009-3009 Robotics: Lecture 6 slide 34 34 17 © 2023 The University of Sheffield This lecture has covered … • • • • • • • • • • Negative-feedback control PID control Operation of P, PI and PID controllers Tuning a PID controller Ziegler-Nichols Alternative formulations PID pseudo code The ‘inverted pendulum problem’ Compliance Limitations of PID control COM2009-3009 Robotics: Lecture 6 slide 35 35 © 2023 The University of Sheffield Any Questions ? (or you can post on the ‘Lecture’ Discussion Forum) COM2009-3009 Robotics: Lecture 6 slide 36 36 18 © 2023 The University of Sheffield Next lecture … Reaching & Grasping COM2009-3009 Robotics: Lecture 6 slide 37 37 19

Use Quizgecko on...
Browser
Browser