INTRODUCTION TO MECHATRONIC DESIGN J. EDWARD CARRYER R. MATTHEW OHLINE THOMAS W. KENNY Mechanical Engineering Stanford University Boston Columbus Indianapolis New York San Francisco Upper Saddle River Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto Delhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo
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
INTRODUCTION TO MECHATRONIC DESIGN
J. EDWARD CARRYER R. MATTHEW OHLINE THOMAS W. KENNY
Mechanical Engineering Stanford University
Boston Columbus Indianapolis New York San Francisco Upper Saddle River
Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto
Delhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo
Contents
Preface Trademark Acknowledgments About the Authors
19 23 25
PART 1 INTRODUCTION 27
CHAPTER 1 Introduction
1.1 Philosophy 1.2 The Organization of This Book 1.3 Who Should Study Mechatronics? 1.4 How to Use This Book 1.5 Summary
27
29 29 30 30 31
PART 2 SOFTWARE 33
CHAPTER 2 What's a Micro?
CHAPTER 3
2.1 2.2 2.3 2.4 2.5
2.6 2.7 2.8 2.9 2.10 2.11
2.12 2.13
Introduction What's a Micro? Microprocessors, Microcontrollers, Digital Signal Processors, and More Microcontroller Architecture The Central Processing Unit
2.5.1 Representing Numbers in the Digital Domain 2.5.2 The Arithmetic Logic Unit
The Data Bus and the Address Bus Memory Subsystems and Peripherals Von Neumann Architecture The Harvard Architecture Real World Examples
2.11.1 The Freescale MC9S12C32 Microcontroller 2.11.2 The Microchip PIC12F609 Microcontroller
Where to Find More Information Homework Problems
Microcontroller Math and Number Manipulation
3.1 Introduction 3.2 Number Bases and Counting 3.3 Representing Negative Numbers 3.4 Data Types 3.5 Sizes of Common Data Types 3.6 Arithmetic on Fixed Size Variables 3.7 Modulo Arithmetic 3.8 Math Shortcuts 3.9 Boolean Algebra 3.10 Manipulating Individual Bits 3.11 Testing Individual Bits 3.12 Homework Problems
Introduction Machine Language Assembly Language High-Level Languages Interpreters Compilers Hybrid Compiler/Interpreters Integrated Development Environments (IDEs) Choosing a Programming Language Homework Problems
Structures for Embedded Systems
Background Event Driven Programming Event Checkers Services Building an Event Driven Program An Example Summary of Event Driven Programming State Machines A State Machine in Software The Cockroach Example as a State Machine Homework Problems
Design
Introduction Building as a Metaphor for Creating Software Introducing Some Software Design Techniques
6.4
6.5
6.6
6.3.1 Decomposition 6.3.2 Abstraction and Information Hiding 6.3.3 Pseudo-Code
Software Design Process 6.4.1 Generating Requirements
Defining the Program Architecture The Performance Specification The Interface Specification Detail Design Implementation Unit Testing Integration
The Sample Problem
6.5.1 Requirements for the Morse Code Receiver The Morse Code Receiver System Architecture The Morse Code Receiver Software Architecture The Morse Code Receiver Performance Specifications The Morse Code Receiver Interface Specification The Morse Code Receiver Detail Design The Morse Code Receiver Implementation The Morse Code Receiver Unit Testing The Morse Code Receiver Integration
to Control an Engine 163 8.4 Pulse Width Modulation 164 8.5 PWM Using the Output Compare System 166 8.6 The Analog-to-Digital Converter Subsystem 167
8.6.1 The Process for Converting an Analog Input to a Digital Value 168
8.6.2 The A/D Converter Clock 168 8.6.3 Automating the A/D Conversion Process 169
8.7 Interrupts 169 8.8 Homework Problems 170
PART3 ELECTRONICS 171
CHAPTER 9 Basic Circuit Analysis and Passive Components 171
9.1 Voltage, Current, and Power 171 9.2 Circuits and Ground 173 9.3 Laying Down the Laws 175 9.4 Resistance 176
9.4.1 Resistors in Series and Parallel 177 9.4.2 The Voltage Divider 179
8 Contents
9.5 Thevenin Equivalents 180 9.6 Capacitors 181
9.6.1 Capacitors in Series and Parallel 183 9.6.2 Capacitors and Time-Varying Signals 184
9.7 Inductors 185 9.7.1 Inductors and Time-Varying Signals 186
9.8 The Time and Frequency Domains 187 9.9 Circuit Analysis with Multiple Component Types 188
9.9.1 Basic RC Circuit Configurations 188 9.9.2 Low-Pass RC Filter Behavior in the Time Domain 189 9.9.3 High-Pass RC Filter Behavior in the Time Domain 192 9.9.4 RL Circuit Behavior in the Time Domain 193 9.9.5 Low-Pass RC Filter Behavior in the Frequency Domain 195 9.9.6 High-Pass RC Filter Behavior in the Frequency Domain 198 9.9.7 High-Pass RC Filter with a DC Bias 199
9.10 Simulation Tools 200 9.10.1 Limitations of Simulation Tools 200
9.11 Real Voltage Sources 201 9.12 Real Measurements 202
9.12.1 Measuring Voltage 202 9.12.2 Measuring Current 203
9.13 Real Resistors 204 9.13.1 A Model for a Real Resistor 204 9.13.2 Resistor Construction Basics 204 9.13.3 Carbon Film Resistors 205 9.13.4 Metal Film Resistors 206 9.13.5 Power Dissipation in Resistors 207 9.13.6 Potentiometers 209 9.13.7 Choosing Resistors 210
9.14 Real Capacitors 210 9.14.1 A Model for a Real Capacitor 211 9.14.2 Capacitor Construction Basics 211 9.14.3 Polar vs. Nonpolar Capacitors 212 9.14.4 Ceramic Disk Capacitors 213 9.14.5 Monolithic Ceramic Capacitors 214 9.14.6 Aluminum Electrolytic Capacitors 214 9.14.7 Tantalum Capacitors 215 9.14.8 Film Capacitors 216 9.14.9 Electric Double Layer Capacitors/Super Capacitors 216 9.14.10 Capacitor Labeling 217 9.14.11 Choosing a Capacitor 220
9.15 Homework Problems 221
CHAPTER 10 Semiconductors 224
10.1 Doping, Holes, and Electrons 225 10.2 Diodes 225
10.2.1 The V-I Characteristic for Diodes 226 10.2.2 The Magnitude of Vt 227 10.2.3 Reverse Recovery 227 10.2.4 Schottky Diodes 227 10.2.5 Zener Diodes 228 10.2.6 Light Emitting Diodes 230 10.2.7 Photo-Diodes 231
Contents 9
10.3
10.4 10.5
10.6 10.7
10.8
Bipolar Junction Transistors 231 10.3.1 The Darlington Pair 236 10.3.2 The Photo-Transistor 237
MOSFETs 238 Choosing between BJTs and MOSFETs 242
10.5.1 When Will a BJT Be the Best (or Only) Choice? 242 10.5.2 When Will a MOSFET Be the Best (or Only) Choice? 243 10.5.3 How Do You Choose When Either a MOSFET
or a BJT Could Work? 243 Multitransistor Circuits 243 Reading Transistor Data Sheets 245
10.7.1 Reading a BJT Data Sheet 245 10.7.2 Reading a MOSFET Data Sheet 247 10.7.3 A Sample Application 249 10.7.4 A Potpourri of Transistor Circuits 250
Homework Problems 251
CHAPTER 11 Operational Amplifiers
11.1 11.2 11.3 11.4
11.5
11.6
Op-Amp Behavior Negative Feedback The Idea Op-Amp Analyzing Op-Amp Circuits
The Golden Rules The Noninverting Op-Amp Configuration The Inverting Op-Amp Configuration The Unity Gain Buffer The Difference Amplifier Configuration The Summer Configuration The Trans-Resistive Configuration Computation with Op-Amps
CHAPTER 12 Real Operational Amplifiers and Comparators 277
12.1 Real Op-Amp Characteristics—How the Ideal Assumptions Fail 277 12.1.1 Noninfinite Gain 277 12.1.2 Variation in Open-Loop Gain with Frequency 278 12.1.3 Input Current Is Not Zero 279 12.1.4 The Output Voltage Source Is Not Ideal 281 12.1.5 Other Nonidealities 282
12.2 Reading an Op-Amp Data Sheet 284 12.2.1 Maxima, Minima, and Typical Values 285 12.2.2 The Front Page 285 12.2.3 The Absolute Maximum Ratings Section 285 12.2.4 The Electrical Characteristics Section 285 12.2.5 The Packaging Section 289 12.2.6 The Typical Applications Section 290
12.3 Reading a Comparator Data Sheet 290 12.3.1 Comparator Packaging 291
Switches as Sensors Interfacing to Switches Resistive Sensors Interfacing to Resistive Sensors Capacitive Sensors Interfacing to Capacitive Sensors
of Sensors Light Sensors Strain Sensors Temperature Sensors Magnetic Field Sensors Proximity Sensors Position Sensors Acceleration Sensors Force Sensors Pressure Sensors
15.1 Active Filters 15.1.1 Phase Delay 15.1.2 Filter Response Characteristics 15.1.3 Active Filter Topologies
378
378 378 379 381
Contents 11
15.2 Digital Techniques 15.2.1 Digital Filtering 15.2.2 Digital Signal Processing 15.2.3 Synchronous Sampling
15.3 Homework Problems
386 387 389 390 391
CHAPTER 16 Digital Inputs and Outputs
16.1 16.2 16.3 16.4 16.5 16.6
16.7
16.8
16.9
Introduction Representing Logical States Ideal Behavior for Digital Devices Real Behavior of Digital Devices Reading Device Data Sheets Digital Inputs
16.6.1 Digital Input Voltage Requirements 16.6.2 Digital Input Current Requirements 16.6.3 Pull-Ups and Pull-Downs 16.6.4 Digital Input Timing Requirements
Digital Outputs 16.7.1 Digital Output Voltage and Current Specifications 16.7.2 Digital Output Timing Specifications
Output Meets Input 16.8.1 Evaluating Compatibility 16.8.2 Pull-Ups and Pull-Downs for Disconnectable
and Indeterminate Inputs 16.8.3 Interconnecting Incompatible Devices
17.3.1 Three-State Output Specifications Low Side Drivers
17.4.1 Low Side Driver Specifications High Side Drivers
17.5.1 High Side Driver Specifications Half-Bridges and Full-Bridges
17.6.1 Shoot-Through Currents and Dead Time 17.6.2 H-Bridge Specifications
Thermal Design Issues Homework Problems
424
424 424 427
428 429 431 431 433 433 434 435 436 437 437 440
CHAPTER 18 Digital Logic and Integrated Circuits
18.1 Basic Combinatorial Logic 18.1.1 Truth Tables 18.1.2 Describing Microcontroller Subsystems Using
Combinatorial Logic
442
442
443
444
12 Contents
18.2
18.3 18.4
18.5 18.6
18.7
18.8
A Survey of Useful Functions Implemented with Combinatorial 18.2.1 The Digital Comparator 18.2.2 The Digital Multiplexer 18.2.3 The Decoder
Introduction to Sequential Logic A Survey of Useful Functions Implemented with Sequential LOJ
18.4.1 The D-Type Flip-Flop 18.4.2 The J-K Flip-Flop 18.4.3 The Counter 18.4.4 The Shift Register
Logic Families Using Available Logic Chips to Expand the Capabilities of a Microcontroller
18.6.1 Using a Multiplexer to Expand Input Capabilities Using a Decoder to Expand Output Capabilities Using Shift Registers to Expand Input Capabilities Using Shift Registers to Expand Output Capabilities Using the SPI Subsystem with Shift Registers
The 555 Timer 18.7.1 Inside the 555 Timer 18.7.2 Astable Operation 18.7.3 Mono-Stable Operation 18.7.4 Other Uses of the 555 Timer
Homework Problems
Logic
gic
18.6.2 18.6.3 18.6.4 18.6.5
445 445 445 446 447 448 448 448 449 451 452
453 453 454 455 457 458 458 458 458 460 461 462
CHAPTER 19 A-to-D and D-to-A Converters
19.1 Interfacing between Digital and Analog Domains 19.2 Digitizing Continuous Signals 19.3 A/D and D/A Converter Performance
19.3.1 Ideal A/D Converter Performance 19.3.2 Sources of Error for A/D Converters 19.3.3 Ideal D/A Converter Performance 19.3.4 Sources of Error for D/A Converters
19.4 D/A Converter Designs 19.4.1 Using Pulse Width Modulation to Generate Analog Voltaj 19.4.2 Summing Amplifier D/A Converters 19.4.3 String D/A Converters 19.4.4 R-2R Ladder D/A Converters
21.2.1 The Origins of the Conductive Coupling Channel 537 21.2.2 Reducing Conductively Coupled Noise 538 21.2.3 Reducing Noise at the Source: Decoupling 538 21.2.4 Reducing the Coupling of Conductive Noise 540 21.2.5 Reducing Conductive Noise at the Receptor:
Power Supply Filtering 541 21.2.6 Best Practices for Reducing Conductive Noise 542
21.3 Capacitively Coupled Noise 542 21.3.1 The Origins of the Capacitive Coupling Channel 542 21.3.2 Reducing Capacitively Coupled Noise 543 21.3.3 Reducing Capacitively Coupled Noise at the Source 545 21.3.4 Reducing the Coupling of Capacitively Coupled Noise 546 21.3.5 Shielding 546 21.3.6 Reducing Capacitively Coupled Noise at the Receiver 547 21.3.7 Best Practices for Reducing Capacitively Coupled Noise 548
21.4 Inductively Coupled Noise 549 21.4.1 The Origins of the Inductive Coupling Channel 549 21.4.2 Reducing Inductively Coupled Noise at the Source 549 21.4.3 Reducing the Coupling of Inductively Coupled Noise 550 21.4.4 Reducing Inductively Coupled Noise at the Receptor 550 21.4.5 Best Practices for Reducing Inductively Coupled Noise 550
Driving a BLDC Motor Commutating a BLDC Motor BLDC Motor Driver Integrated Circuits Comparing Brushed and Brushless DC Motors Homework Problems
CHAPTER 26 Stepper Motors
26.1 Introduction 26.2 Stepper Motor Construction 26.3 The Variable Reluctance Stepper Motor 26.4 The Hybrid Stepping Motor 26.5 Comparing Stepping Motor Types 26.6 Stepper Motor Internal Wiring 26.7 Driving Stepper Motors 26.8 Stepping Sequences for Stepper Motors 26.9 Generating the Drive Sequences for Stepper Motors 26.10 Stepper Motor Dynamics 26.11 Stepper Motor Performance Specifications 26.12 Optimizing Stepper Motor Performance with Drive Electronics 26.13 The Role of Snubbing in Performance 26.14 Homework Problems
569
573
575
578
578 578 586 587 590 592 593 598
601
601
601
603
606
608
608
609
614
614 614 616 617 618 619 620 620 623 624
626
626
626
629
630
631
632
634
635
640
641
643
646
648
649
Contents 15
CHAPTER 27 Other Actuator Technologies 652
27.1 Introduction 652 27.2 Pneumatic and Hydraulic Systems 652
Introduction Terminology Open-Loop Control On-Off Closed-Loop Control Linear Closed-Loop Control
28.5.1 Getting Started 28.5.2 Getting Smarter 28.5.3 Disturbance Rejection 28.5.4 Improving Performance Further by Adding
Derivative Control 28.5.5 Choosing the Right Gains
System Type and the Need for Integral Control Selecting the Control Loop Rate Ad Hoc Methods Homework Problems
16 Contents
29.5.3 Prototype PCBs 29.5.4 Soldering Technique
29.6 Suppliers and Resources 29.7 Homework Problems
718 720 722 724
CHAPTER 30 Project Planning and Management
30.1 Introduction 30.2 Increasing Project Complexity and the Need for Managing
the Process 30.3 Planning and Executing a Project
30.3.1 System Requirements 30.3.2 Generating Design Candidates and Alternatives 30.3.3 Design Concept Evaluation: Prototypes
and Iteration 30.3.4 Specifications
30.4 Management Tools 30.4.1 Project Management 30.4.2 Systems Engineering
CHAPTER 31
CHAPTER 32
30.5 30.6 30.7
30.4.3 Concurrent Design Communication and Documentation Pitfalls and Suggestions Homework Problems
Troubleshooting
31.1 31.2 31.3
31.4 31.5 31.6
Introduction Staring into the Void An Ounce of Prevention Is Worth an AU-Nighter of Troubleshooting Troubleshooting Attitude Final Thoughts Homework Problems
Mechatronic Synthesis
32.1 32.2 32.3 32.4
Introduction The Project Description System Requirements Design Candidates and Alternatives
32.4.1 Team Zero's Concepts 32.4.2 Team InTheRuff s Concepts 32.4.3 Review of the Design Candidates
32.7.1 InTheRuff Drive Motor Choice 32.7.2 Team Zero Ball Release Motor Choice 32.7.3 Team Zero Beacon Sensor Circuit Evolution 32.7.4 Team Zero Support Stiffness Issue 32.7.5 Team Zero Compass Sensor Failure
32.8 The Completed Designs 32.8.1 Team InTheRuff 32.8.2 Team Zero