Anda di halaman 1dari 146

Design Handbook

Design Methods II
ECED-3901
Faculty of Engineering, Dalhousie University
Department of Electrical & Computer Engineering

Dr. Peter H. Gregson

May 30, 2004


Contents

Table of Contents iv

List of Figures vi

1 Introduction 1

2 Design 3
2.1 Philosophy of Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 The Design Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Understand the Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3.1 What IS the Problem? . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.2 Decomposing The Problem . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4 Identify the Key Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.5 Generate Many Candidate Solutions . . . . . . . . . . . . . . . . . . . . . . 10
2.6 Decide on a Candidate Solution . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.7 Implement the Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.8 Evaluate the Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.9 Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

3 Energy Storage 17
3.1 Batteries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2 ‘Stretchies’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3 Other Energy Storage Techniques . . . . . . . . . . . . . . . . . . . . . . . . 19

4 Motors 21
4.1 Introduction to DC Motors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.2 Steady-State Motor Operation . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.3 Motor Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.4 Motor Inductance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.5 The Motor as a Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.6 Measuring Motor Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.6.1 Kω . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.6.2 KT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.6.3 R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.6.4 Kf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.6.5 To . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.6.6 L . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

i
ii CONTENTS

4.6.7 Caveat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

5 Motor Control 35
5.1 Uni-Directional Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.1.1 Determining the Required VGS . . . . . . . . . . . . . . . . . . . . . . 38
5.1.2 Determining MOSFET Power Dissipation . . . . . . . . . . . . . . . 38
5.1.3 Miller Capacitance and Gate Resistance . . . . . . . . . . . . . . . . 38
5.2 Diode Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.2.1 Peak Reverse Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.2.2 Forward Current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.2.3 Reverse Recovery Time . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.3 Half-Bridge Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.4 Full Bridge Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

6 Computing with Analog Components 47


6.1 Op-Amp Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.2 Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.3 Negation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.4 Subtraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.5 Logarithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.5.1 The Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.5.2 The Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.6 Exponentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
6.7 Other Interesting ‘Wrinkles’ . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.8 Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.8.1 Logarithm-Based Multiplication - The Concept . . . . . . . . . . . . 55
6.8.2 Non-linearity-Based Multiplication - The Concept . . . . . . . . . . . 57
6.9 Switching-Based Multiplication - The Concept . . . . . . . . . . . . . . . . . 58
6.10 Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
6.11 Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
6.11.1 Inverting Integrator - The Concept . . . . . . . . . . . . . . . . . . . 59
6.11.2 Interesting Wrinkles With Integrators . . . . . . . . . . . . . . . . . . 59
6.11.3 Non-Inverting Integration - The Concept . . . . . . . . . . . . . . . . 59
6.12 Computing An Arbitrary Function of an Input . . . . . . . . . . . . . . . . . 61
6.13 Converting Current to Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.14 Converting Voltage to Current . . . . . . . . . . . . . . . . . . . . . . . . . 63

7 Some Non-Linear Circuits 67


7.1 Comparators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
7.2 Schmitt Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
7.2.1 Asymmetrical Power Supplies . . . . . . . . . . . . . . . . . . . . . . 70

8 Timers and Timing 73


8.1 Generating Timing Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
8.1.1 The Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
8.1.2 Selecting Components . . . . . . . . . . . . . . . . . . . . . . . . . . 78
8.2 A Simple Time Delay Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . 79
CONTENTS iii

8.2.1 The Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79


8.2.2 A Simple Delay Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . 79
8.2.3 A One-Shot Pulse-Output Timing Circuit . . . . . . . . . . . . . . . 80
8.2.4 A Latched One-Shot . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

9 Sinusoidal Oscillators 85
9.1 R − C Oscillators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
9.1.1 Phase-Shift Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
9.1.2 Wein-Bridge Oscillators . . . . . . . . . . . . . . . . . . . . . . . . . 90
9.2 Resonant Oscillators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
9.2.1 Resonant Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
9.2.2 Coupled Inductors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
9.2.3 Hartley Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
9.2.4 Colpitts Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

10 Sensing The Environment 101


10.1 Optical Sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
10.2 Tactile Sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
10.3 Force Sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
10.4 Sensing Conductive Materials . . . . . . . . . . . . . . . . . . . . . . . . . . 103
10.4.1 Conductivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
10.4.2 Eddy Currents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
10.4.3 Capacitance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
10.5 Acceleration Sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
10.6 Current Sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
10.7 Sensing Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

11 Noise and Interference 109


11.1 Noise-Equivalent Bandwidth . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
11.2 Thermal of Johnson Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
11.3 Shot Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
11.4 Other Noise Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
11.5 Computing Equivalent Input Noise . . . . . . . . . . . . . . . . . . . . . . . 111
11.6 Signal to Noise Ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
11.7 Averaging and Filtering Low-Amplitude, Noisy Signals . . . . . . . . . . . . 112
11.8 Non-White Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
11.9 Interference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
11.10Simple Wiring Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
11.11Decoupling Capacitors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

12 Processing Low-Amplitude Signals 119


12.1 Amplifying Low-Amplitude Signals . . . . . . . . . . . . . . . . . . . . . . . 119
12.2 Detecting Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
12.3 Detecting AC Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
12.3.1 Envelope Detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
12.3.2 Synchronous Detection . . . . . . . . . . . . . . . . . . . . . . . . . 123
iv CONTENTS

13 Voltage Regulators 127


13.1 Linear Voltage Regulators . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
13.2 Switching Regulators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

14 A Hodge-Podge of Ideas 133


14.1 Measuring Frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
14.2 Pulse Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
14.3 Using Analog circuitry for Logic Operations . . . . . . . . . . . . . . . . . . 135
14.4 Connecting Analog Outputs to 7400-Series Logic . . . . . . . . . . . . . . . . 138
List of Figures

2.1 Comparison of the time spent by expert and novice problem solvers on various
aspects of problem solving. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4.1 A conceptual DC motor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22


4.2 Operation of a DC motor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.3 Typical characteristics of a D.C. motor . . . . . . . . . . . . . . . . . . . . . 27
4.4 A simple circuit to illustrate the flyback effect of an inductor. . . . . . . . . 28
4.5 Switching motor current, and the importance of motor inductance. . . . . . . 30
4.6 Measuring motor inductance . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

5.1 Motor frequency response, and the pulse width modulator spectrum. . . . . 36
5.2 A simple uni-directional motor driver. . . . . . . . . . . . . . . . . . . . . . . 37
5.3 A MOSFET motor driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.4 A half-bridge motor driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.5 Conceptual circuit for a full-bridge driver. . . . . . . . . . . . . . . . . . . . 46

6.1 Block diagram of a negative feedback system . . . . . . . . . . . . . . . . . . 49


6.2 Inverting summing amplifier . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.3 Summing current with a BJT . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.4 Using a BJT as a signal inverter. . . . . . . . . . . . . . . . . . . . . . . . . 52
6.5 Computing log V in with a diode in the amplifier feedback path. . . . . . . . 54
6.6 Computing inverse functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.7 An interesting application of inverse functions . . . . . . . . . . . . . . . . . 56
6.8 Multiplication with log-antilog conversions. . . . . . . . . . . . . . . . . . . . 57
6.9 Various integrator circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.10 A diode-break function generator . . . . . . . . . . . . . . . . . . . . . . . . 62
6.11 A BJT transresistance amplifier. . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.12 An op-amp transresistance amplifier. . . . . . . . . . . . . . . . . . . . . . . 64
6.13 Current-to-voltage and voltage-to-current conversions in a common circuit. . 65
6.14 A common voltage-to-current conversion circuit. . . . . . . . . . . . . . . . . 65
6.15 Howland current source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

7.1 Output circuit of a common comparator. . . . . . . . . . . . . . . . . . . . . 68


7.2 A noisy signal, with a detection threshold, resulting in poor signal detection. 69
7.3 A common Schmitt trigger using an op-amp. . . . . . . . . . . . . . . . . . . 70
7.4 A comparator-based Schmitt trigger with a single supply. . . . . . . . . . . . 71

v
vi LIST OF FIGURES

8.1 Block diagram of a relaxation oscillator. . . . . . . . . . . . . . . . . . . . . 75


8.2 Low-pass RC circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
8.3 A simple relaxation oscillator based on an op-amp. . . . . . . . . . . . . . . 77
8.4 A simple delay circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
8.5 A portion of a one-shot timer . . . . . . . . . . . . . . . . . . . . . . . . . . 81
8.6 Forming the delayed signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
8.7 A more advanced one-shot timer . . . . . . . . . . . . . . . . . . . . . . . . . 82
8.8 A simplified edge-triggered one-shot timer . . . . . . . . . . . . . . . . . . . 83

9.1 The concept behind a sinewave oscillator. . . . . . . . . . . . . . . . . . . . . 86


9.2 Characteristics of hard and soft clippers . . . . . . . . . . . . . . . . . . . . 87
9.3 A basic phase-shift oscillator. . . . . . . . . . . . . . . . . . . . . . . . . . . 89
9.4 A basic Wein bridge oscillator. . . . . . . . . . . . . . . . . . . . . . . . . . . 91
9.5 A series resonant circuit with driver and load. . . . . . . . . . . . . . . . . . 93
9.6 A parallel resonant circuit, or ‘tank’ circuit, with driver and load. . . . . . . 94
9.7 A transformer used to couple to a load. . . . . . . . . . . . . . . . . . . . . . 95
9.8 An autotransformer used to couple to a load. . . . . . . . . . . . . . . . . . . 96
9.9 Some resonant-circuit oscillators . . . . . . . . . . . . . . . . . . . . . . . . . 97

10.1 A simple phototransistor circuit. . . . . . . . . . . . . . . . . . . . . . . . . . 102


10.2 The concept behind a resonant metal sensor. . . . . . . . . . . . . . . . . . . 104
10.3 A capacitance probe. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

11.1 Determining the noise-equivalent bandwidth of a low-pass system. . . . . . . 110


11.2 Modeling the equivalent input noise of a circuit. . . . . . . . . . . . . . . . . 111

12.1 Differential processing of space-localized signals. . . . . . . . . . . . . . . . . 119


12.2 Differential processing of time-localized signals. . . . . . . . . . . . . . . . . 120
12.3 Receiver Operating Characteristic curves. . . . . . . . . . . . . . . . . . . . . 121
12.4 An envelope detector. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
12.5 Synchronous detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

13.1 A simple linear voltage regulator. . . . . . . . . . . . . . . . . . . . . . . . . 128


13.2 Switching regulator concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
13.3 Practical step-down switching regulator. . . . . . . . . . . . . . . . . . . . . 130
13.4 A boost regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
13.5 A buck-boost regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131

14.1 A pulse accumulator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135


14.2 Analog logic gates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
14.3 More analog logic gates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
14.4 A simple interface for driving digital logic from analog circuits. . . . . . . . . 139
Chapter 1

Introduction

The Annual Analog Electronics Design Competition in Electrical Engineering provides an


opportunity for students to explore circuit design. Students do not have a rich repertoire of
design experience or of circuits with which to design their systems, and so they are ‘tossed
in at the deep end’. This handbook attempts to provide information on design, on circuit
concepts and on circuits to address this need.

I do not claim that the presentation is comprehensive. These notes should be considered to be
an adjunct to a good textbook, not a replacement for it. These notes do stress fundamental
concepts more than most texts, however, They should provide some insight into the circuit
designer’s approach to electronics design.

Many of the concepts are presented with reference to specific functions to be performed,
viz. impedance matching with a capacitive tap as used in a Colpitts oscillator. I have not
attempted to collect concepts in one place as I feel that this results in a very sterile treatment
which bores students. When learning to cook, you do not learn all the techniques prior to
making anything. You learn the techniques, and the approach to the ‘cooking problem’ as
you attempt to make specific dishes. Electronics should be no different.

These notes attempt to cover a number of areas. Chapter 2 covers design and how to go about
it should be read by all students. Chapter 3 discusses energy storage including batteries and
‘stretchies’. Chapters 4 and 5 discuss the steady-state and dynamic characteristics of d.c.
motors and motor control. Techniques for computing with analog circuits are presented in
chapter 6 and some useful non-linear circuits are presented in chapter 7.

Timers and timing circuits are presented in chapter 8 and sinusoidal oscillators are discussed
in chapter 9. Some insights into sensing the environment are presented in chapter 10. Noise
and interference are discussed in chapter 11, and processing and detecting low-amplitude
signals are touched on in chapter 12. The ubiquitous power supply and voltage regulator
are found in chapter 13 which discusses both linear and switching regulators, albeit in little
depth. Finally, a ‘hodge-podge’ of ideas is presented in chapter 14.

1
2 CHAPTER 1. INTRODUCTION
Chapter 2

Design

What is design? Design has been described by many individuals in different ways. Getting
a good definition is somewhat like ‘nailing jelly to a tree’. However, I will attempt one
definition. I welcome any and all insights on a good definition.

Design is the process of using knowledge and resources to generate an economical


and reliable device, process or product to meet the needs of a user, subject to
internal and external constraints.

I have purposefully left out the word ‘optimal’ in this definition. Optimality can be measured
in many ways and so conveys little information. It is entirely necessary for a design to meet
the constraints of a particular problem; these constraints can include the desired measure of
optimality.

2.1 Philosophy of Design

The object of the design process is to design or modify a product or process to


address a present or new market, improve a process or provide a capability not
currently available, while simultaneously meeting various constraints. The design
process attempts to solve a design problem.

Constraints may be imposed by limitations on money, time, facilities, power consumption,


weight, accuracy, size, etc. All engineering design problems have constraints. Cost is almost
always a concern. In consumer electronics, reliability, size, and power consumption are sig-
nificant issues (consider a cellular telephone). For small-volume consulting projects, the time
and facilities available for design and production facilities are invariably limited. In military
projects, reliability and compatibility with existing equipment are important constraints.

3
4 CHAPTER 2. DESIGN

One approach to solving a problem is to avoid it. From this perspective, the best solution may
be to rearrange the situation so that a perceived problem disappears. In general, however,
solutions require

1. careful analysis of the problem,

2. identification of the key concepts that are operational,

3. postulating many solutions,

4. deciding on a proposed solution and then

5. implementing and evaluating the proposed solution.

Results of the evaluation are then used to make decisions on modifying the proposed solution.

You should be aware that a proposed solution rarely solves the whole problem. Generally, a
proposed solution solves the main part of the problem, but you will have to make changes
to it to handle related issues and unwanted side effects. In addition, there is no such thing
as the perfect answer. There will always be problems with any solution. Your task is to
propose and implement a solution in which the remaining problems are tolerable.

In design, the crucial question that you must continually ask yourself is ‘Does this solution
satisfy the constraints and meet the specification?’ As soon as the answer is ‘yes’, you
are finished. Do not try to make your design ‘as good as possible’ for this phrase may be
translated to ‘it is never finished’. This is worse than not starting to solve the problem
because you will waste a great deal of time without achieving a solution.

Hope plays no part in good design.

Design is the process of removing the requirement for hope. If you are successful, you should
not have to say ‘I hope that my machine . . . ’, or ‘I hope that their machine . . . ’. You may
not realize that the success of your strategy or design depends on some other machine failing,
or some of your components performing better than their specifications, or . . . . This is where
consultation with team members, mentors, professors, and, yes, competing team members is
essential.

You may decide that you do not have the time, materials or knowledge to make your design
capable of handling all possible situations. You can make this decision only after you have
explored these situations and estimated their likelihood of occurrence. If you make this
decision, you are pinning your chances of success on these situations not arising. This is not
hope, but rather a careful assessment of the risks and benefits of changing your design.
2.2. THE DESIGN PROCESS 5

2.2 The Design Process

Design is iterative, recursive and concurrent. At every stage, you must be sensitive to the
implications of your decisions and actions on the other stages and on the performance of the
complete solution. This is totally unlike analysis, in which there is only one solution to the
problem given.

It is generally impossible to find a unique solution which solves the problem and meets the
constraints; invariably there are either too many solutions (an under-constrained problem)
or too many constraints (an over-constrained problem). In the former case, you can make
sufficient additional constraints by making new constraints out of additional desirable qual-
ities of a proposed solution. In the latter case, you must relax one or more constraints by
re-casting the problem or changing the specifications. Note that this must be done in co-
operation with the ‘client’, the individual or group who has the problem for which you are
seeking a solution.

A good imagination is necessary both for coming up with new candidate solutions and
for mentally ‘exploring’ the performance of those solutions. Imagination is essential for
interpreting the measurements that you make on the solutions you are evaluating.

The design process requires you to:

1. Understand the problem.

2. Identify the underlying key concepts.

3. Generate many candidate solutions.

4. Decide on one solution to explore further.

5. Implement the solution.

6. Evaluate the solution.

2.3 Understand the Problem

One of the most difficult aspects of any engineering design task is to clearly understand the
problem that you are trying to solve. Let’s look at a graph of how a novice problem solver
and an expert problem solver allocate their time when solving problems.

Both the novice and the expert will spend time looking at a problem, determining the
underlying essential concepts involved, deciding on possible solutions, implementing and
evaluating the solutions. This happens in mathematics, physics, engineering or in any other
problem-oriented field.
6 CHAPTER 2. DESIGN

We can graph the time that a novice and an expert spend on various parts of the problem-
solving process. A typical graph would look like figure 2.1. The graph shows the time spent
at each activity and also the times when the activity was performed. Time spent in each
activity (problem understanding, determining concepts, proposing solutions, implementing
solutions, evaluating solutions) is shown by the total length of the line segments opposite
each activity. The number of times that the activity was performed is shown by the number
of line segments, and the start times of the activities are shown by the starting times of each
line segment.

We see from the graph that the novice spends little time in understanding the problem and
exploring essential concepts, a short time proposing a solution, and a great deal of time
attempting to implement the solution. Once the novice proposes a solution, he/she rarely
considers other solutions and only infrequently reviews the problem again.

The expert, on the other hand, spends large amounts of time understanding the problem.
She/he proposes solutions and mentally ‘tests’ the solutions against the problem. This is
why the expert spends so much time initially in problem understanding, in exploring the
concepts and in proposing solutions. The expert then starts to implement the solutions.
Frequently he/she will ‘mock up’ or model key parts of an idea to test the essential concepts
of the proposed solution. This ‘prototyping’ activity does not take much time and provides
a great deal of additional information about the problem and potential solutions. The
expert then starts to implement the solution, but constantly reviews his/her understanding
of the problem and evaluates the solution as it is being implemented. Thus, we see from the
graph that the expert is continually implementing a solution, evaluating the solution, gaining
further understanding of the problem and proposing new modifications and solutions.

Finally, the expert will usually find a solution to the problem whereas the novice will fre-
quently not finish the task in the allotted time.

The ‘take home’ messages from all this are:

1. Spend time in trying to understand the problem. It will save time overall.

2. Constantly review the problem and its sub-problems to determine the un-
derlying concepts.

3. There are many solutions to any problem. Try to find several.

4. Make ‘mock-ups’ or prototypes of critical parts of your proposed solutions.


If the critical parts won’t work, the solution won’t work.

5. Evaluate your solutions constantly. Use the results of these evaluations to


steer your thinking for future solutions.

Brainstorming sessions are excellent for gaining problem understanding and


proposing solutions. Use them. Most teams comment at the end of the contest that
2.3. UNDERSTAND THE PROBLEM 7

Problem exploration

Determining key
concepts

Proposing solutions

Implementing solutions

Evaluation
t
Problem solved
Time spent by expert problem solver

Problem exploration

Determining key
concepts
Proposing solutions

Implementing solutions

Evaluation
t
Problem not solved
Time spent by novice problem solver

Figure 2.1: Comparison of the time spent by expert and novice problem solvers on various
aspects of problem solving.
8 CHAPTER 2. DESIGN

they should have done more planning, gained a better understanding of the problem, and
looked further for the solutions to problems that they found.

2.3.1 What IS the Problem?

It is extremely important to determine the exact problem to be solved and to fully appreciate
the constraints on your solution. Some questions which you should answer include

• What is the task to be performed?

• How much time can we spend on finding and implementing a solution?

• How much money can we spend on implementing a solution?

• What resources do we have?

• What materials and components do we have?

• What information sources are available?

• What facilities exist for exploring the problem and testing solutions?

• What system-level specifications are important?

Determining the task often appears to be deceptively simple. If the task is a race, like the
SwampRunners competition, you might think that the task is to get from the start to the
end in minimum time. This is not true because the contest was won by the team which won
the most heats. This means that the task is to get from the start to the end before your
opponent does, or get closer to the end than your opponent by the end of the heat. This
means that while high speed is one winning strategy, it may not be the only one. Consider
interfering with your opponents such as ‘blinding’ their sensors. This may not require speed
on your part and may nullify any speed advantage that they have. If you had assumed
that the task was only based on speed, then you wouldn’t consider this strategy and your
performance might suffer.

Some other questions that you should ask yourself include

• How reliable must the controller be?

• How sophisticated must the control strategy be?

• What is the best strategy for maneuvering the vehicle?

• What sensing ability is required for the best vehicle performance?

• How can the opponent’s vehicle be affected to your vehicle’s benefit?


2.4. IDENTIFY THE KEY CONCEPTS 9

This competition is a classical example of a real engineering problem. All engineering prob-
lems suffer from a shortage of money, resources, knowledge and time. Successful engi-
neering requires careful consideration of all of these limitations.

2.3.2 Decomposing The Problem

After you gain an initial understanding of the problem, you should break the problem into a
set of sub-problems. You should attempt to decompose the project into sub-problems which
are easily described. You then design solutions to these sub-problems. These solutions are
then components of the solution to the whole problem.

When you have properly broken the problem into sub-problems, you will find that it is easy
to describe the connections between the components of the solution. The components will
perform a single task and will be easier to design and implement. Each of the sub-problems
should also depend on a single key concept. The likely success of a given solution may then
be determined early in the design with simple experiments which provide ‘proof-of-concept
verification’.

2.4 Identify the Key Concepts

You must identify the key concept operating in each sub-problem in order to find suitable
candidate solutions. For example, if a particular sub-problem requires a time delay, then the
key concept is measurement of the passage of time. With circuitry, this means that you need
a variable which is time-dependent. Thus, you need a circuit that converts time to voltage
or to current in the sense that the voltage or current varies as some monotonic function of
time.

Why does the function have to be monotonic? Remember that we want to convert time to
another variable (voltage or current) so that we can uniquely represent an arbitrary time.
This means there must be a single, unique value of the variable for each time instant. This
implies monotonicity.

As we will see, integrating a step function, low-pass filtering a step function, or using the
first half cycle of a cosine function as a form of lookup table will all accomplish this, but a
rectangular wave, a delta function and a full sinusoid will not. A circuit which counts the
cycles of an oscillator and then converts the count to a useful variable does not solve the
problem because this approach requires a rectangular-wave oscillator, which itself is based
on the measurement of time.

How do you identify key concepts? The question to ask yourself is ‘What is the general
function that must be performed by this part of the problem?’ You should demand of
yourself an answer that is short and succinct, such as
10 CHAPTER 2. DESIGN

• convert time or some other variable to current or voltage,

• measure time,

• make motor speed proportional to input voltage,

• sense proximity to metal,

• measure light intensity

• sense contact with obstacles

• sense slope

• provide a sequence of time steps,

Once you have the concepts identified, the design task can become much more focused.

2.5 Generate Many Candidate Solutions

Having identified the key concept relevant to a particular sub-problem, you can then explore
many relevant candidate solutions. Don’t hesitate to come up with ‘off-the-wall’ ideas; they
may not be any good, but parts of them may be the breakthrough that you are looking for.
Lets look at an example.

Consider solutions to a sub-problem for which the key concept is measuring time. What are
a few of the ways to measure time?

• Use a pre-built time-keeping module.

• Use a radiation source and a Geiger counter to count emissions over a fixed time.

• Build a radio receiver tuned to CHU, the Canadian National Research Council official
time signal at 8.00 MHz, and build the circuitry necessary to decode the time signal.

