Programming FRC Robots. PID Control

Similar documents
TETRIX Add-On Extensions. Encoder Programming Guide (ROBOTC )

FRC WPI Robotics Library Overview

CONTENTS. What is ROBOTC? Section I: The Basics

TwinCAT NC Configuration

Name: Partners: Period: Coaster Option: 1. In the space below, make a sketch of your roller coaster.

PID Control. Proportional Integral Derivative (PID) Control. Matrix Multimedia 2011 MX009 - PID Control. by Ben Rowland, April 2011

Process Control Primer

An overview of Computerised Numeric Control (C.N.C.) and Programmable Logic Control (P.L.C.) in machine automation

Simple Analysis for Brushless DC Motors Case Study: Razor Scooter Wheel Motor

2/26/2008. Sensors For Robotics. What is sensing? Why do robots need sensors? What is the angle of my arm? internal information

ROBOTICS 01PEEQW. Basilio Bona DAUIN Politecnico di Torino

Introduction to programming moway

Unit 1: INTRODUCTION TO ADVANCED ROBOTIC DESIGN & ENGINEERING

Basics electronic speed Governor

EasyC. Programming Tips

USER MANUAL. EZRUN Series Brushless Speed Controller EZRUN-150A-PRO

Digital Position Control for Analog Servos

Speed Based on Volume Values & Assignment (Part 1)

AEO Head Movement Tracker X-GYRO 1000 USER MANUAL(V1.1bata )

MSc in Autonomous Robotics Engineering University of York

