Sie sind auf Seite 1von 470
Computer Architecture and Interfacing to Mechatronic Systems by Dr. Dario J. Toncich PhD, M Eng,

Computer Architecture and Interfacing to Mechatronic Systems

by Dr. Dario J. Toncich PhD, M Eng, B.E.E. (Hons), MIE Aust, CP Eng

Published by

Published by Chrystobel Engineering Wrixon Avenue Brighton Australia 3187 Orders/Enquiries Facsimile Number: +61-3-957

Chrystobel

Engineering

Wrixon Avenue Brighton Australia 3187 Orders/Enquiries Facsimile Number: +61-3-957

ISBN 0 646 16089 3

Copyright D.J. Toncich, 1994

Layout and artwork by Chrystobel Engineering of Brighton Australia. Printed and Bound in Australia (1994) (1995) (1996) (1997)

First Printed in Australia, 1994. Additional copies of this text may be obtained by mailing or faxing purchase enquiries directly to Chrystobel Engineering. Subject conveners and lecturers prescribing this text as a course reference may be eligible for complimentary copies.

Author

Dr. Dario Toncich was born in Melbourne Australia in 1960. He graduated (with honours) in Electrical Engineering from the University of Melbourne in 1983. Since that time he has held both industry and academic positions and has experience in the fields of data communications, computer architecture, FMS control and simulation.

During his time in industry, Dr. Toncich spent a number of years developing computer control, simulation and communications equipment for FMS at an Australian-based Advanced Manufacturing Technology (AMT) Company. In 1988, he was appointed as Manager of Research Activity for the CIM Centre at the Swinburne Institute in Hawthorn, Victoria, Australia. As the manager of the Centre Dr. Toncich led research into AMT fields including FMS control and simulation and industrial data communications. He is also a professional consulting engineer to industry in the fields of FMS and data communications and has a Master of Engineering (by Research) degree from the Swinburne Institute of Technology and a PhD from the Swinburne University of Technology. In 1995, Dr. Toncich was appointed Research Leader in Control and Automation at the Industrial Research Institute Swinburne (IRIS).

Dr. Toncich is also a subject convener and lecturer in a range of computer and CIM related subjects at postgraduate and undergraduate level at the Swinburne University. His research work has been published in international refereed journals and conference proceedings and he has also authored a number of guided learning programs in computer architecture and data communications. This is his second text book in the field of industrial control and communications systems.

No portion of this text book may be reproduced in any form whatsoever without the explicit, written consent of the author.

Notification of errors or omissions in this text book, or suggestions for its improvement, can be mailed or faxed directly to Chrystobel Engineering

(i)

Table of Contents

Chapter 1 An Overview of the Computer Interfacing Process

1

1.1 General Issues - Analog and Digital Computation

2

1.2 Interfacing Computers Via Hardware

6

1.3 Interfacing Computers Via Software

9

Chapter 2 Computers and Control - Mechatronic Systems

13

2.1 A Review of Developments in Digital Computer Control

14

2.2 Programmable Logic Controllers

20

2.3 Intelligent Indexers and Servo-Drive Systems

24

2.4 CNC and Robotic Controllers

30

2.5 Development Systems for Mechatronic Control

36

2.6 Manufacturing Systems

41

Chapter 3 Fundamental Electrical and Electronic Devices and Circuits

47

3.1 Introduction to Electronic Devices

48

3.2 Diodes, Regulators and Rectifiers

50

3.2.1 Fundamentals and Semiconductor Architecture

50

3.2.2 Zener Diodes for Voltage Regulation

55

3.2.3 Diodes For Rectification and Power Supplies

57

3.3 Basic Transistor Theory and Models

69

3.3.1 Introduction

69

3.3.2 Bipolar Junction Transistors (BJTs)

70

3.3.3 Field Effect Transistors (FETs)

86

3.4 Analog and Digital Circuit External Characteristics

98

3.5 Operational Amplifiers

103

3.6 Linearity of Circuits - Accuracy and Frequency Response

115

3.7 Thyristors

120

3.7.1 Introduction

120

3.7.2 Silicon Controlled Rectifiers

120

3.7.3 Diacs and Triacs

127

(ii)

Table of Contents (Continued)

Chapter 4 Fundamentals of Digital Circuits

131

4.1 A Building Block Approach to Computer Architecture

132

4.2 Number Systems, Conversion and Arithmetic

138

4.3 Representation of Alpha-numerics

146

4.4 Boolean Algebra

150

4.5 Digital Logic Circuits

166

4.5.1 Introduction

166

4.5.2 Transistor to Transistor Logic (TTL)

168

4.5.3 Schottky TTL

173

4.5.4 Emitter Coupled Logic (ECL)

174

4.5.5 CMOS Logic

175

4.6 Digital Circuits for Arithmetic Functions

177

4.7 Flip-Flops and Registers

184

4.8 Counters - Electronic Machines

192

Chapter 5 Memory Systems and Programmable Logic

197

5.1 Introduction

198

5.2 Overview of Memory Operation

202

5.3 Volatile Read/Write Memory

205

5.4 Non-Volatile Read Only Memory

208

5.5 Non Volatile Read/Write Memory

210

5.6 Programmable Logic Devices

211

Chapter 6 State Machines and Microprocessor Systems

217

6.1 State Machines

218

6.2 Microprocessor System Fundamentals

222

6.3 Microprocessor I/O - Data and Address Bus Structures

230

6.4 Memory Mapping

234

6.5 Microprocessor Program Execution

239

6.6 Programming Levels for Processors

245

(iii)

Table of Contents (Continued)

6.8 Paging

255

6.9 Multi-Tasking Multi-User Systems

257

6.10 Combining the Elements into a Cohesive System

258

Chapter 7 Interfacing Computers to Mechatronic Systems

259

7.1 Introduction

260

7.2 The Interfacing Process

262

7.3 A/D and D/A Conversion

268

7.4 Signal Conditioning, Protection and Isolation

279

7.4.1 Introduction

279

7.4.2 Signal Conditioning Circuits

280

7.4.3 Protection Circuits

290

7.4.4 Isolation Circuits

294

7.5 Energy Conversion - Transducers

297

7.6 Attenuation Problems

304

7.7 Data Communications

310

7.8 Combining the Interfacing Stages

313

7.9 Commercial Realities of Interface Design

315

Chapter 8 Software Development Issues

319

8.1 Introduction

320

8.2 Operating System Issues

323

8.3 User Interface Issues

329

8.4 Programming Language Issues - OOP

332

8.5 Software Engines

337

8.6 Specialised Development Systems

339

(iv)

Table of Contents (Continued)

Chapter 9 Electromagnetic Actuators & Machines - Basic Mechatronic Units

341

9.1 Introduction to Electromagnetic Devices

342

9.2 Fundamentals of d.c. Machines

355

9.2.1 Introduction to d.c. Machines

355

9.2.2 Physical Characteristics of d.c. Machines

356

9.2.3 Separately Excited d.c. Machines

364

9.2.4 Series d.c. Machines

366

9.2.5 Shunt d.c. Machines

369

9.2.6 Compound d.c. Machine Configurations

372

9.2.7 Basics of Speed Control

376

9.3 Fundamentals of a.c. Synchronous Machines

383

9.3.1 Introduction to Synchronous Machines

383

9.3.2 Physical and Magnetic Circuit Characteristics of Synchronous Machines

384

9.3.3 Electrical Models and Performance Characteristics

400

9.3.4 Basics of Synchronous Motor Speed Control

409

9.4 Fundamentals of Induction (Asynchronous) Machines

410

9.4.1 Introduction to Induction Machines

410

9.4.2 Physical Characteristics of Induction Machines

411

9.4.3 Electrical and Magnetic Models and Performance

413

9.4.4 Basics of Induction Motor Speed Control

419

9.5 Stepping (Stepper) Motors

421

9.6 A Computer Controlled Servo Drive System

425

Appendix A - References

A-1

Appendix B - Index

B-1

(v)

List of Figures

Chapter 1 An Overview of the Computer Interfacing Process

1.1 Simple Analog Computation - Addition

3

1.2 Cascaded Digital Circuits

(a)

(b)

Allowable Input and Output Voltage Ranges for TTL Circuits

4

1.3 Interfacing Digital Computers to External Systems

6

1.4 The Computer Interfacing Software Development Process

10

Chapter 2 Computers and Control - Mechatronic Systems

2.1 Hierarchical Computer Control Architecture

15

2.2 Distributed Computer Control Architecture

17

2.3 Heterarchical Control Architecture

19

2.4 Schematics of a Programmable Logic Controller

20

2.5 Distributed Control Using PLCs

22

2.6 Stepper Motor Arrangement

25

2.7 Schematic of Traditional Servo Drive System Arrangement

26

2.8 Closed-Velocity-Loop Servo Motor System

27

2.9 A Simple XY-Machine

(a)

(b)

Problems with Using Position Control for Interdependent Axes

28

2.10 Schematics of a CNC or Robotic Axis Control System

31

2.11 Integrated PLC Control of High Power Peripherals

34

2.12 Inter-locking a CNC Machine to a Robot

35

2.13 Basic Interface Board Arrangement for Data-Acquisition and Control in Analog Systems

36

2.14 Using Advanced Interface Boards with "On-Board Processors" for Standard Closed-Loop Control Functions

37

2.15 Miniature Controller Development System

39

2.16 Realms of Metal-Cutting Manufacturing Systems

41

2.17 Schematic of Dedicated, In-Line Transfer Machine

42

2.18 Schematic of a Flexible Manufacturing System

45

(vi)

List of Figures (Continued)

Chapter 3 Fundamental Electrical and Electronic Devices and Circuits

3.1 The Semiconductor Diode

50

3.2 Second-order Approximation of Diode Behaviour

52

3.3 Third-order Approximation of Silicon Diode Behaviour

53

3.4 Circuit Approximations for Silicon Diodes

54

3.5 Approximate Models for Zener Diode in Reverse Breakdown

56

3.6 Typical Zener Diode Characteristic

56

3.7 Schematic of Transformer Construction

(a)

(b)

A Manageable Circuit Model for a Transformer

(c)

Transformer Characteristics for Varying Load

3.8 Simple Half-Wave Rectifier Power Supply with

Current and Operating Frequency

59

(a)

Capacitance Smoothing for Low Load Currents

(b)

Inductance (Choke) Smoothing for High Load Currents

62

3.9 Analysis of Half-Wave Rectifier With Capacitance or Inductance Filtering

62

3.10 Single-Phase Bridge Rectifier with Capacitance Filtering

(a)

Circuit Diagram

(b)

Effective Circuit Diagram for Voltage v ab > 0

63

(c)

Effective Circuit Diagram for Voltage v ab < 0

63

3.11 Three-Phase Bridge Rectifier

64

3.12 Operation of Three-Phase Bridge Rectifier

65

3.13 Zener Diode Regulating Output Voltage Vu from a Rectifier

(a)

(b)

Equivalent Circuit Replacing Diode With its a.c. Resistance R z

67

3.14 Grown (npn) Transistor Schematic and Circuit Symbol Representation

70

3.15 Transistor Diode Analogy for "npn" and "pnp" Devices

71

3.16 Classical Closed-Loop Control System

74

3.17 Common Emitter Circuit

76

3.18 Typical Common-Emitter Output Characteristic of an npn Transistor

76

3.19 Circuit Diagram for a realistic TTL Inverter Circuit

78

3.20 Emitter-Feedback Circuit Commonly Used for Amplification

80

3.21 Emitter-Feedback Circuit with Thévenin Equivalent of Base Biasing

81

3.22 Emitter-Feedback Circuit with a.c. Input Signal Applied

81

3.23 Small-Signal (Hybrid-π) Model for BJT

82

3.24 Complete Circuit Model for Emitter-Feedback Amplifier Incorporating Small-Signal Model for BJT

84

3.25 Total Voltage Waveforms (Quiescent + Signals) in an Emitter Feedback Amplifier Circuit

85

(vii)

List of Figures (Continued)

3.27 Schematic of MOSFET Construction

(a)

Enhancement Mode n-Channel MOSFET

(b)

Depletion Mode n-Channel MOSFET

88

3.28 Complementary n and p channel MOSFETs (CMOS)

90

3.29 Circuit Symbols for Different FET Devices

91

3.30 Typical Output Characteristic for an n-channel MOSFET Operating in Both Enhancement (V GS Forward Biased) and Depletion (V GS Reverse Biased) Mode

92

3.31 Digital Inverter Gate Based Upon MOSFETs

93

3.32 CMOS Based Inverter Circuit with PMOS (Q2) Load

93

3.33 Amplifier Feedback Arrangement for n-Channel JFET

95

3.34 Source-Feedback Amplifier Circuit of Figure 3.33 with a.c. Signals and Thévenin Equivalent of Input Stage

95

3.35 Small Signal (Hybrid-π) Model for JFET or MOSFET

96

3.36 Modelling Analog and Digital Circuits in Terms of External Characteristics

98

3.37 Cascaded Circuits

(a)

(b)

Fan-out From One Circuit

99

3.38 Thévenin Equivalent of a Circuit

(a)

(b)

Norton Equivalent of a Circuit

101

3.39 Determining Thévenin and Norton Equivalent Circuits from an Existing Circuit

102

3.40 Simplified Circuit Diagram for Single-Chip 741 Operational Amplifier

104

3.41 Circuit Symbol for Operational Amplifier

(a)

(b)

Idealised Model of Operational Amplifier Circuit

105

3.42 Operational Amplifier Based "d.c. Voltage Follower" Circuit

(a)

(b)

Operational Amplifier Based "a.c. Voltage Follower" Circuit

107

3.43 Transconductance Amplifier for Floating Load

(a)

(b)

Transconductance Amplifier for Grounded Load

108

3.44 Transresistance Amplifier - Current to Voltage Conversion

109

3.45 Inverting Amplifier Arrangement

(a)

(b)

Inverting "Summing" Amplifier for Providing the Weighted Sum of "N" Input Voltages

110

3.46 Non-Inverting Amplifier

(a)

(b)

Non-Inverting Summing Amplifier for Providing the Weighted Sum of "N" Input Voltages

111

3.47 Differential Amplifier Configuration

112

3.48 Integrator Circuit

(a)

(b)

Differentiator Circuit

113

(viii)

List of Figures (Continued)

3.49 Imperfections of Realistic Energy Transducers and Circuits

(a)

Accuracy Problems;

(b)

Limited Frequency Response;

(c)

Non-Linearity

116