• Build a digital counter with a crystal oscillator time-base.

• Integrate a step function with an op-amp integrator and compare the voltage to a
predetermined threshold.

• Use a microprocessor to keep track of timing in software.

• Sense the 60-Hz electric field present in most buildings, and count the cycles.

• Measure the period of a pendulum (an electronic ‘grandfather’ clock?)


2.6. DECIDE ON A CANDIDATE SOLUTION 11

Clearly some of these are more appealing than others. The radiation-source idea may seem
far-fetched, but it might actually be simple although its time accuracy would be poor (es-
pecially over short times; why?). Using a pre-built time-keeping module has its charms but
it may be quite expensive. Constraints will rule out most of these candidate solutions but
there are insights to be gained by exploring them just the same. In addition, you may rule
out a candidate solution on ‘first blush’, but you might find that careful study of it shows it
to be quite acceptable.

Brainstorming is a great way to generate ideas. Don’t worry about generating good ideas
initially. What good ‘ideas people’ usually do is generate lots of ideas, and then sort out
the good (few) from the bad (many). In one contest, the design team generated 43 ways to
solve one particular problem. They settled on two candidate solutions to explore further.
Both of these were really parts of other ideas ‘cobbled together’ to form viable, relevant and
appropriate candidate solutions.

You should explore each candidate solution until you rule it out because it violates a con-
straint, or you have a good idea as to how you would implement it. This step benefits greatly
from experience, but the only way to get that experience is in the course of ‘hands-on’ design.

2.6 Decide on a Candidate Solution

Once you have a selection of candidate solutions for solving a particular problem, you must
decide which one you will attempt first. Decision-making is tough. One of the toughest parts
is to separate yourself from your decisions. Just because an idea is yours doesn’t mean that
it is the best idea! There are techniques to help make decisions. They take a little time, but
they take much less time than you lose if you make the wrong decision.

One technique follows this sequence of events:

1. Make a list of all the considerations that you want to incorporate into your decision.

2. Estimate the relative importance of each consideration. This is difficult, but sorting
the considerations two-at-a-time into a list can be very helpful. Assign a weight to each
consideration which reflects its relative importance. The most important consideration
might have a weight of 10, the next most important consideration might have a weight
of 6, and the least important consideration might have a weight of 0.2.

3. Now, without looking at the weights, look at each potential solution with respect
to each consideration on the list. Assign a number to each consideration which reflects
how well you feel the solution addresses the consideration. Note that you should
assess each consideration of each potential solution in random order (consideration
5 of solution 2, then consideration 12 of solution 5, etc.) so that your wishes don’t
influence the results.
12 CHAPTER 2. DESIGN

4. Finally, multiply the consideration values by the weights for each solution and compute
the total for each potential solution.
5. The best solution is the one with the highest score.

This method is not perfect (no method is), but it will be a great help.

2.7 Implement the Solution

You must implement your chosen solution in some manner so as to test it. Unlike under-
graduate engineering, do not ‘do the easy stuff first’. We admonish you to do the easy stuff
first on exams and tests so that you receive as many marks as you can. Design is different.

In design you should do the difficult bits first. This is because your design will not work
without all the parts working. The easy parts will work. You know this; that is what makes
them the easy parts! The hard parts are difficult precisely because you don’t know if you
can make them work. So, do the hard parts first so that you find out as soon as
possible if your proposed solution can work. This could save you huge amounts of
time. Consider the time you would waste doing all the easy parts, only to find out that
all the time spent on them was wasted because the hard part can not work for previously
unseen reasons.

There are many ways to implement your potential solutions. I recommend employing what
I call ‘the principle of minimum commitment’. This principle states that you commit as
little time and as few resources as absolutely necessary to accomplish your goal. In the case
of implementing a potential solution, this principle dictates that you should implement and
test blocks that are as small as possible. Remember, any one functional block that cannot be
made to work will jeopardize your whole solution, so don’t spend a lot of time building huge
systems only to find out that the fundamental concept on which your solution is based is
not correct. Instead, test the concept very early on. You can usually do this with relatively
little effort with ‘off-the-shelf’ circuits and equipment.

Actual construction of a circuit is important, and should be appropriate for the task that
the circuit is to perform. Good designs are ‘trashed’ by bad implementation. Circuits
which physically do not stay together cannot work, no matter how well-conceived the design.
Therefore, you should pay attention to circuit construction. Lets look at three examples.

In the first case, the circuit consists of a few op-amps, resistors and transistors. The voltages
are low, the currents are low, the signals have fairly high amplitude (tens of millivolts to a
few volts), and the frequencies are low (below about 100 KHz). Using a breadboard for this
circuit is entirely appropriate.

In the second example, we are trying to implement a power circuit for driving a motor.
The blocked rotor current of the motor is 10 amperes, and the supply voltage is 24 volts.
Constructing and testing this circuit on a breadboard is entirely inappropriate because the
2.8. EVALUATE THE SOLUTION 13

breadboards are not designed to accommodate component leads which are large enough to
properly handle 10 amperes, the contact area in the breadboard is insufficient for 10 ampere
currents, and finally, the connecting straps in the breadboards cannot carry 10 amperes.
Using a breadboard to implement and test this circuit will result in invalid test data due
to contact resistance, etc., a damaged breadboard and quite possibly destroyed components.
This circuit should be constructed on ‘perf board’ or a printed circuit board.

In the third example, signals are small, voltages are small, currents are small, and the
operating frequency of the circuit is about 2 MHz. A breadboard is inappropriate for this
case because the inter-contact capacitance of the breadboard will significantly affect circuit
operation. Further, the capacitance between wires on the breadboard, the inductance of
the wires, and in some circuits, the mutual inductance between wires can cause unwanted
coupling of signals. At these frequencies, care must be taken in construction. This circuit
should be constructed on ‘perf board’ or printed circuit board, paying particular attention
to component and wire layout.

Finally, we should talk about ‘lead dress’. Keep wiring neat, close to the breadboard, perf
board or printed circuit board (whichever you use), and make wires go ‘point-to-point’. It
looks ugly, but it works better. Do not bundle wires together for neatness. The signals
on bundled wires ‘talk to each other’ due to stray capacitance and mutual inductance.
Remember, electrons do not care about appearance.

2.8 Evaluate the Solution

Ah, testing! Its a pain, but it is fun if you approach it as a puzzle to solve.

USE AN OSCILLOSCOPE!!

I cannot stress this enough. Students assume that a voltmeter tells them the voltage. It lies.
If there is any kind of unusual waveform involved, the voltmeter lies to you. The oscilloscope
tells you the real story. If you need more accuracy, by all means use a voltmeter WITH an
oscilloscope. The oscilloscope confirms that the signal is appropriate for measurement with
the voltmeter.

When you make measurements, make sure that you make them properly. If in doubt, try a
‘test case’ for which you know what the measurement should be (measure the signal generator
output, a power supply, etc.).This will quickly confirm that you are making the measurement
properly (you have the right time-base setting, you have accounted for the ×10 ’scope probe,
your ’scope coupling is correct, etc.).

Important concept:

You must know what measurements and signals to expect from your circuit when
it is working properly.
14 CHAPTER 2. DESIGN

After all, if you don’t know what correct circuit operation looks like, you won’t be able to
recognize incorrect operation. Students invariably make convoluted arguments to convince
themselves that the signals they observe are correct. This is a bad idea because it confuses
you and diminishes your confidence in your circuit design. Instead, after careful consideration
of the circuit, predict what the signal should be like. Then make the measurement to see if
the actual signal matches your prediction. Manipulate the input signal to see if the signal
that you are measuring changes as it should. If measured signals match expected signals
(within measurement error, about ±10%), then continue with the next circuit.

If the actual and predicted signals do not agree, you have to do some detective work. This
is where the fun begins. Remember

Every measurement is telling you something about the circuit.

Make enough measurements at different parts of the circuit so that you can decide what
works and what doesn’t. Start making measurements at the input of your circuit. Make
sure that you understand why each signal appears as it does. When you see a signal that
agrees with your expectation of it, then move closer to the output. When you find a signal
that does not agree with your expectation, you have found the source of the problem.

At the problem site, inspect your circuit carefully first. A fragment of wire, or a broken wire,
could easily cause your problem. Then make sure that your devices are operating properly
by checking their bias conditions. You might remove a device to test it, but since this is so
time-consuming, you don’t want to test all devices initially.

When you confirm that a device is bad, THROW IT AWAY!

A team last year destroyed their entire controller by using a faulty device. They couldn’t
compete. You cannot fix these devices, so don’t keep bad ones.

Calm, cool, non-panicked thinking solves problems.

Good luck!

2.9 Strategy

Like any engineering problem, this contest lets you explore the trade-offs concerning com-
plexity, performance, cost, robustness, ease of implementation, etc. These are standard
trade-offs.

You should select your strategy with these trade-offs in mind. Everyone emphasizes different
trade-offs and so we get a large variety of designs. You should attempt to consider all
2.9. STRATEGY 15

possible ways in which you could compete. When most people look at a task requirement,
they usually assume immediately that some approaches are not possible. They have blinkers
on. They are told that some approaches are not possible, and their mental blinkers give
them the misconception that other approaches are not possible. Good design requires
removing the blinkers.
16 CHAPTER 2. DESIGN
Chapter 3

Energy Storage

Energy may be stored in many ways in this contest. The primary form of energy storage is
the batteries used to power the motors and all other circuits. You should be aware of the
nature of these batteries, and of batteries in general.

3.1 Batteries

There are many battery technologies, including nickel-cadmium, alkaline, carbon-zinc, lead-
acid, sealed lead-acid, gelled lead-acid, nickel-metal-hydride, mercury, air, lithium, etc. Each
technology has specific characteristics. Table 3.1 contains a summary of the characteristics
of some of the common battery types.

The batteries used in this contest are lead-acid types because they have a very low internal
resistance and a flat discharge profile. Their terminal voltage does not change a significant
amount from fully charged to almost completely discharged. The major disadvantage of any
of the lead-acid batteries is that they will be destroyed if they are discharged to below 1.81
volts per cell. Internally, a lead whisker grows between the plates, causing a short-circuited
cell. This whisker cannot grow if the cell voltage is in excess of 1.81 volts per cell.

Technology Rechargeable Nominal Internal Self Discharge


Voltage Resistance Rate

nickel-cadmium yes 1.25 very low high (2%-4%/day)


alkaline no 1.5 moderately high very low
carbon-zinc no 1.5 moderately high quite low
lead-acid yes 2.0 very low (0.1 Ω) fairly low
lithium no 3.0 high extremely low
Table 3.1: Battery characteristics

17
18 CHAPTER 3. ENERGY STORAGE

You should be extremely careful of these batteries, and of any batteries with a low internal
resistance. Consider our batteries. If a short circuit is connected between the terminals, the
current that flows is given by
Vopen
Ishort = (3.1)
Rint. res.
which is about 120 amperes for a nominal 12 volt battery. This is an arc welder! It may also
be an explosion or a fire. Don’t do it, ever.

3.2 ‘Stretchies’

Springs, elastics, and pre-tensioned materials can all store energy. These are very good
energy storage devices, but they release their energy cataclysmically! There is virtually no
bound on the rate of energy release and so the instantaneous power can be quite remarkable
(frankly, it can be awesome). Lets assume a simple example. Lets say we have a spring
with a spring constant of 10 Newtons per centimeter. (This spring would stretch about 2.2
centimeters to lift a pound of butter, so it is equivalent to a moderately strong elastic band.)
Now say that we made a catapult to shoot a typical 2-inch common nail with this spring.
The mass of this nail is about 10 grams and the head has an area of about 16 × 10−6 square
meters. Assume that the nail is to be fired head first from the catapult and that the spring
will be stretched 10 centimeters prior to firing.

The potential energy is 21 kx2 where k is the spring constant and x is the amount the spring
is stretched. The stored energy is thus 5 Joules. This energy will be completely converted
to kinetic energy on release of the spring. Kinetic energy is 21 mv 2 where m is projectile mass
and v is the ‘launch’ velocity. After manipulating and solving, we get a velocity of 31.6
meters/second.

When this nail hits an object, it releases all its energy. Lets assume that it decelerates
uniformly to a stop in 1 millisecond. The acceleration is about -31,600 meters/second2
(negative denotes deceleration), the distance the projectile travels is about 15.8 millimeters,
and the force it exerts on the target is about 316 Newtons. The pressure that it exerts on
the target is the force divided by the area of the nail head, or about 19.8 × 106 N/m2 . This
pressure is equivalent to the pressure exerted by a 32 kilogram mass supported on an area
the size of the nail head. This would easily pierce flesh and might damage bone. It could
easily blind someone.

The object of this computational exercise is to illustrate that a simple elastic band and
a small nail can cause severe injury because the elastic releases its energy very rapidly.
The same is true of springs, and other ‘stretchies’.

The fundamental problem with ‘stretchies’ (springs and elastics) is that their
stored energy may be small but their rate of energy release is enormous, resulting
in huge instantaneous power.

The energy is always released in the direction in which the elastic relaxes. A projectile will
3.3. OTHER ENERGY STORAGE TECHNIQUES 19

be fired along a line extending from its position when the elastic is stretched and through
the point at which the elastic is fixed, if complex force-redirecting mechanisms are not used.
This is the line of energy.

Beware of the line of energy. Never position yourself on it. If something goes wrong,
you don’t want to be a projectile’s ‘target’.

3.3 Other Energy Storage Techniques

Other forms of energy storage include gravitational (starting with a raised mass and allowing
it to fall), forms of chemical energy storage other than batteries (gasoline or other combustible
liquid for internal or external combustion engines, fuel cells, etc.), chemo-thermal reactions,
nuclear reactions, etc.), and compressed air. Some of these are more appropriate for a
particular application than others.
20 CHAPTER 3. ENERGY STORAGE
Chapter 4

Motors

4.1 Introduction to DC Motors

The motors most suitable for use in small systems are permanent magnet DC motors with
stationary magnets for the poles and a wound rotor (see figure 4.1). These are low-cost, very
simple devices. There are far more of them than you might imagine; Mabucchi, the largest
motor manufacturer, produces 3,000,000 DC motors per day, worldwide.

To gain some understanding of the operation of a DC motor, look at figure 4.2. In figures
4.2a and b, current flows in the armature coil in one direction. As a result, there will be
a force on the conductors of the armature because of Ampere’s Law. Since the armature
conductors are positioned away from the armature’s center of rotation, there will be a torque
applied to the armature due to this force. This torque is what turns the motor (if it is not
too heavily loaded). From these fundamental concepts, it is clear that the torque must be
proportional to the magnetic field strength of the stator poles, proportional to the armature
current, proportional to the number of armature turns, proportional to the distance of the
armature turns from the armature center of rotation, and proportional to the sine of the
angle made by the armature with the pole faces.

When the armature coil is aligned with the poles, then there is no further torque on the
armature because the angle made by the armature with the poles is zero. If the armature
rotates further and the direction of the armature current is unchanged, then the torque will
reverse direction. The result is that the motor armature will remain aligned with the poles;
the motor will not run.

If the direction of the armature current is reversed at the instant that the armature coil
becomes aligned with the poles, then the torque will not change direction. This will result
in the motor spinning in one direction. This is shown in figure 4.2c, where we see that the
armature current flows in the opposite direction through the armature coil.

The commutator and brushes are responsible for reversing the direction of the current as the

21
22 CHAPTER 4. MOTORS

permanent magnet poles

coils
rotor

N armature shaft
commutator

brushes
S

stator

Figure 4.1: A conceptual DC motor. Note especially the commutator region. No-one would
use this motor as it cannot be guaranteed to start, but it illustrates the principles.
4.1. INTRODUCTION TO DC MOTORS 23

n
P1

N S

s P2

a.

P1
n

N S
s
P2

b.

P2
n
N S
P1
s

c.

Figure 4.2: Operation of a DC motor. The armature rotates because the interaction of
the magnetic field due to the poles and the magnetic field due to the ampere turns on the
armature results in a torque applied to the armature. a. and b. The armature rotates with
current flowing in its coil in one direction. c. As the armature rotates past the pole face, the
current in the armature coil must be reversed to maintain the same direction of the torque.
24 CHAPTER 4. MOTORS

motor turns. You should carefully study figures 4.1 and 4.2 to see how this works.

We have seen that the torque is proportional to motor current, turns and magnetic field
strength of the poles. What else can we say about these motors?

We notice that the armature is a coil of wire. If we allow this coil to cut magnetic flux,
and if this coil is not connected to anything, then a voltage will be generated. Clearly
this will be the case when the armature rotates. Further, because the commutator changes
the connections to the armature coil every 180 degrees of armature rotation, the generated
voltage will be of one sign only.

What will this voltage depend on? Clearly it depends on the magnetic field strength of
the stator poles. (If the field strength were zero, no voltage would be generated.) It must
depend on the number of conductors, hence on the number of armature turns. Since the
voltage induced in a coil by a moving magnetic field is linearly proportional to the time rate
of change of flux, the voltage induced in the armature coil must be dependent on the speed
of armature rotation. This induced voltage is the basis for DC generators.

Now, lets start to put it all together. Lets consider what should happen if we apply a voltage
to a DC motor. In a real motor, the motor will start to turn and current will flow in the
armature. For the moment we will neglect frictional losses in the motor itself.

When the motor reaches its steady state running speed for the voltage we have applied, and
assuming that it is not connected to any mechanical load and that motor friction is zero,
the armature current should drop to zero. Why? Because if the current were not zero, then
electrical power would be delivered to the motor. Without a mechanical load, no mechanical
power would be produced, (the output torque would be zero) and so the motor itself must
be dissipating power. But if there are no motor losses, then this power must be stored as
energy in the motor, resulting in the motor’s internal energy growing without bound. This is
clearly not possible, and so the armature current for the ideal motor must be zero at steady
state.

With zero load at steady state, the armature current is zero and so there are no I 2 R losses
in the armature. This leads to two conclusions:

1. motor speed is sufficiently high that the induced voltage exactly equals the applied
voltage, and
2. the induced voltage ‘bucks’ the applied voltage.

Thus, we can say that under the no-load condition, motor speed is controlled by the applied
voltage.

Now lets look at the case of an infinite load. In this case, the motor cannot turn. The motor
is developing the maximum possible torque, but the load is so large that the motor doesn’t
turn. Thus, the induced voltage is zero. Under these conditions, the applied voltage must
be equal to the voltage drop across the armature due to the armature resistance.
4.2. STEADY-STATE MOTOR OPERATION 25

With a little thought, we see that the voltage drop across the armature resistance must be
proportional to the difference between the applied voltage and the induced voltage. (At zero
current, the induced voltage equals the applied voltage. At zero speed, the induced voltage
is zero and armature current is proportional to applied voltage. Since all the relationships
are linear, the combined relationship must be linear.)

From the foregoing we see that:

1. motor torque is proportional to armature current, armature turns, armature dimen-


sions, armature angle and pole strength, and
2. the applied voltage is equal to the sum of the induced voltage (called the ‘back e.m.f.’)
and the voltage drop due to the armature current flowing in the armature resistance.

For a given motor, torque is proportional to armature current.

Now we can explore these motors in more depth.

4.2 Steady-State Motor Operation

