Top Banner

of 807

Engineering - Mechatronics

Jun 03, 2018

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/12/2019 Engineering - Mechatronics

    1/805

    Copyright 1993-2001, Hugh Jack

    Engineer On a Disk

    Overview: This note set is part of a larger collection of materials available at http://claymore.engi-neer.gvsu.edu. You are welcome to use the material under the license provided at http://clay-

    more.engineer.gvsu.edu/eod/global/copyrght.html. As always any feedback you can providewill be welcomed.

    Copyright 1993-2001, Hugh Jack

    email: [email protected]: (616) 771-6755fax: (616) 336-7215

  • 8/12/2019 Engineering - Mechatronics

    2/805

  • 8/12/2019 Engineering - Mechatronics

    3/805

    page 3

    PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 134EMBEDDED CONTROLLERS........................................................................................... 135

    TYPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 135CONTROLLER DESIGN EXAMPLE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 135PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 135

    DISCRETE SENSORS......................................................................................................... 136INTRODUCTION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 136SENSOR WIRING - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 136CONTACT DETECTION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 143PROXIMITY DETECTION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 143PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 156

    CONTINUOUS SENSORS.................................................................................................. 159INPUT ISSUES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 159SENSOR TYPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 163ANGULAR POSITION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 166LINEAR POSITION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 170

    VELOCITY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 173ACCELERATION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 174FORCE/MOMENT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 176FLOW RATE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 181TEMPERATURE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 182SOUND - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 185LIGHT INTENSITY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 186PRESSURE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 187PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 187REFERENCES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 188

    ACTUATORS ...................................................................................................................... 189

    ACTUATOR TYPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 189DISCRETE ACTUATORS .................................................................................................. 189INTRODUCTION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 189TYPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 190PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 195

    CONTINUOUS ACTUATORS ........................................................................................... 196ACTUATOR CONTROL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 196PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 202

    PROGRAMMABLE LOGIC CONTROLLERS.................................................................. 203BASIC PLCs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 203A SIMPLE EXAMPLE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 212

    PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 212PLC CONNECTION ............................................................................................................ 215

    SWITCHED INPUTS AND OUTPUTS - - - - - - - - - - - - - - - - - - - - - - - - - - - - 215PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 226

    PLC OPERATION ............................................................................................................... 232PLC ORGANIZATION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 232PLC STATUS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 233MEMORY TYPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 234

  • 8/12/2019 Engineering - Mechatronics

    4/805

    page 4

    SOFTWARE BASED PLCS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 234PROGRAMMING STANDARDS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 234PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 236

    SWITCHING LOGIC........................................................................................................... 238BOOLEAN ALGEBRA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 238DISCRETE LOGIC - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 240SIMPLIFYING BOOLEAN EQUATIONS - - - - - - - - - - - - - - - - - - - - - - - - - - 247ADDITIONAL TOPICS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 250DESIGN CASES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 253PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 254

    NUMBERING ...................................................................................................................... 271INTRODUCTION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 271DATA VALUES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 272DATA CHARACTERIZATION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 281PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 283

    EVENT BASED LOGIC...................................................................................................... 286

    INTRODUCTION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 286TIMERS, COUNTERS, FLIP-FLOPS, LATCHES - - - - - - - - - - - - - - - - - - - - - 286PROGRAM DESIGN METHODS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 303DESIGN CASES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 306PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 314

    SEQUENTIAL LOGIC DESIGN......................................................................................... 321SCRIPTS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 321FLOW CHARTS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 325STATE BASED MODELLING - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 335PARALLEL PROCESS FLOWCHARTS - - - - - - - - - - - - - - - - - - - - - - - - - - - 360SEQUENTIAL LOGIC CIRCUITS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 370

    PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 372ADVANCED LADDER LOGIC FUNCTIONS .................................................................. 406ADDRESSING - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 406INSTRUCTION TYPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 412DESIGN TECHNIQUES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 440DESIGN CASES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 442FUNCTION REFERENCE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 445PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 471

    PLC PROGRAMMING........................................................................................................ 478PROGRAMMING STANDARDS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 478PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 480

    STRUCTURED TEXT PROGRAMMING.......................................................................... 481INTRODUCTION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 481THE LANGUAGE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 481PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 494

    INSTRUCTION LIST PROGRAMMING........................................................................... 495INTRODUCTION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 495PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 498

    FUNCTION BLOCK PROGRAMMING ............................................................................ 500

  • 8/12/2019 Engineering - Mechatronics

    5/805

    page 5

    INTRODUCTION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 500PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 501

    ANALOG INPUTS AND OUTPUTS.................................................................................. 503ANALOG INPUTS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 503ANALOG OUTPUTS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 511DESIGN CASES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 514PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 515

    CONTINUOUS CONTROL................................................................................................. 521CONTROLLING CONTINUOUS SYSTEMS - - - - - - - - - - - - - - - - - - - - - - - - 522CONTROLLING DISCRETE SYSTEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - 523CONTROL SYSTEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 523DESIGN CASES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 527PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 527

    PLC DATA COMMUNICATION....................................................................................... 528COMPUTER COMMUNICATIONS CATEGORIES - - - - - - - - - - - - - - - - - - - 528THE HISTORY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 529

    WITH PLCs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 529SERIAL COMMUNICATIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 530PARALLEL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 541NETWORKS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 541BUS TYPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 554DESIGN CASES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 562PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 563

    HUMAN MACHINE INTERFACES (HMI) ....................................................................... 566INTRODUCTION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 566HMI/MMI DESIGN - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 567DESIGN CASES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 567

    PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 568DESIGNING LARGE SYSTEMS ....................................................................................... 569PROGRAMMING - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 569DOCUMENTATION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 570PLC PROGRAM DESIGN FORMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 571PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 578

    IMPLEMENTATION........................................................................................................... 579ELECTRICAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 579SAFETY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 591

    PROCESS MODELLING .................................................................................................... 594REFERENCES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 597

    PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 597SELECTING A PLC ............................................................................................................ 599

    SPECIAL I/O MODULES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 603PLC PROGRAMMING LANGUAGES - - - - - - - - - - - - - - - - - - - - - - - - - - - - 607ISSUES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 607PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 607

    PLC REFERENCES ............................................................................................................. 609SUPPLIERS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 609

  • 8/12/2019 Engineering - Mechatronics

    6/805

    page 6

    PROFESSIONAL INTEREST GROUPS - - - - - - - - - - - - - - - - - - - - - - - - - - - 610PLC/DISCRETE CONTROL REFERENCES - - - - - - - - - - - - - - - - - - - - - - - - 610

    USING THE OMRON DEMO PACKAGE......................................................................... 614OVERVIEW - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 614REFERENCE GUIDE FOR OMRON PLC DEMO SOFTWARE - - - - - - - - - - - 618

    INDUSTRIAL ROBOTICS.................................................................................................. 619INTRODUCTION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619ROBOT TYPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 632ROBOT APPLICATIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 663END OF ARM TOOLING (EOAT) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 666ADVANCED TOPICS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 676

    ROBOTIC PATH PLANNING METHODS........................................................................ 690INTRODUCTION: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 690GENERAL REQUIREMENTS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 696SETUP EVALUATION CRITERIA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704

    METHOD EVALUATION CRITERIA - - - - - - - - - - - - - - - - - - - - - - - - - - - - 709IMPLEMENTATION EVALUATION CRITERIA - - - - - - - - - - - - - - - - - - - - 716OTHER AREAS OF INTEREST - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 719COMPARISONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 720CONCLUSIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 722APPENDIX A - OPTIMIZATION TECHNIQUES - - - - - - - - - - - - - - - - - - - - 722APPENDIX B - SPATIAL PLANNING - - - - - - - - - - - - - - - - - - - - - - - - - - - 725APPENDIX C - TRANSFORMED SPACE - - - - - - - - - - - - - - - - - - - - - - - - - 731APPENDIX D - FIELD METHODS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 738APPENDIX E - NEW AND ADVANCED TOPICS - - - - - - - - - - - - - - - - - - - 740REFERENCES: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 741

    ROBOTIC MECHANISMS ................................................................................................. 746KINEMATICS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 746MECHANISMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 749ACTUATORS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 750PATH PLANNING - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 752PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 758

    MOTION PLANNING AND TRAJECTORY CONTROL................................................. 763TRAJECTORY CONTROL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 763PATH PLANNING - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 767MOTION CONTROLLERS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 771SPECIAL ISSUES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 774

    PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 776MICROBOT OVERVIEW - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 778CRS PLUS ROBOT OVERVIEW - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 778BASIC DEMONSTRATION STEPS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 779

    CNC MACHINES ................................................................................................................ 781MACHINE AXES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 781NUMERICAL CONTROL (NC) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 781EXAMPLES OF EQUIPMENT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 785

  • 8/12/2019 Engineering - Mechatronics

    7/805

    page 7

    PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 788CNC PROGRAMMING....................................................................................................... 789

    G-CODES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 790APT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 798PROPRIETARY NC CODES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 801GRAPHICAL PART PROGRAMMING - - - - - - - - - - - - - - - - - - - - - - - - - - - - 802NC CUTTER PATHS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 803NC CONTROLLERS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805PRACTICE PROBLEMS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805

  • 8/12/2019 Engineering - Mechatronics

    8/805

    page 8

    2. OVERVIEW

    Mechatronics deals with the long ignored union of machanical and electrical systems.

  • 8/12/2019 Engineering - Mechatronics

    9/805

    page 9

    3. PROCESS CONTROL

    To put it simply - we figure out how the process behaves naturally, we determine how we want itto behave, and we insert a controller to make it do what we want.

    3.1 INTRODUCTION

    CONTROL - Using artificial means to manipulate the world - with a particular goal.

    Continuous - the values to be controlled change smoothly. e.g. the speed of a car

    Discrete - The value to be controlled are easily described as on-off. e.g. the car motor is on-off(like basic pneumatics). NOTE: all systems are continuous (Except for Heisenbergs electrons)but they can be treated as discrete for simplicity.

    Linear - Can be described with a simple differential equation (not a very accurate explanation).e.g. a car can be driving around a track and can pass same the same spot at a constant

    velocity. But, the longer the car runs, the mass decreases, and it travels faster, but

    requires less gas, .......... etc. Basically, the math gets tougher, and the problembecomes non-linear.

    - This is the preferred starting point for simplicity, and a common approximation for realworld problems.

    Non-Linear - Not Linear. This is how the world works, but is very complicated. Especially whentrying to do mathematical approximations. (Note: if the coefficients in a differential equationchange it is non-linear)

    CONTROL

    CONTINUOUS DISCRETE

    LINEAR NON_LINEAR CONDITIONAL SEQUENTIAL

    e.g. PIDe.g. MRAC

    e.g. FUZZY LOGIC

    BOOLEANTEMPORAL

    e.g. TIMERS

    e.g. COUNTERS

    EVENT BASED

    EXPERT SYSTEMS

  • 8/12/2019 Engineering - Mechatronics

    10/805

    page 10

    Temporal/sequential - the controller must not just keep track of things that changes, but it mustknow the time, or how long since something happened.

    e.g.non-linear - as rocket approaches sun, gravity increases, so control must change.linear - We are driving the perfect car with no friction, with no drag, and can predict how it

    will work perfectly.discrete - When I do this, that always happens! For example, when the power is turned

    on, the press closes!

    How to tell the difference? An elevator is the perfect example.

    Discrete1. The elevator must move towards a floor when a button is pushed.

    2. The elevator must open a door when it is at a floor.3. It must have the door closed before it moves.etc.

    Linear (our approximation commonly used in industry) NOTE: each floor will have a cer-tain motor position, and we know what that position is.

    1. If the desired position changes to a new value, accelerate quicklytowards the new position.

    2. As the elevator approaches the correct position, slow down.Non-linear (not yet common in industry) e.g. Fuzzy logic, Neural Networks, Adaptive

    Control1 Accelerate slowly to start.

    2. Decelerate as you approach the final position.3. Allow faster motion while moving.4. Compensate for cable stretch, and changing spring constant, etc.

    3.2 CONTROL SYSTEM CHARACTERISTICS

    Control systems are present in most systems we see. Example - elevator height.

    Some systems are naturally unstable and tend to self destruct. Example - balanced broom.

    Other systems are self regulating, and tend to some stable state - these are good candidates foropen loop control. Example - city water tank

    Other systems need some sort of regulation mechanisms added, these are called closed loop sys-tems. Example - car cruise control

  • 8/12/2019 Engineering - Mechatronics

    11/805

    page 11

    If a system is simple we will say that it is linear. Example - perfect elevator

    A system can be subject to complicating factors that make it difficult/impossible to model math-ematically. Example - elevator in tall building with stretchy cable

    If a system has switched states it can be described as discrete. Example - buttons to call elevator,open/close doors

    Temporal/sequential systems can change over time, this requires sequential control. Example -washing machine

    3.3 CONTROLLER TYPES

    - PLCs

    - embedded controls- PCs- hardwired

    3.4 PROCESS DIAGRAMS AND SYMBOLS

    3.5 PRACTICE QUESTIONS

    1. Consider a heater in your house, how can different forms of control be applied to this problem?

    2. Why is discrete control so popular when continuous control allows more precision?

  • 8/12/2019 Engineering - Mechatronics

    12/805

    page 12

    4. DISCRETE CONTROLLER DESIGN

    In controller design we try to meet some objective. Typical objectives include,- positioning - for moving from position to position, where the setpoint is changed sud-

    denlydeadbeat controlfirst order

    - tracking - for following paths where setpoints are constantly changingfirst order

    - disturbance resistant - unexpected variations can be compensated forstep response

    - multi-stage - for complex systems that need small errorsfeed forward disturbance - can reduce effects of disturbancesfeed forward command - to follow complex motionscascade - a controller that examines intermediate steps of a process

    typical constraints to be developed are,- stability - does not diverge over time- stability - sampling period is short enough (no-aliasing)- realizable - does not refer to future values

    4.1 POSITIONING CONTROLLERS

    In these systems we will focus on how the output relates to the input.

    These techniques work best with simple systems that require a jump from one setpoint toanother.

    The general procedure to design a controller is,1. Model the process (i.e., find Gp)2. Determine the control objective (i.e. select the desired system response Gdr)3. Substitute these into the equation below and solve for the controller transfer function,

    4. Check the equation for practicality and stability5. Develop the control equation for the computer

    GdrB( )

    cn

    rn-----

    Gc B( )Gp B( )1 Gc B( )Gp B( )+----------------------------------------= =

    Gc B( ) cn

    rn-----

    1

    Gp B( )---------------

    GdrB( )1 GdrB( )--------------------------

    = =

  • 8/12/2019 Engineering - Mechatronics

    13/805

    page 13

    6. Write the computer program

    Try to derive the expression given above,

    4.1.1 Dead Beat Control

    It is possible (for a first order process) to match the output function to the input function in onestep.

    The desired function is,

    Given the process model below, design a deadbeat controller,

    GdrB( )

    cn

    rn-----

    Gc B( )Gp B( )1 Gc B( )Gp B( )+----------------------------------------= =

    cn rn 1=

    GdrB( ) cn

    rn----- B= = T

    desired posn

    actual posn

  • 8/12/2019 Engineering - Mechatronics

    14/805

    page 14

    Trying to eliminate the error in one step can require an extremely high (power) gain. When thisgain is excessive we may use a less powerful controller.

    4.1.2 Programming Examples

    The following programs are examples of methods for programming using a few common lan-guages.

    These examples are for the Computer Boards DAS08-AOM board (The boards we used in thelab with Labview).

    Please note that these programs have not been debugged.

    Gp B( ) B

    1 0.5B--------------------=

  • 8/12/2019 Engineering - Mechatronics

    15/805

    page 15

    4.1.2.1 - BASIC

    A simple example of the deadbeat controller is given below. This can be converted to many ofthe modern version of basic that have appeared. Comments have been added to help clarifythe operation

    4.1.2.2 - C

    The example program below should implement the deadbeat controller example given in thissection,

    10 REM a control loop for the deadbeat controller example for 12 bit input and output15 REM Written by H.Jack, July 17, 1997 - Not debugged20 BASE = 330H; REM the base address for the card20 T = 0.1; REM control system time step40 M_LAST = 0; REM the current output is zero50 E_LAST = 0; REM the current error60 INPUT ENTER SETPOINT [0 - 4095] , R; REM get a setpoint70 DO ; REM start the control loop80 OUT BASE+2, 0; REM start the a to d conversion

    90 WAIT T; REM an operating system specific timing function100 C_HIGH = INP BASE+0; REM read current position most significant 8 bits110 C_LOW = INP BASE+1; REM read current position least significant 4 bits120 C_NOW = C_LOW/16 + C_HIGH*16130 E_NOW = R - C_NOW; REM calculate the error140 M_NOW = M_LAST + E_NOW - 0.5*E_LAST; REM the controller equation150 IF (M_NOW < 0) THEN M_NOW = 0; REM prevent out of range case160 IF (M_NOW > 4095) THEN M_NOW = 4095; REM prevent out of range case170 M_HIGH = INT(M_NOW/256) ; REM find the 4 high bits of the 12 bit word180 M_LOW = M_NOW - 256*M_HIGH; REM isolate the low 8 bits190 OUT BASE+4, (M_LOW); REM set 8 low bits

    200 OUT BASE+5, (M_HIGH); REM set 4 high bits210 M_LAST = M_NOW; E_LAST = E_NOW; REM current values become last values220 LOOP WHILE(ABS(E) < 0.001); REM continue looping until the error is small

  • 8/12/2019 Engineering - Mechatronics

    16/805

  • 8/12/2019 Engineering - Mechatronics

    17/805

    page 17

    4.1.2.4 - 6811 Assembler

    { A deadbeat controller for a Computer Boards DAS08-AOM card using 16 bit IO }{ Written by H.Jack, July 17, 1997 - Not debugged }

    program deadbeat(input, output);

    varbase = 0x330, { Base address for card }r, c_now, { Set up variables for equations }e_now, e_last=0, { error values }m_now, m_last=0: integer; { control values }

    T = 0.1: float; { set the system time step }begin

    writeln(Enter the Setpoint [0 - 4095]);readln(r); { Input a setpoint }

    while (abs(e_last) < 1) do{ loop until the error is small }begin

    outp(base+2, 0); { start the a to d conversion process }---------sleep(T); { an operating system specific timing function }---------c_now := inp(base+0)/16 + inp(base+1)*16; {calculate the current value }-

    ---e_now := r - c_now; { calculate current error }m_now := m_last + e_now - 0.5 * e_last; { the control equation }if (m_now < 0) then

    m_now := 0; { keep the output in 0-4095 range }

    if (m_now > 4095) thenm_now := 4095;

    outp(base+4, m_now & 255); { output 8 LSB } -------outp(base+5, m_now>>8); { output 4 MSB }---------m_last := m_now; e_last := e_now; { make current values last }

    end;end.

  • 8/12/2019 Engineering - Mechatronics

    18/805

    page 18

    The example program below should implement the deadbeat controller example given in thissection for a 6811 single chip microcontroller.

    As an exercise, implement the controller on a Basic Stamp chip.

  • 8/12/2019 Engineering - Mechatronics

    19/805

    page 19

    4.1.3 First Order Response

    The deadbeat controller can call for extremely high gains, but this requires a high level of powernot commonly found in engineered systems.

    When we want to slow down the system response so that it occurs over a number of controllersteps, we can replace the deadbeat (one time step) function with a gradual first order reduction(exponential decay) over a number of time steps.

    This gradual response will use a time constant to produce the rate of response (recall that the dif-ference between input and output is reduced 63% for each duration of the time constant).

    (note: this program will be similar to all others)

  • 8/12/2019 Engineering - Mechatronics

    20/805

    page 20

    The general form of this relationship is seen below,

    Consider the example for the deadbeat controller,

    Gdr

    cn

    rn-----

    B 1 e

    T

    ---

    1 Be

    T

    ---

    --------------------------= =

    d

    dt-----

    c c+ r=

    First we relate the output c to the input r (Note the first order differential equation).

    Next, we convert this to a discrete equation using the methods (source - table) seen before,

    (from transform table)

    desired

    actual

    T

  • 8/12/2019 Engineering - Mechatronics

    21/805

    page 21

    First we write the process model,

    Gc B( ) cn

    rn-----

    1

    Gp B( )---------------

    GdrB( )1 GdrB( )--------------------------

    1 0.5BB

    --------------------

    B 1 e

    T

    ---

    1 Be

    T

    ---

    --------------------------

    1

    B 1 e

    T

    ---

    1 Be

    T

    ---

    --------------------------

    -----------------------------------------

    = = =

    Assuming the process model given below, find the general form for the control equation,

    Gp B( ) B

    1 0.5B--------------------=

    Next, we use this and the desired response to find the controller equation,

    Gc B( )

    1 e

    T

    ---

    1 0.5B( )

    1 Be

    T

    ---

    B 1 e

    T

    ---

    ----------------------------------------------------------------

    1 e

    T

    ---

    0.5 1 e

    T

    ---

    B

    1[ ] e

    T

    ---

    1 e

    T

    ---

    + B+

    -------------------------------------------------------------------------= =

    After some work.....this should lead the control difference equation,

    mn mn 1 +=

  • 8/12/2019 Engineering - Mechatronics

    22/805

    page 22

    Assume the response time constant should be 1.0 seconds, and the sampling time is 0.2 seconds,develop the final form of the controller.

    4.2 TRACKING

    In tracking controllers we assume that the setpoint will be moving. As a result we will focus ona desired error function, instead of an overall transfer function.

    To do this we must first develop a function that relates the elements of the control loop, to thedesired error response,

    1.0=

    T 0.2=

  • 8/12/2019 Engineering - Mechatronics

    23/805

    page 23

    Specific controllers can be developed using the relationships used for the positioning controllers.

    As an example tracking control would be needed in your hand for curved letters, positioningwould result in block letters.

    4.2.1 Minimum Error

    The method behind this controller is very similar to the deadbeat controller, we try to eliminatethe error in a single step,

    Gde

    en

    rn-----

    1

    1 GcGp+-----------------------= =

    en rn cn= cn GcGpen=

    First we look at the basic relationships for a feedback control system,

    Next we relate in the desired error response, and rearrange to separate the controller,

    e n rn GcGpen=

    e n 1 GcGp+( ) rn=

    1 GcGp+( )1

    Gde---------=

    GcGp 1Gde--------- 1=

    Gc1

    Gp------

    1 Gde

    Gde------------------

    =

    Note: The error is now treated as a position,and we want to control the error instead.A small error will correspond to a small

    difference between the changing inputand the resulting output.

  • 8/12/2019 Engineering - Mechatronics

    24/805

    page 24

    Find a controller for the transfer function given below, assuming a ramped input with a samplingtime of 0.2 seconds. Use a maximum error of 0.02.

    The desired error function should have a finite value at only one point in time,

    en Sn 0B0

    ATB 0B2

    0B3

    0B4 + + + + + +( )=

    en SnATB=

    Gc1

    Gp------

    1 Gde

    Gde------------------

    1Gp------

    rn ATBSn

    ATBSn----------------------------

    = =

    This has to be manipulated into the desired transfer function,

    Gde

    en

    rn-----

    SnATB

    rn-----------------= =

    At this point we would be given or assume an input forcing function, and use it also.

    (A is the largest error value)

    Gp B( ) B

    1 0.5B--------------------= r t( ) 0.2t=

  • 8/12/2019 Engineering - Mechatronics

    25/805

    page 25

    4.3 DISTURBANCE RESISTANT

    In real systems we expect that certain events will occur that are not part of our system model.

    In this case we assume that the system control is happening as expected, and we add in a new

    disturbance input.

    The block diagram below shows one of these systems, with a disturbance injected between thecontroller and the process.

    Notice that in the above form we are reducing the problem by finding differences (basically apartial differential solution) which will be a good approximation when the disturbance is nottoo fast or large.

    We can develop an equation for the controller, based on the desired system response to the dis-

    turbance,

    enrn

    cn

    mn

    dn

    +

    +

    +

    -

    Gp

    Gc

    If we neglect the effects of the setpoint, we can rearrange the loop as shown below,

    Gc

    Gpcn+

    -

    dnmn

    mn

    Note: we can do thisbecause the sys-

    tem is linear.

  • 8/12/2019 Engineering - Mechatronics

    26/805

    page 26

    The closed form expression can be calculated by replacing the desired transfer function,

    These systems are often called regulators, and can be used when a system is subject to unex-pected noise. Examples of possible applications would include plumbing systems, electricalpower supplies, etc.

    4.3.1 Disturbance Minimization

    We can use an approach similar to the deadbeat controller, but we still need to know the type ofdisturbance expected to develop a controller.

    Consider a case where the disturbance is a step function

    Gddcndn

    ---------Gp

    1 GcGp+-----------------------= =

    Gc G

    p

    Gdd

    GpGdd----------------------=

    Gddcndn

    ---------=

    Gc

    Gp Gdd

    GpGdd

    ----------------------

    Gpcndn

    ---------

    Gpcn

    dn---------

    ----------------------dnGp cn

    Gpcn---------------------------= = =

    cn Sn 0B0

    AB1

    0B2

    0B3

    0B4 + + + + +( ) ABSn= =

  • 8/12/2019 Engineering - Mechatronics

    27/805

    page 27

    We can examine the previous controller for stability as well,

    Gp B( ) B

    1 0.5B--------------------=

    Given the example transfer function and input disturbance,

    dn DB0

    DB1

    DB2

    DB3 + + + +( )Sn

    1

    1 B------------

    Sn= =

    Next we assume

    Gc

    dnGp cn

    Gpcn---------------------------

    1

    1 B------------

    SnB

    1 0.5B--------------------

    5BSn

    B

    1 0.5B

    -------------------- 5BSn

    ---------------------------------------------------------------------1 5 1 0.5B( ) 1 B( )

    5B 1 B( )-------------------------------------------------------= = =

    cn Sn 0B0

    5B1

    0B2

    0B3

    0B4 + + + + +( ) 5BSn= =

    Gc

    dnGp cn

    Gpcn---------------------------

    1

    1 B------------

    SnB

    1 0.5B--------------------

    5BSn

    B

    1 0.5B

    -------------------- 5BSn

    ---------------------------------------------------------------------1 5 1 0.5B( ) 1 B( )

    5B 1 B( )-------------------------------------------------------= = =

    Gc1 5 1 0.5B( ) 1 B( )

    5B 1 B( )-------------------------------------------------------

    1 5 7.5B 2.5B2

    +

    5B 5B2

    -------------------------------------------------= =

    mn

    en------

    1 5 7.5B 2.5B2

    +

    5B 5B2

    -------------------------------------------------=

    Now we put this in discrete equation form,

    5mn 1 5mn 2 4en 7.5en 1 2.5en 2+=

    5mn 1 5mn 2 4en 7.5en 1 2.5en 2+=

    mn mn 1 0.8en 1+ 1.5en 0.5en 1+=

    Note: this controller has a reference to an n+1 error term. This term refers to anerror value that is in the future. So.... unless you have a time machine, this con-troller is not REALIZABLE.

    And these are used to calculate the controller equation

  • 8/12/2019 Engineering - Mechatronics

    28/805

    page 28

    If we have a first order system we only need to have a sample time that is shorter than the systemtime constant.

    4.4 MULTI-CONTROLLER SYSTEMS

    It can sometimes be helpful to have more than one controller in a system.

    In feedforward controllers we have one controller to deal with an input value, and a second tocontrol error.

    In cascade control we break the control into segments, that take advantage of readings within the

    process.

    4.4.1 Disturbance Feedforward

    When a system has a disturbance that can be measured we can add a controller that specificallycompensates.

    The figure below shows a feedforward disturbance controller,

    First we get the characteristic equation from the denominator of the controller transfer function,

    5B 5B2

    0=

    Next we find the roots of this equation,

    B 1=

    B 0=

    In this case one root is less than 1, guaranteeing that the system will be unstable. The otherroot with a value of one would lead to a system that is critically stable.

  • 8/12/2019 Engineering - Mechatronics

    29/805

    page 29

    In this case F(B) is a function of how the disturbance actually effects the system. But Gf isthe controller to compensate. First, we need a model of F(B). Next the controller Gf is,

    The error controller is designed as if the disturbance is not present.

    This system is well suited to systems with large measurable disturbances. For example we couldmeasure cutting force, and adapt an axis controller on a CNC machine.

    4.4.2 Command Feedforward

    By separating out error control, and process modeling functions we can make a system that ismore accurate, with reduced steady state error.

    This technique may be used when we have a process model, and the input will not be changing

    suddenly (The feedback error controller will tend to overcompensate).

    We do this using a system of the form below,

    rn

    en mn

    dn

    fn

    m'n cnGp

    Gf

    F B( )

    Gc+

    -

    +

    + +

    +

    In Computer

    Gf F B( )=

  • 8/12/2019 Engineering - Mechatronics

    30/805

    page 30

    The relevant transfer functions are,

    The feedback error controller can be selected to reduce the errors. The typical design techniqueis, to design for minimal error or disturbance.

    Develop the system transfer function (given before) for a command feed forward controller

    rn

    en

    fn

    mn mn cn

    Gf

    Gc Gp+

    +

    +-

    G B( ) cn

    rn----- 1

    Gf

    Gc------+

    GcGp1 GcGp+-----------------------

    = =

    The system transfer function is,

    The feedforward controller is best defined as, a perfect match when there is no error,

    Gf Gp( )1

    =

    en mn 0= =

    cn rnGfGp=

    and the input and output are identical,

    cn rn=

  • 8/12/2019 Engineering - Mechatronics

    31/805

    page 31

    4.4.3 Cascade

    By adding extra feedback loops we can add levels of robustness to a control system.

    In this case the control loops appear to be nested.

    Consider a cascade control system for disturbances,

    cn

    rn----- =

    +

    -

    +

    -

    +

    +

    dn

    rnGp

    rnGc2Gc1

  • 8/12/2019 Engineering - Mechatronics

    32/805

    page 32

    Now consider a cascade controller for a multistage process, such as a sewage treatment plantwith sequential tanks with varying flow rates. Here the disturbance would be the sewage flow-ing into the first tank. the two process blocks are the treatment tanks. The output is waterreturned to rivers The controllers vary the flow rates by looking at parameters for both tanks.

    To do design/analysis for these controllers we do an analysis of the innermost feedback loop.This then becomes a process, and we do design/analysis at the next higher loop.

    Select controllers for the system pictured below,

    +

    -

    +

    -

    ++

    rn

    dn

    Gc1Gc2

    Gp1Gp2

    rn

    Hf

  • 8/12/2019 Engineering - Mechatronics

    33/805

    page 33

    +

    -

    +

    -

    ++

    dn

    rn

    5B

    1 B------------

    rnGc2Gc1

    1. Design for Gc1 as if the disturbance and Gc2 are not present2. Design for disturbance minimization with Gc2

  • 8/12/2019 Engineering - Mechatronics

    34/805

    page 34

    4.5 SAMPLE TIME

    In deadbeat type controllers we do not typically see mentions of the sample period, but in mostpractical systems we see a mention of the sample time T.

    We can use the system transfer function to calculate the acceptable range of controller time. Inall cases the lower sample period is 0, but for practical reasons we may want to make thislarger.

    A shorter sample time requires a faster computer, and steals cycle time from other processes.

    The general procedure is,1. Find the characteristic equation of the overall system transfer function.2. Determine the roots (symbolically) of the equation.3. Select values of T that ensure that all of the roots have a value of 1 or more.4. Select a sample time that is less than the longest time.

    Consider the example below,

    G B( ) 4TB 2

    B2

    TB 2T2

    +-----------------------------------=

    Find the sample time T required for stability,

    B2

    TB 2T2

    + 0=

    First, we find the characteristic equation, and solve for the roots, when the roots are

    B T( ) T( )2 4 1( ) 2T2( )

    2 1( )--------------------------------------------------------------------

    T

    2--- 1 1 8+( ) T

    2--- 1 3( ) 1= = = =

    T 1 0.5,=

    Based on these results we can now determine the stable region.

  • 8/12/2019 Engineering - Mechatronics

    35/805

    page 35

    4.6 SUMMARY

    The following is a map of techniques that show typical uses of the mathematical technique cov-ered so far.

    realsystem

    differentialequations

    differenceequations

    estimatedvalues

    realizability

    transferfunction

    controllerequation

    blockdiagram

    desiredbehavior

    designtechniques

    system transferfunction

    pick sampletime

    stabilityanalysis

    inputfunction

    outputfunction

    input functionsfrom data

    input functionequation output

    value table

    error functions

    steady state

    b-shifttable

    b-shift

    algebra

    differenceequation

    B-shift

    table

    partial fractionsor long division

    transferfunction

    feedbackequation

    transferfunction

    finalvaluetheory

    characteristicequation

    transferfunction

    tablecalculations

  • 8/12/2019 Engineering - Mechatronics

    36/805

    page 36

    4.7 PRACTICE PROBLEMS

    1. a) We are developing a freight elevator control system. The first major task is developing aheight positioning controller. The elevator is moved to a new floor by issuing a step functionfor the new floor height. The transfer function below relates the voltage supplied to the eleva-

    tor motor to the height of the elevator. Develop a controller transfer function that has a firstorder response, and draw a complete block diagram.

    b) Develop the discrete equation for the controller if the time constant for the first order responseis 5 seconds and the sampling time is 1 second.

    2. c) Write a computer program (in the computer language of your choice) that implements thecontroller in question 1. Assume the input and output values are set using the two functionsbelow.

    3. Redraw the following system and add a feedforward controller. Develop the function used forthe feed forward controller.

    4. The control system below will be used for positioning the height of an elevator.

    GpB 1+

    1 0.5B--------------------=

    INPUT() - This function will return the elevator height in feet (floating point)OUTPUT(value) - This function will set the output voltage at value

    +

    _

    10 B( )

    B 1 B( )2------------------------B 5+

    B 1-------------

    B 2+

  • 8/12/2019 Engineering - Mechatronics

    37/805

    page 37

    a) Find a controller transfer function that gives a first order response for a time step of T=1 and atime constant of 3.

    b) Develop the discrete equation and determine if the controller is realizable.

    c) Develop a transfer function for the final system and determine if the system is stable.

    4. We want to design a control system to minimize the effects of disturbance. Given a step input of

    magnitude 1, we are willing to accept a maximum error of 0.5 for one time step.

    a) Find a controller transfer function.

    b) Develop the discrete equation for the system and determine if the controller is realizable?

    1 B

    B------------Gc

    rn cn+

    -

    ANS.

    a) Gc0.283B

    2

    1 2B B2

    +----------------------------=

    b) realizable

    c) G0.283B

    2

    1 0.717B--------------------------= stable

    Gp10B

    1 B------------=

    ANS.

    a) Gc10 0.5 1 B( )2

    5B 1 B( )---------------------------------------=

    b) not realizable mn mn 19.5

    5-------en 1+

    1

    5---en

    0.5

    5-------en 1+ +=

  • 8/12/2019 Engineering - Mechatronics

    38/805

    page 38

    5. DISCRETE SYSTEMS

    When dealing with computers we will sample data values from the real world. These sampledvalues can then be used to estimate how a system will behave.

    The term discrete refers to the use of single sampled values, instead of a continuous functions.You will see that the difference is between weighted sums and integrals.

    5.1 DISCRETE SYSTEM MODELLING WITH EQUATIONS

    We can write a differential equation, and then manipulate it to put in terms of time steps oflength T

    In review consider how we can approximate derivatives using two/three points on a line.

    T - Sample Period

    sampledvalues

  • 8/12/2019 Engineering - Mechatronics

    39/805

    page 39

    Consider the example,

    T T

    yi 1

    yi 1+

    ti

    yi

    ti 1 ti 1+

    y t( )

    y ti( )ti 1

    ti

    yi yi 1+2--------------------- ti ti 1( )

    T

    2--- yi yi 1+( )=

    d

    dt-----y ti( )

    yi yi 1

    ti ti 1---------------------

    yi 1+ yi

    ti 1+ ti---------------------

    1T--- yi yi 1( )

    1

    T--- yi 1+ yi( )= = =

    d

    dt-----

    2y ti( )

    1

    T--- yi 1+ yi( )

    1

    T--- yi yi 1( )

    T-----------------------------------------------------------------

    yi 1+ yi 1 2yi+

    T2

    -----------------------------------------=

    If we read the flow rate of oil in a pipeline once every hour for three hours. The read-ings in order are 1003, 1007, 1010. What is the integral and first and second deriva-tives for the values?

  • 8/12/2019 Engineering - Mechatronics

    40/805

    page 40

    5.1.1 Getting a Discrete Equation

    First, consider the example of a simple differential equation,

    We can continue the example and use this equation to simulate the system. Here the x valuesare given, and the first y value is assumed to be 0. Assume T=0.5 and K=0.2.

    d

    dt-----

    y t( ) Kx t( )=

    y T( ) Kx t( ) td

    T

    Kx t( ) td

    0

    Kx t( ) td0

    T

    + y0 Kx t( ) td0

    T

    += = =

    We can solve the differential equation at time T, assuming that the slope is constant and known,

    The equation above is developed for a time T after zero. We can manipulate it so that itwill be valid for any point in time,

    y T( ) y0 K x0( )T+=

    yn yn 1 K xn 1( )T+=

    yn yn 1 K xn 1( )T=

    y T( ) y0 K x0( )T+=

    Now we can assume that the velocity x(t) is constant,

    ASIDE: The approximations above canbe shown using a slope approxi-mated with two points on a curve.

    for this particular differentialy x0t=equation we can assume

    say d

    dt-----A V=

  • 8/12/2019 Engineering - Mechatronics

    41/805

    page 41

    Find the discrete equation for the differential equation below. Then find values over time.

    We can expand this model by also including a disturbance. This can be used to model random

    i

    01

    23456789101112

    13.....

    xi

    00

    11111100000

    0.....

    yi

    00

    0.10.20.30.40.50.60.70.70.70.70.7

    0.7.....

    0.2(xi)0.5

    00

    0.10.10.10.10.10.100000

    0.....

    d

    dt-----v

    1

    M-----F=

  • 8/12/2019 Engineering - Mechatronics

    42/805

    page 42

    noise, or changes in system loading, found in all systems.

    5.1.2 First Order System Example

    The water tank below has a small outlet, and left alone the fluid level in the tank will drop untilempty. There is a valve controlled flow of fluids into the tank to raise the height of the fluid.

    d

    dt-----

    y t( ) Kx t( ) d t( )+=

    Go back to the original differential equation, and add a disturbance term d that

    y T( ) Kx t( ) td

    T

    d t( ) td

    T

    + Kx t( ) td

    0

    Kx t( ) td0

    T

    d t( ) td0

    T

    + += =

    yn yn 1 K xn 1( )T dn 1 T+ +=

    yn yn 1 K xn 1( )T dn 1 T+=

    y T( ) y0 K x0( )T d0T+ +=

    appears for a single sample,

    d t( ) td

    0

    0=

    assume

    h

    water flow out

    water flow in

    water tank

    valve

    qi

    qoA = Area of tank (i.e., fluid surface)

  • 8/12/2019 Engineering - Mechatronics

    43/805

    page 43

    As long as the fluid levels in the tank are normal, the inlet and outlet flow rates are independent,We can model them both with simple differential equations,

    The water flow rate out of the tank is approximately a function of the hydrostaticpressure caused by the water level in the tank,

    qo Koh=

    The inlet valve can be (very roughly) approximated with a simple equation,

    qi Ki=

    We can now relate these components to find the fluid height in the tank,

    V qi qo Ad

    dt-----h Ki Koh= = =

    Ad

    dt-----h Ki Koh=

    h Ce

    t

    A

    Ko------

    -----------

    Ki

    Ko------

    + Ce

    tKo

    A-------- Ki

    Ko------

    0+= =

    The general form of solution for this differential equation for h is, (we will review later)

    h0 Ce0 Ki

    Ko------

    0+=

    We can find the value of coefficient C by setting time to zero,

    C h0Ki

    Ko------

    0=

    h h0

    Ki

    Ko------

    0 e

    tKo

    A------

    KiKo------

    0+ h0 et

    Ko

    A------

    0Ki

    Ko------

    et

    Ko

    A------

    KiKo------

    +

    += =

    The final form of this equation can be constructed, by separating out height and valve angle,

    hT h0 eT

    Ko

    A------

    0

    Ki

    Ko------

    eT

    Ko

    A------ KiKo------

    + +=

    Put in terms of a time step, to prepare to make discrete,

    hn hn 1 eT

    Ko

    A------

    n 1Ki

    Ko------

    eT

    Ko

    A------

    Ki

    Ko------

    +

    +=

    Then to a discrete form, as a difference equation,

    transient + steady state

    A

    d

    dt-----h Ki Koh=

  • 8/12/2019 Engineering - Mechatronics

    44/805

    page 44

    This difference equation can then be used to predict fluid height. If we change the valve posi-tion, this will also be reflected in the calculated values.

    egr450.0.mcd

    Now try varying the input valve angle,

    Use the parameters given to calculate the height of the water in the tank over time.

    initial height =1 m

    surface area = 2 m2

    Ki = 1 liter/min/degreeKo = 2 liter/min/mvalve angle = 20 degreesT = 30 sec.

  • 8/12/2019 Engineering - Mechatronics

    45/805

    page 45

    5.1.3 Second Order System Example

    Consider the second order example below,

    Using all of the conditions outlined before, find out what happens when the valveangle is changed to 10 degrees after 10 seconds.

  • 8/12/2019 Engineering - Mechatronics

    46/805

    page 46

    try the following problem.

    d

    dt-----

    2y Ax=

    First, the basic equation,

    Second we begin to integrate, starting at time zero, to time T to get difference equations

    d

    dt-----

    yT Ax0T d

    dt-----

    y0+=

    d

    dt-----

    2yT Ax0=

    yT Ax0T

    2

    2-----

    d

    dt-----

    y0T y0+ +=

    d

    dt-----

    ynd

    dt-----

    yn 1 Axn 1 T=

    yn yn 1 Axn 1T

    2

    2-----

    d

    dt-----

    yn 1 T+=

    These equations can be solved in two steps, or we can recombine them to get a singledifferential equation. We do this by rearranging the last difference equation, andthen we substitute this into the previous difference equation.

    T d

    dt-----

    yn 1 yn yn 1 Axn 1T

    2

    2-----=

    d

    dt-----

    yn1

    T---y

    n 1+

    1

    T---y

    n Axn

    T

    2---=

    d

    dt-----

    yn

    d

    dt-----

    yn 1 Axn 1 T

    1

    T---yn 1+

    1

    T---yn A xnT

    2---

    1

    T---yn

    1

    T---yn 1 Axn 1

    T

    2---+ += =

    2yn yn 1 yn 1++ + AxnT

    2

    2----- Axn 1 T

    2 Axn 1

    T2

    2-----+=

    This can then be shifted back in time one step to make it more useful.

    2yn 1 yn 2 yn+ + Axn 1T

    2

    2----- Axn 2

    T2

    2-----=

    yn 2yn 1 yn 2 Axn 1T

    2

    2----- Axn 2

    T2

    2-----+=

    (1)

    (2)

    (2)

    (1)

  • 8/12/2019 Engineering - Mechatronics

    47/805

    page 47

    5.1.4 Example of Dead (Delay) Time

    In a real system there is a distance between an actuator, and a sensor. This physical distanceresults to a lag between when we actuate something, and when the sensor sees a result.

    Assume we have a simple process where after a change in x there is a delay of m time stepsbefore the proportional change occurs in y. We can write the equation as,

    Consider the example,

    Calculate the position of a 5 Kg mass if a force of 2N is applied for 5 seconds and thenremoved. Try the calculations using a 1 second and a 2 second period.

    yn Axn m=

  • 8/12/2019 Engineering - Mechatronics

    48/805

  • 8/12/2019 Engineering - Mechatronics

    49/805

    page 49

    We have already dealt with deriving an equation for the process. In this case it was the valvetank combination discussed before. By itself the tank is an open loop system, we set the valveangle and hope for a liquid level.

    Next, we need to find an equation for the controller. This equation can be highly dependent uponthe control method to be used. If we are to use a computer it is best to have a simple equation,

    as shown below, (NOTE: the form of the equation, and the values of the coefficients changethe nature of the control problem).

    The controllers (equations) that follow will be put in the above form. These controllers can alsobe used individually, or combined to get more complex properties.

    Keep in mind that the typical objective of a control system is to minimize the error between theinput and output. Another common goal is to do this as quickly, or efficiently as possible. Oneconstraint we must observe is that the system should not become unstable.

    Controller

    Feedback

    Process hactualhdesired e

    To make notations more generic we will associate stock variables for desired and actualpositions, as well as error, and controller output. We will also add the discretetimestep subscripts used before,

    rn hdesired=

    cn hactual=

    +

    -

    en rn cn=

    mn =

    (valve/tank)

    mn mn 1 K0en K1en 1 K2en 2 K3en 3 K4en 4 + + + + + +=

    mn mn 1 K0en K1en 1 K2en 2 K3en 3 K4en 4 + + + + +=The basic difference equation is,

    The output oriented form is shown below,

  • 8/12/2019 Engineering - Mechatronics

    50/805

    page 50

    5.2.1 A Proportional Controller

    One of the simplest controllers is the proportional control,

    The magnitude of K will determine how fast the system responds. If the value is too large thesystem will oscillate and/or become unstable (i.e. flood or go empty). If too small the systemerror will be very large. (ie, the tank will never reach the right height.)

    This type of controller will always have a small error between the actual and desired values.

    For the water tank (from before) add a controller, and try varying K values.

    m Ke=

    mn Ken=

    This can be put in discrete form easily,

    The basic proportional equation is,

    mn mn 1 Ken Ken 1=

    Finally this can be put into the general form seen before,

    m n mn 1 Ken Ken 1+=

    Note: This form will bemore useful whendealing with morecomplex controllers.

    hn hn 1 e

    TKo

    A

    ------

    n 1

    Ki

    Ko------ e

    TKo

    A

    ------ K

    iKo------ +

    +=

  • 8/12/2019 Engineering - Mechatronics

    51/805

    page 51

    We could implement this controller using the Basic stamp chip. (Note: not a full implementa-tion)

    -

    +

    GND +5V

    23

    21

    20

    19

    10K

    1uF10K

    +5V

    220

    10K

    10K

    10Kmotor

    potentiometer

    +5V

    e_last=0 set previous error to zerok=2 set multiplierr=100 desired water heightm_last=0 last control output valueloop:high 15 discharge the capacitorpause 1 wait for 1msrctime 15,1,c measure charge timee_now=r-c calculate the errorm_now=m_last+k*e_now-k*e_last the controller equation

    e_last=e_nowm_last=m_nowpwm 14,m,100 set the output voltagegoto loop

  • 8/12/2019 Engineering - Mechatronics

    52/805

    page 52

    5.2.2 Integral Control

    Integral controllers tend to respond slowly at first, but over a long period of time they tend to

    eliminate errors.

    The integral controller is based on a simple integration.

    If the constant K is small, the longer term error will slowly drop off. If K is large the long termerror will be reduced quickly. Too large a K value will result in a signal that grows out of con-trol.

    Try controlling the water tank with the I controller,

    First we write the general equation for the integrator,

    m K e t d0

    t

    =In discrete form this becomes,

    mn K Tej

    j 1=

    n

    =

    Putting this into the difference equation yields,

    mn mn 1 K Tej

    j 1=

    n

    K Tejj 1=

    n 1

    KTen= =

    finally,

    m n mn 1 KTen+=

    ASIDE

    integral

    sum

    Note: now the value of the equa-tion form become obvious.

  • 8/12/2019 Engineering - Mechatronics

    53/805

    page 53

    5.2.3 Differential Control

    When there is a sudden change in the system the differential controller will be able to compen-

    sate. But in terms of long term effects the controller will allow huge steady state errors.

    The control equation can be derived as,

    hn hn 1 eT

    Ko

    A------

    n 1Ki

    Ko------

    eT

    Ko

    A------

    KiKo------

    +

    +=

    First, the basic equation,

    m K d

    dt-----

    e=

    Next, this can be written with the backwards difference equation,

    mn K

    en en 1

    T----------------------- =We then apply the difference equation, and put in final form,

    mn mn 1 Ken en 1

    T-----------------------

    Ken 1 en 2

    T-----------------------------

    KT----en 2

    K

    T----en 1

    K

    T----en 2+= =

    m n mn 1Kd

    T------en 2

    Kd

    T------en 1

    Kd

    T------en 2+ +=

  • 8/12/2019 Engineering - Mechatronics

    54/805

    page 54

    This larger the value of K the faster this controller will compensate for a change in the system.

    Try controlling the water tank level with the D controller,

    5.2.4 Proportional, Integral, Derivative (PID) Control

    The functions of the individual proportional, integral and derivative controllers are complemen-tary. When combined we get a system that responds quickly to change (derivative), generallytrack required positions (proportional), and will eventually reduce errors (integral).

    To get this we combine the expressions from the three individual controllers. Subscripts will beadded to distinguish the K gain values for each controller.

    hn hn 1 eT

    Ko

    A------

    n 1Ki

    Ko------

    eT

    Ko

    A------

    KiKo------

    +

    +=

  • 8/12/2019 Engineering - Mechatronics

    55/805

    page 55

    Quite often the three constants are made the same, giving us the simpler equation below.

    This controller now allows us to vary the three different gains, and as a result we will change theperformance of the system.

    Consider the examples below,

    Recall the equations for the three controllers

    proportional

    integral

    derivative

    mn mn 1 Kpen Kpen 1+=

    mn mn 1 KiTe n+=

    mn mn 1

    Kd

    T------en 2

    Kd

    T------en 1

    Kd

    T------en 2+ +=

    The three differences are added for a new difference equation,

    mn mn 1 Kpen Kpen 1( ) KiTen( ) Kd

    T------en 2

    Kd

    T------en 1

    Kd

    T------en 2+

    + +=

    Rearranging results in,

    mn mn 1 en Kp KiT Kd

    T------+ + en 1 Kp 2

    KdT

    ------ en 2KdT

    ------ + + +=

    mn mn 1 en K KT K

    T----+ +

    en 1 K 2K

    T----

    en 2K

    T----

    + + +=

    mn mn 1 K en 1 T1

    T---+ +

    en 1 12

    T---

    en 21

    T---

    + + +=

  • 8/12/2019 Engineering - Mechatronics

    56/805

    page 56

    egr450.1.mcd

    5.3 BLOCK DIAGRAMS AND TRANSFER FUNCTIONS

    Block diagrams are the primary tool for showing process and control system models.

    In a block diagram each block has one input and one output.

    A transfer function provides functions that are a ratio of block output to block input.

    Consider the block diagram seen before, but with transfer functions (ratio of output to input)shown for the controller and process.

    Given the water tank from before (with the given variables), try a variety of differentvalues for the PID gains to see how the system responds.

  • 8/12/2019 Engineering - Mechatronics

    57/805

    page 57

    Both of the transfer functions are ratios of inputs to outputs,

    These transfer functions (ratios) are rarely a simple multiplication, and so we need to use analternate representation called a transform.

    In this case we will use a backshift transform, hence the B in the representation.

    equations for the block diagram below,

    Controller Process

    rn cn+

    -

    en mn Gp B( )Gc B( )

    Gc B( ) mn

    en------= Gp B( )

    cn

    mn------=

    Controller Process

    rn cn+

    -

    en mnGp B( )Gc B( )

  • 8/12/2019 Engineering - Mechatronics

    58/805

    page 58

    Recall the techniques for block diagram manipulation.

    5.3.1 The Backward-Shift B Operator

    An operator is a special part of an equation - one example is the (d/dt) of calculus.

    The basic definition of the backshift operator B is,

    If we apply this operator to an equation seen before,

    This form then allow some very useful techniques that we will see later.

    Apply the B transform to the PID expression found before,

    yn yn=

    yn 1 Byn=

    yn 2 B2yn=

    yn m

    Bmy

    n

    =

    mn mn 1 K0en K1en 1 K2en 2 K3en 3 K4en 4 + + + + +=

    mn Bmn K0en K1Ben K2B2en K3B

    3en K4B

    4en + + + + +=

    mn

    en------

    K0 K1B K2B2

    K3B3

    K4B4 + + + + +

    1 B--------------------------------------------------------------------------------------------- Gc B( )= =

  • 8/12/2019 Engineering - Mechatronics

    59/805

    page 59

    Apply the B transform to the valve and water tank found before,

    mn mn 1 en Kp KiTKd

    T------+ +

    en 1 Kp 2Kd

    T------

    en 2Kd

    T------

    + + +=

    hn hn 1 eT

    Ko

    A------

    n 1Ki

    Ko------

    eT

    Ko

    A------

    KiKo------

    +

    +=

  • 8/12/2019 Engineering - Mechatronics

    60/805

    page 60

    5.3.2 Reducing Block Diagrams

    A useful method for this form is the ratio of the actual output to the desired output, (c/r)

    If we are planning on applying the PID controller to the water tank example from before we getthe following block diagram, (Note: the block diagram is overkill in this application)

    Controller Process

    rn cn+

    -

    en mn Gp B( )Gc B( )

    Gc B( ) mn

    en------= Gp B( )

    cn

    mn------=

    cn Gp B( )mn Gp B( )Gc B( )en Gp B( )Gc B( ) rn cn( )= = =

    en rn cn=

    cn rnGp B( )Gc B( ) cnGp B( )Gc B( )=

    cn cnGp B( )Gc B( )+ rnGp B( )Gc B( )=

    cn

    rn----- Gp B( )Gc B( )

    1 Gp B( )Gc B( )+---------------------------------------- G B( )= = Closed Loop Transfer Function

    hactual

    hdesired

    Kp KiTKd

    T------+ +

    B Kp 2Kd

    T------

    B2 Kd

    T------

    + +

    1 B------------------------------------------------------------------------------------------------------------

    BKi

    Ko------

    eT

    Ko

    A------

    KiKo------

    +

    1 B eT Ko

    A------

    ---------------------------------------------------------e

    +-

  • 8/12/2019 Engineering - Mechatronics

    61/805

    page 61

    We can find the closed loop transfer function for this process and controller,

    For the problem below, use the PID values, with the valve/tank parameters used previously tofind the system response to a step input to 20 at time zero, and 10 at time 10. (hint: convert theclosed loop equation back to a difference equation)

    G B( ) =

  • 8/12/2019 Engineering - Mechatronics

    62/805

    page 62

    5.3.3 Back-Shift Transform Table

    The general application of the table is,1. Develop the differential equation.2. Look for the equation in the table. Sometimes the equation will have to be rearranged to

    match the form in the table. If it is not in the table, derive the transfer function thelong way.

    3. Select the appropriate transfer from the right column, and substitute in values and vari-ables.

    Kp 0.1=

    Kd 0.02=

    Kp 0.2=

  • 8/12/2019 Engineering - Mechatronics

    63/805

    page 63

    A few of the transforms are given below,

    Time Domain Back-Shift Domain

    y Kx t D( )= y B( )x B( )----------- KB

    INT DT----

    =

    d

    dt-----

    y Kx= y B( )x B( )-----------

    KBT

    1 B------------=

    ddt-----

    y y+ Kx=y B( )x B( )-----------

    KB 1 e

    T

    ---

    1 Be

    T

    ---

    ------------------------------=

    ddt-----

    2y Kx= y B( )x B( )----------- KT

    2B 1 B+( )2 1 B( )2

    --------------------------------=

    ddt-----

    2y ddt-----

    y+ Kx=y B( )x B( )-----------

    K b1B b2B2

    +( )

    1 a1B a2B2

    -------------------------------------=

    a1 1 e

    T

    ---

    += a2 e

    T

    ---

    =

    b1 T 1 eT

    ---

    =

    b2 Te

    T

    ---

    1 eT

    ---

    +=

  • 8/12/2019 Engineering - Mechatronics

    64/805

    page 64

    Try finding the transfer function for the system below,

    Time Domain Back-Shift Domain

    1

    n2

    ------

    d

    dt-----

    2y 2

    n------

    ddt-----

    y y+ + Kx= y B( )x B( )-----------

    K b1B b2B2

    +( )

    1 a1B a2B2

    -------------------------------------=

    1>a1 e

    T

    1----

    e

    T

    2----

    += a2 e

    T

    1----

    T

    2----

    =

    b1 1

    e

    T

    1----

    2--------- e

    T

    2----

    1---------1

    1-----

    1

    2-----

    ------------------------+= b2 e

    T

    1---- T

    2----

    e

    T

    2----

    2--------- e

    T

    1----

    1---------1

    1-----

    1

    2-----

    ------------------------+=

    AND/OR

    12( ) d

    dt-----

    2y 1 2+( ) d

    dt-----

    y y+ + Kx=

    Case 1:

    1=a1 2e

    Tn= a2 e

    2Tn=

    b1 1 e Tn

    Tne Tn

    = b2 e Tn

    e Tn

    Tn 1+( )=

    Case 2:

    1= 0 sec

    vdesired(t) = 100 for t >= 0 sec

    t(sec)

    0

    Input type Time function Laplace function

    STEP f t( ) Au t( )= f s( ) As---=

    RAMP f t( ) Atu t( )= f s( ) A

    s2

    ----=

    SINUSOID f t( ) A t( )u t( )sin= f s( ) A2

    s2 2+-----------------=

    etc......

    PULSE f t( ) A u t( ) u t t1( )( )= f s( ) =

  • 8/12/2019 Engineering - Mechatronics

    102/805

    page 102

    Therefore to continue the car example, lets assume the input below,

    vdesired t( ) 100= t 0sec

    vdesired s( ) L vdesired t( )[ ] 100s---------= =

    Next, lets use the input, and transfer function to find the output of the system.

    vactual

    vactual

    vdesired-----------------

    vdesired=

    vactual

    s2

    Kd( ) s Kc( ) Ki+ +

    s2 M10------ K+

    d s Kc( ) Ki+ +

    -------------------------------------------------------------

    100

    s

    ---------

    =

    To go further, some numbers will be selected for the values.

    Kd= 10000

    Kc= 10000Ki= 1000

    M = 1000

    vactuals

    210000( ) s 10000( ) 1000+ +

    s2

    10100( ) s 10000( ) 1000+ +------------------------------------------------------------------------

    100

    s---------

    =

  • 8/12/2019 Engineering - Mechatronics

    103/805

  • 8/12/2019 Engineering - Mechatronics

    104/805

    page 104

    A s10

    2

    1.01----------

    s2

    s 0.1+ +

    s s 0.113+( ) s 0.877+( )---------------------------------------------------------

    s 0lim

    102

    1.01----------

    0.1

    0.113( ) 0.877( )-------------------------------------

    = =

    A 99.9=

    B10

    2

    1.01----------

    s2

    s 0.1+ +

    s s 0.113+( ) s 0.877+( )---------------------------------------------------------

    s 0.113+( )

    s 0.113lim=

    B 102

    1.01----------

    0.113( )2 0.113( ) 0.1+ +0.113( ) 0.113 0.877+( )

    -----------------------------------------------------------------

    0.264= =

    C 10

    2

    1.01---------- s

    2

    s 0.1+ +s s 0.113+( ) s 0.877+( )--------------------------------------------------------- s 0.877+( )s 0.877

    lim=

    C 102

    1.01----------

    0.877( )2 0.877( ) 0.1+ +0.877( ) 0.877 0.113+( )

    -----------------------------------------------------------------

    1.16= =

    vactual99.9

    s----------

    0.264

    s 0.113+----------------------

    1.16

    s 0.877+----------------------+=

  • 8/12/2019 Engineering - Mechatronics

    105/805

    page 105

    7.1.5 System Response

    Next we use a list of forward/inverse transforms to replace the terms in thepartial fraction expansion.

    f t( ) f s( )

    A A

    s---

    At A

    s2

    ----

    Ae t A

    s +------------

    A t( )sin A

    s2 2+

    -----------------

    e nt nt 1

    2( )sin

    n 1 2

    s2

    2ns n2

    + +---------------------------------------- fo r 1

  • 8/12/2019 Engineering - Mechatronics

    106/805

    page 106

    There are two very common systems assumed - first and second order.

    First order systems are very simple, as is shown below.

    7.1.6 A Motor Control System Example

    Condsider the example of a DC servo motor controlled by a computer. The purpose of the con-

    G s( ) As B+------------= A first order system, and a typical response toa stepped input.

    G s( ) A

    s2

    2ns n2

    + +----------------------------------------=

    A second order system, and a typical response toa stepped input.

    n

    Natural frequency of system, approximate frequency ofcontrol system oscillations.

    Damping factor of system. If < 1 underdamped, and system willoscillate. If =1 critically damped. If < 1 overdamped, and neverany oscillation (more like a first order system). As damping factorapproaches 0, the first peak becomes infinite in height.

  • 8/12/2019 Engineering - Mechatronics

    107/805

    page 107

    troller is to position the motor. The system below shows a reasonable control system arrange-ment. Some elements such as power supplies and commons for voltages are omitted for clarity.

    This system can then be redrawn with a block diagram.

    The block diagram can now be filled out with actual values for the components. Do this below.

    +5V -5V

    5K potentiometer

    12Vdc motor

    shafts are coupled

    -+

    LM675op-amp

    2.2K

    1K

    PCI-1200dataaquisitioncard

    from

    NationalInstruments

    Computer Running Labview

    -+

    desired positionvoltage Vd

    gain K

    X

    desiredpositionvoltage +

    -

    potentiometer

    gain K op-amp motor shaftVd

  • 8/12/2019 Engineering - Mechatronics

    108/805

    page 108

    Given values:- desired potentiometer voltage- gain

    For the op-amp:

    For the potentiometer:

    For the motor:

    For the shaft:

    - assume that the potentiometer has a range of 10 turns

    - use the differential equation below

    - it turns angular velocity into position

    - use the speed curve below from rest when 10V is applied

    d

    dt-----

    K2

    JR------

    + KJR------

    Vs=

    1s 2s 3s

    1400 RPM

  • 8/12/2019 Engineering - Mechatronics

    109/805

    page 109

    Convert the block diagram into a transfer function for the entire system.

  • 8/12/2019 Engineering - Mechatronics

    110/805

    page 110

    Pick a value of the gain K to give a system performance with the damping factor = 1.0.

    7.1.7 System Error

    We typically will be interested in system error and feedback error.

  • 8/12/2019 Engineering - Mechatronics

    111/805

    page 111

    Consider a simple negative feedback system with various inputs,

    re c

    b

    G

    H

    +-

    System error,

    Feedback error,

    D r c=

    D r b=

    G s( ) Kp

    s------= H s( ) 1=

    c

    r-- G

    1 GH+------------------

    Kp

    s Kp+---------------= =

    r A=

    First, a step input,

    Given,

    c AKp

    s Kp+---------------

    =

    D r c A AKp

    s Kp+---------------

    AKp AKp( ) s A( )+

    s Kp+-------------------------------------------------

    As

    s Kp+---------------= = = =

    ess s As

    s Kp+---------------

    s 0lim 0= =

    Next, try a ramp input,

  • 8/12/2019 Engineering - Mechatronics

    112/805

  • 8/12/2019 Engineering - Mechatronics

    113/805

  • 8/12/2019 Engineering - Mechatronics

    114/805

    page 114

    Consider the previous example, the transfer function for the whole system was found, but thenonly the denominator was used to determine stability. So in general we do not need to find thetransfer function for the whole system.

    1

    K1

    s---

    +

    -

    G s( ) K

    s

    ----= H s( ) 1=

    Note: This controller has adjustable gain. After this designis built we must anticipate that all values of K will beused. It is our responsibility to make sure that none of

    the possible K values will lead to instability.

    First, we must develop a transfer function for the entire control system.

    GS s( ) G s( )1 G s( )H s( )+---------------------------------

    K

    s----

    1 K

    s----

    1( )+---------------------------

    K

    s K+------------= = =

    s K+ 0= K

    0123etc..

    root

    Next, we use the characteristic equation of the denominator to find the roots asthe value of K varies. These can then be plotted on a complex plane. Note:the value of gain K is normally found from 0 to +infinity.

    j

    K K 0=

    Note: because all of the roots for all values of K are real negative this system will

    always be stable, and it will always tend to have a damped response. The large thevalue of K, the more stable the system becomes.

  • 8/12/2019 Engineering - Mechatronics

    115/805

    page 115

    Consider the example,

    GS s( ) G s( )1 G s( )H s( )+---------------------------------=

    Consider the general form for a negative feedback system.

    Note: two assumptions that are not often clearlystated are that we are assuming that the control

    system is a negative feedback controller, andthat when not given the feedback gain is 1.

    1 G s( )H s( )+ 0=

    The system response is a function of the denominator, and its roots.

    It is typical, (especially in textbook problems) to be given only G(s) or G(s)H(s).

    G s

    ( )H s

    ( )

    K s z0+( ) s z1+( ) s zm+( )

    s p0+( ) s p1+( ) s pn+( )-------------------------------------------------------------------=

    The transfer function values will often be supplied in a pole zero form.

  • 8/12/2019 Engineering - Mechatronics

    116/805

    page 116

    7.2.1 Approximate Plotting Techniques

    The basic procedure for creating root locus plots is,1. write the characteristic equation. This includes writing the poles and zeros of the equa-

    tion.

    G s( ) K

    s2

    3s 2+ +--------------------------= H s( ) 1=

    First, find the characteristic equation,. and an equation for the roots,

    Given the system elements (you should assume negative feedback),

    1 K

    s2

    3s 2+ +--------------------------

    1( )+ 0=

    s2

    3s 2 K+ + + 0=

    roots3 9 4 2 K+( )

    2------------------------------------------------ 1.5

    1 4K

    2--------------------= =

    Next, find values for the roots and plot the values,

    K

    0123

    root

    0-1-2-3

    j

    ******CALCULATE AND PUT IN NUMBERS

  • 8/12/2019 Engineering - Mechatronics

    117/805

    page 117

    2. count the number of poles and zeros. The difference (n-m) will indicate how many root

    loci lines end at infinity (used later).3. plot the root loci that lie on the real axis. Points will be on a root locus line if they have

    an odd number of poles and zeros to the right. Draw these lines in.4. determine the asymptotes for the loci that go to infinity using the formula below. Next,

    determine where the asymptotes intersect the real axis using the second formula.Finally, draw the asymptotes on the graph.

    5. the breakaway and breakin points are found next. Breakaway points exist between twopoles on the real axis. Breakin points exist between zeros. to calculate these thefollowing polynomial must be solved. The resulting roots are the breakin/breakoutpoints.

    6. Find the points where the loci lines intersect the imaginary axis. To do this substitutethe fourier frequency for the laplace variable, and solve for the frequencies. Plotthe asymptotic curves to pass through the imaginary axis at this point.

    Consider the example in the previous section,

    1 G s( )H s( )+ 1 Ks z1+( ) s z2+( ) s zm+( )s p1+( ) s p2+( ) s pn+( )

    ----------------------------------------------------------------+ 0= =

    k( ) 180 2k 1+( )n m

    -----------------------------------= k 0 n m 1,[ ]

    p

    1

    p2

    pn

    + + +( ) z1

    z2

    zm

    + + +( )n m--------------------------------------------------------------------------------------------=

    d

    ds-----A

    B A

    d

    ds-----B

    0=

    B s z1+( ) s z2+( ) s zm+( )=A s p1+( ) s p2+( ) s pn+( )=

    1 Kj z1+( ) j z2+( ) j zm+( )j p1+( ) j p2+( ) j pn+( )---------------------------------------------------------------------------+ 0=

  • 8/12/2019 Engineering - Mechatronics

    118/805

  • 8/12/2019 Engineering - Mechatronics

    119/805

    page 119

    Plot the root locus diagram for the function below,

    Step 5: (find the breakout points for the roots)

    B s2

    3s 2+ +=

    d

    ds-----B 2s 3+=

    A 1=

    d

    ds-----A 0=

    A d

    ds-----B

    B dds-----A

    0=

    1 2s 3+( ) s2 3s 2+ +( ) 0( ) 0=

    2s 3+ 0=

    s 1.5=

    j

    -1-2

    -1.5

    Note: because the loci do not intersect the imaginary axis, we know the system will bestable, so step 6 is not necessary, but we it will be done for illustrative purposes.

    Step 6: (find the imaginary intercepts)

    1 G s( )H s( )+ 0=

    1 K1

    s2

    3s 2+ +--------------------------+ 0=

    s2 3s 2 K+ + + 0=

    j( )2 3 j( ) 2 K+ + + 0=

    2 3j 2 K+ + + 0=

    3j 3j( )2

    4 2 K( )2

    --------------------------------------------------------------3j 9 8 4K+ +

    2----------------------------------------------

    3j 4K 12

    -------------------------------= = =

    2 3j( ) 2 K( )+ + 0=

    In this case the frequency has an imaginary value. This means that there will be nofrequency that will intercept the imaginary axis.

  • 8/12/2019 Engineering - Mechatronics

    120/805

    page 120

    7.2.2 State Variable Control Systems

    State variable matrices were introduced before. These can now be used to form a control system.

    G s( )H s( ) K s 5+( )

    s s2

    4s 8+ +( )---------------------------------=

  • 8/12/2019 Engineering - Mechatronics

    121/805

  • 8/12/2019 Engineering - Mechatronics

    122/805

  • 8/12/2019 Engineering - Mechatronics

    123/805

    page 123

    8. Draw a detailed root locus diagram for the transfer function below. Be careful to specify anglesof departure, ranges for breakout/breakin points, and gains and frequency at stability limits.

    9. Draw the root locus diagram for the system below. specify all points and values.

    10. Draw the root locus diagram for the transfer function below,

    11. Draw the root locus diagram for the transfer function below,

    12. The block diagram below is for a motor position control system. The system has a propor-tional controller with a variable gain K.

    G s

    ( )

    2K s 0.5+( ) s2 2s 2+ +( )

    s3 s 1+( ) s 2+( )-----------------------------------