Control Loops Nick Schatz FRC 3184.

Slides:



Advertisements
Similar presentations
PID Control for Embedded Systems
Advertisements

Controllers Daniel Mosse cs1657 cs1567.
Introductory Control Theory I400/B659: Intelligent robotics Kris Hauser.
Chapter 4: Basic Properties of Feedback
Add and Use a Sensor & Autonomous For FIRST Robotics
PID Control -1 + Professor Walter W. Olson
Using the NXT Light Sensor. 2 Connect One Light Sensor – 1 From My Files use Left / Right NXT buttons and get to View menu and push Orange button. From.
CHE 185 – PROCESS CONTROL AND DYNAMICS
Introduction to Control: How Its Done In Robotics R. Lindeke, Ph. D. ME 4135.
FRC LabVIEW Software Overview Joe Hershberger Staff Software Engineer National Instruments.
Roberto - Balancing Robot RIT Computer Engineering Senior Design Project.
Process Control Instrumentation II
Intelligent Steering Using PID controllers
Lecture 4: Basic Concepts in Control CS 344R: Robotics Benjamin Kuipers.
Cascade, Ratio, and Feedforward Control
NXT Development Tutorial Part 2: Sensor/ Motor Collaboration NTHU CS Freshman Camp Shu-Ting Wang.
Robot Sensors Kevin Watson and Rich Petras. Overview ➲ Sensors ● Micro Switch ● Gyro ● Encoders ➲ Command Sequencing ➲ PID Control.
Agenda Path smoothing PID Graph slam.
David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #1 David Giandomenico Team mentor for Lynbrook Robotics – Team.
Robot sensors MVRT 2010 – 2011 season. Analog versus Digital Analog Goes from 0 to 254 Numerous values Similar to making waves because there are not sudden.
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Feedback Control.
20/10/2009 IVR Herrmann IVR:Control Theory OVERVIEW Control problems Kinematics Examples of control in a physical system A simple approach to kinematic.
Introduction to ROBOTICS
Low Level Control. Control System Components The main components of a control system are The plant, or the process that is being controlled The controller,
Control of Robot Manipulators
Pioneers in Engineering, UC Berkeley Pioneers in Engineering Week 8: Sensors and Feedback.
PID CONTROLLERS By Harshal Inamdar.
IVR 30/10/2009 Herrmann1 IVR: Control Theory Overview: PID control Steady-state error and the integral method Overshoot and ringing in system with time.
CSCI1600: Embedded and Real Time Software Lecture 12: Modeling V: Control Systems and Feedback Steven Reiss, Fall 2015.
Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015.
ME 431 System Dynamics Dept of Mechanical Engineering.
Lecture 25: Implementation Complicating factors Control design without a model Implementation of control algorithms ME 431, Lecture 25.
Swerve Drive Software Design. Software Layers Joystick Axis Correction Joystick Response Calculation Field-oriented Angle Adjustment Swerve Drive Steer.
Princeton University Prospect Eleven Nov. 17, 2005 Control Systems Speed control module: –Receives desired speed from Speed Decision –Decides how to modulate.
Control 3 Keypoints: PID control
Lecture 16: Introduction to Control (Part II)
Chapter 4 A First Analysis of Feedback Feedback Control A Feedback Control seeks to bring the measured quantity to its desired value or set-point (also.
Flow of signal So you have a sensor, now to process data taken from a sensor you will need a processing unit and that is your controller. sensorcontroller.
Deriving Consistency from LEGOs What we have learned in 6 years of FLL by Austin and Travis Schuh © 2005 Austin and Travis Schuh, all rights reserved.
PID Control Joe Ross Team 330.
Get your software working before putting it on the robot!
SKEE 3143 Control Systems Design Chapter 2 – PID Controllers Design
ABE425 Engineering Measurement Systems ABE425 Engineering Measurement Systems PID Control Dr. Tony E. Grift Dept. of Agricultural & Biological Engineering.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
PID Control for Embedded Systems
Salman Bin Abdulaziz University
PID Control Systems (Proportional, Integral, Derivative)
Automatic control systems III
Automatic control systems I. Nonlinearities in Control System
Deriving Consistency from LEGOs
Control Systems EE 4314 Lecture 12 March 17, 2015
Chapter 7 The Root Locus Method The root-locus method is a powerful tool for designing and analyzing feedback control systems The Root Locus Concept The.
PID Controllers Jordan smallwood.
Feedback Control System
CSCI1600: Embedded and Real Time Software
Balanduino Supervisor: Dr. Raed Al-Qadi Prepared by: Nadeen Kalboneh Nardeen Mabrouk.
Basic Design of PID Controller
Electronic Control Systems Week 7 – PID Control
Cole Perrault Spring 2015 ET 493 Wesley Deneke
Chapter 9 Design via Root Locus <<<4.1>>>
Interactive Basic Tuning for the SERVOSTAR 600
Better Line Following with PID
Brief Review of Control Theory
In the land of the blind, the one eyed man is king
Dynamical Systems Basics
Control.
Advanced LabVIEW
Stryke Force Talon SRX Motor Training Course
The Design of Feedback Control Systems
PID Line Follower.
Presentation transcript:

Control Loops Nick Schatz FRC 3184

Agenda The what/why of control loops Simple control loops (Classical control theory) Applications of control loops Implementation

Me FRC 3184 Lead Programmer Not a control systems engineer

Why? 971 2015 https://youtu.be/35e2R_bPdwA?t=21m32s Boston Dynamics https://www.youtube.com/watch?v=fRj34o4hN4I

Prologue: Sensors Encoders (single-axis position and speed) Gyroscope (Rotation about 1 [important] axis) LIDAR/Ultrasonic (Distance) Current (Power) Accelerometer (useless)

What is a control loop? Move to a certain position (“servo”) Maintain a certain speed Higher level problems Motion profiling Turn to angle Path following Requires closed-loop control (sensor feedback)

What We Want Approaches setpoint quickly Goes to within acceptable error of setpoint Rejects disturbances and minor changes to system Doesn’t overshoot the setpoint too much

Feed-Forward Control (Open-Loop Control) Accounts for known system behavior* Not robust Doesn’t reject disturbances or deal with unexpected behavior

Feedback Accounts for things that we don’t consider in theory Rejects disturbances Requires a continuous sensor (encoders, gyros)

Simple Control Loop (“Bang-Bang”) Error = Setpoint - Measured If Error > 0, set power forward If Error < 0, set power backward (or turn off) If Error = 0, stop Problem: Oscillation

Proportional Control Problems: Over/undershoot, Steady-state error Set motor power to some constant (Kp) * Error Problems: Over/undershoot, Steady-state error

Proportional/Integral (PI) Control Set motor power to some constant (Kp) * Error Add some constant (Ki) * Σ Error Problems: Overshoot

Proportional/Integral/Derivative (PID) Control Set motor power to some constant (Kp) * Error Add some constant (Ki) * ΣError Add some constant (Kd) * ΔError Problems: None!*

PID(F) Footnotes You don’t always need to use all 4 terms Tuning isn’t trivial

Tuning In theory: Tune F until system is close to desired state Increase Kp until system oscillates around setpoint, then reduce to acceptable level Increase Ki until an acceptable amount of steady-state error is reached Increase Kd until the system rejects disturbances and doesn’t overshoot In FRC: You probably don’t need much more than Kp

Modeling your System To improve your control loop, model how the system works in theory Feed-forward accounts for this model Feedback (PID) accounts for things that you can’t predict Model (esp. for position) holds your system at a steady-state

Feedforward in Velocity and Position loops In a velocity loop, FF should do 95% of the legwork In theory, P won’t eliminate all your steady-state error Solutions: Make P into I (WPILib’s solution), OR just realize that it’s close enough In a position loop, FF just keeps the system at a (mostly) steady state Feedback must do most of the legwork to drive to setpoint P can drive to setpoint fairly quickly

Applications

Why not PID? Things that don’t require precise control Complex motion (more than one dimension) PID is SISO (Single Input Single Output)

Flywheel Set Feed-forward to be close to desired speed Let 100% be the maximum speed Choose FF so that velocity is close to desired RPM Ex: 12V is 6000 RPM, set FF to 83% for desired speed of 5000 RPM Tune Kp until the system returns to desired speed quickly

Big Arm Use encoder on axis of rotation Feed-forward accounts for gravity Some constant times cosine of the arm angle Tune Kp until system responds quickly

Turn to Angle (or keep driving straight) Use gyroscope as input Put output as your turn arcadeDrive(0, turn) or tankDrive(turn, -turn) Feedforward is minimum power required to start robot moving Usually only requires kP

Closed-Loop Driving Speed control on drivetrain Tune each side of drive individually (should be similar) Feed-forward is desired speed + friction intercept Paper from 449

Cascading PID Loops Approximates MIMO control Example: Use output of turn-to-angle loop as input for drive loop Provides much better control (functions more linearly at low speeds) Allows for doing fancy stuff like...

Motion Profiling Generate many points (time, position, velocity) that follow a “motion profile” Use velocity control loop to move between these points Enables precise movement Reliable, repeatable autonomous Desmos demonstration

Implementation Should be run at high speed, ≥50 Hz Consistent timing (multithreading) Not really Integral and Derivative, but Sum and Slope WPILib’s PIDController TalonSRX built-in PID control - unit issues Write your own!

Learning More FRC PDR - PID Control PID for Dummies Talon SRX Software Reference Guide WPILib documentation Chief Delphi FRC Discord “PID control system analysis and design” paper

Questions? Suggestions: Nick I don’t understand this This is great, but driving at 50% power for 4 seconds is just as good Является ли майонез инструментом? How do I model systems? How is this actually useful? Is this what those cool robots from Boston Dynamics use?

Modern Control Theory Controls multiple inputs/outputs and orders (position and velocity) Control Bootcamp FRC 971’s control writeups Linear algebra!