The motor speed equation relates applied voltage VM , motor speed ω, and armature current
Ia in accordance with item 2 above, and is given by
VM = Kω ω + Ia R. (4.1)
In this equation,
VM = the applied motor voltage
Kω = motor speed constant (volts per radians/sec)
ω = angular speed of the motor (radians/sec)
Ia = armature current (this is the motor current)
R = motor resistance (armature resistance + commutator resistance.
(4.2)
This equation says that the spinning motor generates a voltage or ‘back electromotive force’
Kω ω that ‘bucks’ the applied voltage. The current drawn by the motor is due to the difference
between the applied voltage and the back e.m.f, and the motor resistance.

The motor torque equation (an expression of item 1 above) is


TM = KT Ia (4.3)
where
TM = motor torque, neglecting losses
KT = motor torque constant (Newton-meters per ampere)
(4.4)
26 CHAPTER 4. MOTORS

A more realistic equation for the torque TL applied to a load is

TL = KT Ia − To − Kf ω (4.5)

where

To = torque losses independent of speed


Kf = coefficient of torque losses linearly dependent on speed (4.6)

This model ignores ‘stiction’, the startup friction which must be overcome whenever an
object is accelerated from rest (the model assumes that the motor is turning). The model
approximates small motors driving gearboxes and high-loss loads reasonably well. If we can
neglect these new losses, then this model becomes the simpler torque model.

If we put these two equations together by rearranging for Ia in equation 4.5 and substituting
into equation 4.1, we see that there is a relationship between speed and torque.

Kf R
 
VM = Kω + R ω + (TL + To ) (4.7)
KT KT
This equation is displayed as the speed-torque curve of figure 4.3. From this equation, we
see that the zero-speed torque TL,ω=0 and the zero-torque speed ωTL =0 are given by

KT
TL,ω=0 = VM − To
R
KT
V − To
R M
ωTL =0 =  Kf

KT
(4.8)
Kω + KT
R R

Clearly this relationship is affected by the applied voltage VM . We see that for a given torque
requirement and applied voltage, the speed is constant.

4.3 Motor Dynamics

You should also be concerned with motor dynamics. The motor combined with its load
have a moment of inertia J. Torque will be required to accelerate the motor. Thus, (with
reference to your year 2 dynamics text) we can write a general equation for the motor

JR dω TL
VM = Kω ω + + R (4.9)
KT dt KT
where TL is the steady state load torque required. This is a linear, first-order differential
equation. It must have an exponential solution. The solution can be found by evaluating
the boundary conditions (at t = 0 and t → ∞) we find that the solution is

1 TL
  
ω= VM − R 1 − e−t/τ (4.10)
Kω KT
4.3. MOTOR DYNAMICS 27

torque zero−speed torque (due to blocked rotor current)

zero−torque speed
(due to back e.m.f)

speed

Typical Speed−Torque Curve


torque

due to motor losses

slope = Kw

motor current

Typical Current−Torque Curve

Figure 4.3: Typical characteristic curves of a D.C. motor. See text for the expressions of
zero-speed torque and zero-torque speed.
28 CHAPTER 4. MOTORS

L
V
A
Vo

I
D C R

Figure 4.4: A simple circuit to illustrate the flyback effect of an inductor.

with
JR
τ= (4.11)
KT K ω
We have ignored the inductance of the motor because the inertia of the load and armature
are usually dominant.

Expressing this system as a black box with motor voltage as the input and motor speed as
the output, we can write the transfer function as
1 TL 1
 
ω(s) = VM (s) − R JR (4.12)
Kω KT s KT Kω + 1

from which it is readily apparent that the transfer function relating speed to applied voltage
is a first-order low-pass filter. The frequency at which the velocity response is reduced by
3db is clearly that frequency for which the two terms in the denominator of equation 4.12
are equal. This frequency is 1/τ radians per second.

4.4 Motor Inductance

The inductance of the motor must also be considered. We will show that motor inductance
is important in the design of power circuits to drive the motor. Clearly, the motor should
exhibit inductance because the armature consists of coils of wire.

You should recall that an inductor builds a magnetic field when current flows through it.
The equation for an inductor,
di
V =L (4.13)
dt
implies that the inductor will try to make the voltage across it sufficient to maintain the
current flow.

Consider the circuit in figure 4.4. When the current I flows in the source, the diode is reverse
biased, the inductor current is I, and we assume that the capacitor is large enough that its
4.5. THE MOTOR AS A GENERATOR 29

voltage VC does not change for ∆t, the time that I flows. The current into the capacitor is
I − VC /R and the voltage change across the capacitor due to this current is

I − VC /R
∆VC ≈ ∆t. (4.14)
C
To meet the assumption that ∆VC << VC as stated above, we must select C appropriately.

So we now have the situation that current is flowing through L, the voltage across C is VC ,
and the diode is reverse biased. Now we turn off the current source. The inductor current
starts to drop, and so di/dt starts to increase in magnitude, and is negative. Eventually (and
it doesn’t take very long) the voltage across the inductor is sufficiently large and negative
that VA is sufficiently negative to turn on the diode. We are still assuming that the voltage
VC is relatively unchanged.

When VA is low enough to turn on the diode, there is a current path for the inductor
current; from ground, through the diode, through the inductor, and through the load to
ground. Thus, the inductor current does not change greatly since the inductor changes its
terminal voltage so as to keep current flowing. In this circuit, the diode is frequently called
a ‘catch’ diode or a ‘freewheeling’ diode. By pulsing I with the appropriate pulse width and
rate, we can cause the voltage across the load resistor R to be nearly constant at whatever
value we wish. This circuit is one form of switching voltage regulator.

Where does the energy come from to supply this current? Well, when the source current I
was flowing, energy was stored in the magnetic field of the inductor. The energy EL stored
was
1
EL = LI 2 . (4.15)
2
Since the inductor does not dissipate energy nor create energy, it must deliver this energy
when the source current is zero. Thus, the magnetic field decays to provide the current
required.

With respect to the D.C. motor in the circuit of figure 4.5, when the switch is closed, current
IM flows through the motor. When the switch is opened, what happens? The inductance of
the motor causes voltage VS to increase rapidly, until current IM flows. Is there any voltage
for which this current will flow if the switch is open? What will happen? This circuit is a
‘smoke generator’. Explain why to yourself.

From this, we see that the inductance of the motor is important. We solved this problem in
the circuit in figure 4.4 with a diode. How could we solve the problem in this circuit?

4.5 The Motor as a Generator

A DC motor behaves as a generator when it is driven by its shaft. This is clearly seen from
equations 4.1 and 4.5. When driven by the shaft, the torque output of the motor is negative.
30 CHAPTER 4. MOTORS

V
Batt

Motor

VS

switch

Figure 4.5: Switching motor current, and the importance of motor inductance.

If the motor is not connected to an electrical load, then the motor current is zero and the
second term on the right of equation 4.1 is zero. The generated voltage is then just given by

VG = Kω ω (4.16)

where VG is the generated motor voltage, and ω is the angular velocity at which the motor
shaft is driven. By measuring the generated voltage, we can measure motor speed.

4.6 Measuring Motor Constants

4.6.1 Kω

Measurement of motor constants is fairly straightforward. The ‘velocity constant’ Kω is


found first. Disconnect the motor from the circuit, spin the armature at a known angular
velocity and read the terminal voltage VG . Then Kω is just VG /ω.

4.6.2 KT

The torque constant KT has the same numerical value (although different units) as the speed
constant Kω . To see this, we have to separate the losses from the energy conversion function
of the motor. With this in mind, we see that the Kω ω term in equation 4.1 relates to energy
conversion, and the Ia R term represents losses. Further, we also note that the mechanical
4.6. MEASURING MOTOR CONSTANTS 31

power produced must be identical to the electrical power flowing into the motor, if losses are
neglected.

The electrical power supplied by the power source is determined by multiplying equation 4.1
by Ia yielding
PE = (Kω ω + Ia R)Ia (4.17)
Now, the Kω ωIa term represents power which is converted to mechanical power, and the
Ia2 R term represents losses. These losses will not be considered further because we separate
them from the energy conversion function of the motor. The mechanical power produced is
found by multiplying equation 4.5 by ω, yielding

PM = KT Ia ω. (4.18)

Again, we are looking at the energy conversion function only.

Now PE = PM , because the ideal energy converter neither creates not dissipates power, so
we have
Kω ωIa = KT Ia ω (4.19)
from which we find that the numerical values of Kω and KT are equal.

4.6.3 R

We can determine the armature resistance R by connecting the motor to a known voltage
source. We measure the voltage, the motor current, and the angular velocity, and rearrange
equation 4.1 to solve for R.

The ‘blocked rotor’ current is the current that flows when the armature is not rotating. We
find this current by solving equation 4.1 for the case of ω = 0. While we should be able to
merely measure the current when the armature is not moving, this yields erroneous values
because the measurement is sensitive to the relative position of the commutator segments
with respect to the motor brushes.

4.6.4 Kf

The speed-dependent torque loss coefficient Kf can be determined by removing any external
load from the motor (so TL = 0), and then monitoring current Ia and speed ω for two
significantly different speeds. If Ia,1 and ω1 correspond to the first measurement, we get
from equation 4.5
To + Kf ω1 = KT Ia,1 . (4.20)
Similarly, the second measurement yields

To + Kf ω2 = KT Ia,2 . (4.21)
32 CHAPTER 4. MOTORS

Subtracting these equations, we get

Kf (ω1 − ω2 ) = KT (Ia,1 − Ia,2 ) (4.22)

resulting in
KT (Ia,1 − Ia,2 )
Kf = . (4.23)
ω1 − ω2

4.6.5 To

Since all the other constants of equation 4.5 have been determined, solving for To is straight-
forward.

4.6.6 L

Determining motor inductance is a little tricky, because we must measure the L/R time
constant of the motor. This is accomplished by turning on the MOSFET in figure 4.6,
letting the motor reach its steady-state velocity, and then turning the MOSFET off. When
the MOSFET is turned off, the inductance of the motor will result in a flyback spike. (Explain
why.)

We monitor the voltage across the MOSFET during this sequence, observing the voltage
L
waveform of figure 4.6. We fit a decaying exponential with time constant 2R to segment
A of the voltage waveform. Since R is known, we can compute L. The time constant is
L
2R
because the motor inductance discharges through the series combination of the motor
resistance R and the resistor in series with the diode. We have neglected the voltage drop
across the diode and we assume that its forward resistance is negligible compared to the two
resistances.

4.6.7 Caveat

Good engineering practice is to determine the constants when operating the motor as near
to the actual operating conditions as possible. This minimizes the impact of the assumptions
made in the various models that we have used, such as ignoring ‘stiction’, and the assuming
that the motor is linear.
4.6. MEASURING MOTOR CONSTANTS 33

V
batt

motor L
D

R R

a.

MOSFET on

MOSFET off

VS

flyback ‘spike’

back e.m.f of motor b.

Figure 4.6: Motor inductance. a. A simple circuit to measure motor inductance. b. The
voltage observed at the drain lead of the MOSFET when it switches the motor on and off.
34 CHAPTER 4. MOTORS
Chapter 5

Motor Control

Precise motion control requires accurate control of motor speed. There are basically two
types of speed controller. Linear controllers are useful for very small motors. You can think
of them as electronically-controllable high-power resistors.

Consider putting a resistor RA in series with a motor having a resistance R. With a supply
voltage of Vcc , the voltage across the motor is Vcc R/(R + RA ). As we have seen in section
4, motor speed is a function of the applied voltage, and so by changing RA we can change
motor speed.

There are two problems with this approach. Firstly, the control resistor must dissipate
significant amounts of power. This wastes power in battery-powered systems. Secondly, large
heatsinks and/or cooling fans are required to remove the heat due to this power dissipation.
For these reasons, linear controllers are used only with very small motors.

Another approach to motor control exploits the low-pass characteristic of motors. Consider
placing a switch in series with the motor. For the moment, ignore the inductance of the
motor. In this scenario, if we close the switch we place full supply voltage across the motor.
When the switch is open, the applied voltage is zero. In either case the switch dissipates
no power, because when it is closed there is no voltage drop across it, and when it is open
there is no current through it. Thus, power dissipation in the switch is always zero and so
no energy is wasted.

Lets assume that we operate the switch with a period of T seconds per switching cycle and
with a duty cycle of D. (Duty cycle is the ratio of the time the switch is closed to the
period of switch operation.) Thus, the voltage applied to the motor is a rectangular wave of
amplitude Vcc with period T and duty cycle D. If we calculate the Fourier transform of this
voltage, we find that it has a D.C. term of Vcc D (the average of the waveform, and the first
term in the Fourier series), a fundamental frequency component at frequency 1/T , and every
odd harmonic of the fundamental component. (Explore this; make the signal and compute
its Fourier transform either numerically using MatLab, MathCad, or some other package, or
analytically.)

35
36 CHAPTER 5. MOTOR CONTROL

amplitude dependent on duty cycle

spectrum of pulse width modulator

frequency
response of
motor

f
fo 10 f o

Figure 5.1: Motor frequency response, and the pulse width modulator spectrum.

We are interested in the D.C. component only, because it is proportional to the duty cycle D
and so by varying the duty cycle (an easy task) we can vary the voltage applied to the motor.
To make the D.C. term the only significant component, we select the operating frequency to
be much higher than the cutoff frequency of the motor. We recall from equation 4.12 that
this frequency is KT Kω /(JR). If we can operate at a sufficiently high frequency, then we
can control motor speed by varying the duty cycle. This is called Pulse Width Modulation
control.

How much higher must the operating frequency be than the cutoff frequency? Note that the
motor exhibits a first-order low-pass characteristic, ‘rolling off’ at -20 db per decade. Thus,
if we want the attenuation of all the non-D.C. terms to be at least 40 db (reducing them
by at least a factor of 100), we must ensure that the switching frequency 1/T is at least 2
decades above the motor cutoff frequency.

Generally we must go higher in frequency than this because of an effect due to the brushes
and commutator of the motor. When the motor runs, the commutator segments pass under
the brushes at a rate equal to the rotational frequency times the number of armature poles.
This means that a three-pole motor turning at 6000 r.p.m., which is 100 revolutions per
second, has a commutator rate of 300 Hz. The motor controller should be operated at
a frequency which ensures that the beat1 frequency caused by the commutator rate and
1
If two signals at different frequencies are passed simultaneously through a square-law system, the output
will have components containing each input frequency, a component at the difference of the input frequencies
and a component at the sum of the input frequencies. These latter two components are ‘beat’ frequency
components. Thus, the output of a square-law system due to inputs at 100 Hz and 150 Hz will contain beat
frequencies at 50 Hz and 250 Hz, and components at 100 Hz and 150 Hz. You should do the math to show
this to prove it to yourself.
Other non-linear systems exhibit similar behaviour. Why? (Consider a Taylor series expansion of the
system.)
5.1. UNI-DIRECTIONAL DRIVER 37

V
batt

motor

VG

Figure 5.2: A simple uni-directional motor driver.

the switching frequency is well above the cutoff frequency of the motor. If the operating
frequency is too low, the motor will sound as if it is breaking up and will twitch and jerk.

As an example, if the 6000 r.p.m. motor above has a -3db cutoff frequency of 5 Hz and we
want to suppress the beat frequency components by a factor of 100, then the beat frequency
must be at least 500 Hz which is two decades above the cutoff frequency. Thus, the operating
frequency of the motor controller switch must be at least 800 Hz which is the sum of the
beat frequency (5 Hz × 100) and the commutator rate (300 Hz).

A switching speed controller consists of timing circuitry and motor driver circuitry. We will
first look at several configurations of motor drivers.

5.1 Uni-Directional Driver

This simple unidirectional motor driver has the disadvantage that its name implies; it can
only drive the motor in one direction. Its major advantage is that it is simple.

The uni-directional driver is shown in figure 5.2. The supply voltage Vbatt is applied across
the motor if VG is raised to a sufficiently high voltage.
38 CHAPTER 5. MOTOR CONTROL

5.1.1 Determining the Required VGS

You want to have the minimum voltage drop across the MOSFET so as to minimize its power
dissipation and maximize the voltage applied to the motor. To do this, VG must be large
enough to ensure that the MOSFET will carry the maximum current required by the motor.
Thus, you must determine the maximum motor current (the blocked rotor current), and
then use the transconductance curves for the MOSFET which are found in its specifications.
Be conservative in your design; ensure that you have a large enough VG for the worst-case
situation. (What is the worst-case situation?) You must also ensure that you do not exceed
the maximum permissible gate-to-source voltage.

5.1.2 Determining MOSFET Power Dissipation

As usual, we must design for the worst-case situation. Power dissipation occurs when the
motor cannot turn (blocked rotor condition) and the controller keeps the motor on constantly.
The power dissipation is then due to the blocked rotor current and the RDS (on) of the
MOSFET for this current, drain-source voltage and gate-source voltage. You must find the
value of RDS (on) from the spec. sheet.

Another source of power dissipation in the MOSFET is due to the reverse recovery current
of the diode, discussed below.

You must establish the operating conditions that result in the worst-case power dissipation
and ensure that the MOSFET and heatsinks are selected to handle this power.

5.1.3 Miller Capacitance and Gate Resistance

Power MOSFETs (indeed, any FET) has a capacitance from drain to gate. This capacitance
is the limiting factor on the speed of operation of the device. This is illustrated in figure 5.3.
In the figure, the gate-drain and gate-source capacitances which are normally considered to
be part of the MOSFET are shown as circuit elements (connected with dotted ‘wires’) so as
to make them more obvious.

You should recall that the expression for the drain current of a MOSFET is given by

iD = K(vGS − VT )2 (5.1)

and so the drain voltage will be

vD = VCC − ZD K(vGS − VT )2 (5.2)

From the -ve sign in front of the second term on the right, we can see that the MOSFET
inverts the input signal.
5.1. UNI-DIRECTIONAL DRIVER 39

V
batt

L
motor model
D
R
C
gd

Is I
2
Q

R1
Vs
I C
1 gs

Figure 5.3: A simple, single MOSFET motor driver with the gate-drain and gate-source
capacitances made explicit.
40 CHAPTER 5. MOTOR CONTROL

Now lets look at our circuit conceptually. If we were to increase Vs suddenly by a small
amount, the voltage at the gate would start to rise. This would turn the MOSFET on more,
with the result that the output voltage would start to drop. When this happens, there is a
changing voltage across Cgd which causes current I2 to flow from the gate to the drain. This
increase in I2 ‘steals’ current that would otherwise be used to charge Cgs , thereby slowing the
rate at which gate voltage rises and thereby slowing the rate at which drain voltage drops.
This clearly affects the speed of the circuit.

Now that we have the concept clear, lets look at the math. We will make one simplification,
but this does not change the nature of the effect. The equations for Is , I1 and I2 are
vS − vG
Is = (5.3)
RS
dvG
I1 = Cgs (5.4)
dt
d(vG − vD )
I2 = Cgd (5.5)
dt
where vG = vGS since the source is grounded. If we write the node equation at the gate and
substitute the equation for drain voltage, we get

vS − vG dvG d
= Cgs + Cgd [vG − VCC + ZD K(vG − VT )2 ]
RS dt dt
dvG
= [Cgs + Cgd (1 + 2ZD K(vG − VT ))] (5.6)
dt
Now for the approximation; if we assume that the gate voltage will only change slightly, then
vG − VT is essentially constant. Under these conditions, we can show that the low-frequency
voltage gain Av of the circuit is just 2ZD K(vG − VT ). (You should derive this to prove it to
yourself.) When we say ‘low frequency gain’ we mean the gain at frequencies for which the
gate-drain and gate-source capacitances are essentially open circuits.

Re-arranging the node equation, we get

dvG vG vS
[Cgs + Cgd (1 + Av )] + = (5.7)
dt RS RS

which has the solution


vG = vS (1 − e−t/τ ) (5.8)
with
τ = RS [Cgs + Cgd (1 + Av )] (5.9)
If we express vG in terms of vS in the Laplace domain, we will see that the equivalent circuit
of the input to our circuit is a first-order R − C low-pass filter in which the shunt capacitance
is Cgs + Cgd (1 + AV ). (Try it and see.) The term Cgd (1 + Av ) is called the Miller capacitance,
denoted CM . The result of the Miller capacitance is that the gate voltage will rise slowly
and so the drain voltage must fall slowly. This certainly supports our previous conceptual
look at the circuit.
5.2. DIODE SPECIFICATIONS 41

Our assumption of vG −VT being constant is only true for the small signal case. How accurate
is this model for the large-signal case? It is not too bad and certainly gives us the ‘flavour’
of the circuit’s performance. If we don’t make the assumption, the differential equation is
harder to solve because it has a non-constant coefficient.

We can see from equation 5.9 that the time constant is controlled in part by selection of RS .
Clearly, if we make RS = 0 the Miller capacitance has no effect. This is because RS = 0
implies that the gate is connected to a voltage source and so the gate voltage will equal the
source voltage regardless of currents conducted by Cgs and Cgd .

In some applications, you may wish to control the rate of change of drain current to let it
rise slowly. You can do this by selecting RS and/or by adding a capacitance from gate to
ground to change the time constant of the input circuit.

You should note that the Miller effect only occurs if the drain voltage is changing. If the
MOSFET drain voltage is either at VCC or ground because the device is either fully on or
fully off, then the current through Cgd will be due to the rate of change of gate voltage only,
and so the Av term in equation 5.9 will not be present.

Finally, this Miller effect occurs for any and all systems. It is not just a characteristic of
MOSFET power circuits. In many circuits, the maximum operating frequency is limited by
the Miller capacitance unless the circuits are specially designed to minimize its effect. This
is especially true for radio frequency circuits.

5.2 Diode Specifications

5.2.1 Peak Reverse Voltage

Clearly the diode must have a peak reverse voltage in excess of the power supply voltage;
when the motor is on and running, the diode is reverse biased by the supply.

5.2.2 Forward Current

When the MOSFET is switched off, the magnetic field around the motor armature coils
will decrease at a rate which maintains the current flow through these coils. This is made
possible by the diode across the motor which provides a path for this current. Since the
inductance works to prevent instantaneous changes in motor current, the diode must be
capable of carrying the maximum motor current.

Some diodes have a repetitive peak current specification as well as a continuous current
specification. You must make sure that your design does not exceed either specification.
The repetitive peak current specification relates to the maximum current that the device can
42 CHAPTER 5. MOTOR CONTROL

carry. The continuous current specification really relates to the maximum power dissipation
of the diode. It will get too hot and burn up if you exceed the continuous specification for
a long time.

5.2.3 Reverse Recovery Time

Diodes have one more specification that is of interest to us. When the diode voltage is
switched from forward bias to reverse bias, the diode will continue to conduct for a very
brief period of time. This is called the reverse recovery time. For the unidirectional motor
driver, this is important because it means that for a brief period of time after turning on
the MOSFET, the diode will conduct. Thus, the MOSFET drain current will consist of the
motor current and the diode’s reverse recovery current. This can result in the MOSFET
conducting excessive current. Since the diode voltage is essentially zero when the MOSFET
is first turned on, the instantaneous power dissipation of the MOSFET is given by the supply
voltage and the reverse recovery current. This is a major cause of power dissipation in the
MOSFET, especially with increasing operating frequency (more turn-ons per second). One
way to limit reverse recovery current by selecting appropriate diodes.

There is also a way to overcome this problem in the design of the circuit. If we select VG
so that the maximum current that the MOSFET will conduct is only slightly greater than
the maximum motor current, then excessive drain current is avoided. Further, if we insist
that the MOSFET turns on relatively slowly, then the initial current that it conducts will be
predominantly the diode reverse recovery current. As this current drops, the motor current
will constitute an ever-larger portion of the MOSFET’s drain current.

Finally, we note that the motor current will not rise instantaneously, and so the total drain
current will be dominated by reverse recovery current initially. The shape of the motor
current curve with time is a function of the inductance and armature resistance. Usually it
is not possible to pick a diode for which the decay of reverse recovery current matches the
rise of motor current.

5.3 Half-Bridge Driver

The half-bridge driver is more complex than the unidirectional driver but it provides control
of the motor in both directions. Its major disadvantage is that it requires a split power
supply.

The half-bridge driver is shown conceptually in figure 5.4a and typical circuit is shown in
figure 5.4b. In the circuit on the left, only one switch is closed at a time. By closing only
one switch we can make the motor run either forward or backward. Diodes D1 and D2 act
as ‘freewheeling’ diodes to conduct the current generated by the collapsing magnetic field in
the armature inductance back into the batteries. Lets see how this works.
5.3. HALF-BRIDGE DRIVER 43

V
batt

S1 D1
motor

V
M

IM
S2 D2

− Vbatt

R3
R5 Vbatt

R7 Q1 Q3
VF D1 motor
R1

R2
VR D2
R8 Q2 Q4

R6 −V
R4 batt

Figure 5.4: A half-bridge motor driver. a) Conceptual design. b) Example of a simple design.
44 CHAPTER 5. MOTOR CONTROL

Lets assume that the motor speed is controlled by a pulse-width modulation scheme. Lets
further assume that we are controlling switch S1 and switch S2 is left open. When S1 is
closed, current flows as shown through the motor as shown and voltage VM is essentially
the positive battery voltage. When we open S1 , voltage VM almost instantaneously becomes
negative due to the inductance of the motor. VM decreases (becomes more negative) until
diode D2 turns on, at which time the motor current can flow from the motor, through D2
and into the lower battery. Thus, when S1 is closed, the motor is powered by the upper
battery. When S1 is opened, the energy stored by the motor inductance is transferred to the
lower battery. Clearly, a similar situation exists with respect to switch S2 .

It is clear from the conceptual circuit in the figure that we do not want to close both switches
at the same time because this would result in a short circuit across the power supply. In
our implementation of the half-bridge driver, we might be tempted to connect the gates of
the two MOSFETs together and to drive them from a single drive signal. Our reasoning
might be something like ‘when the gate signal is high, the N-channel MOSFET will be on
and the P-channel device will be off. When the gate signal is low, the P-channel device will
be on and the N-channel MOSFET will be off’. Connecting the gates together is generally
a bad idea which will result in excessive power dissipation and probably smoke (for a brief
period of time). This is because both devices will usually be on when the gate drive signal is
changing from low to high or high to low. The maximum current that will flow during these
transitions can be determined from the transconductance characteristics of the two devices
which are published in their spec. sheets. (Under what conditions could you connect the
gates together and drive them from a common signal in the design of a half-bridge driver?)

In the example circuit of figure 5.4, transistors Q1 and Q2 drive the MOSFETs, Q3 and Q4 .
The MOSFETs are used as the switches S1 and S2 . We don’t see any freewheeling diodes in
this figure however. This is because a diode is present in the MOSFET itself. This diode,
called the ‘body diode’, is created because of the internal structure of the MOSFET. The
body diode can carry the same current that the MOSFET can carry and so it makes a good
(and free) freewheeling diode. The only problem with it is that it has a long reverse recovery
time because it has a large capacitance. While this is a problem in high-frequency power
switching circuits, it should not be a problem in motor drive applications if care is taken in
the design of the rest of the circuit.

We would like to ensure that the MOSFETs do not conduct too much current when they are
turned on. If we are pulsing MOSFET Q3 , the freewheeling diode is the body diode of Q4 .
We know that during the reverse recovery time the freewheeling diode will be conducting
and the motor current will start to flow. Analysis of the currents and times may reveal that
we want to limit the MOSFET drain current to safe values during this time. Thus, we would
like the MOSFET to turn on slowly.

We would like the MOSFET to turn off quickly, however, to minimize its power dissipation.
While the power dissipation will be low when the MOSFET is fully turned on (it will be
2
ID RDS (on)) and zero when the MOSFET is off, it will be quite considerable when the
MOSFET is switching on or switching off. As the current rises or falls, the drain voltage
also falls or rises at the same time. The instantaneous power is considerable during these
5.4. FULL BRIDGE DRIVER 45

transitions because both voltage and current have significant values. The longer the duration
of the transitions (the longer the rise and fall times of current and voltage), the greater the
average power dissipation.

Thus, we would like the MOSFET turn-on to be slow to limit drain current, but we want the
turn-off to be fast to reduce power dissipation. Resistors R3 and R4 , and diode D1 are used
to accomplish this. When VF is sufficiently high to turn on Q1 , the collector of Q1 goes to
zero volts. Diode D1 is reverse biased, so the gate voltage of MOSFET Q3 decreases to zero
volts because its input capacitance (Cgs + CM ) is charged through R5 . Thus, the turn-on
time constant is R5 (Cgs + CM ).