3.50 Silicon Controlled Rectifier

121

(a)

Schematic of Semiconductor Structure

(b)

Equivalent Two-Transistor Circuit

(c)

Circuit Symbol

121

3.51 SCR Voltage-Current Characteristic

121

3.52 SCRs for Inversion and d.c. Transmission Systems

123

3.53 SCR Crowbar Circuit

124

3.54 SCR Phase Controller for Resistive Loads and Motors

125

3.55 Using a Variable Resistance to Adjust the Average Output From an SCR Phase Controller

126

3.56 Circuit Symbol for Diac

(a)

(b)

Circuit Symbol for Triac

128

3.57 Unijunction Transistor

(a)

Circuit Symbol

(b)

Equivalent Circuit

129

Chapter 4 Fundamentals of Digital Circuits

4.1 Simple Mechanical Controller

133

4.2 Microprocessor Analogy to Mechanical Controller

134

4.3 Basic Computer System Elements

136

4.4 Building Blocks in Computer Architecture

137

4.5 Typical Digital Waveforms on an 8-bit Data Bus

139

4.6 The True Analog Nature of Digital Waveforms

 

140

4.7 Boolean Logic Circuit to Test for Humidity

152

4.8 Digital Control System for Incubator

153

4.9 Boolean Logic Circuit for Heater in Incubator Control

155

4.10 Karnaugh Map for Original Expression for "Z" in Design Problem 2

159

4.11 Karnaugh Map for "Z" in Design Problem 2 with Regions Circled

160

4.12 Sample Karnaugh Map Problems

161

4.13 Karnaugh Maps Marked Out to Maximise Regions of Ones

 

162

4.14 Karnaugh Maps for Incubator Control (i) Heater; (ii) Fan

164

4.15 Simplified Incubator Control System

165

(ix)

List of Figures (Continued)

4.17 TTL Inverter Gate

169

4.18 Input and Output Voltage Levels Associated with TTL

169

4.19 Effect of Fan-Out on TTL Gate Performance

170

4.20 Typical Data-Book Timing Diagrams Illustrating Propagation Delays from Gate Input to Gate Output

171

4.21 Open-Collector TTL Inverter

(a)

(b)

Combining Open-Collector Gates to Create an "AND" Function

172

4.22 CMOS Inverter Including "p" and "n" Channel Devices

176

4.23 Block Diagram for Full-Adder Circuit

178

4.24 Karnaugh Maps for Full-Adder Circuit

179

4.25 A Circuit to Add two 8-Bit Numbers "A" and "B"

180

4.26 Schematic of R-S Flip-Flop Construction

(a)

(b)

Block Diagram Representation of R-S Flip-Flop

184

4.27 Clocked R-S Flip-Flop Schematic

(a)

(b)

Clocked R-S Flip-Flop Block Diagram

185

4.28 Typical Timing Diagrams for a Clocked R-S Flip-Flop

186

4.29 Clocked D Flip-Flop Schematic

(a)

(b)

Clocked D Flip-Flop Block Representation

187

4.30 Negative-Edge-Triggered JK Master-Slave Flip-Flop

(a)

Schematic; (b) Block Diagram Form

188

4.31 Timing Diagrams Highlighting the Operation of Simple

Negative Edge Triggered Flip-Flop and Master-Slave Flip-Flop

189

4.32 Eight Bit Storage Register

190

4.33 Eight Bit Shift Register and Timing Diagrams

191

4.34 Asynchronous Up-Counter

193

4.35 Synchronous Hexadecimal Counter

(a)

(b)

Synchronous Binary Coded Decimal Counter

194

4.36 Modified Incubator Control System

196

Chapter 5 Memory Systems and Programmable Logic

5.1 Tristate Logic Devices

(a)

Non-Inverting Circuit with Active High Enable

(b)

Inverting Circuit with Active High Enable

(c)

Non-Inverting Circuit with Active Low Enable

(d)

Inverting Circuit with Active Low Enable

200

5.2 Inverter Gate with Both Inverting and Non-Inverting Outputs

201

5.3 Schematic of Data Storage in Memory Chips

203

(x)

List of Figures (Continued)

5.5 Representations for AND gates

(a)

Traditional Representation

(b)

PLD Equivalent Representation with Fixed Connections ()

(c)

PLD Equivalent Representation with Programmable

Connections ()

212

5.6 Programmable Array Logic (PAL) Structure

213

5.7 Programmable Logic Array (PLA) Structure

214

5.8 PAL Solution to Incubator Design Problem 1 from Chapter 4

216

Chapter 6 State Machines and Microprocessor Systems

6.1 The State Machine Concept

218

6.2 Typical ASM Chart

219

6.3 Schematic of Building Blocks and Data Flow Within a Microprocessor Chip

224

6.4 Hypothetical 8-Bit Microprocessor Showing Important Pin-Out Features

230

6.5 68 Pin Grid-Array, Typical of Packaging for Devices with Large Pin-Outs

231

6.6 Information Flow in a Microprocessor Based System

 

232

6.7 Schematic of a Hypothetical 16-Word Memory Chip

234

6.8 Using Memory Mapping Techniques to Create a Common Shared Area of Memory (or Registers) to Transfer Data To and From Non-Memory Devices (eg: Graphics Controller Card)

237

6.9 Timing Diagram for Addition Program Execution

242

6.10 A Simple Hexadecimal Keypad to Automate Machine Code Programming

246

6.11 Interfacing Hardware and Software via an Operating System

249

6.12 Polling Techniques

(a)

Waiting for Inputs

(b)

Executing a Task While Waiting for Inputs

251

6.13 Interrupt Programming for Serial Communications

(a)

Schematic

(b)

Memory Map

253

6.14 Paging From Disk (Virtual Memory) to RAM (Physical Memory)

255

6.15 Combining Basic Elements into One Computer System

258

(xi)

List of Figures (Continued)

Chapter 7 Interfacing Computers to Mechatronic Systems

7.1 The Computer Interfacing Process - Closed Loop Control

262

7.2 Basic Steps in the Computer Interfacing Process

263

7.3 Interfacing External Asynchronous Signals to the Synchronous Internal Environment via a Programmable Parallel Interface

265

7.4 Functionality of A/D and D/A Devices Interacting with a PPI Device 266

7.5 Schematic Representation of A/D Converter

(a)

(b)

Schematic Representation of D/A Converter

268

7.6 Schematic of D/A Converter Operation (3-Bit)

270

7.7 Comparator Circuit Formed from an Operational Amplifier

271

7.8 Flash or Parallel A/D Converter

271

7.9 Schematic of Dual-Slope, Integrating A/D Converter

272

7.10 Operation of Dual-Slope Integrating A/D Converter

273

7.11 Schematic of 8-Bit Successive Approximation A/D Converter

274

7.12 Results after A/D then D/A Conversion after Sampling Waveform (a)

at a Range of Frequencies - (b) f s (c) 2f s (d) 4f s

275

7.13 Schematic of Sample and Hold Circuit

277

7.14 Using Sample and Hold Circuits with a Multiplexer to Share an A/D Converter Between Eight Analog Input Lines

278

7.15 The Schmitt Trigger Circuit Symbol

(a)

(a)

"Squaring Up" Slowing Changing Input Signals

(c)

Producing Digital Signals from an Offset Sinusoidal Input

Waveform

281

7.16 Switch Debouncing Circuits Based on R-S Flip-Flops

282

7.17 The Concept of Amplification

283

7.18 The Transformer in Concept

284

7.19 PWM Output for a Range of Different Duty-Cycles

286

7.20 Switch Mode Power Supplies Based Upon Amplification of PWM Signals

287

7.21 Filtering Out Unwanted Signals with Low-Pass, Band-Pass and Notch Filters

289

7.22 Relay Configurations

291

7.23 Protection Using Zener Diodes and Relays

292

7.24 Driving Simple High Current Circuits from Digital Outputs by Using Relays

293

7.25 The Problem of Measuring Small Voltage Differences Between Two Voltages Which are Both High with Respect to E arth

294

(xii)

List of Figures (Continued)

7.27 Using a Current Transformer to Isolate and Monitor Current

295

7.28 Opto-Couplers (Isolators)

(a)

Simple Opto-Isolator

(b)

Darlington-Pair High Gain Opto-Isolator

296

7.29 Schematic of Potentiometer

300

7.30 Incremental Position Encoder

 

301

7.31 Idealised Point to Point Link

304

7.32 Lumped Parameter Approximation of a Conductor

305

7.33 Exaggerated Output Voltage at the end of δl Segment

307

7.34 Degenerative Effects of Long Conductors

308

7.35 A Common Interfacing Problem where the Distance "L" Between the Transducer and Control System is Large

308

7.36 Interfacing Via Data Communications Links (Point to Point)

310

7.37 Interfacing Devices Via a Bus Network

311

7.38 The Basic Closed Loop for the Interfacing Process

313

Chapter 8 Software Development Issues

8.1 Basic Hardware and Software Elements Within a Computer System

320

8.2 Interfacing Hardware and Software via an Operating System

321

8.3 The Basic Closed-Loop Control Elements

322

8.4 Using Distributed Control Based on Intelligent Interface Cards

328

8.5 Typical Screen from Microsoft Corporation Word for Windows

329

8.6 - Typical Screen from Borland International Turbo Pascal for Windows 330

Chapter 9 Electromagnetic Actuators & Machines - Basic Mechatronic Units

9.1 Energy Conversion in Electrical Machines

342

9.2 Magnetic Field Induced Around a Current Carrying Conductor

343

9.3 Typical Shape of a Magnetisation Curve

345

9.4 Energised Toroidal Core with an N Turn Winding

345

9.5 Magnetic Circuit with Air Gap

347

9.6 Electromagnetic Induction

349

9.7 Typical Hysteresis Characteristic

349

(xiii)

List of Figures (Continued)

9.9

Torque Produced in a Current Loop

352

9.10

(a)

Schematic Cross-section of a Stator on a d.c. Machine

(b)

Schematic Cross-section of a Rotor on a d.c. Machine

356

9.11

Flux Density Distribution as a Function of Angular Position in Air Gap

357

9.12

Horizontal and Vertical Elevations of a Rotor (Schematic)

358

9.13

Rectification Effect of Commutator

 

359

9.14

Electrical Model for d.c. Machine

360

9.15

Magnetic Fields Caused By Field and Armature Windings

361

9.16

Affect of Armature Field on Flux Density at North Pole of a 2-Pole Machine

362

9.17

Separately Excited d.c. Generator Driven by a Prime Mover

365

9.18

Separately Excited d.c. Motor with Load of Torque "T"

365

9.19

Series d.c. Generator Driven by a Prime Mover

 

366

9.20

Series d.c. Motor Connected to a Mechanical Load

367

9.21

Shunt d.c. Generator (Self-Excited)

369

9.22

Shunt d.c. Motor Connected to Mechanical Load of Torque "T"

370

9.23

(a)

Short and (b) Long Shunt Compound Generator Configuration

372

9.24

Long Shunt d.c. Motor Connected to Load of Torque "T"

374

9.25

Variation of Separately Excited Motor Torque-Speed Characteristic through - (a) Field Current Control; (b) Armature Voltage Control

378

9.26

Variation of Series Motor Torque-Speed Characteristic through

(a)

Terminal Voltage Variation; (b) Circuit Resistance Variation

379

9.27

Variation of Series Motor Torque-Speed Characteristic through

(a)

Terminal Voltage Variation; (b) Circuit Resistance Variation

380

9.28

Comparative Torque-Speed Characteristics for Different

d.c. Motor Configurations

381

9.29

Schematic of Single-Phase Salient-Pole Synchronous Machine

384

9.30

(a)

Flux Distribution as a Function of Rotor Position

(b)

Shaping Rotor Ends to Approximate a Sinusoidal Distribution

(c)

Induced Voltage in Stator as a Result of Rotor Movement

385

9.31

Schematic of Single-Phase Cylindrical (Round) Rotor

Synchronous Machine

387

9.32

Three-Phase Salient Pole Synchronous Machine

388

9.33

(a)

Stator Flux Distribution in Three-Phase Synchronous Machine

(b)

Induced Stator Voltages as a Result of Rotor Movement

388

9.34

Fields Generated through Application of Three-Phase Currents to Three Symmetrically Displaced Coils

389

9.35

Resultant Magnetic Field Vector for Varying Times (ωt)

391

9.36

Contribution of Total Field Vector to a Point "A" at Orientation "α"

392

(xiv)

List of Figures (Continued)

9.38 Synchronous Machine with 3-Phase, 2-Pole-Pair Stator and Four-Pole Rotor

394

9.39 Torque Development in Synchronous Machines

395

9.40 Torque Production in a Three-Phase, Single-Pole-Pair, Synchronous Machine

398

9.41 Torque-Angle Characteristic for Three-Phase, Synchronous Machine 399

9.42 Typical Open and Short-Circuit Characteristics

for a Synchronous Machine

400

9.43 Circuit Model for One-Phase of a Three-Phase,

Cylindrical-Rotor Synchronous Machine

401

9.44 Phasor Diagram for Synchronous Machine in Generator Mode

402

9.45 Power Angle Characteristic for Cylindrical Rotor Synchronous Machine

404

9.46 Phasor Diagrams for Salient Pole Machines

406

9.47 Possible Three-Phase Synchronous Motor Connections

407

9.48 Different Configurations of Induction Machine Rotors

411

9.49 Electrical Circuit Representation of One Phase of

a

Three-Phase Induction Motor at Stand-Still

413

9.50 Electrical Circuit Representation of One Phase of

a

Three-Phase Induction Motor at Speed "N" and Slip "s"

414

9.51 Equivalent Representations of One Phase of

a

Three-Phase Induction Machine Rotating with Slip "s"

415

9.52 Torque-Slip (or Speed) Characteristic for

a

Three-Phase Induction Machine

417

9.53 Schematic of Stepper Motor with 4-Phase Stator and 2-Pole Rotor

421

9.54 Driving Currents in a 4-Phase Stepper Motor

423

9.55 A Simple Proportional Feedback Servo Control System

425

9.56 Intelligent Servo Drives

 

(a)

Retaining Analog Amplification

(b)

Complete Digital Servo Drive

426

9.57 "H-Bridge" Amplifier Configuration, Driven by

PWM Output Coupled With Combinational (Boolean) Logic

427

9.58 A Distributed Control System Based Upon

a

Number of Intelligent Servo Drive Systems

428

(xv)

List of Tables

Chapter 1 An Overview of the Computer Interfacing Process

