David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #1 David Giandomenico Team mentor for Lynbrook Robotics – Team.

Slides:



Advertisements
Similar presentations
Lecture 20 Dimitar Stefanov. Microprocessor control of Powered Wheelchairs Flexible control; speed synchronization of both driving wheels, flexible control.
Advertisements

Session Objectives: Review basic math for single swerve module
Lecture 7 Curve Turn.
Add and Use a Sensor & Autonomous For FIRST Robotics
Presented By: Lynbrook Robotics, Team 846 John Chai, David Liu, Aashish Sreenharan, Michael Wachenschwanz, and Toshi Tochibana Available online at lynbrookrobotics.comlynbrookrobotics.com.
PHY 235 Robotics Workshop Day 6 DC Motors, H-Bridge Board, Simple Lego/Boe Bot.
Electric Drives FEEDBACK LINEARIZED CONTROL Vector control was invented to produce separate flux and torque control as it is implicitely possible.
One of the most common types of drivetrain is known as a skid steer drivetrain, which may also be referred to as a tank drive. A skid steer drivetrain.
Available at: – Program Optical Quad Encoders in Autonomous Mode Program optical quad encoders in autonomous mode.
Enabling Objective 1.3 Describe the Design of the Magnetek Impulse VG+ series 3 Variable Frequency Drive Controller.
Mechanisms Get your notebook please- we are taking a few notes first
DC Motors DC Motors are widely used in robotics because of their small size and high energy output. Key characteristics of DC motors include: 1. High Speed.
FRC LabVIEW Software Overview Joe Hershberger Staff Software Engineer National Instruments.
Fundamentals of Electric Drives: DC Drives
DC Motor Control  mouse EE 496 Advisor: Dr. Tep Dobry.
September 15, 2007 D.Giandomenico PWM Motor Control with IFI Robotics Victor884 Electronic Speed Controller David Giandomenico Lynbrook High School Robotics.
Micromouse Meeting #3 Lecture #2 Power Motors Encoders.
Introduction to Robotics Electronics and Robotics Club.
1 Sensors BADI Year 3 John Errington MSc. 2 Sensors Allow a design to respond to its environment – e.g. a line following robot may use photosensors to.
David GiandomenicoBasic Feedback ControlDec 2009 WRRF Workshops David Giandomenico Team mentor for Lynbrook Robotics – Team #846 David Giandomenico Team.
1 Motors & Motor Controllers ECE AC or DC Motors AC –Few robots use AC except in factories –Most of those that use AC first convert to DC DC –Dominates.
Applied Control Systems Robotics & Robotic Control
David GiandomenicoBasic Feedback ControlDec 2009 WRRF Workshops Foreward To the Reader: These slides were created for presentation with verbal explanations,
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
ENGR 6806 – Motor Control Prepared By: Rob Collett September 15, Office: EN2074.
Lynbrook Robotics Team, FIRST 846 Control System Miniseries - Lecture 2 05/22/2012.
Lecture 18. Electric Motors simple motor equations and their application 1.
An Objective and Component View (Not included Drive: Balance and Turret: Axis Camera)
Engineering H193 - Team Project Gateway Engineering Education Coalition Lab 2P. 1Spring Quarter Motor Dynamics Lab 2.
David GiandomenicoBasic Feedback Control 5/15/2012 David Giandomenico Team mentor for Lynbrook Robotics – FIRST #846 David Giandomenico Team mentor for.
Default_Routine(); - PWM Mapping /******************************************************************** * FUNCTION NAME: Default_Routine * PURPOSE: Performs.
Tuning. Overview Basic Tuning Difference between commutation methods Use of digital filters Vertical axis – no brake Overview 2.
Electrical Actuation System Lecture 9 (Chapter 9).
STEPPER MOTORS Name: Mr.R.Anandaraj Designation: Associate. Professor Department: Electrical and Electronics Engineering Subject code :EC 6252 Year: II.
1 Lecture on Lab 6 Lab 7 Lab 8. 2 Lab 6: Open Loop Controller As you learned in lab 5, there are two kinds of control systems: open loop and closed loop.
DC Motor Control The material presented is taken from a variety of sources including: ponents/inductor001.html#howworks,
Cass Lake Bena Robotics.  Drivetrains  Electrical System  Operator Interface.
Find the Mindstorms Icon on the computer.. To start a new program click go.
Automatic accident avoiding system PROJECT MEMBERS MUTHUKUMAR.K (05ME33) SAKTHIDHASAN.S (05ME39) SAKTHIVEL.N (05ME40) VINOTH.S (05ME56) PROJECT GUIDE:
Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015.
In Unit 5: Speed, Power, Torque, and DC Motors, you build a VEX test stand winch that enables you to learn key engineering concepts and principles so.
Session 12 Sensors and Timers. 3 Main Types of Robot Projects Command-Based Robot A more complicated project for more complicated robots Iterative Robot.
Electronics and Controls
ELEC 3105 Basic EM and Power Engineering Rotating DC Motor PART 2 Electrical.
1 ©2006 INSciTE Common Blocks. 2 ©2006 INSciTE Common Blocks Common blocks are full featured actions Like English statements Move Wait for an action Display.
NATCAR SUMMER CLASS II 6 July 2004 Chung Hsieh. Topic of Discussion Power Supply Motor Drive Circuits Braking.
Robot Physics MVRT 2011 – 2012 Season. Overview Mass vs. Weight Velocity Force Torque.
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.
INTRODUCTION TO ROBOTICS Part 3: Propulsion System Robotics and Automation Copyright © Texas Education Agency, All rights reserved. 1.
Electrical and Computer Engineering Cumulative Design Review Team 22: Driver Assist.
Limited rotation servo basics David Hall output shaft servo horn red wire = 5V + black wire = Gnd - white wire = control signal standard servo.
Get your software working before putting it on the robot!
ROBOTC for VEX Online Professional Development. Homework Questions Thoughts? Questions?
The “Board of Education” 1 Three-position switch 0 = OFF 1 = ON / wheels OFF 2 = ON / wheels ON breadboard (for building circuits) electrical power (V.
Microcontroller basics Embedded systems for mortals.
Programming Applied Sensors in FIRST Robots Chris Elston – Team Download sample code:
DC Motors DC Motors are widely used in robotics because of their small size and high energy output. Key characteristics of DC motors include: 1. High Speed.
Speed, Power, Torque & DC Motors
PID Control Systems (Proportional, Integral, Derivative)
DC Permanent Magnet Motors A tutorial winch design
ROBOTC for VEX Online Professional Development
ROBOTC for VEX Online Professional Development
DC MOTOR SPEED CONTROL 1. Introduction
Electric Motors.
Control Loops Nick Schatz FRC 3184.
Introduction to Team 294 Programming Concepts
Cole Perrault Spring 2015 ET 493 Wesley Deneke
CMPUT 399 Intro Robotics & Mechatronics: Motor Control
Introduction to Motors
Stryke Force Talon SRX Motor Training Course
Presentation transcript:

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #1 David Giandomenico Team mentor for Lynbrook Robotics – Team #846 David Giandomenico Team mentor for Lynbrook Robotics – Team #846 FeedBack Control for your FIRST robot’s drivetrain

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #2 Driving Smart Make your robot easy to drive Using brakes More control when turning Closed Loop (Feedback) control Precision driving

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #3 Turning without Brakes When the joystick is at neutral position, the robot coasts. When turning, the inboard motor coasts, gradually slowing, causing the robot to spiral! If reverse power is applied during a turn, the robot easily spins out.

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #4 Normalized Quantities Speed Torque Voltage Current The reference quantities must be measured on the Robot

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #5 Ideal Torque vs Joystick (PWM)Input Ideal case: Robot not moving no drag Jaguar (not IFI Victor884 )

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #6 Robot is Non Linear when Moving PWM Speed Controller can’t “sink” current. M + − +12V EMF < 12V “ESC” model Robot coasts when input is less than robot speed!

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #7 Use Brakes to Fix the Curves The Fix: 1.Measure the robot speed. 2.Calculate: ( Robot_Speed – Joystick_Input ) 3.Apply brakes proportional to this amount.

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #8 Dynamic Braking + − 1.Rotation generates voltage 2.Short allows current flow 3.Current creates magnetic field that resists rotation

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #9 H H H-Bridge: Inside your Motor Controllers +− 12 V S-1 S-2 S-3 S-4

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #10 H-Bridge: Inside the I FI S PIKE Relay Module M +− 12 V Fwd RelayRev Relay M+M+ M−M− INPUTSOUTPUTSMOTOR FUNCTION FwdRevM +M – 00 GND Off (Braked) 01 GND12V Reverse 10 12VGND Forward 11 12V Off (Braked) Motor is “Braked” Even when unpowered! ½ Tyco 2VR-1001

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #11 Dither Braking … const int brakebit[8][7]= { {0,0,0,0,0,0,0}, {1,0,0,0,0,0,0}, {1,0,0,1,0,0,0},... }; int dither = brakebit[ brake_amt ][ packet % 7]; ApplyBrake( dither ); const int brakebit[8][7]= { {0,0,0,0,0,0,0}, {1,0,0,0,0,0,0}, {1,0,0,1,0,0,0},... }; int dither = brakebit[ brake_amt ][ packet % 7]; ApplyBrake( dither ); Packet or loop_count

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #12 Dynamic Braking Increases with Speed Common “caliper brake” applies constant drag. Dynamic brakes apply drag proportional to speed. Bike brake Car brake

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #13 Dynamic Braking + − M + − 1.Rotation generates voltage proportional to speed 2.Short allows current flow, I = V/R 3.Creates magnetic field that resists rotation, T = K t I

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #14 Faster → Brakes Harder Motor voltage: With no load, and 12V applied, When shorted at full speed, Motor delivers most of I stall, and develops T stall

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #15 Quick Observations At 100% speed, when the motor is shorted, the motor resists with about 100% of its stall torque. At 40% speed, we get ~40% of the stall torque. How can we deliver a known amount of braking?

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #16 When shorted, and the motor is running at speed N, Or, with normalized quantities, when the motor is shorted, To achieve a normalized braking torque, T, Pulse brakes with a duty cycle, DC: Calculate duty cycle, DC, to apply the brakes.

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #17 Adjusting Brakes for Speed The Fix: 1.Measure the robot speed. 2.Calculate: B = ( Robot_Speed – Joystick_Input ) 3.To brake at rate ‘B”, calculate Duty Cycle: if (N>B>0) then DC = B/N; else DC = 100%;

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #18 Effects of Friction Friction adds braking Requires tweaking the Brake algorithm

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #19 Benefits of Dynamic Braking Turn without spinning out Come to a straight dead stop Linearized response for your FeedBack Control Systems

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #20 Closed Loop Control for your FIRST robot’s drivetrain What is Closed Loop Control? Pros & Cons – Open Loop vs Closed Loop Basic Velocity Control – demo & C++ code Tuning the parameters

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #21 Closed Loop System Control Systems Open Loop System System Controller Sensor Input + − n Measured error Output Measured output System Controller OutputInput

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #22 Open Loop Pros + Simple Reliable + Fast to build More time to practice Cons –Harder to drive –Less Capable Pros + Precision maneuvering + Easier to drive + The Future Cons –More parts –Less reliable –More time to build Closed Loop

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #23 Closed-Loop Control System Yet more sensors: Accelerometers & Gyros Optical Distance Meas. Cameras, Ultrasonic : Yet more sensors: Accelerometers & Gyros Optical Distance Meas. Cameras, Ultrasonic : Out G Sensor Potentiometer, Encoder, Gear Tooth Sensor, Hall effect Sensor, … E.S.C. M + − + − Input Speed or Position (joystick, preset button, autonomous, etc.)

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #24 Speed Controller cRio ESC Speed Sensor (Encoder) Speed Sensor (Encoder) n n Input + Measured error Output (speed) Measured output M M + − n n G + + −

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #25 Code Implementation: Forward Motion DriveOutput ClosedLoopDriveTrain::ComputeArcadeDrive(float rawFwd, float rawTurnRateRPS) { : : Code for turning robot was here : float robotSpeed = m_encoders.GetNormalizedForwardSpeed(); float fwdError = rawFwd - robotSpeed; float fwdCorrection = fwdError * m_pGainFwd; float newFwd = rawFwd + fwdCorrection; return m_dbsDrive.ComputeArcadeDrive(newFwd, newTurn); } cRio ESC Speed Sensor (Encoder) Speed Sensor (Encoder) n n Input + Measured error Output (speed) Measured output M M + − n n G G + + −

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #26 Code Implementation: Turn at Rate DriveOutput ClosedLoopDriveTrain::ComputeArcadeDrive(float rawFwd, float rawTurnRateRPS) { float turningRate = m_encoders.GetNormalizedTurningSpeed(); float turningError = rawTurnRateRPS - turningRate; float turningCorrection = turningError * m_pGainTurn; float newTurn = rawTurnRateRPS + turningCorrection; : : Code for driving robot straight was here : return m_dbsDrive.ComputeArcadeDrive( newFwd, newTurn ); } How do we set the gain, m_pGainTurn ?

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #27 Calibration and Tuning 1.Calibrate: Normalize your Robot’s Speed a.Measure no load speed on test stand b.Measure fastest rate robot can turn on floor 2.Tune the Gains a.Increase gain with robot on floor until oscillations start. b.Back-off gain. TIP: Use a fast adjustment method, such as: a potentiometer, FTP to a data file on the cRio, or, a driver-station control.

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #28 Feedback System “Closed Loop” In OutG H + −

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #29 Feedback System “Closed Loop” In(f) Out(f) G H + −

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #30 Moving Forward… Where we started: Basic Functionality Where we are going: Performance!

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #31 David Giandomenico Team mentor for Lynbrook Robotics – Team #846 David Giandomenico Team mentor for Lynbrook Robotics – Team #846 FeedBack Control for your FIRST robot’s drivetrain

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #32 Concept of integrating error: Faster changing errors are not weighted as heavily as slow changing errors. Consider: Robot Shakes: Filter the Error DriveOutput ClosedLoopDriveTrain::ComputeArcadeDrive(float rawFwd, float rawTurnRateRPS) { float turningRate = m_encoders.GetNormalizedTurningSpeed(); // update the running sum with the error float turningError = rawTurnRateRPS - turningRate; turningError = m_turnRunningError.UpdateSum( turningError ); float turningCorrection = turningError * m_pGainTurn; float newTurn = rawTurnRateRPS + turningCorrection; : : Code for driving robot straight was here : return m_dbsDrive.ComputeArcadeDrive( newFwd, newTurn ); }

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #33 Running sum, S n with a decay constant, a S n converges to: So, to prevent modifying our loop gain, return a scaled output, O n One Method: Running Sum Filter Examples: 1a + ½a + ½ 2 a +½ 3 a + … + ½ n a = 2a 1 + ¾ 2 + ¾ 3 + … + ¾ n = 4

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #34 Code Implementation: Integrate Error Example Call: turningError = m_turnRunningError.UpdateSum(turningError); class RunningSum { : : constructor was here : public: float UpdateSum(float x) { m_runningSum *= m_decayConstant; m_runningSum += x; return m_runningSum * (1 - m_decayConstant); } private: float m_decayConstant; float m_runningSum; };

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #35 David Giandomenico Team mentor for Lynbrook Robotics – Team #846 David Giandomenico Team mentor for Lynbrook Robotics – Team #846 FeedBack Control for your FIRST robot’s drivetrain

David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #36 Jaguar CAN; limited by serial port Jaguar CAN bus 1Mbs 125KB/s, or 1.2KB every 1/100 sec Serial Port: 56KBaud = ~ 5.6KB/sec or 56 bytes in 1/100 sec