When VF goes sufficiently low to turn off Q1 , the collector of Q1 can rise. Prior to turning off
Q1 the input capacitance of Q3 is charged with the supply voltage so the voltage at the gate
of Q3 is about zero (since the input capacitance is measured between gate and source). Thus,
with Q1 turned off, Q3 ’s gate voltage will rise to the supply voltage with a time constant of
R3 (Cgs + CM ).

To achieve rapid turn-off and slow turn-on of the MOSFET, we see that R3 must be smaller
(usually considerably smaller) than R5 . We can pick suitable values by considering the
MOSFET drain current, the body diode reverse recovery time, the power dissipation of Q1
and the MOSFET, and the MOSFET input capacitance.

Finally, we can determine the motor speed by measuring the motor voltage when the MOS-
FETs are turned off. The best time to measure this voltage is just prior to turning on a
MOSFET. Why is this? See figure 4.6b.

5.4 Full Bridge Driver

If we want more motor power, we want to apply more motor voltage. Therefore, we must
either increase battery voltage or make better use of the batteries. Notice that in the half-
bridge driver, only one battery is used to power the motor at any time.

Lets look at the conceptual circuit in figure 5.5. By closing switches S1 and S4 and opening
the other two switches, we can cause the motor current to flow as shown. To reverse the
motor, we need to reverse the current through it. We can do this by opening switches S1
and S4 and closing switches S2 and S3 . Make sure that when changing motor direction you
open switches before you close other switches (Why?).

For a given direction, you only need to pulse one switch, not both switches.

If you look carefully at the conceptual circuit of the full bridge, you should notice that it is
essentially two half bridges. Therefore, the design issues that you need to consider are . . . .
Are there any other considerations?

By controlling which switches are on and (possibly) by pulsing switches, you can control
46 CHAPTER 5. MOTOR CONTROL

V
batt

S1 D1 D3 S3
motor

IM
S2 D2 D4 S4

− Vbatt

Figure 5.5: Conceptual circuit for a full-bridge driver.

motor speed and direction, permit the motor to ‘coast’ or apply braking. You might want
to look into these aspects of motor control further. See the reading list, or consult one of
the mentors.
Chapter 6

Computing with Analog Components

Voltages and currents may be used to represent numbers so that circuits can perform com-
putations. Thus, we can perform the computations required for a system by representing
the system variables (numbers) by voltages or currents, and then inputting these signals into
the appropriate circuitry. The circuit output will be a representation of the desired result
of the numerical computation. This is called ‘analog computing’ because voltages and/or
currents are used as ‘electrical analogs’ of physical quantities.

Any system’s variables may be represented by analog signals. Temperature may be repre-
sented as a voltage (so many millivolts per degree Kelvin), or as a current. Force, pressure,
heat flow, strain, torque, and any and all variables internal to a system may be represented
this way. This allows us to ‘model’ system performance with an electrical system which is
usually faster, easier, and cheaper than testing the real system. In years gone by, analog
computation was taught as part of the Electrical Engineering program in most universi-
ties and was a major research tool for system simulation and testing. Digital computers
have usurped analog computers for simulation in most fields, although analog computing
is making a come-back. Some advanced computer vision and image processing systems use
analog computation, as do neural networks and other speed-sensitive or very-high-density
applications.

When representing numbers with signals, it is not always necessary to make the signal directly
proportional to the number to be represented. Consider a transistor amplifier circuit. The
circuit is biased at some operating point (Q point). We can consider this operating point to
represent the number zero if we wish. Positive numbers might be represented as increases in
Vce and negative numbers as decreases in Vce . Alternatively, the sign of the Vce change may
not agree with the sign of the number being represented. As another alternative, we may
represent the number by the collector current and not by collector-emitter voltage.

You will frequently wish to convert voltage to current or vice versa. The absolute simplest
circuit for converting voltage to current and current to voltage is a resistor. How is it
possible that a resistor can be used to convert current to voltage and also to convert voltage
to current? The answer to this is a little philosophical. Voltage across a resistance and

47
48 CHAPTER 6. COMPUTING WITH ANALOG COMPONENTS

current through it are related by Ohm’s Law. Because of this, the function performed by
the resistance (current-to-voltage or voltage-to-current) is a matter of the point of view of
the circuit designer! If the independent variable is current (we’ll see how we can make this
so later) then the resistor is a current to voltage converter. If the independent variable is
voltage, then it is a voltage to current converter.

6.1 Op-Amp Concepts

An operational amplifier, or op-amp, is an amplifier with two inputs, called the inverting
and non-inverting inputs, and one output. The output voltage Vo is proportional to the
difference between the two input voltages V+ and V− ,

Vo = A(V+ − V− ) (6.1)

where V+ and V− are the voltages on the non-inverting and inverting terminals respectively.
The gain A is typically between 105 and 107 , and is often approximated as infinite. The
input resistance of the amplifier is extremely large, also approximated as being infinite. The
output resistance is usually assumed to be zero, but is usually in the range of 25 to 100
ohms.

The op-amp’s output usually cannot exceed the supply ‘rails’ because the op-amp has no
internal mechanism for boosting voltage. An op-amp (or any other circuit) whose output
can go to the supply voltages is said to ‘swing rail-to-rail’. Many amplifiers cannot do this
because of their internal circuitry (see an equivalent circuit of any common op-amp), but
new circuits are being developed which can swing rail-to-rail because of demand for lower
operating voltages. (Why would this require rail-to-rail output swings?)

The op-amp can be used in a vast number of ways. In one large class of circuits, the op-amp
and associated circuitry is configured so that the op-amp forces its two inputs to be almost
identical. These are called negative feedback circuits. In these circuits, a disturbance (noise)
on either of the op-amp’s inputs will cause a change in the op-amp output which at least
partially corrects or compensates for the initial disturbance. The block diagram of such a
system is shown in figure 6.1. Consider a small increase in Vin . This causes an increase in the
input to the box marked G. The output Vo will increase correspondingly, which increases the
input to the H block. This in turn leads to an increase in Vf b which reduces the difference
between Vin and Vf b and thus reduces the input to the G block. Thus, the circuit attempts
to make Vf b match Vin . This is a fundamental characteristic of negative feedback systems.

From equation 6.1, we can see that if the magnitude of Vo is to be less than the supply
voltage, as A gets bigger the difference between V+ and V− must get smaller. In the limit
as A approaches infinity, this difference must go to zero. This is a characteristic of negative
feedback circuits, not of op-amps generally.

In switching circuits, the op-amp and associated components are configured to prevent the
two inputs from being similar. These circuits employ positive feedback; that is, one input
6.2. ADDITION 49

op−amp
V
in

G Vo

V
fb

Figure 6.1: A negative feedback system. Disturbances or noise on either op-amp input cause
the output to change in a manner which corrects or compensates for the initial disturbance.

is driven by the amplifier output (usually through additional circuitry) so that it does not
match the other (usually external) input. If the two inputs should match at any time, the
circuit changes its output. See the section on Schmitt triggers for further discussion on
circuits of this type.

Oscillators employ sufficient positive feedback at one frequency only to maintain oscillation.
At other frequencies, feedback is not sufficient for oscillation. This results in the oscillator
generating one frequency only. More discussion on oscillators will follow.

6.2 Addition

We will look at an inverting op-amp summing circuit as an example of a simple analog


computation (figure 6.2). This circuit is based on the concept of current summation. At
low frequencies, the op-amp may be considered to have infinite (or at least very large) gain
and input resistance, and zero (or very low) output resistance. To analyze the circuit, lets
assume a finite gain A for the op-amp and then take the limit as A goes to infinity.

The voltage at the non-inverting terminal is zero. The voltage at the inverting terminal can
be found by solving the node equation at this point
Vin1 − V− Vin2 − V− V− − Vo
+ = . (6.2)
R1 R2 Rf
Combining these two equations and solving for Vo , we get
" #
ARf ARf
Vo = − V1 + V2 (6.3)
Rf + R1 (A + 1) Rf + R2 (A + 1)
50 CHAPTER 6. COMPUTING WITH ANALOG COMPONENTS

R4
R1
V1
+Vcc

R2 −
V2 Vout
+

R3
V3 −Vcc

Figure 6.2: Inverting summing amplifier

Now if we let A go to infinity, we see that

Rf Rf
 
Vo = − V1 + V2 (6.4)
R1 R2

In general, with multiple inputs and with A approaching infinity,


N
X Vi
Vo = −Rf (6.5)
i=1 Ri

Clearly, we may compute a weighted sum of the inputs if the input resistors have different
values. If the input resistors all have the same value, then the equation above becomes
N
Rf X
Vout = − Vi (6.6)
Rin i=1

in which we see that the output is merely the negative of the scaled sum of the inputs. This
circuit is very useful for adding two or more numbers if the numbers are represented by
voltages.

Numbers may be represented in many ways. If we make currents proportional to the numbers
which we wish to use in a computation, then we can use current summation to add the
numbers. Many circuits can be used for this.

Consider the BJT transistor circuit in Figure 6.3. In concept, the collector current is virtually
identical with the emitter current (for a high-gain device). If the base terminal is grounded
and a current injected into the emitter of a PNP device, then the current in the collector
will be equal to the total emitter current. If this total emitter current is the sum of several
independent current sources, then the collector current will be equal to this sum. Generating
these currents will be fairly easy because the emitter-base voltage is quite constant at about
0.7 volts. Thus, generating the input currents need not be difficult. Note that biasing must
be considered carefully in this circuit since the collector voltage cannot be more than Vce(sat)
6.3. NEGATION 51

These resistors convert input


voltages into input currents, since
V1 the emitter is at approximately zero
volts.
I1

V2
I2
Ic
V3
I3

Vb is approximately −0.7 volts


due to diode used for biasing.


Vbias
+

Figure 6.3: BJT current summing. Note that the collector current is proportional to the
sum of the currents injected in the emitter.

less than the emitter voltage (that is, the collector voltage must be less than about Ve − 0.2
volts).

Many other computations may be performed.

6.3 Negation

Clearly, we wish to represent the negative of a number by changing the sign of its represen-
tation. The most obvious way to do this is with an op-amp inverter. From equation 6.5,
with N = 1 and Rf = Rin ,
Vout = −Vin (6.7)

Other options for inversion may also exist. The BJT is an inverting device when used as a
common-emitter amplifier. Looking at figure 6.4, we see that the gain equation is given by

−hf e RL
Av = (6.8)
hie + (hf e + 1)RE

If hf e is sufficiently large, this reduces to

−RL
Av = (6.9)
RE
52 CHAPTER 6. COMPUTING WITH ANALOG COMPONENTS

Vcc

V
o
Vi

V V
i o

Figure 6.4: Using a BJT as a signal inverter. Note the inversion between the input and the
output. This corresponds to multiplication of the waveform by -1 followed by a level shift.

This is -1 for RL = Rin , and so this circuit is an inverter. You should note that there will be
an ‘offset’ to the inverted signal which you must compensate for, but the circuit is essentially
an inverter.

6.4 Subtraction

Now we will see the advantage of looking at signal processing in a conceptual framework.
Subtraction is merely adding one signal to the negative of the other, or
Vout = V1 − V2 (6.10)
= V1 + (−V2 ) (6.11)

Both of the circuits to do this have been discussed above.

6.5 Logarithm

Taking the logarithm of a number is a little tricky and requires some care in the circuit
design and implementation, but it can be accomplished with reasonable accuracy.
6.5. LOGARITHM 53

6.5.1 The Concept

The underlying concept is that the output of an inverting amplifier is a function of the input
element and the feedback element (see equation 6.5). The fundamental concept employed
in the op-amp summer is current summation at the inverting input. We used resistors to
convert input and output voltages to current so as to perform current summation. In the
inverting amplifier having one input resistor and one feedback resistor (from the output
to the inverting input), the input-output relationship is found by equating currents at the
summing junction. The input current is Vin /Rin and the output current is −Vout /Rf and so
we see that the familiar gain equation for this circuit is given by manipulating
Vin Vout
=− (6.12)
Rin Rf

Clearly, we can still sum the currents at the inverting input even if the relationship between
current and voltage for each circuit element is not linear. This should result in a different
input-output relationship for the circuit.

6.5.2 The Circuit

What can we do if we change one of the circuit elements to one with a more ‘interesting’
voltage-current relationship? Consider a diode in place of the feedback element as shown in
figure 6.5. The equation for the current through a diode is
 
ID = Io eVD /ηkT − 1
≈ Io eVD /ηkT (6.13)

where VD is the voltage across the diode and is assumed to be much larger than 26 millivolts, η
is a scaling constant, k is Boltzmann’s constant, T is absolute temperature in degrees Kelvin,
and Io is the reverse leakage current. Re-arranging this to solve for VD we have
ID
VD = ηkT log (6.14)
IO

Now, if we replace the feedback resistor with the diode as shown in figure 6.5, then the input
current must equal the diode current and so VD is given by

Vout = −VD
Vin
= −ηkT log
Io Rin
= −K log Vin (6.15)

where K is a constant containing all the fixed terms. Note that this will work only for
positive input voltages because current can only flow through the diode for positive inputs.
If negative inputs were required, what would you do?
54 CHAPTER 6. COMPUTING WITH ANALOG COMPONENTS

Id D1 R3

R1
R2
Vin −

+ Vout(A2)
Iin A1 +

A2

Vout(A1)

Figure 6.5: Computing log V in with a diode in the amplifier feedback path.

Note that this circuit is not very good, but it does work. It is highly sensitive to temper-
ature since IO is a temperature-dependent function. Note that the voltage across a diode
changes by about -2.2 millivolts per Celsius degree when diode current is kept constant. This
will lead to temperature-dependent errors. Additional circuitry may be added to improve
performance, but the fundamental concept remains unchanged.

Note that this circuit performs its function because of the non-linear relationship between
current and voltage inherent in a diode.

6.6 Exponentiation

This uses the same concept as the logarithm calculation. As we have seen, if we place a
diode in the feedback path of an op-amp, the resulting circuit computes the logarithm of the
input. What might we get if we place the diode in the input path? Using the method above
(setting the input and feedback-path currents equal), try it and see! Again, this function
makes use of the diode’s nonlinear relationship between voltage and current.

There is a general principle here:

The two circuits of figure 6.6 compute inverse functions of one another because
the feedback function of one is the input function of the other.
6.7. OTHER INTERESTING ‘WRINKLES’ 55

G F

Vin F − Vin G −
Vout Vout
+ +

a b

Figure 6.6: Circuit b computes the inverse function of circuit a.

6.7 Other Interesting ‘Wrinkles’


1. What would happen if you had a circuit with two inputs, each with a different non-
linearity?

2. What other types of non-linearities might you consider?

3. What would happen if function F in figure 6.6 were a low-pass filter, and function G
were a resistor?

4. Consider the circuit of figure 6.7. What happens if the potentiometer is adjusted so
that filter F is directly connected to the input? to the output? What can this circuit
configuration be used for?

6.8 Multiplication

Multiplication is more difficult, and many methods have been used to compute products,
but we will look at a very simple method.

6.8.1 Logarithm-Based Multiplication - The Concept

We recall that we can multiply two numbers by adding their logarithms and then taking the
inverse logarithm of the sum. Thus, we might perform multiplication of two signals by first
56 CHAPTER 6. COMPUTING WITH ANALOG COMPONENTS

KR (1−K)R

L.P.F.

R2 R1

Vcc

Vin −
Vout
+
R1
−Vcc

Figure 6.7: What is the effect on the circuit transfer function of varying the potentiometer?
6.8. MULTIPLICATION 57

V1 log

exp V1*V2

V2 log

Figure 6.8: Multiplication with log-antilog conversions.

taking their logs, then adding them, and finally taking the inverse log of the sum. The block
diagram for this approach is shown in figure 6.8

6.8.2 Non-linearity-Based Multiplication - The Concept

Another approach to multiplying two values is to pass their sum through a suitable non-
linearity. If the nonlinearity may be expressed in a power series as
N
ai (v − vo )i
X
f (v) = f (vo ) + (6.16)
i=1

about some known point vo , then the expression for the output as a function of the sum of
two inputs is
N
ai (v1 − vo1 + v2 − vo2 )i
X
f (v1 + v2 ) = f (vo1 + vo2 ) + (6.17)
i=1
where vo1 and vo2 are the values for which the function of their sum is known. Now if we
select our nonlinearity so that the only dominant coefficient ai is a2 , vo1 + vo2 = 0, and
f (0) = 0, then
f (v1 + v2 ) ≈ a2 (v1 + v2 )2 (6.18)
≈ a2 (v12 + v22 + 2v1 v2 ) (6.19)
If we can find a way (design a circuit) to ‘throw away’ the v12 and v22 terms, we will then
have an output proportional to the product of the inputs.

Consider the transconductance curve of a junction FET. (Note that the form of this rela-
tionship is similar for a MOSFET.) The drain current is given by
2
Vgs

Id = IDSS 1− (6.20)
VP
58 CHAPTER 6. COMPUTING WITH ANALOG COMPONENTS

This is the kind of nonlinearity that we are looking for, because it is a ‘square law’ device
and so a2 is dominant. If we design our circuit so that Vgs is proportional to the sum of the
inputs, then the drain current will contain a term proportional to the product of the inputs.

Various methods of ‘throwing away’ the unwanted terms exist. In some cases, the unwanted
terms may be removed by first generating them in additional circuitry and then subtracting
them from the output. In other cases, the particular application results in the spectra of the
unwanted terms being significantly different from the spectrum of the desired product, and
so the unwanted terms may be filtered out. This is the technique used in the modulator of
superheterodyne radio receivers.

6.9 Switching-Based Multiplication - The Concept

If you think about it, you will realize that the pulse width modulation used for motor speed
control is really multiplication. See the beginning of chapter 5. To control motor speed, we
controlled the duty cycle of a switch in series with the motor (see figure 4.5), and used the
motor to filter out all frequency components other than the DC component. We saw that
the DC component (the first term) of the Fourier transform is just Vbatt D, where D is the
duty cycle.

Clearly, multiplication can be performed using the same concept. To do this. we replace
Vbatt with signal V1 and make D controlled by signal V2 . We also design a filter to severely
attenuate all frequency components other than the DC component. The DC term of the
Fourier transform will then be proportional to V1 V2 , and no other terms will be significant.

6.10 Division

If multiplication is performed by adding logarithms of inputs, and then finding the anti-log
of the result, then division can be performed by . . . .

6.11 Integration

This is an easy function to implement in analog circuitry, and a ‘proper pain’ to implement
in digital circuitry. Lets look at the concepts involved.
6.11. INTEGRATION 59

6.11.1 Inverting Integrator - The Concept

We have seen that the fundamental concept behind inverting op-amp circuits is current
summation at the inverting node. We have used resistors and diodes as input and feedback
elements. What happens if we make the feedback element a capacitor and the input element
a resistor? The circuit is shown in figure 6.9a.

The current through a capacitor is


dvC
iC = C (6.21)
dt
Using current summing at the inverting node, and assuming that op-amp gain A is effectively
infinite, the equation for the output is

−1 Z t
Vo = vi dx (6.22)
RC x=0

You should derive this for yourself (its good practice).

6.11.2 Interesting Wrinkles With Integrators

• What would the output be if there were two input resistors of equal value and two
different input voltages? What would the output be for two different input resistances
and input voltages?

• What is the circuit function if the feedback and input elements in the figure were
interchanged? (This should be a 10-second answer.) Why? (This is a 3 minute
answer.)

• What is the equation for the output voltage in figure 6.9b?

• Are there any other components that could be used as input or feedback elements to
achieve integration?

6.11.3 Non-Inverting Integration - The Concept

The voltage across a capacitor is proportional to the integral of the current through it. Thus,
we can perform integration by converting voltage to current, passing the current through a
capacitor, and measuring the voltage across the capacitor. This is shown in figure 6.9c.

Several suitable voltage-to-current converters can be used. One option is a Howland current
source (discussed in section 6.14). Another option is a BJT circuit with a significant emitter
resistor. (Why should the emitter resistor be fairly large?)
60 CHAPTER 6. COMPUTING WITH ANALOG COMPONENTS

Vcc
R
V −
i
+
Vo

−Vcc

a.

C
R1
V1
R2
V2 Vcc
R3
V3 −

+
Vo

−Vcc

b.
R

Vcc
L
V
i −
Vo
+

−Vcc

c.

V Vo
i

C
Kv
i

d.

Figure 6.9: a. Inverting integrator. b. Inverting integrator with multiple inputs. c. What is
this? Why? d. Concept for a non-inverting integrator.
6.12. COMPUTING AN ARBITRARY FUNCTION OF AN INPUT 61

6.12 Computing An Arbitrary Function of an Input

Sometimes we want to compute some arbitrary function of an input. One possibility is to use
an op-amp and diodes to make a ‘diode-break function generator’, a circuit which permits a
user-defined non-linearity. Consider the following circuit.

This circuit consists of an input subcircuit and a feedback subcircuit. For a first-level, non-
mathematical understanding of it, we will look first at the input subcircuit. We will assume
that the diodes are ideal for simplicity.

The op-amp has its non-inverting terminal connected to ground and the feedback works to
force the two terminals to be at the same voltage, so we will assume that the voltage at point
A is zero volts. We assume that VB1 is greater than zero and that VB2 and VB3 are greater
than VB1 . Further, we assume that VB4 and VB5 are fairly large. With these assumptions,
we see that for very small input signals, all diodes are reverse biased. The gain of the circuit
is given by the slope m0 and is just m0 = −R8 /R1 .

As the input signal increases (becomes more positive), we reach a point were the voltage at
the anode of D1 os zero. (What is this input voltage?) If the input increases further, D1
turns on. Now the current through R2 is just Vin /R2 and the current through R3 is −VB1 /R3
and so is constant. The difference current flows through the diode to the summing junction
of the op-amp. The total current flowing into this node is then this difference current plus
Vin /R1 . This is equal to the current flowing out of this node, which is −Vout /R8 .

What has happened here? When the input voltage was very small, current in the input
circuit flowed through R1 only. As the input voltage increased, diode D1 turned on and the
current in excess of the (constant) current through R3 . Thus, at this input voltage, and
for inputs greater than this voltage, R2 is in parallel with R1 . Clearly this means the gain
increases and this is shown in the lower figure by the slope m1 = −R8 /(R1 kkR2 ).

For negative-going signals, D3 will turn on at some voltage, resulting in R6 being ‘switched’
in parallel with R1 and so we see a corresponding gain change at that input voltage.

The feedback circuit works in a similar manner. As diodes are turned on, the corresponding
resistors are switched in parallel with R8 resulting in a gain decrease. It is clear that by
judicious use of the biasing sources (the various VBX ) and resistors, almost any transfer
characteristic can be realized as long as it has a local negative slope. (Why is this negative
slope a required condition? How would you add or modify circuitry to get around this?)

Two additional points. First, there is no need for the input circuit diodes to turn on before
feedback circuit diodes. Second, the various bias sources and their series resistors may be
realized with resistive dividers across the power supply. (To see this, write the Thevenin
equivalent model of a resistive divider across a fixed voltage source.)
62 CHAPTER 6. COMPUTING WITH ANALOG COMPONENTS

R8
R1
V
in D4 R9
R2 D1
R10
R3
V
D5 B4 R11
VB1
R4 D2
R12
R5
VB5
VB2 Vcc
R6 D3

R7 A Vout
+
VB3
−Vcc

V
out

m
4 V R9
B4 R10

m
3

m0 V R2 V R4
B1 R3 B2 R5
R6 Vin
VB3
R7
m
1

m2

V R11 m
B5 R12 5

Figure 6.10: a) A diode-break function generator. Diodes D1 , D2 and D5 relate to positive