No tables in this chapter

Chapter 2 Computers and Control - Mechatronic Systems

No tables in this chapter

Chapter 3 Fundamental Electrical and Electronic Devices and Circuits

No tables in this chapter

Chapter 4 Fundamentals of Digital Circuits

4.1 Representation of Decimal Numbers from 0 to 20

144

4.2 ASCII and EBCDIC Character Representation

147

4.3 Special Functions of the first 32 ASCII Characters

149

4.4 Common Boolean Logic Functions and Representation

151

4.5 Truth Table for Digital Incubator Controller

154

4.6 Fundamental Principles of Boolean Algebra

156

4.7 Truth Table for Original Expression in Design Problem 2

158

4.8 Truth Table for Simple Addition Circuit

177

4.9 Truth Table for Full-Adder

178

4.10 Truth Table for R-S Flip-Flop

185

4.11 Truth Table for JK Flip-Flop

187

4.12 Flip-Flop States for Asynchronous "Up-Counter"

192

(xvi)

List of Tables (Continued)

Chapter 5 Memory Systems and Programmable Logic

5.1 - Truth-Table for Tristate Inverter with Active High Enable

199

Chapter 6 State Machines and Microprocessor Systems

6.1 Truth Table for States Derived from ASM Chart for Figure 6.2

221

6.2 Part of an Instruction Set for a Hypothetical Microprocessor

226

6.3 Memory Mapping of Identical Memory Chips in Figure 6.6 to Unique Locations with respect to Microprocessor

236

6.4 Contents of System Memory (of Figure 6.6) after Program and Boot Address Entry

240

6.5 Key Sequence Required to Enter Addition Program on a Simple Hexadecimal Keypad

245

Chapter 7 Interfacing Computers to Mechatronic Systems

7.1 Interfacing Options for Figure 7.38

314

7.2 Sample Interfacing Issues and Possible Courses of Action

317

Chapter 8 Software Development Issues

No tables in this chapter

Chapter 9 Electromagnetic Actuators & Machines - Basic Mechatronic Units

9.1

"Dual" Electrical and Magnetic Circuit Properties

347

(xvii)

Introduction

Very few systems in modern engineering are either purely mechanical or purely electronic in nature. Most engineering devices, machines and systems are a combination of mechanical elements, computer controls and the electronic interfacing circuitry that binds these elements together. In the mid-1980s, these hybrid systems were recognised as being a rapidly growing part of the engineering world and were given the rather commercial, but nonetheless appropriate, title of "mechatronic" systems. It is somewhat ironic that the two fields of engineering (electronic and mechanical) that were derived from the classical mechanical engineering streams of the early 19th century have now had to be brought back together as a result of the growing need for mechatronic systems.

A mechatronic system can have many forms. At a domestic level, it could be a

compact-disk player or a video recorder. At an industrial level, a mechatronic system could be a robot, a computer controlled production machine or an entire production line. The extraordinary increase in low-cost processing power that has arisen as a result of the microprocessor now means that few mechanical devices in the modern world are born without some form of intelligence.

The problem that most engineers now face is that their undergraduate courses have simply not equipped them to undertake the task of designing mechatronic systems. Mechanical and manufacturing engineers seldom understand enough about electronic engineering and computing concepts to tackle the inter-disciplinary realities of system design. Electrical and electronics engineers similarly understand very little about the mechanical systems for which they design computer controls and interfaces.

It is surprising therefore, that in this day and age we still retain separate courses

for electronic and mechanical engineering - and yet the trend towards greater specialisation is unfortunately continuing. The common university argument is that in order to be a good electronic or mechanical engineer, one needs to have a highly specialised undergraduate program. The reality is that in order to be a good engineer, one needs to have a good understanding of both mechanical and electronic engineering disciplines and a degree of specialisation that is born of practical realities, rather than esoteric theories.

The purpose of this book is to address the links that need to be bridged between modern electronic and mechanical equipment. In other words, we look at the issue of what a mechanical or manufacturing engineer needs to know in order to sensibly design mechatronic systems. We also introduce the basic concepts that electrical / electronics engineers will need to understand when interfacing computer systems to mechanical devices.

(xviii)

Computer Architecture and Interfacing to Mechatronic Systems is not an exhaustive applications guide for computer interfacing and systems design. The issues that have been selected for discussion in this book are wide-ranging and at first glance may appear to be somewhat unusual. However, a great deal of thought has gone into the structure of this book so that mechanical, manufacturing and even chemical engineers can come to terms with the electronics, computers and control systems that are used to drive mechatronic systems. Similarly, electronics engineers will find that the book summarises the basic concepts that they have learnt in their undergraduate engineering courses and places this knowledge into perspective with the mechanical devices to which they must tailor their designs.

In the final analysis, only a small percentage of engineers will undertake a complete interfacing exercise from first principles. Many would argue that there is little need for such developments in light of the number of commercially available building blocks that can be used to interface computers to the outside world. However, even if one accepts that interfacing is gradually (and fortunately) becoming a systems engineering task, one must also accept that this task cannot be undertaken without a sound understanding of the basic principles and limitations of the building blocks involved. It is to be hoped that this book will give you an understanding of those principles and limitations.

(xix)

How to Read and Use This Book

"Computer Architecture and Interfacing to Mechatronic Systems" is one of a series of books that has been designed to enable electrical, mechanical and manufacturing engineers to tackle mechatronic systems design and to enable electronic engineers to understand the realities of the industrial devices around which computer controls and interfaces must be designed. The other text book, currently released in the same series is:

Toncich, D.J., "Data Communications and Networking for Manufacturing Industries (Second Edition)", 1993, Chrystobel Engineering, ISBN 0 646 10522 1

These books have been designed with a view to bringing together all the major elements in modern industrial mechatronic equipment, including robotics, CNC and Flexible Manufacturing Systems (FMSs). If you are a mechanical or manufacturing engineer, then this is probably the first of the books that you should read.

All the books in the series feature a similar format, in the sense that they have modular chapters which can be read in isolation from other chapters in the same book. All books in the series have overlapping sections, to enable modules to be covered in their entirety and to allow readers to migrate from one text to another with reinforcement of critical issues at appropriate points.

The writing style of all books in the series is such that each chapter begins in a qualitative form and then introduces equations and technical detail only after the broad concepts have been described. For this reason, you should find "Computer Architecture and Interfacing to Mechatronic Systems" to be a very readable text. Each chapter begins with a summary and a diagram of the overall interfacing process that this text has set out to address. The parts of the interfacing diagram that are most relevant to the chapter are shown in bold text and heavy lines, while the remainder are shown in normal text and dotted lines. The diagram should assist you in understanding where each chapter fits in to the global issues of this text book.

This particular book has been written in a chapter (module) sequence that is felt to be the most suitable for learning the concepts to which the title alludes. You may feel that the contents of a particular chapter are already familiar to you and hence you may choose to omit that chapter. However, be judicious in omitting chapters - the time spent reading an additional chapter will more than be recovered if it assists you in understanding the concepts of a following chapter by refreshing your memory on subject areas that you may have forgotten (or misunderstood at undergraduate level).

(xx)

1

1

Chapter 1

An Overview of the Computer Interfacing Process

A Summary

A qualitative description and overview of the entire computer interfacing process (shown below). The analog and digital computing domains and the basis of digital circuit design. Steps in computer interfacing including hardware design phases and software issues.

Digital Voltages

Digital Voltages Analog Voltages Analog Energy Forms External Voltage Supply Digital to Scaling or Energy Analog

Analog Voltages

Analog Energy Forms

Digital Voltages Analog Voltages Analog Energy Forms External Voltage Supply Digital to Scaling or Energy Analog

External Voltage Supply

Digital to Scaling or Energy Analog Isolation Amplification Conversion Conversion
Digital to
Scaling or
Energy
Analog
Isolation
Amplification
Conversion
Conversion

Computer

External

System

Analog to Digital Protection Scaling or Energy Isolation Conversion Circuits Amplification Conversion
Analog
to Digital
Protection
Scaling or
Energy
Isolation
Conversion
Circuits
Amplification
Conversion

External Voltage Supply

2

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

1.1 General Issues - Analog and Digital Computation

It is difficult to know whether the modern digital computer, and its Von Neumann architecture, were ever intended to interface to the real world. A computer is, by definition, a "reckoning machine" and certainly its original designers went to great lengths to make it into a device that could carry out repetitive computations and provide a limited amount of human reasoning. The analog computer, on the other hand, has always been closely associated with the control of physical systems, but has never been able to provide the reckoning ability that we associate with the digital computer. Analog computers no longer play any significant role in modern engineering, and so, this book is predominantly about digital computers and the problems that we face in connecting them to engineering systems.

It is interesting to note that when we use digital computers as islands of intelligence (that is, on their own), we find that their capabilities are only restricted by our own reasoning ability (that is, our ability to generate software) and by the speed at which computers can carry out the reasoning that we have instilled via our software. However, when we wish to interface computers to the real world (so that they can use their programmed reasoning to control a physical system) we find that our reasoning needs to be supplemented with an understanding of electronics, physics and engineering design principles before we can generate sensible solutions.

It is altogether likely that any computer programmer, with no knowledge of computer architecture or electronics, could create a working computer control system. Certainly, there are a sufficient number of commercially available, "black-box" solutions to assist in interfacing computers to external systems. The problem with using such solutions, without a proper understanding of the design principles behind them, is that sooner or later the seemingly minor problems that arise (system instability, unwanted spurious signals, irregular behaviour, etc.) become insoluble. This book has not been written with the intention of by-passing the ready-made solution, but rather, with the intention of helping you to understand the basis of these solutions and the problems that arise when using them.

The first issue that really needs to be addressed is that of the digital and analog computing domains. In all our "Newtonian" time-frames, the world is essentially analog in nature. Physical quantities do not change from one energy level to another in zero time - there is normally a continuous transition from one state to another, rather than a quantum variation. One may well ask why, if the world is essentially analog, have we chosen to discard the concept of analog computing and replace it with digital (quantum) computing. There are many reasons why analog computers were discontinued in the 1970s. These include:

An Overview of the Computer Interfacing Process

3

Accuracy

Size

Power consumption

Cost.

Underlying all the problems in analog computing is the issue of representing quantities accurately. Consider an analog computer that is required to take in two numbers (between zero and ten) and add them together to achieve a given result. How is this achieved? We could represent each of the inputs and outputs with a voltage and use a circuit to electrically add the inputs to provide the required output. This is shown in Figure 1.1.

Input A [0, 10] Analog Output Computer [0, 20] Input B (Addition Circuit) [0, 10]
Input A
[0, 10]
Analog
Output
Computer
[0, 20]
Input B
(Addition Circuit)
[0, 10]

Figure 1.1 - Simple Analog Computation - Addition

From Figure 1.1, we would assume that if Input A is equal to 5 volts and Input B is equal to 2 volts, then the output would be equal to 7 volts. What happens however, if:

Input A = 5.001322447 volts

Input B = 1.999933821 volts ?

The answer to this question really depends upon how accurately we can design and fabricate our analog addition circuit. In engineering, we know that accuracy in setting or measuring energy levels normally equates to higher complexity and higher cost. This is certainly true in electronic circuits.

The alternative to generating accurate (expensive) circuits is digital computing, where we only allow electronic hardware to represent the binary numbers zero and one. Digital circuits allow us to carry out both arithmetic and a limited amount of human reasoning (tautology). The reasoning component is achieved by using zero to represent "false" or "off" and one to represent "true" or "on". The basis of digital circuits, and hence digital computing, is that voltage accuracy must not be permitted to dominate circuit design. As long as we can achieve voltages within certain ranges, then we can represent the only two numbers that we need to handle in digital computing.

4

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

The major design effort in the fabrication of digital semiconductor devices is therefore oriented towards achieving:

High circuit speeds

Small component sizes / High Component Density

Low power dissipation

Low circuit fabrication costs.

Figure 1.2 (a) shows two, cascaded digital circuits, each with two inputs and one output. Figure 1.2 (b) shows the allowable output and input voltage ranges for each of the circuits. An error margin exists between the output of one circuit and the input of the subsequent circuit, so that minor voltage variations that may occur do not affect the meaning of the information represented.

Input A Output Input A Output Digital Circuit 1 Digital Circuit 2 Input B Input
Input A
Output
Input A
Output
Digital Circuit 1
Digital Circuit 2
Input B
Input B
(a)

5.0

v

2.4

v

2.0

v

0.8

v

0.4

v

Voltage

True / 1 / ON True / 1 / ON Error Margin False / 0
True / 1 / ON
True / 1 / ON
Error Margin
False / 0 / OFF
False / 0 / OFF

Circuit Ouputs

Circuit Inputs

(b)

Figure 1.2 - (a) Cascaded Digital Circuits (b) Allowable Input and Output Voltage Ranges for Transistor to Transistor Logic (TTL) Digital Circuits

An Overview of the Computer Interfacing Process

5

The actual digital voltage ranges shown in Figure 1.2 (b) correspond to a family of digital circuits known as Transistor to Transistor Logic or TTL. This is the oldest of the widely used digital circuit technologies (dating back to the 1960s) and is important because most modern digital circuits are still designed with the same allowable input and output voltage ranges.

One of the major objectives of this book is to help you to come to terms with the design of modern digital computer systems, so that you can understand why it is so difficult to interface them to the outside world. The strategy chosen in order to achieve this is to begin with an overview of the role of computers in the industrial arena, so that you may gain some insight into the range of performance attributes required by modern computers. The next stage in the process is to introduce (or rekindle) the basics of modern electronic circuits, including transistors, thyristors and so on. This serves two purposes. Firstly, it will help you to understand how both analog and digital circuits are designed and the limitations of those circuits. Secondly, it will introduce you to the basic elements used in interfacing computers to the outside world.

As we progress through this text, we will examine how digital circuits are designed and how they are joined together to carry out binary arithmetic and limited "human" logic functions. Once we understand these concepts, we will move on to the development of digital storage devices (memory) and the digital state machine concept - the heart of modern microprocessor technology. We will then see how all the basic elements are brought together via an address and data bus structure to create what we now understand to be the modern digital computer.

