|
Table of Contents
CHAPTER 1: MECHATRONICS - AN INTRODUCTION
Objectives 3
1.1 What Is Mechatronics? 3
1.2 Essential Skills for Mechatronics 4
1.3 Why Is Mechatronics Important? 5
1.4 Components of a Mechatronic System 5
1.5 Brain for Mechatronics 7
1.6 Book Layout 8
Related Reading 9
Questions 10
Problems 10
Project 11
CHAPTER 2: ELEMENTS AND ANALYSIS OF ELECTRIC CIRCUITS
Objectives 12
2.1 Introduction 12
2.2 Electric Field (EE and ME BASIC) 13
2.3 Current and Voltage (EE and ME BASIC) 14
2.4 Elements of an Electric Circuit (EE and ME BASIC) 16
2.4.1 Circuit Conditions 16
2.4.2 Electric Circuit Sources 16
2.4.3 Circuit Load 18
2.4.4 Circuit Ground 18
2.5 Circuit Analysis (EE and ME BASIC) 19
2.5.1 Circuit Elements in Series and Parallel 19
2.5.2 Kirchhof’s Laws 20
2.5.3 Equivalent Circuit Representation 21
2.6 Resistor (EE and ME BASIC) 22
2.6.1 Voltage Divider 24
2.6.2 Bridge Circuit 26
2.6.2 Small-signal Resistance 27
2.6.3 Resistance-based Sensors 27
2.6.4 Measuring Electrical Resistance 28
2.7 Capacitor (EE and ME BASIC) 29
2.7.1 Capacitor Applications 35
2.8 Inductor (EE and ME BASIC) 35
2.8.1 Magnetic Effect of an Electric Current 36
2.8.2 Electromagnetic Force 38
2.8.3 Self-inductance 72
2.8.4 Inductor-based Devices 74
2.9 Alternating Current (EE and ME) BASIC 78
2.9.1 Steady-state and Frequency Response 79
2.9.2 Complex Number Representation of Voltage and Current 47
2.10 Impedance (EE and ME BASIC) 47
2.10.1 Generalized Voltage Divider 49
2.10.2 Circuit Loading 50
2.10.3 Impedance Matching 52
2.11 Power (EE BASIC) 53
2.11.1 Average Power 55
2.11.2 Reactive Power 56
2.11.3 Power Factor 57
2.12 Signals and Signal Sources EE BASIC 58
2.12.1 Signal Sources 59
2.13 Time Domain Analysis EE BASIC 60
2.13.1 Differentiators 62
2.13.2 Integrators 63
2.14 Passive Filters 63
2.14.2 Low-pass Filters (LPF) 65
2.14.2 High-pass Filters (HPF) 68
2.14.3 Band-pass and Band-Reject Filters 71
2.14.4 Notch and Trap Filters 72
2.15 Noise and Interference in Circuits 73
2.15.1 Guarding Against Electromagnetic Interference (EMI) 74
2.15.2 Bypass Capacitors 75
2.16 Grounding 76
2.16.1 Ground Loops 76
2.16.2 Grounding Techniques 77
2.16.3 Galvanic Isolation 78
2.17 Summary 79
Related Reading 80
Questions 81
Problems 83
Laboratory Projects 88
CHAPTER 3: DIODE, TRANSISTOR, AND THYRISTOR CIRCUITS
Objectives 91
3.1 Semiconductors (EE BASIC) 92
3.2 Diodes (EE BASIC) 93
3.3 Diode Applications 95
3.3.1 Rectification 95
3.3.2 Diode Limiter 98
3.3.3 Diode Clamp 98
3.3.4 Inductive Load and Diode Protection 99
3.3.5 Temperature Sensor 100
3.3.6 Varactor 100
3.4 Zener Diodes 101
3.5 Light-emitting Diode (LED) 102
3.6 Photodiode 103
3.7 Transistors (EE BASIC) 104
3.8 Bipolar Junction Transistor (BJT) (EE BASIC) 105
3.8.1 Transistor Characteristics 107
3.8.2 Transistor States 108
3.8.3 DC Biasing of the BJTs 111
3.8.4 Basic BJT Circuits 112
3.9 Phototransistor 116
3.10 Field-Effect Transistor (FET) (EE BASIC) 117
3.10.1 JFETs 117
3.10.2 MOSFETs 118
3.11 Main Features of FETs and BJTs 121
3.12 Power Transistors 121
3.12.1 Packages 122
3.12.2 Power Bipolar Transistors 123
3.12.3 Darlingtons 124
3.12.4 Power MOSFETs 126
3.12.5 Insulated Gate Bipolar Transistors (IGBTs) 129
3.13 Thyristors 130
3.13.1 Silicon Control Rectifiers (SCR) 130
3.13.2 Gate Turn-off (GTO) 133
3.13.3 TRIAC 133
3.14 Optocouplers 135
3.15 Summary 135
Related Reading 136
Questions 137
Problems 138
Laboratory Projects 141
CHAPTER 4: Operational Amplifier (Op-amp) Circuits
Objectives 141
4.1 Introduction 142
4.2 Op-amp Basic Symbol (EE and ME BASIC) 143
4.3 Circuit Model (EE and ME BASIC) 143
4.4 Ideal Op-amp Behavior 145
4.5 Common Op-amp ICs 147
4.6 Basic Op-amp Circuits 149
4.6.1 Inverting Amplifier 149
4.6.2 Non-inverting Amplifier 150
4.6.3 Follower 151
4.6.4 Differential Amplifier 151
4.6.5 Instrumentation Amplifier 153
4.7 Linear Circuit Applications 156
4.7.1 Summing Amplifier (Adders) 156
4.7.2 Integrators 157
4.7.3 Differentiators 158
4.8 Nonlinear Op-amp Circuits 160
4.8.1 Comparators 160
4.8.2 Schmitt Triggers 161
4.8.3 Rectifiers 162
4.8.4 Limiters 162
4.9 Non-ideal Op-amp Behavior 163
4.9.1 Feedback with Finite-gain Amplifiers 163
4.9.2 Offset Voltage and Bias Currents 164
4.10 Active Filters 167
4.10.1 Filter Circuits and Frequency Characteristics 168
4.10.2 Filter Types 169
4.11 Power Op-amps 172
Related Reading 173
Questions 174
Problems 175
Laboratory Projects 180
CHAPTER 5: Digital Logic and Logic Families
Objectives 180
5.1 Digital Signals (EE and BASIC) 181
5.2 Combinational and Sequential Logic Circuits (EE BASIC) 181
5.3 Clock Signals 183
5.4 Boolean Algebra (EE BASIC) 184
5.4.1 Basic Functions and Gates 184
5.4.2 Boolean Laws and Theorems 186
5.4.3 Karnaugh Maps 189
5.4.4 Design of Combinational Logic Circuits 190
5.5 Integrated Circuits and Logic Families 192
5.5.1 Logic Levels 193
5.5.2 Noise Immunity 193
5.5.3 Fan out 194
5.5.4 Power Dissipation 195
5.5.5 Propagation Delay 195
5.6 TTL Logic Family 195
5.6.1 TTL Designations 196
5.6.2 TTL Versions 197
5.6.3 Output Configurations 197
5.6.4 TTL Characteristics 199
5.7 The CMOS Family 200
5.8 Interfacing CMOS and TTL 202
5.8.1 Interfacing TTL to CMOS 204
5.8.2 Interfacing CMOS to TTL 204
5.9 Flip Flops 205
5.9.1 Set-reset (SR) Flip Flop 205
5.9.2 Trigger or T Flip Flop 206
5.9.3 Clocked D Flip-flop 206
5.9.4 J-K Flip Flop 207
5.10 Buffers and Drivers 208
5.11 Counters and Registers 211
5.12 Decoders and Encoders 212
5.13 Multiplexers and Demultiplexers 213
5.14 The 555 Timer 214
5.15 Phase Locked Loop (PLL) 217
5.16 Glossary of Logic Terms 219
Related Reading 222
Questions 223
Problems 224
Laboratory Projects 226
CHAPTER
6: Microcontrollers and Programming
Objectives 228
6.1 Computers and Computer Programs (EE BASIC) 228
Microprocessor or Microcontroller 229
6.2 Overview of the 9S12C MCUs 231
6.2.1 The Central Processing Unit (CPU12) 234
6.2.2 System Bus 235
6.2.3 System Clocks 236
6.2.4 Operating Modes 237
6.2.5 Memory Map 239
6.2.6 Programming Basics 241
6.2.7 Cpu12 Programming Registers 247
6.2.8 Instruction Queue 254
6.3 Addressing Modes 256
6.4 Instruction Set of the CPU12 265
6.4.1 Data Handling Instructions 266
6.4.2 Arithmetic Instructions 276
6.4.3 Special Math Instructions 284
6.4.4 Logic Instructions 287
6.4.5 Data Compare and Testing Instructions 288
6.4.6 Condition Code Register Instructions 289
6.4.7 Program Control Instructions 290
6.4.8 Miscellaneous Instruction 302
6.5 Assembler Directives 303
6.6 Development of an Assembly Language Program 309
6.6.1 Program Strategies 309
6.6.2 Source Code Structure 311
6.6.3 Assembly-to-machine Code Conversion 313
6.7 High-level Language 315
6.8 Development Tools 323
6.9 16 Kbyte Flash Module 326
6.10 Microchip PIC Microcontrollers 333
6.11 Summary 339
Related Reading 340
Questions 341
Problems 342
Laboratory Projects 348
CHAPTER
7: Parallel I/O and Interrupt Mechanism
Objectives 348
7.1 Introduction 348
7.2 Parallel Input/output (I/O) 349
7.2.1 Common Ports Features 351
7.2.2 Specific Ports Features 353
7.3 Mechanical Switches 360
7.3.1 Interfacing Binary Switches 361
7.3.2 Switch Debounce 362
7.4 Interfacing Keyboards 363
7.4.1 Hardware Decoding 364
7.5 Displays 365
7.5.1 Light Emitting Diodes (LEDs) 366
7.6 Interfacing LED Displays 371
7.6.1 Software Decoding 372
7.6.2 Multiplexed Displays 380
7.6.3 Hardware Decoding 383
7.7 LCD Displays 384
7.8 Interrupt Mechanism 386
7.8.1 Maskable and Non-maskable Interrupts 386
7.8.2 Interrupt Process 389
7.8.3 Vectored Priority Interrupt 390
7.8.4 Interrupt and Reset Vectors 391
7.8.5 Stacking the Registers 392
7.9 Resets 393
7.9.1 External Pin Reset 394
7.9.2 Power-on Reset 395
7.9.3 Cop Failure Reset 396
7.9.4 Clock Monitor Reset (CMR) 397
7.9.5 Reset Sequence 397
7.10 Non-maskable Interrupt (XIRQ) 397
7.11 Maskable Interrupts 400
7.12 Summary 403
Related Reading 403
Questions 404
Problems 406
Laboratory Projects 409
CHAPTER
8: : Serial Interface Facility
Objectives 410
8.1 Introduction 411
8.2 Serial Communication Interface (SCI) 411
8.2.1 Communications Protocol (Framing) 412
8.2.2 Data Transfer (Baud) Rate 413
8.3 SCI Registers 414
8.3.1 Data Register 414
8.3.2 SCI Control Registers 415
8.3.3 SCI Status Registers 419
8.4 Sci Operation 421
8.4.1 SCI Configuration 421
8.4.2 Transmit Operation 423
8.4.3 Receive Operation 425
8.5 Interfacing the 9S12C with RS-232 Port 426
8.6 Serial Peripheral Interface (SPI) 428
8.6.1 Port M Data Direction Register (DDRM) 429
8.6.2 SPI Baud Rate Register (SPIBR) 430
8.7 SPI Registers 430
8.7.1 SPI Data Register (SPIDR) 431
8.7.2 SPI Control Registers 431
8.7.3 SPI Status Register (SPISR) 433
8.8 SPI Topologies 434
8.9 SPI Operation 435
8.10 I/O Expansion of the 9S12C 440
8.10.1 Output Port Expansion 440
8.10.2 Input Port Expansion 442
8.11 Summary 444
Related Reading 445
Questions 445
Problems 445
Laboratory Projects 448
CHAPTER
9: Programmable Timer Facility
Objectives 448
9.1 Introduction 449
9.2 Timer Module in the 9S12C MCU 450
9.2.1 Free Running Counter (TCNT) 451
9.2.2 Timer Overflow 452
9.2.3 Clearing the Timer Flag 452
9.3 Output Compare 452
9.3.1 Output Compare Registers 453
9.3.2 General Set-up for Output Compare Operation 455
9.3.3 Operation of OC7 460
9.3.4 Forced Output Compare 464
9.4 Input Capture Facility 465
9.4.1 Input Capture Pins and Registers 465
9.5 Pulse Accumulator 470
9.5.1 Pulse Accumulator Count Register (PACNT) 470
9.5.2 PA Enable and Active Edge Detection 471
9.5.3 PA Operating Modes 471
9.6 Real-time Clock 475
9.7 Pulse Width Modulation (PWM) 476
9.8 Summary 484
Related Reading 484
Questions 485
Problems 486
Laboratory Projects 487
CHAPTER
10: Analog-to-Digital (A/D) and Digital-to-Analog (D/A) Conversion
Objectives 487
10.1 Introduction 488
10.2 Fundamentals of A/D Conversion 488
10.2.1 Resolution 489
10.2.2 I/O Mapping 490
10.2.3 Aliasing 495
10.2.4 Amplitude Uncertainty 496
10.2.5 Sample and Hold (S/H) 498
10.2.6 Multiple Sensor Inputs 500
10.3 A/D Conversion Techniques 500
10.3.1 Integrating ADCs 501
10.3.2 Successive -Approximation ADC 503
10.3.3 Flash ADC 505
10.4 ADC Facility of the 9S12C MCU 506
10.4.1 Voltage References 506
10.4.2 ATD Registers 507
10.4.3 ATD Setup 507
10.4.4 Conversion Time 509
10.4.5 Channel Selection 510
10.4.6 Channel Sampling and Conversion Results 510
10.4.7 Input Signal Range 516
10.5 Digital-to-Analog Conversion (DAC) 520
10.5.1 Components of a D/A Converter (DAC) 520
10.5.2 Output Voltage 521
10.5.3 Range 522
10.5.4 Resolution 522
10.5.5 Accuracy 523
10.5.6 Bipolar DACs 523
10.5.7 DAC ICs 525
10.5 Summary 526
Related Reading 527
Questions 527
Problems 528
Laboratory Projects 531
CHAPTER
11: Sensors and Their Interface
Objectives 532
11.1 Introduction 533
11.2 Classification of Sensors 534
11.3 Smart Sensors 536
11.4 Sensor Models and Response Characteristics 537
11.5 Sensor Characteristics 539
11.6 Signal Conditioning 543
11.7 Potentiometer Sensors (Pot) 547
11.8 Light Detectors 550
11.8.1 Materials for Light Detectors 552
11.8.2 Types and Modes of Operation of Light Detectors 553
11.8.3 Applications of Light Detectors 553
11.9 Photoresistor (Photocell) 554
11.9.1 Materials for Photocells 554
11.9.2 Interfacing a Photocell to the 9S12C 555
11.10 Photodiode 556
11.10.1 Photodiode Types 556
11.10.2 Photodiode Characteristics 556
11.10.3 Operating Modes 557
11.10.4 Applications 559
11.11 Phototransistor 559
11.11.1 Characteristics 559
11.11.2 Applications 560
11.12 IR Emitter/detector Packages 561
11.12.1 Optical Interrupter 562
11.12.2 Optical Coupler (Optical Isolator) 563
11.12.3 Optical Reflectors 564
11.12.4 NIR Receiver/demodulator Sensors 565
11.13 Optical Encoder 567
11.14 Pyroelectric Sensor 570
Signal Conditioning 571
11.15 Thermal Detectors 573
11.15.1 Thermocouple 573
11.15.2 Thermopiles 578
11.15.3 Theremoresisitive Devices 579
11.15.4 Thermodiode 584
11.15.5 Thermotransistor 585
11.16 Heat Flux Sensor 586
11.17 Magnetic Sensors 588
11.17.1 Magnetic Reed Switch 588
11.17.2 Hall-effect Device 588
11.18 Strain Gauges 592
11.18.1 Bridge Circuit 594
11.18.2 Strain Gauge Measurement 597
11.19 Acoustic Measurement 597
11.19.2 Acoustic Sensors 602
11.19.3 Types of Transducer Element 604
13.19.4 Types of Measurements 607
11.20 Piezoelectricity 613
11.20.1 Piezoelectric Effect 613
11.20.2 Piezoelectric Use in MEMS 614
11.20.3 Constitutive Relations in One-dimension 615
11.20.4 Piezoelectric Sensor 616
11.20.5 Piezoelectric Mass-sensitive Chemical Sensor 618
11.21 Resolver 619
11.23 Capacitive Sensors 621
11.24 Inductive Sensors 623
11.24.1 Motion-detection Sensor 623
11.24.2 Linear Variable Differential Transformer (LVDT) 623
11.25 4-20 mA Transmitters 625
11.26 Summary 62x
Related Reading 627
Questions 629
Problems 631
Laboratory Projects 636
CHAPTER
12: Electric Actuators
Objectives 634
12.1 Actuators (EE BASIC) 635
12.2 DC Motors 636
12.2.1 Principles of Operation of a DC Motor 637
12.2.2 Modeling of DC Motor Behavior 641
12.2.3 Heat Dissipation in DC Motors 649
12.2.7 Servo Amplifiers 656
12.2.8 DC Motor Servo Drive 661
12.2.9 Interfacing DC Motors to the 9S12C 665
12.3 Stepper Motors 672
12.3.1 Characteristics of a Stepper Motor 672
12.3.2 Classification of Stepper Motors 673
12.3.3 Principle of Operation 677
12.3.4 Step Angle 679
12.3.5 Electrical Model of an Energized Coil 680
12.3.6 Drive Methods 683
12.3.7 Stepper Motor Performance 685
12.3.8 Interfacing Stepper Motors to the 9S12C MCU 691
12.4.1 Three Phase Motors 699
12.5 Summary 708
Related Reading 709
Questions 710
Problems 713
Laboratory Projects 716
CHAPTER
13: Control Schemes
13.1 Introduction 714
13.1.1 History of Control 714
13.1.2 Open-loop Control 717
13.1.3 Closed-loop Control 718
13.2 Classical Control 718
13.2.1 Mathematical Modelling 719
13.2.2 Transfer Function 722
13.2.3 Transient and Steady State Analysis 724
13.2.4 Root Locus 729
13.2.5 Frequency Response 734
13.2.6 Lag-lead Compensator 740
13.2.7 Proportional-integral-derivative (PID) Controller Design 750
13.3 STATE SPACE BASED CONTROL STRATEGIES 758
13.4 ADAPTIVE CONTROL 766
13.4.1 Gain Scheduling 767
13.4.2 Model-reference Adaptive Control (MRAC) 768
13.4.3 Self-tuning Regulators 769
13.5 DIGITAL CONTROL 769
13.5.1 Discretization Techniques 770
13.5.2 Emulation 771
13.5.3. Direct Digital Control 772
13.6 INTELLIGENT CONTROL 773
13.6.1Fuzzy Logic Control Design 774
13.7 ADAPTIVE FUZZY LOGIC CONTROLLERS 781
13.7.1 Introduction 781
13.7.2 Fuzzy Model Reference Adaptive Controller 782
13.7.3 Membership Tuning Adaptive Controller 784
13.8 Experimental Comparative Analysis 787
13.8.1 Hardware Platform 787
13.8.2 Digital Control Workstation 788
13.9 Summary 796
RELATED READING 796
QUESTIONS 799
PROBLEMS 800
CHAPTER
14:Case Studies
14.1 INTRODUCTION 805
14.2 CASE STUDY I: AUTONOMOUS MOBILE ROBOT 808
14.2.1 Introduction 808
14.2.2 Mechanical Design Alternatives ME BASIC 808
14.2.3 Design Specifications 811
14.2.4 Electronic Circuits and Interfacing 822
14.2.5 Software Design 827
14.2.6 Case Outcomes 831
14.3 CASE STUDY II: WIRELESS SURVEILLANCE BALLOON 832
14.3.1 Problem Definition 832
14.3.2 Design 833
14.3.3 Parts 840
14.3.4 Case Outcomes 851
14.4 CASE STUDY III: FIRE FIGHTING ROBOT 853
14.4.1 Problem Statement 853
14.4.2 Design Alternatives 856
14.4.3 Implementation 858
14.4.4 Case Outcomes 867
14.5Case Study IV: Piezo Sensors & Actuators in Cantilever Beam Vibration Control…………869
14.5.1 Introduction 869
14.5.2Modeling of the Cantilever Beam and Pzt Actuator 869
14.5.3 Beam Experimental Setup 874
14.5.4 Instrumentation Setup 876
14.5.5 Controller and Software 880
14.5.6 Simulation and Experimental Pid Results 884
14.5.7 Simulation and Experimental Fuzzy Results 886
14.5.8 Conclusions 886
14.5.9 Case Outcomes 887
Appendices
Appendix A: DC Power Supply EE BASIC 888
Appendix B: Pinout of Selected ICs 890
Appendix C: Instructions Set, Addressing Modes, And Execution Times for the MC9S12C 892
Appendix D: MC9S12C Registers and Control Bit Assignments 894
Appendix E: Using the CodeWarrior Integrated Development Environment (IDE) 896
Appendix F: ASCII Code 898
Appendix G: Number Systems (EE BASIC) 900
Appendix H: Mechanims for Mechatronics (ME BASIC) 920
|