inputs and diodes D3 and D4 relate to negative inputs. b) The transfer characteristic of the
circuit. Note that the feedback circuit imposes thresholds on the output voltage. This is
why thresholds with respect to VB4 and VB5 are shown with respect to the output.
6.13. CONVERTING CURRENT TO VOLTAGE 63

Vcc

Iin

Vout

Figure 6.11: A BJT transresistance amplifier.

6.13 Converting Current to Voltage

The absolute simplest current to voltage converter is a resistor. You should try to explain
this to yourself in terms of Ohm’s Law.

The next simplest current-to-voltage converter, or transresistance amplifier although not


a very good one, is just a BJT common-emitter amplifier, with the collector connected to
the supply through a moderately-valued resistor (figure 6.11). The problem with this circuit
is that both the input and output have resistances that are too high for true current-to-
voltage converters, and the input current must be into the base as no bias is otherwise
provided. The circuit also inverts. The underlying concept of current to voltage conversion
is correct, however. The transistor is a current to current converter (a current-controlled
current source). Its collector is connected to a resistor, which is a current to voltage converter
(push a current in, you get a voltage across it), and so the complete circuit converts current
to voltage.

A common transresistance amplifier circuit uses an op-amp (figure 6.12). You should try to
determine how it works by expressing the feedback current in terms of the input current and
the output voltage.

6.14 Converting Voltage to Current

Converting voltage to current is equally easy. It also depends on Ohm’s Law. We can see
both roles in the following circuit. The transistor is a current-controlled current source.
Hence it expects a current and produces a current. The input is a voltage source, however,
and so we want to convert voltage to current so as to provide the BJT with its base current.
64 CHAPTER 6. COMPUTING WITH ANALOG COMPONENTS

If

Iin

Vout

Figure 6.12: An op-amp transresistance amplifier.

The collector of the transistor looks like a current source. (It is the output of a current-
controlled current source, so it had better look like a current source!) Thus, the collector
current is the independent variable with respect to the collector resistor, and so this resistor
acts as a current to voltage converter.

A better voltage to current converter is shown in figure 6.14. Remember that for a linear
op-amp circuit at sufficiently low frequency, the two inputs are at the same voltage, or stated
another way, the voltage between the inverting and non-inverting inputs is essentially zero.
Also remember that the base current is much smaller than the collector and emitter currents.
What does the resistor in the base do? Is it necessary? Would the circuit work if we replaced
the BJT with a FET?

Of course, one obvious voltage to current converter is a junction FET transistor. The
equation for the FET’s drain current in terms of the gate-source voltage is
2
Vgs

ID = IDSS 1− (6.23)
VP
and so it is clear that the FET converts voltage to current. It is not a linear conversion how-
ever, and so this circuit can be considered a voltage-to-current converter for input voltages
of very low amplitude (effectively linearizing the circuit).

A final circuit is the Howland current source. Consider the circuit of figure 6.15. To get an
idea of how it works, you should find Io as a function of Vi . To simplify things, you should
recognize that the circuit within the dotted outline is just a gain stage. What is the gain,
that is, what is Va /Vo ? With this gain found, you should be able to solve this circuit easily.
6.14. CONVERTING VOLTAGE TO CURRENT 65

Vcc

Ic

Vo
I
b

Vs

Figure 6.13: Current-to-voltage and voltage-to-current conversions in a common circuit.

Iout

Vin
Ie

Figure 6.14: A common voltage-to-current conversion circuit.


66 CHAPTER 6. COMPUTING WITH ANALOG COMPONENTS

R1 R2

Vcc

Va
Vi +

R3 −Vcc
Vo

R4

I
o
Figure 6.15: Howland current source.
Chapter 7

Some Non-Linear Circuits

There are many circuits which exhibit non-linearities. Some of the most useful, however, are
comparators and Schmitt triggers.

7.1 Comparators

If we wished to determine if an input voltage was greater than a given reference voltage,
we would compare it with that reference. The circuit we would use is called a comparator.
Integrated-circuit comparators are quite similar to op-amps, at least in concept. They have
two inputs and one output. If the inverting input (marked on the schematic diagram by a ‘-’
sign) is greater than the non-inverting input (marked with a ‘+’), then the output will be a
low level. If the inverting input is less than the non-inverting input, then the output will be
high. You could get the same behaviour with an op-amp in which the feedback circuit was
disconnected.

The comparator is different from an op-amp, however, because it is optimized for speed.
Comparators frequently have ‘uncommitted outputs’, which means that the output circuit
does not have a means of generating a high voltage. Look at figure 7.1. It is clear that if
the output transistor is turned on by the rest of the circuit (not shown), then it will sink
current and so the output voltage will be low. However, if this transistor is turned off, then
the output voltage is not known because there is no source of current in the comparator to
drive the output. Circuit designers must connect a resistor between the comparator output
and a positive voltage source to cause the output to ‘go high’ when the output transistor is
turned off. Designers of the chip did this so that the outputs of several comparators could
be wired together without damage.

67
68 CHAPTER 7. SOME NON-LINEAR CIRCUITS

Figure 7.1: Output circuit of a common comparator.

7.2 Schmitt Triggers

Schmitt triggers are used to ‘clean up’ a signal and to decrease the rise and fall times of the
signal.

Consider the signal in figure 7.2. If we attempt to detect the signal in the noise, we will
get many false detections of the signal. If it were necessary to count external events and
the measurements of the events were noisy, then it is obvious that too many events will get
counted. We need to ‘clean up’ the signal first.

Schmitt triggers are used for this task. A Schmitt trigger is a circuit which uses two thresh-
olds, which we will call VU and VL for ‘upper’ and ‘lower’ respectively. The device functions
as follows. As long as the input is greater than VU , the output is low. When the input goes
below VL , the output goes high, and stays high until the input goes above VU . The Schmitt
trigger is said to have hysteresis because of this behaviour. The circuit designer selects VU
and VL to detect the signal as well as possible while rejecting noise as much as possible.

A common Schmitt trigger is shown in figure 7.3. In this circuit, Vo will change from high
to low when the input exceeds VU . Lets analyze this. If the input Vi is less than VL , then
Vo is equal to Vmax , the maximum value that the comparator (or op-amp) output can reach.
With this output, the node voltage VA can be found from

Vo − VA Vref − VA VA
+ = (7.1)
R1 R3 R2

in which Vo is Vmax . When Vi rises to greater than VA , then the inverting input exceeds the
non-inverting input and so the output switches from Vmax to Vmin , the minimum value that
the comparator can reach. Thus, VA is VU in this case.

If the input is greater than VU , then the output is Vmin . The output will switch to Vmax when
the input decreases to less than VL . We can solve for VA in equation 7.1 with Vo equal to
Vmin . This is the case for which VA is VL .
7.2. SCHMITT TRIGGERS 69

VU
V
T
VL

a.

b.

c.

d.

Figure 7.2: A noisy signal, with a detection threshold, resulting in poor signal detection. a)
Noisy signal (signal shown dotted). b) recovered signal using the threshold shown in a. c)
Actual signal. d. Signal recovered using Schmitt trigger with thresholds shown.
70 CHAPTER 7. SOME NON-LINEAR CIRCUITS

Vcc

Vi −
Vo
+

R1
R3 −Vcc
VA
R2
Vref

Figure 7.3: A common Schmitt trigger using an op-amp.

Thus, the designer’s task is to select R1 , R2 , R3 and Vref so that VA equals VU when
Vo equals Vmax , and VA equals VL when Vo equals Vmin .

Note that the Schmitt trigger circuit discussed here inverts the signal; that is, when the
signal exceeds the upper threshold, the Schmitt trigger output goes low. Say you need a
Schmitt trigger circuit that does not invert the signal? Can you do it? Can you do it with 2
op-amps? How about one op-amp and a BJT? Can you do it with just 1 op-amp? Explain
why and how as appropriate.

7.2.1 Asymmetrical Power Supplies

The Schmitt trigger discussed above depends on having bipolar power supplies. If you
choose to use a comparator rather than an op-amp, chances are that you will not use bipolar
supplies. Will the circuit work in this case? The answer is that it won’t work. When the
comparator output is low, the voltage at its non-inverting input will always be slightly lower
than the voltage at its non-inverting input because the output can never go exactly to zero.
Thus, the voltage on the capacitor can never be less than the voltage at the non-inverting
comparator input, and so the comparator output will remain low indefinitely.

This problem can be solved with the circuit of figure 7.4, in which a resistor is used to bias the
non-inverting input node to a voltage well above ground even when the comparator output is
essentially zero. The circuit may be analyzed (and designed) by writing the node equations
for this node for both comparator output levels (high and low). From these equations, it
will become apparent how the resistor values determine VU and VL .
7.2. SCHMITT TRIGGERS 71

Vcc

Vcc R3
Vi −
Vo
+

R1

R2

Figure 7.4: A comparator-based Schmitt trigger with a single supply.


72 CHAPTER 7. SOME NON-LINEAR CIRCUITS
Chapter 8

Timers and Timing

Circuits which provide time delays, or which generate signals which you can use for timing
purposes are very useful. They are frequently integral components of the circuitry used to
implement strategy, they can be used for clocking latches and flip-flops, and they are used
to adjust the timing of various signals. For example, a time delay circuit might be used to
ensure that the upper and lower MOSFETs in a half-bridge motor driver are not on at the
same time.

8.1 Generating Timing Signals

It is frequently necessary to design a circuit which generates a signal so that you can mea-
sure the passage of time. Such a signal might output one pulse per second, one pulse per
millisecond, or pulses at some other convenient frequency. The circuit might generate timing
signals of some other waveform such as sinusoids, triangles, etc., but pulses are by far the
most frequently used waveform.

8.1.1 The Concept

Consider the problem of generating a timing waveform. Clearly we want a voltage (or
current) to change as a function of time. When the voltage (or current) reaches some
predetermined level, we want the output to go from a low level to a high level. We then
want more time to pass so we want another voltage-as-a-function-of-time waveform to change
to another predetermined level, at which time the circuit output will change from high to
low. We want this cycle to repeat endlessly.

Lets take a look at various waveforms (figure 8.1.1) to see if they are applicable to this
circuit. Consider a square wave. While this waveform changes level at fixed times, it does
not change continuously with time and so its level cannot be compared with an arbitrary

73
74 CHAPTER 8. TIMERS AND TIMING

fixed value to measure the passage of time. (In addition, if we had a square wave already,
we wouldn’t need to build the circuit in the first place!)

Now look at a triangle wave. On each slope of the triangle, the voltage is a linear function
of the time elapsed since the last time the slope changed. The waveform level (voltage or
current) can be compared to an arbitrary, fixed value to measure the elapsed time since the
slope last changed. This elapsed time is clearly inversely proportional to the slope of the
waveform, and proportional to the difference between the present waveform voltage and the
waveform voltage at the time of the most recent slope change.

Finally, lets look at the third waveform in the figure. This waveform is composed of two
alternating exponentials. A positive-slope exponential may be expressed as

v(t) = (VU − VL )(1 − e−(t−t0 )/τ ) (8.1)

where VU and VL are the maximum and minimum waveform voltages respectively, t0 is the
time from the preceding change from negative to positive slope and τ is a time constant. A
negatively-sloped portion of the waveform may be expressed as

v(t) = (VU − VL )(e−(t−t1 )/τ ) (8.2)

where t1 is the time of occurrence of the last slope change from positive to negative slope.
Is this waveform useful for generating timing signals? Yes it is. Why?
8.1. GENERATING TIMING SIGNALS 75

Square to Tri−Wave
Tri−Wave to Square

Figure 8.1: Block diagram of a relaxation oscillator.

Now lets arrange a block diagram of the timing-generation circuit that we want. In this figure,
the triangle-wave-to-square-wave converter takes a square wave and generates a triangle-wave
from it. What is a simple circuit that can do this? Consider a ‘low-pass’ RC circuit (figure
8.2). We know that this circuit attenuates high frequencies, but what does it do to a step
input? We will now see that the low-pass RC circuit does a crude job of converting a step
input to a ramp output under certain conditions.

Lets write the expression for the output of this circuit when a step is applied. If a step of
amplitude A is applied to the input, then the output can be expressed as

Vo (t) = A(1 − e−t/RC ) (8.3)

Now the slope of this function is

dVo (t) A −t/RC


= e (8.4)
dt RC
76 CHAPTER 8. TIMERS AND TIMING

R
Vin(t)=AU(t) Vo(t)

Figure 8.2: Low-pass RC circuit.

At t = 0, the slope is A/RC. We solve for the times at which the output rises to one third
and two thirds of the input amplitude, and then compute the slopes at these times. If the
slopes are sufficiently similar, then over this range of output voltage, the circuit response may
be considered to be an approximation to a ramp. In this case, the circuit can be considered
to be a form of integrator. (Why?)

We find that these times are 0.405RC and 1.10RC respectively. The slopes at these times
are 0.666A/RC and 0.333A/RC. These aren’t wonderfully close, but they might well suffice.
We can see how well the circuit output behaves like a ramp over the range of 1/3 to 2/3 of
maximum from figure 8.2. For the moment, lets assume that this performance is acceptable.
We will show later that deviation from a constant slope is not important for this application.

Now lets turn attention to the triangle-to-square wave converter. Have we seen a circuit that
will satisfy this requirement already? Consider a Schmitt trigger. Remember that its output
switches low when the input goes above VU , and high when the input goes below VL . If we
arrange the Schmitt trigger so that VU = 2/3 of the maximum amplitude and VL = 1/3 of
the maximum amplitude, then its output will have the correct polarity to drive the input to
the RC filter, which will generate the triangle which will switch the Schmitt trigger output
which .... Note that the design strategy for this (and any other) oscillator is

Assume an input to the first block. Design circuitry to produce the desired out-
put and also generates a second output identical to the assumed input. Connect
this output to the assumed input.

An oscillator is thus a ‘self-fulfilling prophecy’.

Since we want a square wave for timing purposes (remember how we got into this discussion?),
we don’t care about the shape of the supposed triangle wave. Our circuit will work as long
as the input to the Schmitt trigger changes continuously with time. For a good design, we
want the input to the Schmitt trigger to change rapidly with time. To see why, you should
consider what would happen if the slope at either threshold was very small, and the Schmitt
trigger threshold was somewhat noisy (slightly uncertain).

Now lets look at a complete circuit for this relaxation oscillator (figure 8.3). This circuit
implements the concepts essential to this relaxation oscillator. The R − C circuit that
converts the square wave into a rough approximation of a triangle wave is composed of R
8.1. GENERATING TIMING SIGNALS 77

Vcc
R

R1
C −Vcc

R1

Low−Pass Triangle to Square


Figure 8.3: A simple relaxation oscillator based on an op-amp.
78 CHAPTER 8. TIMERS AND TIMING

and C. In this circuit, we have used an op-amp to make things simpler. If we assume that the
maximum and minimum output voltages of the op-amp are ±15 volts, then the maximum
and minimum inputs to the low-pass filter are also ±15 volts. We have set the two thresholds
to be −5 volts for VL and +5 volts for VU so that the total range of the ‘triangle’ voltage is
one-third of the total supply range. (How did we do this? Analyze the circuit.) Thus, the
circuit meets the assumptions that we made above.

Lets determine the period of oscillation of this circuit. When the triangle wave is at its
minimum value (−5 volts) and the op-amp output switches high (to +15 volts), then the
instantaneous voltage across the R − C low-pass circuit is 20 volts. Thus, the time to charge
the capacitor C to +5 volts from −5 volts is found by solving
Vtriangle (t) = 20(1 − e−t/RC ) (8.5)
or, after re-arranging to solve for t and setting Vtriangle (t) to 10 volts,
10
 
t = −RC log 1 − (8.6)
20
= 0.693RC (8.7)
The period of the oscillator will be twice this time because one period requires that it alter-
nately charge the capacitor to +5 volts and −5 volts, and each of these charging operations
take the same time. Thus the period is 1.386RC, and so the frequency is 0.722/RC.

If we were to change the threshold voltages to other values, what would happen, and why?
What would happen if we changed the upper threshold to 10 volts, but left the lower threshold
at -5 volts? Try some of these ideas to get an understanding of the circuit.

8.1.2 Selecting Components

Here are some of the considerations in selecting the components for these circuits:

• The current through R must be much greater than the op-amp or comparator input
bias current.
• The output voltage of most op-amps usually is less than Vcc − 3 and greater than
−Vcc + 3 due to internal circuitry. Make sure that you account for this in your designs.
• The capacitor C should have leakage current much less than the current through R.
• The resistors which set the threshold voltage at the non-inverting input should be large
enough that the current through them is much less than the op-amp or comparator
maximum output current.
• The op-amp or comparator have certain frequency-response limitations (power band-
width, slew-rate). Make sure that your design is not trying to exceed them.

Why do these considerations apply? What would be the consequences of violating them?
Explain this to yourself.
8.2. A SIMPLE TIME DELAY CIRCUIT 79

8.2 A Simple Time Delay Circuit

It is frequently necessary to generate a time delay or to cause some operation to happen


some known time after an initiating event. To do this, you need a timer function. The
circuit will be triggered by an initiating event, and will either generate an output for a
predetermined time or wait a predetermined time before generating an output. This type
of circuit is frequently referred to as a ‘monostable multivibrator’ or a ‘one-shot’, because
it has one stable state (untriggered) and produces a single pulse for each event (one-shot
operation).

8.2.1 The Concept

Again, we need to convert time to a voltage (or current) which other circuitry can measure
and compare with a fixed threshold. We have seen these concepts before with respect to the
relaxation oscillator. In that application, the R − C circuit is used to convert a square wave
to a triangle (which we can think of as a sequence of converting steps to ramps), and the
voltage comparison function is the function of a comparator. We must also have a means of
resetting the time-to-voltage conversion so that we can initiate new timing intervals.

8.2.2 A Simple Delay Circuit

There are many ways to make such a circuit. One very simple technique is shown in figure
8.4. Two key concepts are employed in this circuit; R − C timing, and using a transistor as
a switch to discharge the capacitor.

In this circuit, the input is usually high, so Q1 is on. This keeps the capacitor discharged, and
so the comparator output is low. When the input goes low, Q1 turns off and the capacitor
starts to charge. The comparator output will stay low until the capacitor charges to the
voltage at the comparator’s inverting input as set by R1 and R2 .

Note:

• Q1 could be replaced by a semiconductor switch (1/4 of a 4016), or a FET (with a


change in trigger voltage).
• The time delay is independent of Vcc . This is usually desirable. Why is it true for
this circuit?
• Vin must keep Q1 off during and after the timing interval. This is not an ‘edge sensitive’
or ‘latching’ timer.
• IR1 and IR must be much greater than Ibias .
• You must ensure that Q1 is fully turned on prior to the timing interval desired.
80 CHAPTER 8. TIMERS AND TIMING

Vcc

R R1

Vcc


Vo
+
R3
Vin C R2
Q1

Figure 8.4: A simple delay circuit. The output goes high a predetermined time after the
input goes (and stays) low.

8.2.3 A One-Shot Pulse-Output Timing Circuit

Now lets design a circuit that generates a pulse of a fixed duration whenever the input goes
high and stays high. Again, the key concepts are

1. using an R − C time constant to control the time delay, and


2. using a transistor as a switch.

In this case, however, we use the transistor to enable current flow through the R − C circuit,
not to discharge the capacitor.

This circuit is an excellent example of the design process. We perform the following steps,
in sequence:

1. determine the key concepts,


2. implement and test the concepts,
3. modify the implementation to meet additional constraints, and
4. simplify the circuit to reduce costs and complexity

This circuit compares the output voltage of the R − C circuit with a reference voltage, just
like in the previous circuit. In the case of this circuit, however, we want the comparison to
result in an output for a fixed length of time only.
8.2. A SIMPLE TIME DELAY CIRCUIT 81

Vcc

V
A
R

R1
Vin Q1

Figure 8.5: Part of a one-shot timer. If the voltage across the capacitor is initially zero, then
VA decays with time after Q1 is turned on.

Consider the following, rather unusual, and incomplete circuit. If the voltage across the
capacitor is initially zero (don’t worry yet about how we accomplish this), then when Q1 is
turned on, voltage VA decreases toward zero with time.

If we compare this voltage to a reference voltage VB (see figure 8.6), we can produce an
output as long as VA is higher than the reference.

Two problems remain. The first, and more difficult, is that this circuit will produce a high
output even when the input is low, prior to it going high. We can fix this by having VB change
when the input is high. Consider the enhanced circuit of figure 8.7. Note that resistors R1
and R2 are necessary to ensure that both transistors are turned on at the same time. If we
just connected their bases together, and VBE for one was lower than for the other, only one
transistor would turn on instead of both transistors. Resistors R3 and R4 are selected so
that voltage VA will be slightly lower than VB until the transistors are turned on. (Note that
VB will be equal to Vcc when the transistors are off.) R3 and R4 should be selected so that
little current flows through them compared to the capacitor charging current.

Now we look at simplifying the circuit, since it is more complex than it needs to be. Since
Q1 and Q2 are turned on and off at the same time, we can consider using only one transistor
instead. If we do this, we see that R3 is then in parallel with the series combination of R5
and R6 . Making these changes, the new circuit is shown in figure 8.8.

Notes for figure 8.8:

• The diode D is used to discharge the capacitor rapidly when Vin goes low to turn off
Q1 . To accomplish this, R2 + R3 must be much less than the timing resistor R.

• The time between triggers must be long enough to allow the capacitor to discharge to
82 CHAPTER 8. TIMERS AND TIMING

Vcc
R3
C
VB
V −
A
+

R
Q1
R1
Vin R4

Figure 8.6: Comparing the voltage VA of figure 8.5 with a reference produces an output as
long as VA is greater than the reference VB .

Vcc
R3
C
R5
VB
V −
A
+

R R6
Q1
R1
Vin
R4

R2
Q2

Figure 8.7: Here we are switching the reference circuit as well as the R − C circuit, and we
have added resistors R3 and R4 to the R − C circuit so that VB is always higher than VA
until the input is asserted and Q1 is turned on.
8.2. A SIMPLE TIME DELAY CIRCUIT 83

Vcc
C R2
VB
V −
A
+

R D R3

R1
Vin Q1 R4

Figure 8.8: This circuit is the reduced version of the one-shot circuit of figure 8.7.

the point that VA is


R2 + R3
VA ≈ Vcc (8.8)
R2 + R3 + R4
• Take care that the currents through R2 and R3 and through the capacitor are much
greater than the comparator bias currents.

• For a large change in the capacitor voltage while timing (and equivalently, to use
the smallest (and hence cheapest) capacitor possible), R4 must be much greater than
R2 + R3 .

You should be able to explain to yourself why these considerations are so.

8.2.4 A Latched One-Shot

This circuit works identically to the preceding one-shot except that once it is triggered (Q1
turned on), the high output from the comparator is used to hold Q1 on. Note that R5 and
R6 must be chosen so that Q1 is on when either the input or the comparator output is high.
Also, select CC so that the time constant formed by it and the parallel combination of R1 ,
R5 and R6 is much less than the duration of the output pulse. Explain how the circuit works
to yourself. What does diode D1 do?
84 CHAPTER 8. TIMERS AND TIMING
Chapter 9

Sinusoidal Oscillators

Sine-wave oscillators are also ‘self-fulfilling prophecies’. For a sinewave oscillator, we want
to generate a single frequency with a known, stable amplitude. To do this, we typically use
an untuned amplifier and a tuned, frequency-selective feedback circuit.

In the conceptual circuit of figure 9.1, assume that the desired sinewave is present at the
input of the amplifier. This sinewave is amplified by the amplifier without distorting it in
any way. It is then passed to the feedback network.

The feedback network is assumed to be a frequency-selective circuit which either passes the
desired frequency and attenuates all others, or shifts the phase of the signal by a known
amount at the desired frequency and shifts all other frequencies by a different amount, or
both. Now the crucial point (otherwise known as the Barkhausen Criterion):