This text book does not concern itself with the specifics of any one computer system or computer architecture. There are a number of reasons for this. Firstly, there are so many different microprocessor and computer system architectures that any reasonable treatment of their architecture would make this book unwieldy and out of date (by the time the information was compiled). Secondly, there are so many technical side-issues involved in the design of a commercial computer system that they tend to cloud the reader's understanding of the more important basic issues. Despite many manufacturers' claims to the contrary, this author believes that most modern computer systems are still only variations on a central theme. It is that theme which we shall explore in this book. You should then have enough knowledge to move on to the task of examining and understanding the specifics of a particular architecture in your own right. The same principle applies in terms of the treatment of microprocessors and Digital Signal Processors (DSPs) - they are both lumped together under the generic term of microprocessor. The assumption is that the DSP is a specialised form of microprocessor that has been optimised for low level control functions. Although most DSPs have, what is referred to as a "Harvard" architecture (rather than Von Neumann), in this book they are simply treated as a variations upon the central, Von Neumann theme.

6

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

1.2 Interfacing Computers Via Hardware

When we talk of interfacing computers to external systems, we are generally endeavouring to create closed control loops that enable a digital computer to generate (compute) some desired driving force, based upon the feedback obtained from the outside system. Sometimes, of course, we don't need a closed loop. This is particularly true if we only use a computer based device as a data logging or monitoring system, or if we use the computer to drive a system independently of the feedback (ie: as an open loop controller). However, regardless of the application, the same sorts of issues need to be addressed as a result of the incompatibilities between the "Newtonian-analog outside world" and the "digital computing world". The issues are shown schematically in Figure 1.3, together with the book chapters (shown in braces { }) that address them. You will see this diagram in various forms throughout this text, particularly on the front page of each chapter, where it will be used to remind you of the topics covered within that chapter. The topics most closely related to that chapter will be shown in bold lines and bold text, while the remainder will be shown in dotted lines and plain text.

Digital Voltages

Digital Voltages Analog Voltages Analog Energy Forms External Voltage Supply { 7 } { 3,7 }

Analog Voltages

Analog Energy Forms

Digital Voltages Analog Voltages Analog Energy Forms External Voltage Supply { 7 } { 3,7 }

External Voltage Supply

{ 7 } { 3,7 } { 3,7 } { 2,9 } Energy Digital to
{ 7 }
{ 3,7 }
{ 3,7 }
{ 2,9 }
Energy
Digital to
Scaling or
Isolation
Conversion
Analog
Amplification
(Actuators)
Conversion

Computer

{ 2,3,4,5,6,7,8 }

External

System

{ 2,9 }

Analog Energy to Digital Conversion Isolation Conversion Protection Circuits Scaling or Amplification
Analog
Energy
to Digital
Conversion
Isolation
Conversion
Protection
Circuits
Scaling or
Amplification
(Transducers)
{ 7 }
{ 3,7 }
{ 3,7 }
{ 3,7 }
{ 3,7 }

External Voltage Supply

Figure 1.3 - Interfacing Digital Computers to External Systems

When observing Figure 1.3, the most important point to understand is that modern computers will only respond to incoming digital voltage signals and will only generate outgoing digital voltage signals. The levels of these digital voltages are normally in the order of those shown for TTL circuits (in Figure 1.2 (b)), although the actual levels depend upon the specific architecture of the digital circuits within the computer.

An Overview of the Computer Interfacing Process

7

Modern computers do not respond to energy represented in any form other than voltage - generally, not even current. However, Figure 1.3 shows the generalised "outside world" as an external system which is propelled by continuous (analog) energy sources (mechanical, electrical, thermal, etc.) and feeds back analog signals that represent some form of energy (eg: temperature, voltage, current, pressure, stress, strain, position, velocity, acceleration, etc.) which is, in general, not a voltage. The closed loop of Figure 1.3 clearly represents some problems in terms of interfacing the small digital voltage signal world of the computer to the analog energy world outside. Signals fed back from the external system to the computer need to be:

(i)

Converted from their original form to voltage

(ii)

The raw voltage levels may need to be isolated from the external system

(iii)

The raw voltage levels need to be scaled to a level compatible with the needs of computer circuits

(iv)

In the event that the scaled voltages may suffer from unwanted spikes (as a result of spikes in the energy levels received from the outside world), protection circuits need to be considered to prevent high signals from damaging the computer

(v)

The scaled voltages need to be converted into a digital form.

The other major problem with connecting digital computers to the outside world is that the circuits within the computer are not only low in energy consumption, but also incapable of providing a large amount of energy. We know that signals within the computer are represented by digital voltages, somewhere in the order of those shown for TTL circuits in Figure 1.2 (b). However, we also need to appreciate that the major limitation of those circuits within a computer is that they are unable to provide large amounts of current. Typically, a digital circuit can provide less than a milli-Amp of current. This means that digital circuits can only provide a few milli-Watts of power. The actual amount depends upon the type of digital circuit but, in any event, is generally much less than the energy normally required to drive many external systems.

Consider the case where a computer is required to control a power station. The external system is a generator driven by a rotating turbine. The signals fed back to the computer may include items such as turbine speed, output voltages, etc. Based upon these signals, the computer needs to provide a controlled driving force that will cause the turbine to rotate at a given speed - clearly the computer is not going to supply the Mega-Watts of mechanical power that are required to rotate the turbine. Rather, the "driving force" produced by the computer is a very low level electrical signal that is used to drive actuators, valves, etc. that control the flow of steam or water to the generator turbine. The problem is then how to convert the computer's controlling signals into some form of energy that can ultimately drive the external system.

8

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

Assuming then, that the computer circuits are unable to provide the required driving energy for an external system, there are a number of interfacing steps that may need to be carried out in order to achieve the required outcome. These include:

(i)

Conversion of the computer's internal digital voltages to analog form

(ii)

Amplification of the analog voltages to higher energy levels

(iii)

Isolation of the computer circuits from the external system

(iv)

Conversion from the analog voltage form to the required final energy (mechanical energy, thermal energy, etc.).

Chapter 3 of this text actually has two objectives. The first is to introduce you to the basic electronic elements so that you can understand how these are used in order to create modern digital computers. The second objective of the chapter is to introduce you to the basic electronic elements used in the computer interfacing process. One of the key elements in all digital and analog circuits is the transistor. Chapter 3 shows how the transistor can be used to create basic digital circuit elements and also how it can be used as an analog amplifier. In both cases, the transistor is shown to be a device whose function is to control the flow of energy from a fixed, external electrical energy supply in such a way that the outputs of transistor circuits are related to the inputs by some predefined characteristic. This concept is fundamental to both computing and interfacing.

Following an examination of the basic elements of modern computer architecture, in Chapters 4, 5 and 6, Chapter 7 continues the hardware interfacing theme by examining the basic elements of closed-loop control systems. As you may gather from Figure 1.3, Chapters 3 and 7 are closely tied together. Chapter 9 completes the study of interfacing hardware by examining one of the classic mechatronic systems and bench- mark control problems - the servo motor. The purpose of this chapter is to bring together, in hardware and software, the sort of elements that have been introduced during the course of this book. Electromagnetic actuators (motor drives) have been singled out from other mechatronic devices for special attention in this text. This is because of their enormous importance in modern industrial systems, most notably robots, CNC machines, transfer lines and flexible manufacturing systems (FMSs). As a result of their widespread application, inherent complexity and the fact that they embody the concepts of mechatronics and interfacing as a whole, they have been allocated an entire chapter.

One major issue that isn't dealt with in this book is the hardware interfacing of computers via networks. This is an important subject in its own right and has therefore been dealt with in the complementary text book, "Data Communications and Networking for Manufacturing Industries".

An Overview of the Computer Interfacing Process

9

1.3 Interfacing Computers Via Software

The problems associated with interfacing computers to external systems are often accentuated when the software development phase commences. It is then that the designer realises the limitations of the hardware and has to make the decision of whether to continue on the existing course or perhaps revise the original hardware design altogether.

In most applications where computers are interfaced to external systems (particularly mechatronic systems), the critical issue is whether incoming signals can be processed quickly enough and, in a closed loop, whether outputs can be generated quickly enough, to ensure the stable operation of the combined system. The most efficiently coded software cannot overcome inadequacies of the processing and interfacing hardware, but poorly written software can certainly exacerbate hardware problems. The objective therefore, in most time-critical applications, is to develop software that can carry out a given task within a specified time. This is referred to as real-time software development and has an added dimension of difficulty that isn't found in many other software development tasks - that is, the computational time factor.

There are a number of features which are common to most pieces of software related to computer interfacing. These include:

(i)

Time-critical input/output routines that read incoming data from interfacing hardware and write outgoing data to interfacing hardware

(ii)

Control routines that process incoming data through some set of algorithmic or decision making criteria in order to generate an output response

(iii)

User input/output routines that enable a system user to interact with the computer and, thereby, the external system to which it is interfaced.

These elements are shown schematically in Figure 1.4, which needs to be studied for a few moments in order to understand the interaction between the various components. Of particular significance is the so-called "operating system" of the computer control system, which is a piece of software that acts as a "shell" in which all the other software elements execute. In the majority of applications, the operating system will be a commercially produced piece of software. However in low level environments, such as application-specific microprocessor controls, the system designer may write a very limited form of operating system to achieve a given task.

10

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

An operating system is not only a shell in which software can execute but it is more importantly a manager that controls each program's access to resources such as disk-drives, screens, memory locations, etc. We will examine the important role of the operating system in some detail in Chapter 8, before we move on to other issues of software development and software selection.

Computer / Microprocessor Controller Driving Operating System Force Output Routines External System User Input
Computer / Microprocessor Controller
Driving
Operating System
Force
Output
Routines
External System
User
Input &
Control
Output
Algorithm
Input
Routines
Feedback
Keyboard
Screen

Figure 1.4 - The Computer Interfacing Software Development Process

Attempting to provide the specifics of how pieces of software, such as input/output routines, etc. should be written is akin to telling people how long to cut a piece of string - it all depends upon the specific application. More importantly, the software development strategy depends upon the specifics of the functions provided by the operating system itself.

The basic software routines illustrated in Figure 1.4, although common, are not universal to all applications. For example, the user input/output routines sometimes don't exist on a very low level microprocessor control system whose only purpose is to carry out some predefined task whenever activated. Output routines are not required in data logging applications and inputs are not required in open-loop control systems. However, in as much as both these tasks are common to most mechatronic control systems, they will be reviewed together in Chapter 8.

An Overview of the Computer Interfacing Process

11

Given that there are a wide range of applications in computer interfacing, the issue arises of how we can tackle the subject of software development within the confines of a single book or chapter. The answer is that we clearly cannot cover all the issues involved in software development. More importantly, it must be remembered that this book has not been written with the intention of superseding the countless, existing text books on programming languages and packages. In this book, our objective is to examine the process of selecting development platforms and packages to achieve a set of criteria.

Some years ago, one might have argued that the selection of software development platforms was a trivial task - simply use low-level assembly language for time-critical tasks and high level languages (such as C or Pascal) for user input/output and common control algorithm development. However, this decision is no longer clear cut as a result of the introduction of "windows" type operating system environments and so-called "software development engines" (such as spread-sheets, databases, etc.). These are over and above the novel, 1980s attempts at computer programming, including neural networks, expert systems, etc. As we go through Chapter 8, we shall examine the task of software development with these new tools in mind, so that we can establish a decision making process for the selection and design of software.

At the end of Chapter 9, we will see how hardware and software can be brought together in the design of the traditional servo motor control, implemented via both analog and digital techniques.

12

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

13

13

Chapter 2

Computers and Control - Mechatronic Systems

A Summary

An overview and history of industrial computer control systems. General-purpose computer systems adapted for process and system control. Specialised computer control systems (micro-controllers, Computer Numerical Controllers (CNC) and robot controllers). Industrial computer interfaces for process control - the Programmable Logic Controller. Mechatronic elements and systems - servo motors, transfer lines, FMS, etc.

Digital Voltages

Digital Voltages Computer Analog Voltages Analog Energy Forms External Voltage Supply Digital to Energy Scaling or

Computer

Analog Voltages

Analog Energy Forms

Digital Voltages Computer Analog Voltages Analog Energy Forms External Voltage Supply Digital to Energy Scaling or

External Voltage Supply

Digital to Energy Scaling or Analog Isolation Conversion Amplification Conversion (Actuators)
Digital to
Energy
Scaling or
Analog
Isolation
Conversion
Amplification
Conversion
(Actuators)

Energy

Conversion

(Transducers)

External

System

Energy Conversion (Transducers) External System Analog to Digital Protection Scaling or Isolation
Analog to Digital Protection Scaling or Isolation Conversion Circuits Amplification
Analog
to Digital
Protection
Scaling or
Isolation
Conversion
Circuits
Amplification
System Analog to Digital Protection Scaling or Isolation Conversion Circuits Amplification External Voltage Supply

External Voltage Supply

14

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

2.1 A Review of Developments in Digital Computer Control

Digital computer control is a relatively recent phenomenon. It began to proliferate in the 1970s as a result of the increased computational capacity of digital computers and the increased availability (and "affordability") of integrated digital circuits. However, early developers in digital computer controls faced a difficult task because the external systems requiring control were predominantly analog in nature. Ironically, now that we have an enormous supply of devices to simplify the process of interfacing to analog systems, we increasingly find that the "systems" themselves are becoming more digital in nature as a result of the increasing intelligence of constituent components.

Unfortunately for early system designers, the cost of control computers was relatively high and so, as a result, only the most expensive and complex processes were generally considered for computerisation. The cost of applying computers to simple control systems was prohibitive and so designers had to add to their professional skills by first tackling the worst possible problems, with few experts to turn to for advice. Typical applications included:

Power station control systems

Chemical plant and refinery controllers

Metal smelting plant controllers

Large-scale food processing control systems.

All of these types of computer applications can be classified under the umbrella of "real-time control" and all suffer from similar problems. The problems include:

(i)

The need to extract information from hundreds of sensors and energy transducers

(ii)

The need to process incoming information in "real-time" (ie: before the next change of information occurs)

(iii)

The need to output signals to hundreds of sensors and transducers.

Very few real-time control problems had been tackled by computer manufacturers up until the 1970s. Most manufacturers had been busy enough just developing computers to handle the growing number of data processing tasks that had arisen during the 1960s. However, the requirements of real-time control were quite different and, given the limitations of the technologies available in the 1970s, designers did an outstanding job in creating relatively reliable end systems.

Typical computer control systems in the 1970s had an architecture of the form shown in Figure 2.1. This is commonly referred to as a "hierarchical" control architecture. It is composed of an intelligent control device (computer), referred to as the host, and a number of unintelligent slave devices (sensors, transducers, actuators, amplifiers, etc.) that together make up a functioning system.

Computers and Control - Mechatronic Systems

15