ServoPAL (#28824): Servo Pulser and Timer

APPENDIX. SureSERVO QUICK START GUIDE. In This Appendix... Quick Start for SureServo Drives...A 2. Tuning Quick Start for SureServo Drives...

Electric Landing Gear controllers and sequencer LGC12 / LGC 13C

Application Note AN-SERV-006

Six-servo Robot Arm. DAGU Hi-Tech Electronic Co., LTD Six-servo Robot Arm

Servo Info and Centering

G-100/200 Operation & Installation

FREE FALL. Introduction. Reference Young and Freedman, University Physics, 12 th Edition: Chapter 2, section 2.5

ROBOTC Programming Competition Templates

Autonomous Advertising Mobile Robot for Exhibitions, Developed at BMF

The Basics of Robot Mazes Teacher Notes

Introduction to Process Control Actuators

A1000 Cheat Sheet (Open Loop Vector)

Mobile Robot FastSLAM with Xbox Kinect

1 One Dimensional Horizontal Motion Position vs. time Velocity vs. time

Robotics. Lecture 3: Sensors. See course website for up to date information.

Inclined Plane: Distance vs. Force

Pine Hill Public Schools Curriculum

Radio Control System

North Texas FLL Coaches' Clinics. Beginning Programming October Patrick R. Michaud republicofpi.org

After: bmotorreflected[port2]= 1; //Flip port2 s direction

Current Loop Tuning Procedure. Servo Drive Current Loop Tuning Procedure (intended for Analog input PWM output servo drives) General Procedure AN-015

Data Sheet. Adaptive Design ltd. Arduino Dual L6470 Stepper Motor Shield V th November L6470 Stepper Motor Shield

The following information can be output as speech: status of the teacher / student connection. time markers of the timers.

B Robo Claw 2 Channel 5A Motor Controller Data Sheet

Operational Overview and Controls Guide

HITACHI INVERTER SJ/L100/300 SERIES PID CONTROL USERS GUIDE

How To Turn On A Robot On A Computer On A Black Box On A Pc Or Macbook

1. Learn about the 555 timer integrated circuit and applications 2. Apply the 555 timer to build an infrared (IR) transmitter and receiver

The word teamster today means a truck driver,

How To Control Gimbal

KS3 Computing Group 1 Programme of Study hours per week

QTRONIX Programmer Pad

Chapter 22: Electric motors and electromagnetic induction

Pulse Width Modulation

PIC Application Notes

Digital Single Axis Controller

Programming Logic controllers

Measuring Resistance Using Digital I/O

Wind Energy Math Calculations Calculating the Tip Speed Ratio of Your Wind Turbine

How To Program An Nxt Mindstorms On A Computer Or Tablet Computer

CHAPTER 11: Flip Flops

E190Q Lecture 5 Autonomous Robot Navigation

Blender Notes. Introduction to Digital Modelling and Animation in Design Blender Tutorial - week 9 The Game Engine

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

BUILD A REVOLUTE COORDINATE ARM

Teacher Answer Key: Measured Turns Introduction to Mobile Robotics > Measured Turns Investigation

Advantages of Auto-tuning for Servo-motors

Adaptive Cruise Control System Overview

Adaptive Cruise Control of a Passenger Car Using Hybrid of Sliding Mode Control and Fuzzy Logic Control

Example. Fluid Power. Circuits

GRAPH MATCHING EQUIPMENT/MATERIALS

By: M.Habibullah Pagarkar Kaushal Parekh Jogen Shah Jignasa Desai Prarthna Advani Siddhesh Sarvankar Nikhil Ghate

Data Sheet. Electro-mechanical counters Hengstler 800 series

CPW Current Programmed Winder. Application Handbook. Copyright 2002 by Eurotherm Drives, Inc.

Accuracy and Tuning in CNC Machine Tools

Effective Use of Android Sensors Based on Visualization of Sensor Information

Software Manual RS232 Laser Merge Module. Document # SU Rev A

Transmission Line Terminations It s The End That Counts!

Whitepaper. Image stabilization improving camera usability

YOSEMITE REGIONAL OCCUPATIONAL PROGRAM COURSE OUTLINE. COURSE TITLE: Robotics Engineering I ROP S1 Robotics Engineering I ROP S2

S4000TH HART. HART Communication Manual

Robotics and Automation Blueprint

Mach3 Tutorial Setting up a basic three axis milling machine. Based on Mach3 2.0

Hands-On Math Algebra

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

Chapter 2 The Research on Fault Diagnosis of Building Electrical System Based on RBF Neural Network

Explore 2: Gathering Momentum

The Quadcopter Controller

Shutter Speed in Digital Photography

BACKING UP PROCEDURES FOR SCHOOL BUS DRIVERS

How to design and implement firmware for embedded systems

Polar Alignment by Iterating on One Star and Polaris

Advanced Programming with LEGO NXT MindStorms

Rubber Band Race Car

Mathematical goals. Starting points. Materials required. Time needed

Epec 4W30 INSTRUCTIONS FOR USE. Seinäjoki Finland MEASURING EQUIPMENT NOTE! Read this manual and observe all safety instructions.

MTII Case Study Instructions

USER MANUAL ESP. Enhanced Steering Performance. R-Net

Inequalities - Absolute Value Inequalities

Transcription:

Programming FRC Robots PID Control

Presenters Michael DiRamio: Programming and Controls mentor on 1114 for the past 2 years. High School teacher for District School Board of Niagara E-mail: Michael.DiRamio@dsbn.edu.on.ca Tyler Holtzman: Mechanical and Programming mentor on 1114 and 2056. Started in 2003 as a student on 1114. Software Engineering Student at McMaster University

Autonomous For the last few years each game has started out with an autonomous period, in which the robots move based only on pre-programmed commands and sensor input.

Timer Based Robot follows pre-programmed commands that each last for a given length of time. Time can be judged by either using the processors timers or by counting the number of cycles that have passed.

Common Sensors Range Finders Light Sensors Limit Switches Hall Effect Encoders Gyros CMU Camera etc..

Basic Sensor Use There is always some value you are trying to get to. Go until you get to that value, then stop Problems: tends to overshoot the goal

PID Control PID stands for Proportional-Integral- Derivative A way of using what you know from your sensors to compute an intelligent motor output. Incorporates the idea that you need to slow down as you get close so you don t overshoot the target.

Our Example We want to drive our robot forward 10 metres, and then stop. The concepts we explore do not always have to involve distance. (ie your goal may be to maintain a certain speed or certain rate of acceleration)

Proportional (P) A measure of how far you are away from your goal. The larger the P value, the larger the motor output should be, since you have farther to go. In our example this would be the distance remaining between our current position and our goal of 10 metres.

Calculating Distance An encoder or hall effect sensor can be used to keep track of how far a wheel has turned. Hall effect sensors (or gear tooth counters ) signal the RC when a gear tooth passes in front of it. It is possible to calculate the distance each gear tooth covers. Encoders signal the RC for each part of a revolution turned. The number of signals per revolution varies. An advantage of encoders is that some ( quadrature encoders are able to distinguish between forward and reverse movement)

Derivative (D) How quickly you are moving towards your goal. Unlike P, when D is higher you want to pull back your motor output. This keeps you from heading towards you target too quickly. If P is still large (ie you are far from your target) then it will overpower the D. In our example this would be the speed we are traveling towards the goal.

Calculating Speed We have already seen how to keep track of the distance we have covered. Since cycles occur at set time intervals, it is possible to keep track of speed by calculating the distance travelled since the last cycle. speed = last cycle distance - current cycle distance

Integral (I) The integral is how long you have been away from your target. The idea is that the longer the robot has not made it to the target, the more power should be applied to get it there. The most difficult part to incorporate. PD control alone can be very effective.

Measuring I I is the sum of the distances you are away each time. It can be calculated by adding up the P value from each loop. In actual use, this value can grow VERY quickly, especially with a cycle time of ~ 27ms. A useful alternative is to cap the contribution to I each cycle to 1. If the robot is not at the target, add 1 to I. If the robot is close to the target, reset I.

Calculating the Motor Output The basic formula is: output = P * C P + I * C I - D * C D Where C P, C I, and C D are values tweaked to get the proper result. There are some methods to calculate the values of C P, C I, and C D, but it is generally more effective to find them by trial in error in robotics.

Method for Setting Values Start with C P small and C I, C D both zero. Raise C P until the robot is oscillating consistently around the target. Once this is accomplished, start increasing C D until the robot stops oscillating. Then add C I until the robot stops within a desired range of the target.