The gain around the loop must be unity and the phase shift around the loop
must be zero for the desired frequency to sustain oscillations. For all other
frequencies, loop gain must be less than unity and/or loop phase must be other
than zero.

The foregoing assumes that you can set the amplifier gain exactly. In practice, of course,
this is not possible. How do we cope with this problem? The ideal solution is to use
amplitude-dependent gain. When the amplitude of the signal is lower than some value, the
gain is slightly higher than that required for oscillation. As the amplitude increases, the
gain is reduced to slightly less than that required for oscillation. Thus, stable oscillation is
maintained at the amplitude that provides just the right gain for the oscillation to be stable.

How can we implement this? The most common method is to use the limited output voltage
swing of the amplifying device. The output of nearly all amplifiers cannot exceed the supply
voltages for the amplifier. Now consider a sinusoidal input signal Vi to an amplifier which
has gain A and which has a maximum output voltage amplitude of Vmax . If Vi is sufficiently
small, the peak magnitude of the amplifier output is |AVi | < Vmax . As the input voltage is

85
86 CHAPTER 9. SINUSOIDAL OSCILLATORS

gain

frequency−
selective
network

Figure 9.1: The concept behind a sinewave oscillator.

increased, a point will be reached where the peak magnitude of the amplified input is equal
to the maximum peak output magnitude.

If the input is increased still further, an interesting thing happens. The output gets clipped,
meaning that the peaks get removed. The transfer characteristic of such a device is shown
in figure 9.2a. We note that the ‘incremental’ gain, or ‘dynamic’ gain, is the slope of the
transfer characteristic at the point under consideration. Thus, the gain for inputs between
V1 and V2 is 3. For any input outside this range, the dynamic gain is zero. This is the
transfer characteristic for ‘hard’ clipping. If we were to find the spectrum of the output,
we would find that the first term occurs at the frequency of the input signal, and there
would be significant amounts of the odd harmonics. However, continuing to increase the
amplitude of Vi , we find that the amplitude of the fundamental component in the output
does not change. If we define gain Gf as the ratio of amplitude of the output component
at the frequency of the input to the amplitude of the input, then we see that increasing the
input does not increase the output, and so Gf is reduced with increasing input amplitude.
This is an amplitude-dependent gain of the type that we want.

Is it ‘legitimate’ to define gain this way? Well, in this application we are interested in
the fundamental frequency only, and we can arrange the feedback portion of the circuit to
attenuate any harmonics as much as required. So this is a legitimate definition in this
application. This points up a consideration when exploiting non-linear phenomena; you
must make sure that approximations and assumptions are appropriate for the task at hand.

The problem with using hard clipping by the amplifier (as discussed above) is that the
harmonic content of the output is increased. For a sinusoidal oscillator, this is not good.
One way to improve this situation is to take the oscillator output from the input to the
amplifier so that the frequency-selective properties of the feedback circuit can attenuate
harmonics in the amplifier output. This requires a second amplifier to buffer the signal
because the impedance looking into the output of the feedback circuit is usually too high for
87

V
o

V
U

Vi
V2 V1

V
L

Vo

V
U

Vi
V V
2 1

V
L

Figure 9.2: a. The transfer characteristics of a hard clipper. b. The characteristic of a soft
clipper.
88 CHAPTER 9. SINUSOIDAL OSCILLATORS

practical applications.

There are other ways of controlling gain. One very successful way is to use ‘soft’ clipping.
In this case, the dynamic gain is changed only slightly. In figure 9.2b, the dynamic gain is
2 for V2 < Vi < V1 and 1 for all other voltages. Clearly, we could envisage a soft clipper
in which the gain is slightly greater than necessary for oscillation for low amplitude inputs,
and slightly less than necessary for high amplitude inputs. Since the gain is approximately
constant, the distortion should be very small. (Why? Explain how the change in gain could
cause distortion. How is this connected to the Fourier transform of the output? How would
you determine the amplitude of the oscillations?) Again, we could reduce the distortion
further by using the input signal to the amplifier as the oscillator output.

Now lets look at a variety of oscillators.

9.1 R − C Oscillators

One group of sinusoidal oscillators uses R − C networks to implement a frequency-dependent


phase shift in the feedback circuit. These circuits depend on achieving the phase shift
required to satisfy the Barkhausen criterion. The gain of these feedback circuits does not
change greatly with frequency.

9.1.1 Phase-Shift Oscillator

Remember, an oscillator is a self-fulfilling prophecy. This means that we will start by assum-
ing that we have the output signal that we desire, then use this signal as the input to the
feedback portion of th circuit to create the input to the amplifier. We will make the feedback
the frequency-dependent portion of the circuit. We will keep our discussion quite conceptual
at this point, but show how it can be extended to phase-shift oscillators implemented with
op-amps, transistors or FETs.

The basic phase-shift oscillator is shown in figure 9.3. The R − C network shifts the phase
of the output by 180 degrees at the desired oscillating frequency. You can see this by solving
the expression for the feedback circuit. This is most easily accomplished by writing the
admittance matrix for the circuit.

First, we model the output of the op-amp, together with R3 as a Norton source. We will
also model the R1 − C1 branch as an equivalent impedance. By doing this, we can model
the circuit as a 2-node circuit instead of a 4-node circuit. Now we will write the admittance
matrix.

If you recall, each diagonal element of the matrix is the sum of the admittances which are
incident on the corresponding node. Off-diagonal elements are the sum of the admittances
connecting the corresponding nodes. Dependent sources must be handled carefully, but there
9.1. R − C OSCILLATORS 89

V
A
−K Vo

R1 R2 R3

C1 C2 C3

feedback circuit

Rs R3 1 R2 2 R1

Vo VA
C3 C2 C1
Vs

1 R2 2 R1
VA
R3 C3 C2 C1
Vs
R3+Rs
Rs

Figure 9.3: A basic phase-shift oscillator.


90 CHAPTER 9. SINUSOIDAL OSCILLATORS

is really nothing special about them.

The matrix equation for the network is therefore


 "
1 1
Vs sC3 + + − R12
" # #
Ro +R3 Ro +R3 R2 V1
= − R12 1
+ sC2 + 1  (9.1)
0 R2 1
R1 + sC V2
1

With some practice, you can write this expression by inspection. The next The output
voltage VA of the network is solved by first solving equation 9.1 for V2 , and then determining
VA using voltage division based on the R1 − C1 network. That is,
1
sC1
VA = V2 1 . (9.2)
R1 + sC1

The op-amp output resistance Ro is usually insignificant compared to R3 and so it can be


assumed to be zero.

After all this, we can determine the phase and gain of VA with respect to Vo as a function of
the resistor and capacitor values. We usually set R1 = R2 = R3 = R and C1 = C2 = C3 = C
for simplicity. (There are also good design reasons for making all the resistors and capacitors
the same, but they are beyond the scope of this presentation.) We then solve for the complex
gain from which gain magnitude and the phase shift are determined as a function of frequency.
We select R and C to provide a 180 degree phase shift at the desired frequency of oscillation.
We substitute these values of R and C into the equation for gain magnitude. From this, we
can select K so that the closed-loop gain is unity at the frequency of oscillation. Solving the
equations is tedious; consider using Maple or one of the other equation solvers.

A phase-shift oscillator can also be designed with the resistors and capacitors interchanged
in figure 9.3. (Why?)

The amplitude-dependent gain required for oscillation has not been shown in this figure. We
assume that this has been taken care of; clearly, one option is to use the clipping due to
power supply voltages. A second option is to use an amplifier that exhibits soft clipping.

Phase-shift oscillators are usually used at low frequencies. They are not the oscillators of
choice, however, because they use more components than strictly necessary to achieve the
desired phase shift. They are fairly simple to design, however.

9.1.2 Wein-Bridge Oscillators

Wein bridge oscillators also use Rs and Cs to cause a phase shift. The fundamental circuit
is shown in figure 9.4. The phase shift is accomplished by the bridge. The series arm of
the bridge causes a phase lead, while the shunt arm causes a phase lag. These are equal
and hence cancel, resulting in a net zero phase shift, at only one frequency. The amplifier,
therefore, must be non-inverting. (An inverting amplifier has a 180 degree phase shift; why?)
9.2. RESONANT OSCILLATORS 91

C
R

A Vo

R C

Figure 9.4: A basic Wein bridge oscillator.

You should write the transfer function of the feedback circuit to see how the frequency for
a zero phase shift is related to the values of R and C. This will also show you the gain that
is necessary to sustain oscillation.

Again, we have not shown how to implement the amplitude-dependent gain required. And
again, this oscillator is useful up to frequencies of about 1 MHz. This is the most common
circuit for low frequency oscillators.

9.2 Resonant Oscillators

Resonant oscillators use a resonant circuit to achieve a very large change in gain as a function
of frequency. These circuits consist of inductors and capacitors in both series and parallel
combinations. Frequently, coupled inductors are used.

To understand the fundamentals of these oscillators, we must understand resonant circuits.

9.2.1 Resonant Circuits

Inductors and capacitors can be connected in series and parallel combinations. Each topology
has its own characteristics.
92 CHAPTER 9. SINUSOIDAL OSCILLATORS

Series Resonance

We define the resonant frequency of a circuit as that frequency for which the complex com-
ponent of the impedance is zero. A resonant circuit consisting of a series-connected inductor
and capacitor has an impedance Zs given by
1
Zs = jωL + (9.3)
jωC
When the two terms on the right have equal magnitude, Zs is zero. This occurs for
1
ωL = (9.4)
ωC
which implies that the resonant frequency ωo is
1
ωo = √ (9.5)
LC

Clearly, there are losses in any circuit, so the impedance cannot be exactly zero. Indeed, the
inductor is a coil of wire which has a resistance. For series resonant circuits, this resistance
can be modeled as being in series with the inductor. Therefore, the impedance at resonance
is really this series resistance Rs . This resistance is usually quite small. (You should derive
the equation for the impedance of a series-resonant R − L − C circuit.)

The ‘quality’ or Qs of a series resonant circuit is a function of the ratio of the energy stored
in the reactances to the energy dissipated in the resistive losses. This can be expressed as
ωL
Qs = (9.6)
Rs
The Q is a measure of the ‘sharpness’ of tuning of the circuit, or, equivalently, its bandwidth
at its resonant frequency. Circuits with higher Q have narrower bandwidth and so they are
more frequency selective. This is usually desirable in tuned circuits (within reason).

Now, the fact that the impedance of the series-connected resonant circuit is very low (because
Rs is usually low) at resonance has major implications for the design of circuitry employing
series resonance. The low input impedance at resonance means that the current through
the circuit will peak at resonance, assuming that the voltage amplitude of the driving signal
is independent of both frequency and the connected resistance. This in turn implies that
the series resonant circuit should be driven by a circuit with a very low output impedance
(ideally a voltage source), and it should drive a low-resistance load which measures current
(ideally a load with a zero ohm resistance). Remember that any resistance in series with the
L − C portion of the circuit will lower circuit Q, and thereby increase bandwidth, making
the circuit less frequency selective.

Lets look at an example. Consider the resonant circuit of figure 9.5. In this circuit, the
output resistance Ro of the driver and the resistance RL of the load are taken together with
the resistance Rs of the R − L − C circuit to determine Q. Thus, the Q is
ωo L
Q= (9.7)
Ro + Rs + RL
9.2. RESONANT OSCILLATORS 93

I
R Rs L C L
o

RL
inductor

Figure 9.5: A series resonant circuit with driver and load.

From this we see that the resistance of the driving circuit and of the load are important for
determining the Q of the circuit.

Parallel Resonance

If we look at the impedance ZP of a parallel resonant circuit (sometimes called a ‘tank’


circuit), we find that it is given by
1
jωL jωC
ZP = 1 . (9.8)
jωL + jωC

Again, with resonance defined as the condition in which the complex portion of the impedance
is zero, solving the above equation yields an infinite impedance when
1
ωL = . (9.9)
ωC
Again, the resonant frequency is just
1
ωo = √ (9.10)
LC
A practical circuit has losses; these losses can be considered to be an equivalent resistance.
We can model the losses as a resistance in parallel with the inductor (and hence in parallel
with the capacitor). In this case, the circuit Q is defined as
RP
QP = (9.11)
ωo L

We see that the impedance of this circuit is maximized at resonance, and that the impedance
is resistive. This suggests that we should drive the circuit with a high-resistance source
(ideally a current source). This will result in the maximum change in output amplitude with
frequency. In addition, we want the load resistance to be as high as possible; thus, the circuit
that we drive must sense voltage (why?).
94 CHAPTER 9. SINUSOIDAL OSCILLATORS

Ro
RP L C RL V
o

inductor

Figure 9.6: A parallel resonant circuit, or ‘tank’ circuit, with driver and load.

An example of a tank circuit, with its driver and load, is shown in figure 9.6. Simple analysis
of this circuit shows that the source resistance Ro and the load resistance RL are in parallel
with the resistive losses RP . Including these resistances in the calculation of circuit Q yields
Ro ||RP ||RL
QP = (9.12)
ωo L

From the foregoing discussion, we see that we must be careful to ensure that the circuits we
use to drive and to load a resonant circuit should be appropriate for the type of resonant
circuit that we employ.

9.2.2 Coupled Inductors

There are times when it is useful to invert the signal in the feedback circuit, to scale the
voltage or current, or to match the impedance of a driving circuit or load circuit. Coupled
inductors are useful for this. Coupled inductors include transformers and autotransformers.

Transformers

As you know, in an ideal transformer with n primary turns and m secondary turns, the
secondary voltage vs , secondary current is and the impedance of the driver as seen at the
secondary terminals Zs are given by
m
vs = vp
n
n
is = ip
m
 2
m
Zs = Zo (9.13)
n
where vp and ip are the primary voltage and current respectively, and Zo is the output
impedance of the circuit driving the primary side of the transformer.
9.2. RESONANT OSCILLATORS 95

R R n : m
o losses

RL

Figure 9.7: A transformer used to couple to a load.

The foregoing equations are based on the assumptions that

1. transformer losses are zero,

2. the inductances of the transformer primary and secondary windings are vastly greater
than the impedances connected to the primary and secondary windings,

3. the primary and secondary windings are perfectly coupled, so that all flux generated
in the primary cuts all turns of the secondary, and vice versa.

Real transformers are rarely this good, but we will use these assumptions anyway. (Trans-
formers wound on high-permeability toroidal cores and ‘pot’ cores can approach the ideal
transformer quite closely. Any ideas as to why?) To satisfy assumption 2 above, we usually
design the inductance of the windings to have a reactance magnitude at least four times the
magnitude of the connected load impedance, including the effects of all losses.

As an example of this, consider the transformer in figure 9.7. If we require a turns ratio of
n/m, then the load impedance reflected into the primary circuit is
2
n

RL 0 = RL . (9.14)
m
We can now replace the transformer with a resistance equal to RL 0 and calculate the total
connected resistance RT as RT = Ro + Rlosses + RL 0. In order to satisfy assumption 2 above,
we want the magnitude of the inductive reactance of the transformer primary to be at least
four times RT at the lowest frequency ωm that we wish to pass through the transformer.
Therefore, we choose the transformer primary inductance LP to be
4RT
LP = . (9.15)
ωm
The inductance determines the number of turns required for the primary. (For toroidal cores,
inductance is proportional to n2 .) The number of secondary turns is then determined from
the turns ratio required.

Autotransformers

Autotransformers (see figure 9.8) are essentially identical to ordinary transformers with the
exception that there is no electrical isolation between ‘primary’ and ‘secondary’ windings.
96 CHAPTER 9. SINUSOIDAL OSCILLATORS

R R
o losses

n−m

m
RL

Figure 9.8: An autotransformer used to couple to a load.

In this figure, we assume that the secondary winding of m turns is actually a part of the
primary winding of n turns. We further assume that all flux generated in the primary cuts
all secondary turns and vice versa, that losses are negligible, and that the magnitudes of
the inductive reactances of the primary and secondary windings are vastly larger than the
connected loads. Under these assumptions, and with the number of turns defined as in the
figure, equations 9.13 apply.

The figure illustrates a case in which the autotransformer is used as a step-down transformer.
It can also be used as a step-up device with proper selection of the primary and secondary
turns.

9.2.3 Hartley Oscillator

The Hartley oscillator is a resonant oscillator in which the feedback network is extremely
frequency selective. This oscillator is used in tunable circuits at frequencies up to 100 MHz
or more.

The oscillator circuit is shown in figure 9.9a. As can be seen from the figure, the Hartley
oscillator uses a tank circuit composed of L and C. This is a parallel resonant circuit and
so we require the amplifier to have a high output resistance.

The input resistance of the amplifier is usually lower than we might like. (Remember, we
want a very high load resistance on a tank circuit.) We can use the impedance transformation
characteristics of the autotransformer to convert a low input impedance to a much higher
value, since the autotransformer obeys the ideal transformer equations. If we were to ‘tap’
the output of the tank off the inductor at 1/10th the total number of turns, the amplifier
input resistance would be reflected across the whole tank as a resistance 100 times larger.
Of course, this mean that the output voltage amplitude of the tank would be only 1/10th
the amplitude of the amplifier output.

How much gain would we require from the amplifier in this case?
9.2. RESONANT OSCILLATORS 97

A Vo

n−m
L C
m

A Vo

C1
L
VA C2

b
Figure 9.9: Oscillators using resonant circuits. a. Hartley oscillator. b. Colpitts oscillator.
98 CHAPTER 9. SINUSOIDAL OSCILLATORS

9.2.4 Colpitts Oscillator

The Colpitts oscillator is shown in figure 9.9b. It is also an oscillator used to generate sine
waves at frequencies up to about 100 MHz or more.

The Colpitts oscillator uses a single, untapped inductor and two capacitors in series to form
a tank circuit. Again, we have ‘tapped’ the tank output across only part of the tank circuit
to perform impedance transformation, but this time we have used a ‘capacitive tap’.

We can see how this works in two ways, using only fundamental concepts. For the first way
to see this, consider the following. We know that the capacitors form a capacitive voltage
divider since the voltage VA is
1
sC2
VA = Vo 1 1
sC1
+ sC2
C1
= (9.16)
C1 + C2

Now if VA is a fraction of Vo , then there must be a point ‘in’ the inductor at which the voltage
VA is to be found. (They are in parallel across a common voltage; this must be true.) Thus,
we can consider this point on the inductor to be the ‘tap’ at which the output is connected,
and so all the impedance transformation characteristics of the tapped coil must apply.

The second approach to seeing how a capacitive tap can transform impedances is quite
simple, making use of the passive nature of the tank circuit. Again, we argue that the
voltage VA is a fraction of Vo . This voltage is presented across the load resistance.

Since Vo is presented across the entire tank circuit, which, at resonance ‘looks like’ a resistance
Re , the power delivered to the tank by the amplifier is just Vo2 /Re . But the power delivered
to the tank must be equal to the power delivered by the tank to the load since the tank does
not dissipate any power and it is not a power source. Thus, the load power must be VA2 /RA
where RA is the amplifier input resistance. Equating these, and using the expression for VA
as a function of C1 , C2 and Vo , we get

VA2 V2
= o (9.17)
RA Re

from which, after rearranging, we get

C1 + C2 2
 
Re = RA
C1
CT 2
 
= RA (9.18)
C2

where CT is the equivalent capacitance of the series combination of C1 and C2 . Thus,


impedance transformation occurs with a capacitive tap. Satisfy yourself that the capacitance
values behave as the reciprocal of the turns in the Hartley oscillator.
9.2. RESONANT OSCILLATORS 99

In all discussions of oscillators to this point, we have assumed that the input and output
impedances of the amplifier are strictly resistive. What happens if this is not so?

The simple (and correct) answer is that any and all complex parts of the input and output
impedances can be considered to be part of the resonant circuit. Thus, you select values for
L and C which, together with the amplifier reactances, result in the oscillating frequency
that you desire. Thus, you need only consider the resistive components of the amplifier
impedances.

There are many other forms of oscillator. Clearly, we should be able to implement oscillators
with series-resonant circuits. Try it and see. Its not that difficult.
100 CHAPTER 9. SINUSOIDAL OSCILLATORS
Chapter 10

Sensing The Environment

There are various methods of sensing the environment of your machine. We will discuss
some techniques relating to the materials in your kit of parts. You may decide that some
of the sensing techniques may not be suitable for your strategy, but you should know about
them before you make that decision.

10.1 Optical Sensing

Your kit contains a number of phototransistors which are equipped with lenses. The ‘receiver
angle’ for these sensors is about 20 degrees (±10 degrees of the nominal optical axis) to the
‘half power’ points1 . These sensors are most sensitive to the longer wavelengths of light
(in the red and infrared region). Thus, they are more sensitive to incandescent lights than
fluorescent lights which contain a preponderance of blue and shorter wavelengths. See the
spec. sheet for these devices for more information on the receiver angle and the wavelength
sensitivity.

Phototransistors use light to control collector current. You can think of the light incident on
the phototransistor as a form of base current. Some phototransistors also have a base lead
with which you can bias the phototransistor.

The change in collector current for a moderate change in light level is usually quite small,
and so it can be difficult to distinguish from noise. Care must be taken to minimize noise
when designing circuits for processing phototransistor (and other sensor) signals.

A major difficulty with photosensing is the variation in ambient light from place to place
and with respect to time. Sources of variation include the 120 Hz ripple due to room lights
1
The ‘half power’ points are the points at which the power is one√ half of the maximum power. They are
also the -3db points since at the -3db √points, the amplitude is 1/ 2 of the mid-band gain. Since power is
proportional to amplitude squared, 1/ 2 amplitude results in 1/2 power.
These points are referred to as the half power points because light is measured in terms of power.

101
102 CHAPTER 10. SENSING THE ENVIRONMENT

VCC

R3


VCC
+

R1 V
o
R2

−V
CC

Figure 10.1: A simple phototransistor circuit.

(why is it 120 Hz, not 60 Hz?), changes in average illumination through the day in rooms
with large exterior windows, changes due to objects moving in the room casting shadows,
and changes in the light level from place to place. While these changes may not appear large
to you (if you can perceive them at all), you must remember that your visual system has
evolved to be sensitive to relative light level and so it ignores these changes because they do
not convey information useful for survival. Optical sensing systems, however, are sensitive
light level and so they are sensitive to these changes.

A simple phototransistor circuit is shown in figure 10.1. In this circuit, the phototransistor
generates a current. The op-amp converts this current to a voltage, since, with respect to
the phototransistor, the op-amp is a current-to-voltage converter.

A phototransistor will output a current even when there is no light shining on it. Usually, we
must compensate for this ‘dark current’. Potentiometer R1 and resistor R2 allow the output
voltage corresponding to the zero-light condition to be set to any arbitrary value. (Can you
see how this works? Use superposition.)

The optical sensors can be used for sensing changes in colour and/or surface reflectance,
finding lights, finding shadows, etc. When you do this, however, you usually find that the
signal that you want is superimposed or ‘riding on’ a varying ‘baseline’. For example, if you
are trying to detect a black surface marking against a lighter background, you will find that
the change in photo current which denotes the marking is small compared to the variation in
photo current due to variations in the illumination of the background. For reliable detection
performance, you must find a way to make the signal due to surface markings easily detectable
in spite of the background variations in illumination.
10.2. TACTILE SENSING 103

10.2 Tactile Sensing

Tactile (or touch) sensing can be performed with ‘whiskers’ and switches. This sensing is
useful for detecting the presence of objects or obstacles. Tactile sensors can be very easy to
implement, but may not be overly reliable.

To use whiskers effectively, you need several of them of differing lengths. A short and a long
whisker can be used to control the position of an object relative to the whiskers.