Control Computer (Host) Input/Output Interfacing Boards Computer Outputs to System Sensor 1 Transducer 1 Relay
Control Computer
(Host)
Input/Output
Interfacing Boards
Computer Outputs to System
Sensor 1
Transducer 1
Relay 1
Amplifier 1
Solenoid 1
Sensor N
Transducer N
Relay N
Amplifier N
Solenoid N

Feedback Signals from System

Figure 2.1 - Hierarchical Computer Control Architecture

The hierarchical control architecture came about as a result of necessity rather than outright design acumen. Computer processing was a relatively expensive commodity in the 1970s and as a result it was most uncommon (and expensive) to consider the use of more than one computer for a control problem. For this reason, the host computer had to carry out all the functions associated with real-time control, including:

Input/output (normally abbreviated to I/O)

Control algorithm execution

Interaction with the system supervisors (users)

Display of current status on screens and mimic panels.

This level of functionality was a radical departure from the traditional concept of computing that had developed in the late 1950s and throughout the 1960s. Computers had to become devices that could execute programs within a given time-frame and interact with the outside world to an extent that had previously been difficult to imagine.

16

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

There were a number of important issues to be overcome before a transition could

be made from the data-processing role of the computer to a real-time control scenario.

Firstly, specialised input/output (I/O) boards and circuits had to be devised in order to enable the computer to interact with the wide range of analog signals that emanated from external systems and to enable the computer to drive high level analog outputs. Secondly, the most fundamental piece of software within a computer system, the operating system, had to change its functionality. The operating system still had to remain as a resource manager and a scheduler and an interface between the computer hardware and software. The big change was that it now had to perform these functions

in such a way that programs could execute quickly enough to process incoming signals

before the status of those signals altered (otherwise data would be lost). This was the critical, "real-time" issue.

In the 1950s and 1960s, operating systems were really designed so that large computer systems (main-frames) could process office data, entered on punch-cards

(known as Holorith cards), as efficiently as possible. The basic principle was that it didn't really matter which data the computer processed first as long as, over a given time-period (eg: one day), the total amount of information processed was maximised.

A small amount of task prioritisation was allowed, but in general, operating systems

tended to treat all data in terms of "files". In strict terms, a file was a quantum of data stored on either magnetic disk or ferrite-core memory. However, the changing nature

of data input and output (from punch-cards and print-outs through to video terminals

and serial communications links) could not readily be accommodated in terms of the

older operating systems. The operating systems were therefore modified to consider newer forms of data as though they were files (even though they were physically something else).

Although the concept sounds rather convoluted, treating all inputs and outputs as though they were files on a disk worked satisfactorily in the office but it became unwieldy for control purposes. If inputs and outputs related to an external system under control were treated as though they were files, then they were subject to the same level of prioritisation as files. In simple terms this meant that the operating systems associated with office computing could not deliver the time responses required for real- time control. In other words, it could take the older computers longer to process data from external systems than it may take for the data to change - information could be lost.

One of the first organisations to recognise the limitations of the older style computer architectures and operating systems was the Digital Equipment Corporation (DEC). Their response was to develop a range of computers that are still revered today for their innovative hardware and software. The computer range was given the title prefix PDP-11 and was really the first computer series that engineers would claim for themselves.

Computers and Control - Mechatronic Systems

17

Several factors made the DEC PDP-11 series revolutionary in its time (and led to its survival for some 20 years). The first was an innovative hardware design that simplified the control system development task for engineers through an enormous range of powerful instructions. The second advantage of the PDP-11 was that the company began to produce a range of products that enabled the computer to interact with the outside world, at a time when other manufacturers were still producing computers that worked in isolation. The third major advantage of the PDP-11 was its new operating system, specifically designed for real-time control applications. The operating system was given the acronym RSX-11 and also endured for some 20 years.

The DEC PDP-11 series of computers became a bench-mark for digital control systems and were widely used in the complex types of applications cited earlier. Indeed, even in the 1980s (when computer processing costs had diminished), system designers still worked with the sort of hierarchical control architecture made popular (and feasible) by DEC. However, by the mid-1980s, the cost of microprocessor chips and microprocessor-based devices (including personal computers) had plummeted and a new trend in both computing and control emerged.

Mid-range computers such as the DEC PDP-11 became relatively expensive in comparison to microprocessor based computers and controllers and so, a new industry arose, focused on the task of minimising the use of mid-range computers and maximising the use of low-range (single microprocessor) based devices. This was greatly assisted by the proliferation of intelligent (microprocessor controlled) devices in the early 1980s. The net effect was to make possible a different form of control architecture, which we now refer to as "distributed control". The concept of distributed control is shown schematically in Figure 2.2.

Host Computer (Event Scheduler) Data Communications Links Local Local Local Processor 1 Processor 2 Processor
Host Computer
(Event Scheduler)
Data
Communications
Links
Local
Local
Local
Processor 1
Processor 2
Processor N
Inputs / Outputs
to local system 1
Inputs / Outputs
to local system 2
Inputs / Outputs
to local system N

Figure 2.2 - Distributed Computer Control Architecture

18

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

The basic principle of distributed control is that a complex control system is divided up into a number of components and each component is controlled by a local computer (which may be microprocessor or Digital Signal Processor (DSP) based). The role of the host computer is then only to coordinate (schedule) the activities of each of the local (slave) processors and to interact with the system users. The host computer and local processors are normally connected to one another via data communications links or a network, both of which unfortunately create a new range of design problems that have to be resolved. However, if the communications issue can be resolved then the distributed control architecture has a great deal of potential.

The idea of distributed control is to make each local control unit modular and simple so that the overall control system becomes more robust than one large and complex system. This means that the host system can be a much smaller computer than would be required for a hierarchical control system. The collective cost of the smaller host computer and the local processors can be comparable, or lower, than the cost of one large computer. Moreover, when a local processor fails, it is often much more cost effective to replace it entirely than it is to repair a mid-range or mainframe computer.

A typical area of control that is commonly allocated to some form of local processor is the collection and processing of signals from external systems. If the local processor is designed to gather and process signals and it is not loaded down with other tasks, then it may result in a total system that can perform time-critical functions more efficiently than a large computer carrying out many tasks.

There is some ambiguity amongst different text books on the subject of "hierarchical" and "distributed" control, largely because the definitions are rather subjective. In this book, we will simply define a distributed control system as being one in which the total control structure is divided up amongst a number of computers or processors. One could also argue that the structure shown in Figure 2.2 is both hierarchical and distributed since there is a host computer (ie: higher level computer) that controls the local processors.

The distributed control architecture concept can be further extended to the point where there is no longer a need for a host computer. In other words, a system is controlled by a collection of computers (processors) that all work together in order to achieve some particular objective. This is referred to as a "heterarchical" control structure and is shown schematically in Figure 2.3. This is a departure from the other two computer control architectures in the sense that there is no coordinating device in the control system. The structure is sometimes referred to as a "functionally decomposed" control architecture, since all control functions have been devolved down to local devices. The heterarchical control system looks interesting and has a number of characteristics in common with the way in which the human brain operates - that is, as a collection of equally intelligent nodes operating together for some common purpose.

Computers and Control - Mechatronic Systems

19

Data Communications Network (Local Area Network) Local Local Local Processor 1 Processor 2 Processor N
Data Communications Network (Local Area Network)
Local
Local
Local
Processor 1
Processor 2
Processor N
Inputs / Outputs
to local system 1
Inputs / Outputs
to local system 2
Inputs / Outputs
to local system N

Figure 2.3 - Heterarchical Control Architecture

The problem with the heterarchical control architecture is that it makes the development of control software rather difficult because no single node has a coordinating role. This really requires a new way of thinking and many modern system designers are graduates of the hierarchical control school and have difficulty in translating their existing techniques to heterarchical control. Over and above the problems related to the development of control systems in heterarchical structures, there is the issue of networking. Networking has always been one of the irritating bottlenecks in the development of digital computers and computer control systems. Since the need for networking emerged in the 1970s, the progress towards standardisation has been painfully slow. In the case of heterarchical control systems, the networks form the backbone for communications between devices and are critical to the success or failure of the system. However, the speed of communications between devices across a network has always been a limiting factor in the use of heterarchical control.

The heterarchical control architecture is making some progress as the performance of computer networks improves and system designers begin to change their ways of thinking about control problems. However, all three forms of control architecture are currently in use and all have advantages and limitations that need to be considered. It is to be hoped that once you have completed reading this book, you will have a much greater understanding of the issues that are involved in selecting a digital computer control architecture for a mechatronic control system.

The remainder of this chapter is devoted to exploring a number of different computer devices that are available in common mechatronic systems and the way in which they are used in those systems.

20

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

2.2 Programmable Logic Controllers

The Programmable Logic Controller, more commonly known as a PLC, is an unusual device in many ways. The modern PLC is an industrial control computer in every sense but its predecessors were really only designed to be low-level digital replacements for the electromechanical control systems found on industrial equipment during the 1940s, 1950s and 1960s. As a result of this rather unusual heritage, the PLC has been developed in a rather peculiar way relative to other computer systems.

The first point to note about the PLC's heritage is that it was originally developed as a "tradesman's tool" rather than the "professional's tool" that the traditional office computer was designed to be. For this reason, a great deal of emphasis in early PLC design was to create a programming language that was best understood by industrial electricians rather than professional programmers. This language became known as "relay-ladder-logic" and can still be found today on older equipment. The second point to note about the PLC is that it was always designed as a computerised device with extensive input and output facilities that were very rare in traditional office computers.

PLCs are now amongst the most prolific of all modern industrial control systems. They are used for a wide range of applications and are very diverse in their capabilities. A PLC is shown schematically at its simplest level in Figure 2.4.

Voltage

Voltage

Inputs

Current

Microprocessor Power Power and Transistor Transistor Digital Front-End Back-End Control Circuitry
Microprocessor
Power
Power
and
Transistor
Transistor
Digital
Front-End
Back-End
Control
Circuitry

Outputs

Current

Inputs

Outputs

Figure 2.4 - Schematics of a Programmable Logic Controller

Computers and Control - Mechatronic Systems

21

PLCs use power-transistor technology, in combination with microprocessors and digital circuitry, in order to produce a specialised computer system for high power switching and control. The power transistor front and back ends, are used to buffer the low-voltage microprocessor computer circuitry from high power industrial inputs and outputs. PLCs therefore provide the ideal combination of a small computer system together with interfacing to the industrial environment.

We earlier noted that PLCs were introduced to replace the electromechanical relay-ladder logic systems used to implement industrial controls. A typical function could be as follows:

"If Input A is high and Input B is greater than 50 volts, then delay 10 seconds and then set Output C to High."

The starting point in PLC design was to give the devices the ability to perform such functions with minimum programming effort. Moreover, to enable the industrial electricians who once created relay ladders to program the newer technology PLCs. The inherent ability of PLCs to perform such functions makes them ideal for sequential control functions where (say) a number of hydraulic and pneumatic actuators and sensors have to be governed. For example, the opening and closing of safety doors or the switching of fluid pumps in a production system.

Modern PLCs are relatively inexpensive items, which are industrially rugged in design and extremely modular in structure. It is commonplace to buy a Central Processing Unit PLC, together with any number of bus-connected Input/Output (I/O) modules. This allows both simple and complex machines to be based upon the same, basic PLC unit. An Original Equipment Manufacturer (OEM) may choose to design a machine using a basic PLC system (with say 10 to 20 inputs and outputs) and then purchase expansion I/O modules as customer, design requirements change.

Programming languages for Programmable Logic Controllers are as diverse as the controllers themselves. Early PLCs were only programmable in "ladder-logic diagrams" that were a pictorial representation of Boolean circuits coupled with delay and timer elements. However, as people grew to realise the enormous range of design applications for these programmable devices, it became less and less attractive to use the now dated, ladder-logic, diagrams.

Many modern PLCs are sold with specialised implementations of the BASIC programming language as a built-in feature. This allows a much more sensible and structured approach to system design to be used. It has also been a logical step, since the proliferation of Personal Computers meant that more and more technical people were comfortable with the concept of programming in a language, rather than using diagrams. In recent years, PLCs have now become available with specialised "C" or "PASCAL" compilers, that allow complex program development for control applications.

22

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

Despite the availability of high-level languages on PLCs, they still remain very much a "tradesman's tool". PLCs are generally weak in terms of their ability to carry out complex computations and control algorithms. The real strength of the PLC is in its ability to interact with high voltage and current inputs and outputs. Moreover, since PLCs are designed in a modular (building-block) manner, an enormous range of energy conversion transducers can be used to turn PLC outputs into useful drivers for mechatronic equipment. For example, PLCs can readily be connected to a range of solenoids and pneumatic actuators to convert a voltage output into a mechanical movement.

The functionality of the PLC makes it ideal for controlling sequential "event- oriented" systems such as conveyors, dedicated transfer machining lines and so on. However, the ability of the modern PLC to communicate with higher level computer systems through a data communications link or network has made it into a useful processing device for distributed control. Figure 2.5 illustrates a commonly used distributed control system (similar to that shown in Figure 2.2) in which the PLCs are responsible for interacting with the outside world while the host computer system carries out some complex control algorithm.

Host Computer (Control Algorithm) Data Communications Links or Network PLC 1 PLC 2 PLC 3
Host Computer
(Control Algorithm)
Data
Communications
Links or Network
PLC 1
PLC 2
PLC 3
Inputs / Outputs
to local system 1
Inputs / Outputs
to local system 2
Inputs / Outputs
to local system N

Figure 2.5 - Distributed Control Using PLCs

The distributed system of Figure 2.5 enables the PLCs to input information from hundreds of external sources, carry out minor processing on that information and then feed it as control input data to the host computer. Once the host computer has calculated the next set of required outputs (as determined by the control algorithm) it sends the information to the PLCs via the communications links or network. The PLCs are then responsible for creating the high current or voltage output.

Computers and Control - Mechatronic Systems

23

The problem with the sort of architecture shown in Figure 2.5 is that the commonly used data communications links and networks are relatively slow. If, for example, the system shown therein was used for some form of continuous process control (such as in a power station or chemical plant) then the communications link between the PLC and the host computer could form an unacceptable bottle-neck in terms of data flow. For this reason, a number of PLC manufacturers are now developing devices that have a much closer coupling to the host computer system so that the external communications link can be avoided. This form of design involves connecting the PLC directly into the internal architecture of the host computer system and is referred to as a "back-plane" connection.

The range of PLCs currently on the market is quite extensive and can include small devices costing less than a personal computer up to large systems costing more than most mid-range computer systems. Simple PLCs have an appearance similar to a programmable pocket calculator - however, the PLC is equipped with a number of high-voltage, high-current input/output terminals which are used for interaction with the outside world. These systems are useful for simple sequential control.

Sophisticated PLCs can resemble computer workstations in both appearance and functionality. Most of the high-end PLCs are capable of executing multiple programs simultaneously, and interacting with the user through graphical software interfaces. These systems normally represent the "break-even" point in control systems design. A control system designer would sometimes need to decide whether to use one of these costly PLCs to carry out a complete control system or whether it would be more cost effective to use a traditional computer and a lower cost PLC system.

The criteria typically used to select a PLC for a particular application include the following:

PLC Programming Language

Number of Inputs and Outputs (I/O capability)

Ability to interact with the user and/or display graphical system information

Expansion Capability

Processor Execution Speed

Modularity of Design

Ruggedness of Design

Capacity for Integration with other systems through:

Serial Communication

Back-plane (Bus) Communication

Local Area Network Communication.

Overriding the technical factors are the always considerable political factors, which cause a company to choose a PLC vendor based upon conformance with other systems already installed in a plant. This reduces the need for maintenance personnel to become familiar with a wide range of programming languages and implementation techniques.

24

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

2.3 Intelligent Indexers and Servo-Drive Systems

One of the most important issues in the development of mechatronic control systems for industrial applications is the ability to accurately move some mechanical element such as a cutting tool or end-effector from one position to another. This is essential to the development of precision devices such as robots, Computer Numerical Control (CNC) machine tools, indexing tables for laboratory equipment, etc.

There are many ways in which an element can be moved from one position to another. Older industrial systems traditionally used hydraulics and pneumatics to propel mechanical elements. For centuries, mechanical clocks have used springs for energy and gears to index the arms with a relatively high degree of accuracy. However, in modern industrial systems the most common approach is to use electromagnetic techniques - that is, electric motors whose rotational positions can be accurately controlled. Rotational movement is transformed into linear motion by driving simple "screw-feeds" or low-friction, low-backlash, recirculating ball-bearing, screw-feeds (ball-screw-feeds).

Those who are unfamiliar with the intricacies of electric motors will assume that the only function of a motor is to rotate continuously within a required velocity range. However, when we talk about the accurate positioning of a robot arm or CNC machine axis, we are really talking about motors that are designed to rotate a fraction of a revolution and then stop. The actual motors used for these applications are similar to the a.c. and d.c. motors that rotate continuously in other electrical machinery - the difference is in the way they are controlled.

There are essentially two types of motor control systems that can be used for accurate positioning of mechanical elements:

Stepper Motor or Indexer Control (Open loop control)

Servo Motor Control (Closed loop control).

The stepper motor system is based upon a special type of motor that rotates (indexes) by a fraction of a revolution each time a voltage pulse is applied to one of its windings. Unlike traditional motors, the stepper motor does not rotate smoothly but rather, steps from one position to another and hence its name. The overall stepper drive system is shown schematically in Figure 2.6. Stepper motors were originally used for small scale applications such as in printers, plotters, etc. However, they are now also used in industrial applications where the mechanical load on the motor is known (and stable). Although the control principles are similar, the industrial systems tend to be referred to as "indexers" in commercial literature.

Computers and Control - Mechatronic Systems

25

Electrical Energy Input

Voltages Representing Stepper Motor Drive Electrical Outputs Mechanical Stepper Motor Output
Voltages
Representing
Stepper Motor Drive
Electrical
Outputs
Mechanical
Stepper Motor
Output

Required Position

Figure 2.6 - Stepper Motor Arrangement

The nature of the actual stepper motor drive can vary considerably. For very small motors, the drive can be implemented on a single silicon chip. On large systems, the stepper motor drive has to include power electronics and cooling fins to dissipate heat and hence has to be implemented on a circuit board, with discrete transistors and digital circuits.

The fundamental limitation of stepper motors arises when they are used as shown in Figure 2.6 - that is, as "open-loop" devices. If the load on the motor shaft is larger than the torque generated by the electrical energy input to the motor windings, then the motor will not index from one position to another in a predictable manner. The absolute positioning characteristic of the motor is therefore lost. As a result, open-loop stepper motors are only used in situations where the load is always well defined - for example, in parts transfer (shuttle or indexing) systems where the maximum load on the motor can be calculated during the system design phase. A stepper motor, running in "open-loop" mode would be inappropriate for positioning a cutting tool, since the load caused by tool could vary substantially depending on the work-piece properties and amount of material being removed.

Some stepper motor controllers can function in a closed-loop, where the position of the motor shaft is fed back to the controller from a resolver or position encoder. However, once these devices are converted into closed-loop systems, then they lose their cost advantage over traditional servo drives that can provide a "smoother" rotation.

26

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

The servo motor system is the embodiment of classical control theory and operates in a closed loop that enables the controller to drive the motor according to its current velocity or position. The traditional servo motor system is shown in Figure 2.7. It is composed of:

An a.c. or d.c. motor

An analog resolver or digital encoder device that provides a voltage signal or signals corresponding to the orientation of the motor shaft

The servo drive controller itself

An electrical energy supply.

Electrical Energy Input Input voltage proportional to required position Servo Drive (Controller) Electrical
Electrical Energy
Input
Input voltage
proportional to
required position
Servo Drive
(Controller)
Electrical
Position
Energy
Feedback
Output
Encoder
Mechanical
or
a.c. or d.c Motor
Output
Resolver

Figure 2.7 - Schematic of Traditional Servo Drive System Arrangement

The servo drive is an electronic device that is used to provide a regulated flow of electrical energy from an external power supply to the motor, based upon the difference between a specified voltage signal (the set-point or reference position) and the feedback signal from the encoder or resolver on the motor shaft. This provides closed-position loop control of the shaft.

Computers and Control - Mechatronic Systems

27

A number of servo motor systems have servo drives that do not provide closed- position loop control. Instead, their purpose is to provide closed-velocity-loop control. In these systems, the servo drive provides an output proportional to the difference between the actual velocity of the motor and a specified voltage signal (the set-point or reference velocity). In servo drives such as this, the velocity feedback can either be obtained by differentiating the position feedback signal (readily achieved in both analog and digital servo drives) or from an additional element known as a tacho- generator. A tacho-generator is a d.c. machine that is mounted onto the same shaft as the main motor and provides an output voltage proportional to the speed of rotation of the shaft. This closed-velocity loop form of servo drive is shown in Figure 2.8.

Electrical Energy Input Input voltage proportional to required velocity Servo-Drive (Controller) Electrical
Electrical Energy
Input
Input voltage
proportional to
required velocity
Servo-Drive
(Controller)
Electrical
Position
Velocity
Energy
Feedback
Feedback
Output
Encoder
Tacho-
Mechanical
or
Generator
a.c. or d.c Motor
Output
Resolver

Figure 2.8 - Closed-Velocity-Loop Servo Motor System

The "velocity" terminology in regard to servo drives will cause some annoyance to those concerned with engineering etiquette. Strictly, of course we are referring to the speed of rotation (not velocity). However, this speed is normally directly related to the linear velocity of some end-effector and so the terms tend to be used interchangeably.

The closed-position and closed-velocity loop servo drives both have roles to fulfil in industrial applications. The closed-position loop system is most useful where only one independent axis of movement is required in order to move some element or "end- effector" to a given position. However, where two or more motors are used to drive an end-effector to a given position, the axes are often interdependent. The path taken to reach that position also needs to be controlled through the velocities of the servo motors.

28

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

The difference between velocity and position control is best demonstrated with a simple "XY" machine, as shown in Figure 2.9 (a), where one motor controls X movement and the other controls Y movement. Figure 2.9 (b) shows two paths taken by the end-effector in order to reach the point "P". Path (i) is obtained using velocity control of servo motors so that a straight line is generated between the starting point and the final destination. This is called "linear interpolation". Path (ii) is what can result from using two position controlled servo motors, which each attempt to reach their final positions independently. In path (ii) it is clear that the "X" movement is faster than the "Y" movement and hence when the X motor reaches its final position, the Y motor still has to continue for some time. Since it is obviously not possible to have "total velocity control" over a motor, because of acceleration and deceleration, most multiple-axis machines (robots and CNCs) use a dual feedback loop arrangement incorporating both velocity and position.

End-Effector Position X Drive Y Y Drive X (a) Y P (i) (ii) X (b)
End-Effector
Position
X
Drive
Y
Y
Drive
X
(a)
Y
P
(i)
(ii)
X
(b)

Figure 2.9 - (a) A Simple XY-Machine (b) Problems with Using Position Control for Interdependent Axes

Computers and Control - Mechatronic Systems

29

There are many different types of servo drive control available for industrial applications. The first distinction between drives is that some are designed for d.c. motors and others are designed for a.c. motors (induction and synchronous motors). Direct current motors are much simpler to control than alternating current motors but cost considerably more and are less reliable. As a result of technology limitations, older servo drives were only designed to control d.c. motors and a.c. drives did not emerge until the 1980s.

The older types of servo drives (both d.c. and a.c.) are analog in nature and are characterised by the fact that the circuit boards are relatively bulky. Modern drives utilise digital technology to control the power flow to the motors and as a result, less "waste" heat is generated and hence the drives can be much smaller. Traditional servo drives did not have any in-built "intelligence" and could thus only carry out simple forms of closed-loop control. The most prolific form of control was (and still is) the so-called Proportional-Integral-Differential or PID control which is a classical, closed- loop control methodology.

In recent years, servo drives have also begun to utilise the low-cost processing power that has become available through microprocessors and Digital Signal Processors (DSPs). This enables manufacturers to design servo drives that can "intelligently" control the flow of energy to the motors through some complex algorithm. A number of commercially available indexers (stepper motors) are now also equipped with microprocessor control. In addition to allowing a broader range of control algorithms to be implemented (in addition to PID), the on-board processor can also allow the servo drive controller to be networked, so that it will respond to positioning or velocity commands.

Servo motors and drives, both a.c. and d.c., are not only the basis for a great range of modern machinery design but are also contributors to the improved factory environment that now exists in many Western countries. Servo drive systems are much quieter than hydraulic and pneumatic systems and considerably reduce noise emission levels in the factory when they replace these older drive systems in low power applications (up to a few kilowatts). The servo motors not only provide quieter operation but also the ability to position elements with a high degree of accuracy over an entire range of displacements. Hydraulic and pneumatic systems, on the other hand, tend to be used only for point to point positioning and are not suitable for graduated positioning. However, the hydraulic and pneumatic drives still have advantages in situations where extremely high forces need to be applied to move actuators or end- effectors from one position to another.

30

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

2.4 CNC and Robotic Controllers

The servo motor drive system is a basic building block for most modern industrial equipment. In particular, it is the basis for Computer Numerical Control (CNC) machine and robot design. These two elements are, in turn, amongst the most prolific pieces of machinery in a modern industrial complex.

The CNC machine is very much a "fish out of water" in the worlds of computing and manufacturing. CNC has never provided a full-fledged computer control system (in the way most engineers would understand it) and the machines which are controlled by CNC are still designed like machines that should be manually driven. Robotics on the other hand, benefited enormously by arriving at a more opportune "technological time" after suitable electronics and processing became available to provide sensible controls.

In the middle of the twentieth century, the majority of lathes and mills were manually driven by operators that moved axes by turning hand-wheels. The axes were composed of "screw-feeds" that were used to move some end-effector (such as a cutting tool or work-piece fixture) so that the work-piece could be processed. These machines were designed around a rudimentary, geometric axis system (based on either orthogonal or cylindrical coordinates) so that the operators could easily relate the required geometry of a work-piece to the movement of a single hand-wheel on the machine.

The most logical first step in automating these machines in the 1950s was to replace each of the manual hand-wheels with a servo motor drive. Initially, the servo motor drives were all connected to a controller, known as a Numerical Controller or NC, that would cause each of the drives to move, based on a punched, paper-tape program. Considering the high cost of computing in the 1950s, these machines provided an extremely good mechanism for automated processing of work-pieces. Unfortunately however, as computer technology evolved and low cost microprocessors proliferated in the 1970s, NC became Computer Numerical Control or CNC, with little revision of the fundamental concepts. CNC is conceptually little more advanced than NC and its basic advantage is that it provides the ability for programmers to enter, edit and simulate cutter paths on the controller itself.

Few people question the design of CNC machines. As with many other industrial systems, features that were ill-designed due to lack of technology have remained as industry standards, long after the enabling technologies have emerged. There are many other limitations that have arisen in CNC, in terms of the design of the computer control itself. Many CNCs are still designed as though machines were intended to exist in isolation from other computers and the outside world - that is, as "islands of automation". However, in industry we now know that it is important for all computer controllers to either receive instructions from the outside world or send data to the outside world in order to simplify the task of factory automation.

Computers and Control - Mechatronic Systems

31

Robots, unlike CNC machines, really only came into being (on a large scale) after the advent of microprocessors and the dawn of "low-cost" computing. Modern robot design has therefore suffered far less from the manacles of the by-gone manual era than has CNC machine design. As a result, robots tend to look and perform like devices designed for a specific function using modern concepts of computer control. Even after all the advances in CNC design, robots still tend to interact with the outside world in a far more proficient manner than the CNCs. However, despite the obvious physical differences between, say, an articulated welding robot and a CNC milling machine, the principles behind the actual control systems are essentially similar. The schematics of CNC and robot control systems are shown in Figure 2.10.

Supervisory Controller (Executing Program) Reference Position Position Feedback Axis Controller (Axes 1 to N)
Supervisory Controller
(Executing Program)
Reference
Position
Position Feedback
Axis Controller
(Axes 1 to N)
Reference
Velocity
Position Transducer
Voltage
Servo Drive
End
Motor 1
Controller 1
Effector
or Current
Mechanical
Coupling
Velocity Feedback

Figure 2.10 - Schematics of a CNC or Robotic Axis Control System

The supervisory controller in robotic and CNC systems is responsible for a number of simultaneous activities including the user (system) interface and part program parsing and execution. As each step (block) of a part program executes, the supervisory controller passes down positioning information to the axis control computer.

The axis controller is responsible for achieving the desired position, using appropriate acceleration and deceleration curves. It does this by sending reference velocities to the servo-drive controller, on the basis of the actual position that has been achieved. As a result, a double feedback loop (velocity and position) is established.

32

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