Consider whiskers mounted on a vehicle that is intended to follow a wall on the right hand
side. In this case, a long whisker can be used to detect the presence of the wall. If the
whisker does not sense the wall, the vehicle should turn right. If it senses the wall, the
vehicle should go straight. A shorter whisker is used to ensure that the vehicle does not get
too close to the wall. If the shorter whisker is activated, the vehicle should turn left. If it is
not activated, the vehicle should go straight. These two whiskers (if properly implemented)
will ensure that the vehicle follows the wall, does not stray from it, and does not run into it.

10.3 Force Sensing

In some applications it may be appropriate to measure force. This can be accomplished with
a spring-loaded switch in which the spring is calibrated. It can also be accomplished with a
position sensor (capacitive, inductive, LVDT (you can look this up), etc.) and a mechanical
component that converts force to a position change (spring, elastic, etc).

A crude direct force sensor employs a piece of the conductive foam used for protecting inte-
grated circuits from electrostatic discharge. The sensor is made by placing the foam between
two metal electrodes. The sensor is mounted so that the force to be measured will com-
press the foam by squeezing the electrodes closer together. When very lightly compressed,
the resistance of the sensor is in the order of several hundred kilohms. When significantly
compressed, this resistance can drop to below 10 kilohms.

While this sensor is very crude, and suffers from hysteresis, fatigue, and significant non-
linearity, it is cheap, moderately robust and readily available.

10.4 Sensing Conductive Materials

10.4.1 Conductivity

There are many ways to sense the presence of conductive materials. A simple method is
to measure the conductivity; essentially to make the material part of the circuit. This is
certainly cheap, but its reliability is likely to be poor because it depends on sufficient pressure
104 CHAPTER 10. SENSING THE ENVIRONMENT

Rs V
o

Vexc
a.c. voltage C L R
source

parallel resonant loosely−coupled


circuit resistance of
conductive material
Figure 10.2: The concept behind a resonant metal sensor.

for a good contact and accurate alignment of the sensing probes.

10.4.2 Eddy Currents

A much more complex method is to couple the conductive material into a tuned circuit.
This approach is much less sensitive to alignment and pressure is not necessary. It requires
careful design, however.

Lets explore the underlying concept. If we have a coil with an a.c. current of sufficiently
high frequency flowing in it, and if we bring this coil close to a conductive, moderately thick
material of significant size, then energy will be transferred to the material. This is because
the time-varying magnetic field of the coil will cause ‘eddy currents’ to flow in the conductive
material. In essence, the conductive material acts as a short-circuited single-turn winding
coupled loosely to the coils. Because the material is not infinitely conductive, the coupled
energy is dissipated, and so there is a transfer of energy from the coil to the material.

Now lets suppose that the coil is part of a parallel resonant circuit or ‘tank’ circuit as shown
in figure 10.2. We drive the tank circuit with a source with a fairly high source impedance
because tank circuits present very high impedance at resonance. Thus, the a.c. voltage Vo
across the tank circuit will be essentially Vexc .

When the coil of the tank circuit is brought near a conductive material, energy is transferred
to the material. This is equivalent to coupling a resistance into the tank circuit, making it
an R − L − C circuit. At resonance, the capacitive and inductive reactances cancel, leaving
just the coupled resistance. If this resistance is R, then the voltage Vo is just Vexc R/(Rs + R).
Resistances should be selected to make this change in voltage readily detectable.
10.5. ACCELERATION SENSING 105

electrodes

gap metal to detect

Figure 10.3: A capacitance probe.

10.4.3 Capacitance

Another technique for sensing a conductive material is to sense a capacitance change. This
can be accomplished with a tuned circuit in which at least part of the tuning capacitance
depends on the proximity of a conductive surface to a pair of electrodes. An example sensor
configuration is shown in figure 10.3.

10.5 Acceleration Sensing

To sense acceleration, you need to use an accelerometer. You can make a crude one with a
force sensor and a reference mass. The mass may be anything provided that it is sufficiently
large to cause a measurable signal from the force sensor when undergoing the acceleration
expected.

You can also use a position sensor, a reference mass and a force element such as a spring or
an elastic. Since F = ma, then a = F/m. But F is proportional to the amount that the
force element is extended or compressed, and this can be measured with the position sensor.
The mass m is known, and so the acceleration can be determined. For more sensitivity,
increase the reference mass or use a spring with a lower spring rate.

10.6 Current Sensing

Sensing motor armature current gives an indication of the load on the motor. This can be
useful to determine if the motor is stalled or heavily loaded, and might be used for controlling
a drive motor for a vehicle or gripper.

A simple method of determining motor current is to measure the voltage drop across a
reference resistor. You want to make the reference resistor very small so that there is a very
small drop across it. A large drop will dissipate power that is better applied to the motor.
106 CHAPTER 10. SENSING THE ENVIRONMENT

Remember that the inertia of the motor prevents it from starting instantaneously. If the
mechanical time constant of the motor is large compared to the electrical time constant due
to armature inductance and resistance, then the motor will be essentially stationary when
the current reaches its maximum magnitude. Because the motor is stationary, this current
will be the blocked rotor current. Thus, every time that you start the motor, the peak
current will be the blocked rotor current. The current will decrease as the motor begins to
turn. Control strategies that sense current should be designed to account for this behaviour.

Another way to sense motor currents might be to measure the energy dumped in the free-
wheeling diode circuit when the motor is shut off. This is easier if there is a resistor in series
with the freewheeling diode as in figure 4.6 because you can measure the voltage across the
resistor. The energy E stored in an inductor is
1
E = Li2 . (10.1)
2
This energy must be released to the resistor in series with the freewheeling diode. This
energy is related to the voltage vR across the series resistor by
1Z 2
ER = vR (t)dt (10.2)
R
Thus, by measuring vR and computing the integral above, you can determine the armature
current. If you are merely trying to detect excessive current, then measurement of the voltage
across the series resistor after a known time (one electrical time constant, say) should permit
you to determine if motor current is too high.

Note that the addition of the resistor will raise the required breakdown voltage (maximum
permissible voltage) of the MOSFET or other switching element.

There are many other methods of sensing current. For direct currents, there are Hall effect
devices, current-sensing relays, magnetic saturation-based devices, etc. For alternating cur-
rents you can use current transformers as well as the direct current methods. You might
want to look into what is involved in these techniques if you think that current sensing is an
option.

10.7 Sensing Speed

As shown in figure 4.6 and discussed in 4.5, the back e.m.f. of the motor indicates the motor
speed. Measurement of this motor voltage must be made after the energy stored in the motor
inductance has been dumped, however. The problem with using the back e.m.f. to indicate
motor speed is that the motor driver must shut off current to the motor for long enough to
dump the energy stored in the inductor completely. This means that the motor cannot run
at maximum speed (the motor driver constantly on) if you must measure its speed.

Another approach is to measure the commutator noise. If you monitor the voltage across
the motor with enough sensitivity, you will see what appears to be a noisy square wave.
10.7. SENSING SPEED 107

This waveform is due to the armature circuits being connected and disconnected from the
brushes by the turning commutator. Since the period of this waveform is determined by the
rotational speed of the motor, you should be able to use this commutator noise to measure
motor speed. Much filtering and other signal processing may be necessary, however. See the
‘Hodge-Podge’ chapter.
108 CHAPTER 10. SENSING THE ENVIRONMENT
Chapter 11

Noise and Interference

We will greatly simplify the discussion by classifying noise as either ‘thermal’ noise or ‘shot’
noise. There are many types of 1/f noise, but we will not concern ourselves with their
specifics here. In addition, there are other types of noise, but these two types predominate
in our analysis.

A concept that we must understand first of all is the noise-equivalent bandwidth.

11.1 Noise-Equivalent Bandwidth

The noise-equivalent bandwidth can be thought of as the bandwidth of the ‘filter’ through
which the noise is passed. This notional ‘filter’ is really just the frequency response of the
system from the source of the noise up to and including the measurement subsystem.

How do we determine the noise-equivalent bandwidth for a system? To determine this


bandwidth, we must first draw the frequency response on a linear-linear graph instead of
the more frequently used log-log graph. The frequency response will look a little weird
when drawn this way (see figure 11.1). We then draw a rectangle with the same passband
gain and with the same area as the frequency response. The width of the rectangle is the
noise-equivalent bandwidth. This is shown in figure 11.1b.

11.2 Thermal of Johnson Noise

Thermal, or Johnson, noise is generated thermally as the first name implies. It is a noise
voltage which is generated by the ‘friction’ of current flow in resistive elements. Thermal
noise is a ‘white’ noise since its amplitude is independent of frequency.

109
110 CHAPTER 11. NOISE AND INTERFERENCE

B
a. b.

Figure 11.1: Determining the noise-equivalent bandwidth of a low-pass system.

The noise voltage en is given by



en = 4kT RB (11.1)

where k is Boltzmann’s constant (1.38 × 10−23 ), T is the absolute temperature in degrees


Kelvin, R is the resistance in ohms that is generating the noise, and B is the noise-equivalent
bandwidth in hertz. Thus, the noise voltage is proportional to the square root of both
resistance and noise-equivalent bandwidth. Ideal inductors and capacitors do not generate
this noise. Only resistive terms can generate it.

A good strategy for the design of a low-noise system is to keep resistance values and band-
width small. Ideally, we make the bandwidth as small as possible as long as we do not
attenuate the desired signal.

11.3 Shot Noise

Shot noise is due to the discrete nature of current flow in semiconductor p-n junctions. The
noise current in is given by
q
in = 2qIdc B (11.2)

where q is the charge on an electron, Idc is the dc current flowing through the device under
consideration, and B is again the noise-equivalent bandwidth. This noise is also independent
of frequency, and so it is also ‘white’.
11.4. OTHER NOISE SOURCES 111

source noiseless circuit


Rs e
en
A Vo

Vs i Z
en i

Figure 11.2: Modeling the equivalent input noise of a circuit.

11.4 Other Noise Sources

There are other types of noise, but the power spectra of these sources generally exhibit a
‘1/f’ dependence on frequency (at least to a point).

11.5 Computing Equivalent Input Noise

We can model the effect of all the noise sources taken together as an equivalent input noise
voltage een and an equivalent input noise current ien as shown in figure 11.2. These are
the noise voltage and current which, if connected to a noiseless circuit which was otherwise
identical to the circuit under consideration, would result in the same noise at the output.
Note that the noiseless circuit must have the same bandwidth and input impedance, and the
source must have the same impedance for us to be able to model noise this way.

This approach is really quite helpful as it reduces the noise contributions of all the resistances,
junctions and any other sources to just two sources.

Now, how do we combine noise sources? Since the noise sources are uncorrelated, we compute
the output as the square root of the sum of the squared outputs due to each source alone.
You can see that this is really a superposition of noise power. Since noise is a function of
measurement bandwidth, we normally compute the noise per unit bandwidth (strictly we
compute the square root of the noise power per unit bandwidth).

Using this superposition approach, we see that the output noise voltage von of the circuit in
figure 11.2 will be

von = Ave
" 2 2 #
Zi Zi

2
= A een + eRs + (ien (Rs kkZi )) . (11.3)
Zi + R s R s + Zi
112 CHAPTER 11. NOISE AND INTERFERENCE

The second term on the right-hand side is due to the thermal noise generated by the source
resistance. Note that we have not considered the output due to the signal source because we
are only considering output due to noise. Also note that each of the noise voltages is scaled
by the impedance divider consisting of the source resistance and the circuit input impedance.
If the source had a complex impedance, this would be used instead of the source resistance,
of course.

11.6 Signal to Noise Ratio

If we compute the ‘spot signal to noise ratio’, the signal to noise ratio or SNR per unit
bandwidth, at the output, we find that it is just
Avs
SN R =
von
vs
= (11.4)
ve
This is a handy way of expressing the signal to noise ratio because it shows that changing
circuit gain does not improve the ‘spot SNR’.

When computing the overall signal to noise ratio, we must remember that the signal power
does not change as a function of the measurement bandwidth (assuming that the measure-
ment bandwidth is always at least sufficient to pass the signal), but the noise power does
increase with the square root of bandwidth. Thus, a wider bandwidth system will always be
noisier than a narrow bandwidth system, all other things being equal.

11.7 Averaging and Filtering Low-Amplitude, Noisy


Signals

We may express a noisy signal v(t) as the sum of the deterministic component v̂(t) and the
output from an uncorrelated noise process ζt , as

v(t) = v̂(t) + ζt (11.5)

where we have expressed the noise term as ζt to denote the fact that the random component
changes with time, but cannot be described as a function of time.

The anticipated range of variation in the output due to noise is of interest as this tells us
the range of uncertainty to be expected in the output. This variation is expressed by the
standard deviation. The signal to noise ratio is defined as

deterministic component of signal amplitude


SN R = (11.6)
standard deviation of signal variation
11.7. AVERAGING AND FILTERING LOW-AMPLITUDE, NOISY SIGNALS 113

The standard deviation σv of a signal v(t) = v̂(t) + ζt is the expected value of the square of
the signal variation due to noise, or,
σv = E{(v(t) − v̂(t))2 }
= E{v 2 (t) + v̂ 2 (t) − 2v(t)v̂(t)}
= E{v̂ 2 (t) + ζt2 + 2v̂(t)ζt + v̂ 2 (t) − 2(v̂ 2 (t) + ζt )v̂(t)} (11.7)
But E{v̂(t)ζ} = 0 since the noise is uncorrelated with the noiseless signal, and so this reduces
to
σv = E{ζ 2 } (11.8)
as might be expected. Thus, the signal to noise ratio SN Rv is just
v̂(t)
SN Rv = . (11.9)
σv

If we were to define our desired signal va (t) as the sum of N signals v(ti ), we could compute
the signal to noise ratio of va (t). In each of the v(ti ) the deterministic components would
be the same, but the random components would differ. The new deterministic component
v̂a (t) is just the expectation of va (t) given by
v̂a (t) = E{va (t)}
(N )
X
= E (v̂(ti ) + ζti )
i=1
= N v(t). (11.10)

The new standard deviation σa is computed by substituting


N
X
va (t) = (v(ti ) + ζti )
i=1
XN N
X
= v(ti ) + ζti (11.11)
i=1 i=1

into equation 11.7. Since we have assumed that the sequence of noise samples is uncorrelated,
it follows that
E{ζti ζtj } = 0 (11.12)
for all i 6= j.

With this in mind, substituting va (t) into equation 11.7 results in the standard deviation of
the averaged signal,
σa = E{(va (t) − v̂a (t))2 }
= E{va2 (t) + v̂a2 (t) − 2va (t)v̂a (t)}
= N 2 v̂ 2 (t) + N E{ζt2 } + N 2 v̂ 2 (t) − 2N 2 v̂ 2 (t)

N
!2 N
! 
 X 
+ N 2 v̂ 2 (t) − 2
X
= E (v̂(ti ) + ζti ) (v̂(ti ) + ζti ) N v̂(ti )
 
i=1 i=1

= N E{ζt2 } (11.13)
114 CHAPTER 11. NOISE AND INTERFERENCE

Thus, the signal to noise ratio SN Ra of the sum of signals is just


N 2 v̂ 2 (t)
SN Ra =
N E{ζt2 }

= N SN Rv (11.14)

We see that by adding N signals, the signal to noise ratio improves by N . Note that we
get the same performance improvement by averaging the signals as well as adding them.
(Why?)

But what is signal averaging? Not surprisingly, it is a form of filtering. (What does the
Fourier transform of a N -point averaging function in a M, M >> N point sequence look
like?) Thus, by selecting an appropriate filter, we should be able to improve the SNR.
(How much can we improve it? What controls the amount of improvement? Averaging is a
low-pass function. What would happen with a band-pass function? A high-pass function?)

11.8 Non-White Noise

The previous section suggests that the SNR can be improved by averaging or filtering. If
your problem is electronics noise and this noise is not white (for instance, it has a large
1/f component), then another possibility is to shift the signal to a frequency in which the
electronics noise amplitude is small1 . The signal is amplified, and then shifted to a frequency
at which it is easily processed.

11.9 Interference

Interference can come from many sources. The electromagnetic interference/radio-frequency


interference (called EMI/RFI) generated by your motor brushes is a classic form of inter-
ference. Even though you may use this signal for measuring motor speed, to the rest of
your circuitry, its just interference. Radio stations, cell phones, any radio transmitters,
poor fluorescent light ballast transforms, automobile ignition systems, . . . are all sources of
EMI/RFI.

Broad-spectrum interference (such as automobile ignition noise) tends to have a 1/f char-
acteristic. Thus, it can be useful to shift the frequency at which you are making your
measurements into a region with low interference. Clearly, you would also try to avoid the
frequencies of local radio and television broadcasters as well as other radio sources.

Interference can also arise when one part of your circuit generates signals, either radiated
or conducted, which interfere with another portion of the circuit. A classic culprit is digital
1
Frequency shifting requires modulation, one form of which is multiplication. For any frequency shifting
to occur, we need a non-linear element. We will see one way to shift the frequency of sensor outputs in
subsection 12.3.2.
11.10. SIMPLE WIRING PRECAUTIONS 115

logic creating noise on the power supply rails which is then picked up by other circuits. This
form of interference can also be handled with proper design.

The best approach to dealing with interference is to avoid it with adequate shielding, ground-
ing and decoupling. This is a topic which deserves at least one large textbook in itself. It
has been said by electronics experts that grounds are the most complex part of any circuit.
However, a few simple ideas will certainly help you.

11.10 Simple Wiring Precautions

When two wires are placed parallel to each other and close together, they can be considered
to be a combination of two plates of a capacitor and also the primary and secondary windings
of a (rather poor) transformer. A large alternating current flowing in one of the wires will
result in a voltage induced in the second wire. How big is the voltage? Clearly it is a function
of the current amplitude, probably a function of frequency (there will be no induced voltage
if the current is a DC current), and also a function of the length over which the wires are
parallel and their proximity.

How can this affect our design? Consider the following.

Suppose that you have wire A connected to the output of a logic gate which sinks 10 mA
from a load whenever the gate output is low, and sources zero current whenever the gate
output is high. Suppose further that this gate changes state in 10 nS (a rather slow gate).
Suppose that parallel to wire A is wire B, which is connected at one end to an ideal voltage
source, and at the other to the input of a gate which has an input resistance of 1 megohm
(this is not at all uncommon.) The voltage induced in wire B due to transformer action will
be given by

diA
VB = M
dt
∆iA
≈ M
∆t
0.01
≈ M (11.15)
1 × 10−8

We see from this that a mutual inductance of 2 microhenries will result in 2 volts being
induced in wire B. This is sufficient to change a logic low input to the gate to a logic high, or
vice versa. Mutual inductances of 2 microhenries and greater are easily created with quite
short parallel wire runs. Note that we have not even considered the effects of capacitive
coupling.

How do you fix this?

• Don’t make parallel wire runs if you can help it.


116 CHAPTER 11. NOISE AND INTERFERENCE

• Don’t have wires carrying high current in close proximity to wires carrying low voltage
signals.

• Keep low-amplitude signals as far as possible from high-amplitude signals.

• Use signal sources and inputs with the lowest impedances possible commensurate with
your design requirements, especially for long wire runs.

This last point requires explanation. The transformer created by the close proximity and
parallel placement of the two wires in our example is not a good one. Its coupling coefficient
is poor, and the impedance looking into wire B back toward the circuit of wire A would have
a large component due to the transformer itself2 . Thus, if we loaded wire B with a low-valued
resistance to ground, the induced voltage in wire B would be attenuated by the impedance
divider consisting of this resistance and the transformer impedance. (Think about this. It
crops up in electronics very frequently. Look up ‘4-20mA current loop’ signal transmitters.
With these, the signal is carried by the current flowing in the connecting wiring. Why is this
good?)

11.11 Decoupling Capacitors

When a circuit demands current from the power supply (such as when it turns on a motor,
changes the state of a logic gate, or drives a load resistance), more current must flow in the
power supply rail. Since there must always be some non-zero impedance to the power supply
rail due to its inductance and resistance, there will be a voltage drop when the current is
demanded. This will cause a change in the power supply voltage seen by the rest of the
circuit. If this change is sufficiently great, it may cause these other circuits to malfunction.
Frequently, this power supply ‘noise’ (its really interference) will be coupled into the output
of these other circuits, resulting in degraded performance.

How do we stop this? Firstly, make sure that all power supply leads are as short and fat
as possible. This minimizes both the resistance and the inductance. Secondly, connect
decoupling capacitors from the power supply leads to ground as close to your integrated
circuits as possible. Typical values would be 0.1 microfarad to 0.01 microfarad. These
capacitors act as little ‘electron reservoirs’ storing charge which can be used to supply the
instantaneous current demands made on the power supply. The capacitors are small because
larger capacitors tend to have larger lead inductance and larger internal resistance. This
is just the problem that we are trying to fix!. The capacitors must be small enough to
have small internal inductance and resistance, but large enough to store sufficient charge
to supply the integrated circuit until the power supply can compensate for the increased
current requirements.

Since these decoupling capacitors are electrically close to each chip, the chips do not ‘see’
the impedance of the power supply and its power distribution wiring, but primarily the
2
In transformer design, we try to minimize this impedance.
11.11. DECOUPLING CAPACITORS 117

impedance of the capacitor to ground. The current required by each chip is supplied by its
associated coupling capacitor in the short term, and by the power supply in the longer term.
Thus, the voltage fluctuations on the power supply rails are minimized and the interference
with the rest of the circuit is reduced.
118 CHAPTER 11. NOISE AND INTERFERENCE
Chapter 12

Processing Low-Amplitude Signals

The signals from sensors are frequently of low amplitude, and so they are subject to being
corrupted by noise and interference. Clearly, if we want to extract the maximum amount of
information possible from our sensor measurements, we must minimize the effects of these
disturbances. To understand how to do this, we need to gain an understanding of noise, of
interference, and of sensor characteristics.

12.1 Amplifying Low-Amplitude Signals

A common technique for amplifying and detecting low-amplitude signals which ‘ride’ on a
varying level is to amplify or detect the difference between the signal-plus-background and
the background. This technique is based on the concept that the signal is well localized in
time, in space, in frequency, or in some other domain which is easily handled.

In figure 12.1, we see the basic concept underlying this idea. In the case of a sensing system
for surface markings (which are localized in space), two sensors are required. One sensor
‘looks for’ the surface marking and the other looks at the background. In our example, the
two sensors must be looking at areas with very similar overall illumination. With proper
adjustment, the output is essentially zero until a mark is present. This technique can be

signal +
background

signal

background

Figure 12.1: Differential processing of space-localized signals.

119
120 CHAPTER 12. PROCESSING LOW-AMPLITUDE SIGNALS

signal +
background

signal

signal averager

Figure 12.2: Differential processing of time-localized signals.

probability of correct detection detecting the signal when it is present


probability of false detection detecting a signal when it is not present
probability of correct rejection not detecting a signal when it is not present
probability of false rejection not detecting a signal when it is present

used to easily attenuate the signal from the background by a factor of 10, thereby increasing
the ‘signal to background’ ratio by a factor of 10.

Another approach is shown in figure 12.2. In this case, only one sensor is required and we
assume that the signal is well localized in time, meaning that the time at which the signal
occurs is well defined. Remember that speed of the sensor in space can be used to convert
space to time (think about this), so that either of these solutions might be appropriate for
finding surface markings.

12.2 Detecting Signals

We have already seen a common method of detecting a signal; compare it to a threshold


using a comparator. When the detection circuit is preceded by one of the foregoing circuits,
then the signal may be detected even in the presence of variations in the background level.
Care must be taken to ensure that you detect all the signals and only the signals.

In signal detection theory, we talk about the probability of false detection, the probability of
correct detection, the probability of false rejection and the probability of correct rejection.
These are defined as follows: We will not go into great detail here (there are many books
written on the subject). Suffice it to say that no system will perfectly detect the signal of
interest and nothing else. We will state, however, that the goal of a signal detection system is
to minimize the probability of false detection simultaneously with minimizing the probability
of false rejection.

Lets look at an example. Lets assume that we have a noisy signal containing a 1 volt peak-
to-peak and noise with a standard deviation of 0.5 volts. Lets assume that we will use a
simple comparison with a threshold to detect the signal. Whenever the signal exceeds the
threshold, we will detect a pulse. Lets further assume that we don’t know how long the
12.2. DETECTING SIGNALS 121

Probability of False Detection

0 0.5 1.0

1.0
C
increasing threshold
B
Probability of Correct Detection

A
0.5

Improving performance

performance corner

performance obtained of no
attempt is made to separate
the signal from noise prior
to detection.
0

Figure 12.3: Receiver Operating Characteristic curves.

pulses will be.

It should be clear that the lower the threshold, the less the chance that we might inadvertently
miss a pulse, but the greater the chance that we will detect noise as a pulse. If we raise
the threshold, the opposite will occur. The likelihood of missing a pulse goes up, but the
likelihood of detecting noise as a pulse goes down. Thus we see that as we raise the threshold,
the probability of false detection decreases (this is good) but the probability of detection also
decreases (this is bad).

If we plot the probability of false detection against the probability of correct detection for
all values of the threshold, we get a curve such as curve A in figure 12.3. This curve is
called the Receiver Operating Characteristic (ROC) curve. The ROC curve shows that as
the threshold is decreased, the probability of correct detection increases but so does the
probability of false detection.

If we were to modify the system by adding a filter to suppress the noise and enhance the
signal, we might have system performance represented by curve B in the figure. This curve
shows that the new system is better than the old system because the probability of false
detection is everywhere lower on curve B than curve A for the same probability of correct
122 CHAPTER 12. PROCESSING LOW-AMPLITUDE SIGNALS

detection. Thus, we see that better systems have performance curves which pass closer to
the ‘performance corner’.

The strength of ROC curves is that they allow us to compare the achievable performance of
two or more systems without concern for the outcomes of those systems. In some applica-
tions, it may be crucial to detect all events even if this means that we will have a relatively
high false detection probability. Examples include earthquake prediction, detecting thin
spots in the steel for submarines, and detecting cancer tumors in medical images. In other
applications, the cost of false detections may be sufficiently high and the benefits of correct
event detection may be sufficiently low that we are willing to miss some events. An example
is predicting the stock necessary in retail sales. It is too expensive for the retailer to carry
sufficient stock to ensure that he/she never runs out.

To achieve the optimum performance, a system designer first optimizes his system based on
the ROC curves, and then selects a threshold suitable for the application.

12.3 Detecting AC Signals

When discussing carrying information on AC voltages or currents, we must be clear about


our terms. In the following, the AC voltage or current will be called the carrier, and the
information to be carried will be called the signal. Thus our task is to separate the signal
from the carrier.

To detect the signal, you must have an idea of how the information is carried by the carrier.
Is our signal encoded by the carrier amplitude, as in AM broadcast-band radio transmissions?
Does the frequency carry the signal as in FM transmission? What about the phase, or the
time of arrival of any of these? Another option is to carry the signal via the rate of change
of any of these methods.

We will look briefly at two detectors. The output of the first detector, called an envelope
detector, follows the amplitude of the carrier. The second detector is called a synchronous
detector (and there are many types of these). Its output is proportional to carrier amplitude
also, but under certain circumstances, it can also be made to recover carrier phase informa-
tion. This is useful we attempted to detect the signal carried by a carrier which was quite
close in frequency to other carriers (Why?.

12.3.1 Envelope Detector

This is the simplest of detectors (figure 12.4). Resistor R1 and capacitor C1 are merely used
to remove any DC level. The detector itself has only three parts.

When an input signal forward biases the diode, current flows to charge capacitor C2 , raising
its voltage. When the AC input is not enough to forward bias the diode, the capacitor slowly
12.3. DETECTING AC SIGNALS 123

C D
1
V V
sig out
R C R
1 2

Figure 12.4: An envelope detector.

discharges until either the diode is forward biased or the capacitor voltage is zero. Thus we
can see that we must select C2 and R2 to have a time constant considerably longer than the
period of the AC signal, but considerably shorter than the time between the fluctuations in
signal amplitude which carry the desired information. For an AM broadcast-band a radio,
this is not too tough because the carrier signal (the AC signal) is no less than about 0.5
MHz, and the information transmitted (voice and music) contains frequencies no higher than
20 KHz.

This detector is the basis of the crystal radio. It isn’t great, but it is cheap, and does work.

12.3.2 Synchronous Detection

Synchronous detection permits us to have the frequency of the carrier closer to the frequency
of other carriers, and also, the frequency of the signal much closer to the carrier frequency.

The concept is outlined in figure 12.5a. The input is Vsig and the switch is operated by signal
Vswitch . The resistor merely ensures that the input to the low-pass filter is zero when the
switch is open.

This circuit works as follows. We assume that we know the frequency and phase of the input
signal, and can control the switch so that it is closed only when the input is positive. (we
will see one way to do this shortly.) With these assumptions, the input to the low-pass filter
will be either zero or positive. If we select the filter so that it severely attenuates frequencies
at the switching rate, then the filter output will be merely the average value of its input,
which is the rectified input signal. This is proportional to the amplitude of the input signal.

Now, if there is a phase shift of θ between the input signal and the switch signal, we should
be able to see that shift in the output. How can we be sure of this? Consider two scenarios.
In the first, the switch signal is exactly in phase with the input, and so we have seen above
what will happen. In the second scenario, the switch is operated 90 degrees out of phase
with the input signal. The low-pass filter will find the average of the switch output; what
will it be?

Try to develop the math. Assume that the filter just computes the average of its input every
cycle of the carrier.
124 CHAPTER 12. PROCESSING LOW-AMPLITUDE SIGNALS

low−pass
Vsig Vout
filter

Vswitch

a.

transducer output
AC excitation
(the measurement)

low−pass
transducer Vout
filter

A1

−1

b.

Figure 12.5: Synchronous detection. a) Conceptual model. b) A block diagram of a system.


12.3. DETECTING AC SIGNALS 125

This detector can be improved by using the negative half of the input as well as the positive
half. How would you accomplish this?

Finally, lets see how we could use this in a sensor system. Consider figure 12.5b. In the
figure, we have an oscillator (sinusoidal or square wave) which both excites1 a linear sensor
such as strain gauge or our pressure transducer and drives the comparator which operates
the switch. The sensor output will now contain the AC excitation signal modulated by the
physical measurement that we wish to make. If you write the equations (always a good
idea!), you will see that the output carrier frequency of the sensor is just the AC excitation
frequency, and its amplitude contains the signal frequencies. Thus, we have shifted the
frequency of the signal, as promised in section 11.8. With care, we can shift it to a relatively
noise- and interference-free part of the spectrum.

We also know the phase and frequency of the carrier; indeed, we use the AC excitation
(which is also the carrier) to drive the switch. Thus, we have met the assumptions required
for synchronous detection.

If you use this technique, be careful of two things. The are that

1. noise from the switch may be larger than the noise that you were trying to avoid, and

2. the phase of the excitation may be shifted through either the transducer, the switch
comparator, or both. You may have to compensate for this.

What does amplifier A1 do, and why does it significantly improve circuit performance?

1
No-one said that all sensors could only have a DC voltage or current applied to them!
126 CHAPTER 12. PROCESSING LOW-AMPLITUDE SIGNALS
Chapter 13

Voltage Regulators

Power supplies are essential for any electronic equipment. Most equipment requires well-
conditioned power; a known voltage which fluctuates little with changes in the supplied
voltage and the connected load.

A voltage regulator is used to perform this task. This is a circuit that can provide large
currents at a fixed voltage, independently of the input voltage. Look at figure 6.1. We
showed that negative feedback attempts to minimize the difference between the two inputs
to the summing block; stated another way, it attempts to make the output track the input.
If we were to make the input a constant voltage, then the output would be constant. This
is exactly the concept that we want.

Voltage regulators come in ‘linear’ and ‘switching’ flavours. We first look at linear regulators.

13.1 Linear Voltage Regulators

In concept, a linear regulator is just a high-power, variable resistor in series with the load.
Circuitry is provided to automatically adjust this resistor so that the voltage across the load
is constant regardless of the current that the load draws. Thus, the power PD dissipated by
our conceptual power resistor is just
PD = (VB − VL )IL (13.1)
where
VB = voltage of the unregulated supply (13.2)
VL = desired load voltage (13.3)
IL = load current (13.4)
For high-power applications, this power can be quite considerable. It can be quite difficult
to design an adequate heat sink. An additional problem is that energy from the unregulated
source is wasted. This is unacceptable in battery-operated systems in general.

127
128 CHAPTER 13. VOLTAGE REGULATORS

Vcc

Vcc

−Vcc G
Vo

reference

Figure 13.1: A simple linear voltage regulator.

Thus, linear regulators are used for very low power applications so that the power dissipated
by the regulator, and hence the energy wasted, is low.

Lets look at implementing the negative feedback structure using linear components. We need
an element to compute a difference and amplify that difference; consider an op-amp. We
require some means of controlling a large current because the op-amp cannot do it; consider
an emitter follower. We need a constant reference voltage for the input; consider a zener
diode. And finally, we need feedback from the output to the input which scales the desired
output voltage to the reference input; consider a resistive voltage divider.

The op-amp and emitter follower together form a high-current, high-gain op-amp. This takes
the role of the summing block and the G block in figure 6.1. The feedback resistor network
plays the role of the H block in figure 6.1, and the constant reference voltage is the input.
The circuit of a linear regulator will therefore look like figure 13.1. The circuit diagram is
labeled with G and H denoting the corresponding blocks in figure 6.1.

13.2 Switching Regulators

In concept, switching regulators use a switch to control the power flow to the load. Circuitry
is required to sense the load voltage and automatically adjust the duty cycle of the switch
to achieve constant load voltage regardless of the current drawn by the load. To prevent
the load from being switched on and off, a low-pass filter is placed between the switch and
13.2. SWITCHING REGULATORS 129

switch
period T
duty cycle D
unregulated V
supply B

load

A
low−pass filter characteristic
spectrum of V
B

f
fo 10 fo

Figure 13.2: a. Conceptual switching regulator. b. characteristics of the low-pass filter


superimposed on the spectrum of VB . Note that only the d.c. component has significant
magnitude after the low-pass filter.

the load. The -3db cutoff frequency of the filter is made much lower than the switching
frequency so that only the d.c. term is passed. This is the power sent to the load. This is
shown in figure 13.2.

The expected efficiency of a switching regulator is very high since a switch does not dissipate
any power either when open or closed. In a practical application, the switch is implemented
with a semiconductor so there is some power dissipation when it is ‘closed’ and some during
transitions from open to closed and closed to open. To keep efficiency high and minimize
losses, the low-pass filter is implemented with inductors and capacitors only. Since there is a
90 degree phase shift between current and voltage in both of these devices, no power will be
dissipated by the filter. In theory therefore, the regulator itself will dissipate no power and
so no energy is wasted. In practice there is a little dissipation by the losses in the capacitors
and coils.

We should look a little more carefully at the switch in figure 13.2. We would find great
130 CHAPTER 13. VOLTAGE REGULATORS

V L V
unregulated B o
supply

C load
Control
Circuit

Figure 13.3: Practical step-down switching regulator.


L V
unregulated o
supply

C load

Control
Circuit

Figure 13.4: A Boost regulator. Note that the flyback inductor voltage adds to the unregu-
lated input voltage.

difficulty implementing the switch as it is shown. Instead, we use the circuit of figure 13.3.
In this circuit, when the P-channel power MOSFET is conducting, VB is greater than Vo and
so the diode is not conducting. When the power MOSFET turns off, the voltage VB will
swing negative with respect to Vo due to the flyback effect of the inductor. This effect occurs
because the inductor will not permit an instantaneous change in the current flowing through
it. VB will continue to go increasingly negative (very rapidly) until the diode is forward
biased. At this time, the inductor current will flow. The voltage drop across the diode will
be small when it is conducting, and so the combination of this diode and the MOSFET make
up the single-pole, double-throw switch of figure 13.2.

This regulator is a step-down regulator, sometimes referred to as a ‘buck’ regulator. Its


maximum output voltage is just the unregulated supply voltage, and its minimum is zero.
How can we come to this conclusion? Ask yourself what would happen if the control circuit
caused the MOSFET to conduct continuously. What would happen if the MOSFET did not
conduct at all?

In the preceding regulator and the ones to follow, we assume that the control circuitry
monitors the output voltage and controls the duty cycle of the switch to result in the desired
output voltage.

Other forms of regulator are possible. The ‘boost’ regulator (figure 13.4) provides an output
voltage greater than the input voltage. You should try to determine how this circuit works.

Another form of regulator is the ‘buck-boost’ regulator which can provide an output either
13.2. SWITCHING REGULATORS 131

unregulated V
o
supply

L C load

Control
Circuit

Figure 13.5: A buck-boost regulator. Note that the output is due solely to the energy stored
in the inductor.

less than or greater than the input (figure 13.5. Part of the price that you pay for this
flexibility is that the output voltage is negative with respect to ground. This regulator
works somewhat differently from the previous ones. In the buck-boost regulator, energy is
loaded into the inductor when the MOSFET is conducting. When the MOSFET turns off,
this energy is dumped into the load. The energy stored while the MOSFET is conducting is
1
E = Li2L (13.5)
2
where L is the inductance and iL is the inductor current. Because the voltage drop across
the MOSFET is essentially zero when it is conducting, the inductor current is
1Z
iL = VL (t)dt
L
Vunreg t
= (13.6)
L
where VL is the inductor voltage, Vunreg is the unregulated supply voltage, and t is the length
of time that the switch is closed. Thus, the energy per switch closure is

(VL t)2
E= (13.7)
2L
and so the power output is
(VL t)2
Po = (13.8)
2LT
where 1/T is the switching frequency.

Since the power PL delivered to load RL is

Vo2
PL = (13.9)
RL

and this must equal Po (why is this so?), then the output voltage is
s
RL
Vo = VL t (13.10)
2LT
132 CHAPTER 13. VOLTAGE REGULATORS

Thus, the output voltage is a function of the load resistance, unlike the buck regulator.

There are many other forms of switching regulator. Some use transformers or coupled
inductors to great advantage, enabling regulators with multiple outputs and permitting the
designer to change the polarity of the output. For more information, see a book on voltage
regulator design.
Chapter 14

A Hodge-Podge of Ideas

This chapter is not really a chapter at all. It is a collection of ideas on a wide variety of
topics.

14.1 Measuring Frequency

Frequency can be measured in a number of ways. Lets assume that we have a square
wave, and we wish to determine its frequency. Clearly, determining the waveform’s period
is equivalent to determining its frequency if we want to compare the frequency with a fixed
threshold. If we wish to have an output proportional to frequency, however, then measuring
period is not such a great way to do this. (Why are these two sentences true? Explain it to
yourself.)

Note that there is another advantage to determining frequency by measuring the waveform
period. If we measure frequency directly, the resolution if the measurement increases with
the number of cycles used in the measurement. If we measure the number of positive-going
(or negative-going) zero-crossings of a 10 Hz square wave for 1 second, we have a resolution
of one cycle in 10. Thus, we can determine if the signal is really at 9 Hz or 11 Hz, but we
cannot do better. (This of course assumes that we cannot measure the fractional parts of a
wave. This assumption is valid since the ability to measure fractional parts suggest that the
measurement technique is not based strictly on frequency measurement.)

However, if we measure the period of the incoming waveform, we can determine its frequency
to arbitrarily high resolution, limited only by system noise considerations.

These two approaches represent fundamentally different concepts of measurement. The


frequency measurement approach counts events (cycles) and so its resolution is limited by
the discrete nature of the events in the signal. The period-based measurement measures
time, which is a continuum, and so the resolution is limited by the measuring equipment,
not by the signal.

133
134 CHAPTER 14. A HODGE-PODGE OF IDEAS

Lets assume for the moment that we wish to compare frequency of an incoming signal to a
fixed threshold. To do this, we will measure period of the signal. Lets further assume that
the signal is a rectangular wave. This assumption will not pose a problem as we have already
seen ways to convert any signal to a rectangular signal. (How?) How can we convert the
signal period to a signal that we can process further?

Lets look at a concept that we have seen before. We have seen that the average output
voltage of a rectangular wave is merely the peak output scaled by the duty cycle. We saw
this in the pulse width modulator discussion for motor control.

Thus, it is clear that we need to convert signal period to duty cycle. How can we do this?

What happens if we use a one-shot to generate a pulse of a known, short duration t at every
leading edge of the signal? Clearly, if the period of the signal is T , the ‘on’ time of the pulse
will be t (which is fixed) and the ‘off’ time will be T − t (which is proportional to T ). Thus,
the average output voltage from this one-shot pulse generator will be
t
Vo = VP (14.1)
T −t
where VP is the output voltage of the one-shot pulse generator.

How do we get the average value of the one-shot’s output? Look at the section on motor
control, specifically pulse-width modulation to see.

How do you select the width t of the one-shot’s output pulse? Clearly, it must be sufficiently
short that the pulse ends before being retriggered. I it is of zero length, however, the output
voltage will always be zero. Thus, it should be as long as possible, but strictly less than the
minimum wave period possible.

But what if we do want to measure frequency? Since period is just the reciprocal of frequency,
we might consider taking the reciprocal of the period measurement. How can we do this?
Other sections discuss the concepts and circuitry required. Look in chapter 6.

What if the signal to be measured is not a nice rectangular wave? How can you make it into
a rectangular wave? See chapter 7.

14.2 Pulse Accumulator

Say that you want to count pulses, but you do not have any digital chips to do it with. What
can you do?

Well, first recognize that an integrator accumulates a signal. If the signal consists of pulses
of fixed amplitude and width, then the output of the integrator will be a function of the
number of pulses. Thus, the basis for a pulse accumulator could be an integrator.

Now, we must condition the signal for use by the integrator. This can be done by the blocks
14.3. USING ANALOG CIRCUITRY FOR LOGIC OPERATIONS 135

one−shot
Vin schmitt trigger V
multivibrator o

Figure 14.1: A pulse accumulator. What do the first two blocks do?

in figure 14.1 If the one-shot multivibrator outputs a pulse of duration t and amplitude
VP whenever it is triggered, then the output of this system will be nVP t. In a practical
application, we would need to account for the negation inherent in most integrator circuits,
and we need to be very careful of integrator drift.

14.3 Using Analog circuitry for Logic Operations

Yuck! Why would you want to do this?

Well, there are some very good reasons. Consider these possibilities:

1. you may not have any logic circuitry available,

2. you have unused analog circuitry available (unused op-amps and comparators in multi-
op-amp and multi-comparator packages),

3. your analog circuitry uses ±15 volts and you don’t want to incorporate a 5 volt regulator
so that you can include logic (but you could use CMOS 4000-series logic; look this up),

4. you don’t want the interfacing headaches between analog and logic,

5. you have a perverse nature

This list is not exhaustive.

Lets consider an analog AND gate. Clearly, we can use a summing op-amp followed by a
comparator which compares the sum to a fixed threshold, as in figure 14.2. If the input
voltages are either zero or VL , then the comparator threshold can be selected to implement
AND, OR or majority logic. If the two comparator inputs are swapped, then NAND or NOR
can be implemented. (Do this for yourself to verify that it can be done.) Note that we must
ensure that the input voltages are either zero or VL . How would we do that? This circuit is
expensive in parts but it is conceptually easy.

Figure 14.2b illustrates a simpler form of this logic circuit. Explain its operation to yourself.

If you have spare transistors but not spare op-amps or comparators, you can still implement
logic functions. These circuits are based on the concept that a transistor can perform a crude
comparison. We note that the collector current is zero unless the base voltage is more than
0.7 volts greater than the emitter voltage (for a NPN device). First lets look at a simple
136 CHAPTER 14. A HODGE-PODGE OF IDEAS

R Vcc
V Vcc
1 −

R −

V
+ Vo
2 V +

R −Vcc thresh
V −Vcc
3

a.

Vcc
V −
R thresh Vo
V1 +

R −Vcc
V2
R
V3

b.

Figure 14.2: Analog logic gates. a. By proper selection of the comparator inputs and the
threshold, we can implement AND, OR, majority logic, NAND and NOR functions. b. A
less costly circuit. How does it work?
14.3. USING ANALOG CIRCUITRY FOR LOGIC OPERATIONS 137

V
cc

Vo
V1

V2

V3

a.

V
cc

V1 Vo

V2

V
3
D
1

b.

Figure 14.3: More analog logic gates. a. A logic NOR. b. A logic OR. How do they work?
What does diode D1 do in each circuit?
138 CHAPTER 14. A HODGE-PODGE OF IDEAS

NOR gate (figure 14.3a). When the transistor is ‘on’, the output voltage is low. Now the
transistor will be ‘on’ whenever its base is 0.7 volts above its emitter. This will happen
whenever a sufficiently high voltage is applied to any or all of the inputs. (What is the
expression for determining how high this voltage should be?)

Now lets look at a NOR gate (figure 14.3b). Note that the input circuit is essentially the
same, with the exception of the circuitry in the emitter of the NPN transistor. The output
of the first part of the circuit is used to drive a PNP inverter, hence this is an OR gate. We
should look further at the emitter circuit of the NPN transistor.

Lets assume that diode D1 is conducting regardless of whether or not the NPN transistor is
‘on’. This results in the transistor emitter being at a voltage of 0.7 volts, and so the base
must be at 1.4 volts to turn the transistor on. Standard (TTL) logic levels require the low
voltage VL < 0.8 volts and the high voltage VH > 2.1 volts. Thus, having the transistor turn
on (and off) at 1.4 volts is a reasonable compromise.

Both of these circuits could also be used to interface logic circuitry to analog circuitry.

How would you implement AND and NAND functions with circuits like these? One option,
of course, is to merely invert the inputs of the NOR gate to get the AND function, and
invert the inputs to the OR gate to get the NAND function. This will be expensive in parts,
however, because each inversion will require one transistor. Is there a better(cheaper) way?
(Hint: go back to the concepts of how to turn on a transistor and when a diode conducts.)

14.4 Connecting Analog Outputs to 7400-Series Logic

74LSTTL logic families require that the driving circuit (the circuit from which the input
signals originate) to sink 0.4 mA with a voltage less than 0.8 volts to generate a logic ‘0’
at a gate input. Similarly, the driving circuit must be able to source 0.1 mA at a voltage
greater than 2.1 volts to generate a logic ‘1’ at the gate input. Other popular logic families
such as 74ALS, 74S, 74F, 74AS, etc. also have similar drive requirements, although the
numbers may differ. The various logic families are designed to be able to drive a reasonable
number of gates in the same family, so interfacing considerations are minimal for designs
employing one family only.

Designs which require that analog outputs be used to drive logic inputs are a different matter,
however. Care must be taken to ensure that the gate inputs stay within the safe operating
levels for the family. Further, the analog circuitry must be able to source and sink the
necessary currents at the required voltages if interfacing is to be reliable.

Th simplest interface uses a transistor with a grounded emitter (14.4). In this circuit, the
transistor as turned on fully by the analog input signal with the result that it saturates.
This results in the collector voltage being about 0.2 volts or less, with the collector sinking
significant current. When the input voltage is too low, the transistor is off, and so the
collector resistor sources the required input current to the logic gate. In this circuit, you are
14.4. CONNECTING ANALOG OUTPUTS TO 7400-SERIES LOGIC 139

Vcc

logic gate
V
in

D1

Figure 14.4: A simple interface for driving digital logic from analog circuits using a transistor.
What does D1 do?

responsible for ensuring that the input voltage changes rapidly from one state to the other.
Some logic devices do not like to have slowly-changing inputs.

Other circuits can be used, including comparators and schmitt triggers.

Anda mungkin juga menyukai