The relationship between the servo-drive controller and the servo-motor is dependent upon the type of motor in use. In d.c. systems, the servo-controller varies the average voltage (hence current) applied to the motor windings. In both synchronous and induction motor, variable-speed a.c. systems, the servo controller supplies the armature of the motor with a variable frequency supply voltage. Note also, that the servo motor drives in traditional CNC and robotic control systems are based upon closed-velocity-loop control. The CNC or robotic axis controller is then responsible for closing the position loop.

In older CNC and robotic control systems, a number of processors were used to implement the entire control. One processor acted as the supervisory controller, another as the axis controller and so on. In some cases, each axis had its own processor because the task of closing the position loop was so "processor-intensive". Current processor technologies enable a typical four axis machine to be controlled by one microprocessor which performs all processing (supervisory, axis control, etc.) functions in real-time through multi-tasking.

The transducers used to provide velocity and position feedback on both robots and CNC machines vary according to the specific applications. Commonly, shaft- mounted tacho-generators are used to provide velocity feedback and linear resolvers or pulse-code transducers (encoders) provide position feedback.

Both CNC and robot control systems share another common trait in that they tend to be very specialised in their design. They are optimised to achieve multi-axis control, with minimum user programming, and hence the languages that they use tend to be somewhat restrictive.

For historical reasons, related to early hardware limitations, CNC machines were (and still are) traditionally programmed in a "G-Code" language. This dated system provides a user with a number of sub-programs, commonly prefaced with either a "G", "F", "S", or "T" and suffixed with a subroutine number or parameter. These facilitate the movement of a cutting tool through a predefined path; the selection of a cutting tool and so on. However, few (if any) of these languages will allow a programmer to do more than this.

G-Code languages were never intended to provide the user with routines for accessing various aspects of the machine controller itself and for interfacing it to the outside world. These features, which are now both desirable and important, are difficult or impractical to implement on CNCs. For example, with older CNCs, it is often difficult to display user programmed screens as a part program executes. Further, it is generally not possible to access the serial communications facilities of a CNC through the G-Code language itself.

Computers and Control - Mechatronic Systems

33

CNC designers often attempt to augment the limited features of the G-Code languages by running additional (concurrent) tasks on the CNC. For example, many CNCs have programs designed to handle serial communications and remote commands, running as tasks, while a part program executes. This type of task is referred to as a Direct Numerical Control or DNC task/facility. It generally enables a host computer to remotely control a CNC machine through a serial link. There are other tasks, such as concurrent, graphic information displays, which are also added by a number of manufacturers.

The deficiency with older forms of CNC architecture is that they ultimately provide a closed (black) box to the end-user. It is often difficult for end-users to re- program CNCs in order to change graphics displays, or the way in which serial communication occurs. So, while traditional CNCs provided great flexibility in terms of cutting and shaping materials, they generally provided very little flexibility in terms of tailoring the user environment. Modern CNC designs, however, have improved since the early 1990s and are gradually moving towards high-level, structured languages and open-architecture programming capabilities.

Robot controllers have generally been better than traditional CNCs in terms of programming flexibility. Unlike CNC machines, robots seldom, if ever, work as devices in total isolation from other systems. They are generally linked to other computer controlled or logic controlled mechanical systems. For example, a spray- painting robot must be linked to the production line that feeds it with work-pieces for painting - otherwise there can be no inter-locking between line movement and robot cycles. As a result, programming languages on robots have tended to reflect the systems oriented nature of these devices. However, it is far more difficult to categorise the capabilities of robot controllers, because they are far more diverse in software architecture than CNC systems.

Some robot-controllers can be programmed in PASCAL or "C" (or special structured languages such as VAL) in the same manner as any normal computer system. These systems provide users with a high level of access to the internal hardware of the controller itself. This makes such controllers more amenable to interfacing with the outside world. A few, "less sophisticated", robot controllers are analogous to older CNCs and can only be programmed in restrictive, specialised, movement languages (similar to proprietary G-Codes). These systems suffer from the same interfacing disadvantages as CNC systems.

34

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

CNC systems and robot controllers generally come with built-in Programmable Logic Controllers, usually of a specialised and complementary design, and normally produced by the CNC or robot manufacturer. The PLCs are integrated into the CNC or robot control system, under the control of the main processor. They are used to control a range of sundry functions requiring high voltage or current switching. For example, on a CNC machine, the internal PLC may control the switching of coolant pumps, the opening and closing of doors, etc. On a robot, the PLC may control the opening and closing of grippers and the switching of inter-locked equipment. The inputs and outputs of PLCs on both robot and CNC systems are accessible from within the robot programming language or G-Code programming language. This scheme is shown in Figure 2.11.

CNC Integrated or Purpose-Built Robot Control PLC Servo Servo Drive 1 Drive N
CNC
Integrated
or
Purpose-Built
Robot Control
PLC
Servo
Servo
Drive 1
Drive N

InputsCNC Integrated or Purpose-Built Robot Control PLC Servo Servo Drive 1 Drive N Outputs

OutputsCNC Integrated or Purpose-Built Robot Control PLC Servo Servo Drive 1 Drive N Inputs

Figure 2.11 - Integrated PLC Control of High Power Peripherals

CNC and robot controls are generally both provided with a "hard-wire" interface to the outside world. This provides a simple means of integrating the devices into automated systems. In a hard-wire interface, spare inputs and outputs from the integrated PLC are selectively connected to external devices so that they can be inter- locked. Program execution is then made dependent upon the condition of inputs.

For example, if we wished to use a robot to feed a CNC machine with work- pieces, a hard-wire inter-locking arrangement, such as the one shown in Figure 2.12 may be used.

Computers and Control - Mechatronic Systems

35

 

PLC

  PLC PLC Input m  

PLC

Input m

 

Output x

 

Robot

CNC

Input y

CNC Input y   Controller
 

Controller

Output n

Figure 2.12 - Inter-locking a CNC Machine to a Robot

In such a system, the CNC machine program should start execution as soon as the robot has loaded a part (ie: when the robot program has been completed). The robot should unload a part when the CNC machine program has ended. This can be achieved by the robot setting output number "n" high when it completes a program (last executable line of code) and the CNC machine setting output "x" high when it completes a program (last executable line of code). The first lines of code on both the CNC and robot are to wait for inputs "y" and "m", respectively to go high before continuing.

This form of inter-locking is suitable for simple systems, but is unable to deal with problems that occur during the execution of a robot program or CNC program. For example, the robot may jam a component while loading the CNC machine and stop while its grippers are still inside the machine. The CNC has no way of knowing the actual position of the robot and so may damage the grippers. These sorts of issues can only be resolved by having the robot and CNC intelligently communicate with one another through a data communications link. These links require specialised communications software packages (known as protocols) to execute on each of the devices. Robots have been equipped with communications protocols since the early 1980s and CNCs became available with similar protocols shortly thereafter. The actual implementation of a control system via a communications protocol is the subject of another book and is outside the scope of this text.

36

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

2.5 Development Systems for Mechatronic Control

The advances in computer processing power which took place during the 1970s produced an enormous number of low cost personal computers in the 1980s. However, by the mid-1980s it was evident that these personal computers were limited by their inability to communicate with the outside world. As a result, their use in engineering control was limited. Engineers with a good background knowledge of electronics were able to design interfaces between personal computers and real-world systems but these were "one-off" solutions that were very costly to pursue. For those without an electronic engineering background, the concept of linking personal computers and workstations to the outside world presented serious problems.

By the latter part of the 1980s, a number of companies had recognised the need and potential for equipment suitable for interfacing personal computers to the outside world. Vendors began to launch a range of "building-block" products that could be used by engineers, with limited knowledge of computer hardware, to implement engineering control systems. Since that time, the interfacing-board market has grown to the extent where plug-in interfaces have almost become a commodity.

There are literally thousands of different types of products that are suitable for mechatronic control systems in industrial and laboratory environments. In general, these are designed to plug directly into a variety of commonly available personal computers and workstations. At their most basic level, these interfacing boards provide the ability for computers to input and output analog voltage signals through a number of different channels. This is shown schematically in Figure 2.13.

Host Personal Computer Operating System User Interface Program Board Interface Board Software Library
Host Personal Computer
Operating System
User
Interface
Program
Board
Interface
Board
Software Library

1

Analog Outputs

Analog Outputs

:

N

1

Analog Inputs

Analog Inputs

:

N

Figure 2.13 - Basic Interface Board Arrangement for Data-Acquisition and Control in Analog Systems

Computers and Control - Mechatronic Systems

37

An interface board such as the one shown in Figure 2.13 would also typically provide a library of software routines that would carry out the low level hardware access to the input and output channels of the board. The end user can utilise these routines in a common high-level language program such as C or Pascal without ever understanding the complexities of the board or the processes that transfer data between the board and the computer's memory areas. As with nearly all consumer items, the more one pays, the more one gets. A more sophisticated version of the board could provide protection and isolation between the external signals and the computer hardware.

The basic arrangement of Figure 2.13 assumes that the end-user will wish to develop control software entirely on the "host" personal computer. However, there are many instances where the development of a control algorithm may be a case of "reinventing the wheel". A typical example would be the implementation of a basic PID control, where an incoming feedback signal is processed via a standard algorithm to produce a required output signal. A number of boards are equipped with their own "on-board" microprocessors or Digital Signal Processors that are available to carry out basic "closed-loop" control functions. The host personal computer then essentially becomes a development tool that provides a screen and keyboard/mouse input arrangement. However, when the control system is fully implemented, the system designer can develop software that will enable the personal computer screen and keyboard to become the interface between the user and the control system. This is shown schematically in Figure 2.14.

Host Personal Computer Operating System Interface Board with Interface On-Board Board Processor Software Library
Host Personal Computer
Operating System
Interface
Board with
Interface
On-Board
Board
Processor
Software Library
Standard
User
Control Loop
Program
Software

Analog OutputsInterface On-Board Board Processor Software Library Standard User Control Loop Program Software Analog Inputs

Analog InputsInterface On-Board Board Processor Software Library Standard User Control Loop Program Software Analog Outputs

Figure 2.14 - Using Advanced Interface Boards with "On-Board Processors" for Standard Closed-Loop Control Functions

38

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

The concept shown in Figure 2.14 is often extended to provide more than just a simple general-purpose control. A number of intelligent controller boards are available for specific functions including:

Servo motor control

PC-based digital storage oscilloscope applications

Waveform synthesis

Micro-stepper and stepper motor control

Video acquisition (frame-grabbing and image-processing, etc.).

To some extent, a number of plug-in boards available for personal computers and workstations really do little more than replicate the functionality available in a Programmable Logic Controller. There is however, one major advantage in using plug- in interface boards in preference to PLCs and that is the fact that the interface board connects directly into the bus structure of the host computer. This provides the fastest possible link between the outside world and the computer. Most PLCs can only be connected to a computer via a network or point-to-point communications link, both of which are relatively slow for real-time control. In some instances, PLCs have evolved to a level where there is really no difference between the functionality of an interface board and a PLC - this is particularly true of PLCs that plug directly into the bus structure of a personal computer or workstation in much the same way as the arrangement of Figure 2.14.

The major disadvantage of nearly all plug-in boards (and PLCs) is their relative cost. An interface board can often cost as much or more than the host computer system. If the board is to be used for a "one-off" system design then this is not an issue, since the cost of developing an interface board would be a much more expensive proposition. However, if the objective is to develop control systems for mass production, then clearly the off-the-shelf interfaces are unacceptable.

One of the reasons for the relatively high cost of interface boards is the fact that they are designed to be "general-purpose". Most of the boards accept a wide range of voltage and current inputs and can provide a wide range of output voltages and currents. This sort of functionality is expensive. In situations where many boards need to be produced and cost is of the essence, specialised boards with strictly limited functionality (in other words, purpose-built) need to be designed from first principles. The focus of this book is to help you to come to terms with the basic principles behind the design of interfaces so that you can understand how commercial systems operate, their limitations and the appropriateness of designing from first principles.

Computers and Control - Mechatronic Systems

39

In some cases, the decisions in regard to control system design are already fixed by overriding physical or commercial factors. For simple controller applications, the cost of a personal computer plus interfacing boards may be too high to make such a solution viable. In other situations, the physical size of a personal computer and interfacing boards precludes the use of such a solution. There are several ways to resolve these control problems. The first is to design a complete microprocessor or DSP based controller from first principles. This is normally the most cost-effective solution where mass production is involved, but is expensive for low volume applications. The other alternatives are based upon the tailoring of so-called "miniature controllers" or "micro-controllers".

Miniature controllers are microprocessor based computers that are usually designed to fit onto a relatively small printed-circuit board. Unlike the mother-board of a personal computer or workstation, a miniature controller already has built-in control functionality such as analog inputs and outputs and relay-drivers. The software for the miniature controllers is normally stored in special memory chips known as "Electrically Erasable Programmable Read Only Memory" or EEPROM. On a normal computer, programs are stored on magnetic disks and transferred to memory later for execution. This allows for much greater storage but also makes the overall computer system larger in size than the miniature controller. A typical arrangement is shown in Figure 2.15.

Key-Pad LCD Display PC Workstation Operating System Miniature Controller µµµµP EEPROM Software Serial Link
Key-Pad
LCD Display
PC Workstation
Operating System
Miniature Controller
µµµµP
EEPROM
Software
Serial Link
Development
Kit
A/D
D/A
Strain Gauge
Analog Output 1
Load Cells
Analog Output 2
Temperature
Analog Output 3
Sensor
Linear Position
Analog Output N
Transducer

Figure 2.15 - Miniature Controller Development System

40

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

The beauty of miniature controller development systems is that a system designer can develop software on a standard PC workstation using a special development compiler (normally programmed in the "C" language). The software is then down- loaded to the miniature controller memory via a serial communications link. Thereafter, the miniature controller can be disconnected from the PC and act as a stand- alone unit.

Miniature controllers are designed in a building-block fashion so that the development does not require a highly skilled electronics engineer nor the production of printed circuit boards and so on. Typical accessories include liquid crystal display screens and operator keypads that enable the final users of such controllers to interact with them at a very basic level. As with all other general-purpose "building-block" devices, the cost of a miniature controller can become excessive when large volumes need to be produced. However, when one takes into account the fact that development times are minimised and hardware reliability is much higher than for "one-off" designs, the miniature controller is a very useful device.

Computers and Control - Mechatronic Systems

41

2.6 Manufacturing Systems

There are very few areas of engineering where control systems proliferate to the extent that they do in modern manufacturing systems. A sophisticated manufacturing system can contain control elements including:

Microprocessor or DSP controlled Servo Drives

CNCs

Robot Controllers

PLCs

Cell controllers (PC workstations or dedicated computers).

The difficulty, of course, lies in getting all these different types of controllers to talk to one another so that a cohesive manufacturing system can be produced.

In continuous processes (such as in chemical, food and petrochemical production

and power generation) the interaction between different levels of control is very tightly

governed because the level of intelligence ascribed to each element tends to be limited. However, in discrete processes, such as in metal-cutting manufacturing systems or textile production systems, the boundaries between the different levels of control are somewhat blurred and cohesive control is more difficult to achieve.

A number of different, metal-cutting, manufacturing systems are used in order to

satisfy the performance criteria demanded by a wide range of industries, including workshops, automotive and aerospace manufacturers. The common system configurations are shown in Figure 2.16, which gives an indication of how each system fits into annual volume / variety regions in the production environment.

Annual Volume

Dedicated Systems 100000 F.T.L. 10000 FMS with CNCs, AGVs & Robots 1000 100 Robot Fed
Dedicated
Systems
100000
F.T.L.
10000
FMS with CNCs, AGVs & Robots
1000
100
Robot
Fed CNC
10
Stand-alone CNC
1
Part Variety
1
10
100
1000

Figure 2.16 - Realms of Metal-Cutting Manufacturing Systems

42

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

The systems mapped onto the graph in Figure 2.16 have differing performance characteristics and also place different demands upon the data communications used by their control systems. We shall now examine the structure of each of the integrated systems and the way in which communication between devices occurs.

The dedicated, in-line transfer machine is shown in Figure 2.17 and is a high- volume, low part variety system. It is composed of a number of machining stations and a transfer conveyor. Each of the machining stations is designed and tooled for a specific application. For each station, tools are loaded into an induction motor driven, multi-spindle cutting head, which has an advance and retract motion. When a work- piece comes into position within a machine, the head advances for a fixed period, then retracts, to allow the work-piece to move down-line to the next destination. Each machining module is generally controlled by a PLC, which is hard-wired to its sensors, coolant pumps, etc. These machining modules are generally not user-programmable devices. They are pre-programmed to perform only a fixed task.

Supervisory PLC PLC PLC PLC PLC Transfer Mechanism (Conveyor) PLC PLC PLC Dedicated Machining Modules
Supervisory PLC
PLC
PLC
PLC
PLC
Transfer Mechanism
(Conveyor)
PLC
PLC
PLC
Dedicated
Machining Modules

Figure 2.17 - Schematic of Dedicated, In-Line Transfer Machine

The transport mechanism for in-line transfer machines is also a PLC controlled device. In simple systems, the transport mechanism controller is also the system controller, and is hard-wire inter-locked to the dedicated machining modules. In more complex systems, a separate, high powered PLC is used to coordinate the running of the system and drive mimic-panels and graphic information displays.

Computers and Control - Mechatronic Systems

43

In transfer machines, where individual modules are controlled by a range of PLCs, produced by different vendors, it is common practice to simply hard-wire from the supervisory PLC to other PLCs in the system. However, in a single-PLC-vendor environment, a number of proprietary solutions are generally feasible. Some of these solutions allow PLC data buses to be inter-connected through a back-plane system for information exchange. Other solutions allow for interconnection of PLCs through high speed Local Area Networks. Regardless of which system is chosen, the objective is for the supervisory PLC to implement sequential control over the system through input/output inter-locking with individual module controllers.

Rotary transfer machines are analogous to in-line transfer machines except that parts transfer, from machine to machine, occurs through via an indexing mechanism in a circular path. The control principles however are almost identical.

The hard-wire, inter-locking, communications techniques, shown in Figure 2.17, for dedicated systems are generally adequate because:

Individual machining modules are relatively simple devices, executing simple, fixed, programs

The amount of information which any, one machine can feed back to a supervisor is comprised of little more than off/on limit-switch status

The supervisory controller does not need to change programs on individual modules in the system.

Dedicated manufacturing systems, of the type shown in Figure 2.17, fulfil a vital role in the high-volume production of a small variety of parts. However, in order to vary the type of part that passes through such a system, it is necessary to manually re- tool each of the machining stations. If the type of part to be produced is radically altered, then such systems require major re-engineering, or as is often the case, complete replacement. Since these systems are designed for the production of a specific item, their cost and production life are calculated on the basis of anticipated product life.

Increased competition in manufacturing, coupled with increasing consumer demands for new products, mean that product life-spans are decreasing. The cost effectiveness of dedicated production systems is therefore diminished accordingly. In addition, companies driving towards export competitiveness with products now find that they need to produce a "family" of products, tailored to specific global markets. These requirements engender a need for flexibility in production systems.

44

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

Flexibility in production systems is achieved through the ability of individual modules in those systems to respond to changes in part variety. This is in turn, achieved through the use of fully programmable machining modules and flexible parts transport techniques.

It would be sensible to suggest that flexibility in manufacturing could be achieved by taking a dedicated system, such as that shown in Figure 2.17, and replacing some or all the fixed machining modules with CNC machines. This is common practice, and the result is referred to as a "Flexible Transfer Line" or FTL. However, it should be noted that the cost ratio of a CNC machining module to a dedicated module can be as high as 10 to 1. It is therefore not economically feasible to replace, say 50 dedicated machining modules in a fixed system with 50 CNC machines. Generally, each CNC machine uses automatic, programmable tool changing in order to perform the functions of a number of dedicated modules. Thus, production flexibility is increased but throughput is decreased in what becomes a normal trade-off situation.

While it may be common in a dedicated production line to have 50 to 100 machining stations, a flexible production system may have only 5 to 10 CNC machining stations, performing the same net function at a lower production rate. However, the benefits in flexible production become self-evident when production needs change, because flexible systems can respond very quickly to new demands, with minimal human intervention.

The transfer line arrangement of Figure 2.17, whilst very fast, does not provide the optimal transport mechanism for maximum production flexibility. Robots, Gantry Robots and Automated Guided Vehicles (AGVs), on the other hand, provide a high degree of transportation flexibility at the cost of production throughput. All three devices use relatively sophisticated control systems. AGVs in particular, commonly use a powerful PLC as a Constant System Monitor (CSM), which governs the positions to which vehicles move.

The Flexible Manufacturing System (FMS), designed for a very wide variety of parts, is more likely to resemble the schematic shown in Figure 2.18, rather than that of 2.17. The intelligence level of each module (machine) within the system is much greater than that within the dedicated production line. CNC machines in sophisticated FMS environments may even be augmented with specialised robots to transfer tools from AGVs to machine tool carousels and vice-versa. The practicality of such systems has long been questioned by industrialists and their reliability has been unsatisfactory. The primary reason for this is the difficulty of creating a cohesive and robust control system that can recover from the numerous system faults that arise when handling a wide range of parts.

Computers and Control - Mechatronic Systems

45

AGV CNC CNC AGV Programmable Machining Modules CNC CNC AGV FMS Controller AGV Controller
AGV
CNC
CNC
AGV
Programmable
Machining Modules
CNC
CNC
AGV
FMS Controller
AGV Controller

Figure 2.18 - Schematic of a Flexible Manufacturing System

In a complex FMS environment, where a number of different part-types may be within the system simultaneously, the controller is required to:

Coordinate the flow of work-pieces of differing types, from one machine to another, based upon a rolling schedule

Activate different part programs on CNC machines, as required by the part- types present in the system

Down-load part programs to CNC machines as required by the machines

Coordinate (inter-lock) the role of the work-piece transport system with the operation of CNC machines.

46

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

Some of these functions can be (and sometimes are) implemented through the hard-wire inter-locking of devices to the FMS controller, which can be a powerful PC, PLC, workstation or mini-computer. However, FMS control is more appropriately achieved through data communications between the controller and the other computerised (intelligent) modules within the system. In a complex, FMS environment, the system controller must have the capacity to interrogate other equipment whilst programs are running. This gives the controller access to a wide variety of information regarding the status and error-conditions of machines, thereby allowing for intelligent decision making in the control algorithm.

Simple, hard-wiring techniques only allow devices to exchange one piece of data per wire (say an on/off state or transducer voltage). They do not allow one computer to transfer data files to another computer. This of course means that down-loading of CNC machine programs from a supervisory computer cannot be achieved with the hard-wired system alone. In simple hard-wired, FMS systems, machine programs are normally resident in the local memories of each machine during a production run. Programs are generally down-loaded (or file-dumped) to machines, via data communications links, prior to the start of automatic FMS control.

One of the major benchmarks of FMS is the ability to tolerate and reconcile fault conditions. Each module in the system performs a complex task and is therefore subject to a large number of possible faults or errors. It is costly for an FMS controller to shut down an entire system, simply because one machine has developed a fault. The objective is for the controller to attempt to maintain orderly and safe system operation even under certain fault conditions. However, as previously stated, this is far more readily achieved in a rarefied academic environment than it ever has been in industry.

One of the major problems in FMS is the difficulty involved in integrating a range of different and proprietary computer controllers (PLCs, CNCs, robot controllers, etc.) via computer networks. There are considerable problems with lack of standardisation and an overwhelming sensation that many of the "intelligent" controlling devices to be linked in an FMS were designed to operate as "islands" of control without the necessary functionality for interaction. These sorts of integration problems are the subject of another book, but as we progress through this text we shall see why it is that integration problems arise with computer based devices.

47

47 Chapter 3 Fundamental Electrical and Electronic Devices and Circuits A Summary An overview of the

Chapter 3

Fundamental Electrical and Electronic Devices and Circuits

A Summary

An overview of the electrical and electronic devices that are the basis of modern analog and digital circuits. Basic analog devices including diodes, Bipolar Junction Transistors (BJTs) and Field Effect Transistors (FETs). Diode based circuits including regulators and rectifiers. Simple analog transistor amplifier circuits. Operational amplifier circuits. Transistors for digital logic. Interfacing circuits to one another - input/output characteristics. Thyristors and thyristor based circuits.

Digital Voltages Analog Voltages Analog Energy Forms External Voltage Supply Digital to Scaling or Energy
Digital Voltages
Analog Voltages
Analog Energy Forms
External Voltage Supply
Digital to
Scaling or
Energy
Analog
Isolation
Amplification
Conversion
Conversion
Computer
External
System
Analog
to Digital
Protection
Scaling or
Energy
Isolation
Conversion
Circuits
Amplification
Conversion
External Voltage Supply

48

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

3.1 Introduction to Electronic Devices

Most people can readily relate to the concept of resistance in electric circuits and to the concept of energy storage and release through inductance and capacitance. Our understanding is greatly enhanced by the fact that relatively straightforward and systematic techniques can be used to model circuits with these elements. In the so- called "time-domain" we can use the simple interrelationships between voltage and current in these devices to analyse these passive circuits:

v =

i =

v =

C dv

L di

dt

dt

iR

(Resistor Relationship - Ohm' s Law)

(Capacitor Relationship)

(Inductor Relationship)

(1)

We couple these relationships with the use of Kirchoff's voltage and current laws in order to analyse circuits. As circuits become more complex, we introduce the traditional mathematical approaches to the solution of differential equations in order to determine the transient and steady-state conditions of circuits. The LaPlace Transform technique and the Phasor-Method technique are, respectively, the two most common (and interrelated) methods used to solve for transient and steady-state circuit conditions.

When we introduce common electronic devices, such as diodes, transistors, etc. into our circuits, analysis becomes far more complicated - particularly when circuits are used for analog applications. Not only do we have to contend with all of the above analysis techniques, but we additionally need to consider dependent voltage and current sources that add substantially to analysis problems. Moreover, analysis of circuits with devices such as diodes and thyristors requires the use of intuition in order to simplify circuits that are otherwise unwieldy. It is therefore much more difficult to develop systematic techniques for analysing and understanding the operation of such circuits.

It is not only the analysis of analog electronic circuits that causes problems. Implementation introduces a whole range of complex problems with which we need to contend. It is often said that the implementation and testing of analog electronic circuits is composed of 10% design and 90% trouble-shooting. This rule-of-thumb arises because of the parasitic characteristics of each of the electronic devices that we will be examining in this chapter.

Fundamental Electrical and Electronic Devices and Circuits

49

Most of the devices which we shall look at in this chapter are fabricated on semiconductor materials (Group IV in the Periodic Table) that have been doped with Group III and Group V impurities. The interaction of doped regions within the semiconductor gives rise to the valuable properties of each particular device and also leads to other parasitic or non-ideal behaviour patterns.

As a result of these parasitic (non-ideal) characteristics, it is often difficult to justify the cost of engineers designing and debugging analog electronic circuits from first-principles. In addition, the staggering growth in digital computing since the 1960s has led to a need for circuits that can co-exist in heterogeneous analog/digital circuits. For these reasons, a number of interesting trends have arisen:

(i)

An enormous range of commonly used electronic circuits are normally available in a modular form in single-chip Integrated Circuit (IC) packages

(ii)

IC packages are normally designed in family groups so that a range of different devices can be put together in "building-block" fashion to create new systems

(iii)

Analog devices are often made compatible with digital circuits in order to facilitate bridge building between computers and continuous external signals.

In terms of power electronics (ie: the conversion of low energy electronic signals to high-voltage and/or high-current outputs) it is also necessary to note specific trends that have arisen in electronic devices. Firstly, there is the ability of small, single-chip semiconductor devices to absorb, supply and switch high currents and voltages. Secondly, there has been a trend away from the traditional analog approach to circuit design. As we shall see later in this text, devices such as transistors can form far more energy-efficient amplification circuits when they are used as digital switches in Pulse Width Modulation (PWM) based circuits, rather when they are used as analog (linear) amplification devices.

There are many issues that need to be examined in detail before one can carry out any electronic circuit design that will have industrial relevance in terms of reliability and accuracy. The objective of this chapter is not to make you an expert in electronic circuit design, but to assist you in understanding the basic phenomena involved, so that you can make intelligent decisions in the analysis and application of the semiconductor modules and electronic interfacing devices required in modern systems design.

50

D.J. Toncich - Computer Architecture and Interfacing to Mechatronic Systems

3.2 Diodes, Regulators and Rectifiers

3.2.1 Fundamentals and Semiconductor Architecture

Diodes are the most basic of electronic devices and are an important part of any electronic circuit design because they (and their controlled derivatives such as thyristors) are used for:

Providing uni-directional current paths through a circuit

Regulating and limiting voltages

Power supplies