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 K
T
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.6.3 R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.6.4 K
f
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.6.5 T
o
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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 V
GS
. . . . . . . . . . . . . . . . . . . . . . 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
Time spent by expert problem solver
Problem solved
Time spent by novice problem solver
Problem not solved
t
t
Problem exploration
Proposing solutions
Implementing solutions
Evaluation
Problem exploration
Proposing solutions
Implementing solutions
Evaluation
Determining key
Determining key
concepts
concepts
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
I
short
=
V
open
R
int. res.
(3.1)
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
1
2
kx
2
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
1
2
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/second
2
(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 ×10
6
N/m
2
. 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
N
S
rotor
coils
armature shaft
brushes
commutator
stator
permanent magnet poles
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 S
N S
N
S
a.
b.
c.
s
n
n
s
s
n
P1
P2
P1
P2
P1
P2
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 V
M
, motor speed ω, and armature current
I
a
in accordance with item 2 above, and is given by
V
M
= K
ω
ω +I
a
R. (4.1)
In this equation,
V
M
= the applied motor voltage
K
ω
= motor speed constant (volts per radians/sec)
ω = angular speed of the motor (radians/sec)
I
a
= 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
T
M
= K
T
I
a
(4.3)
where
T
M
= motor torque, neglecting losses
K
T
= motor torque constant (Newton-meters per ampere)
(4.4)
26 CHAPTER 4. MOTORS
A more realistic equation for the torque T
L
applied to a load is
T
L
= K
T
I
a
−T
o
−K
f
ω (4.5)
where
T
o
= torque losses independent of speed
K
f
= 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 I
a
in equation 4.5 and substituting
into equation 4.1, we see that there is a relationship between speed and torque.
V
M
=

K
ω
+
K
f
K
T
R

ω + (T
L
+T
o
)
R
K
T
(4.7)
This equation is displayed as the speed-torque curve of figure 4.3. From this equation, we
see that the zero-speed torque T
L,ω=0
and the zero-torque speed ω
T
L
=0
are given by
T
L,ω=0
=
K
T
R
V
M
−T
o
ω
T
L
=0
=
K
T
R
V
M
−T
o

K
ω
+
K
f
K
T
R

K
T
R
(4.8)
Clearly this relationship is affected by the applied voltage V
M
. 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
V
M
= K
ω
ω +
JR
K
T

dt
+
T
L
K
T
R (4.9)
where T
L
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
K
ω

V
M

T
L
K
T
R

1 −e
−t/τ

(4.10)
4.3. MOTOR DYNAMICS 27
t
o
r
q
u
e
motor current
slope = K
w
due to motor losses
Typical Current−Torque Curve
Typical Speed−Torque Curve
t
o
r
q
u
e
zero−speed torque (due to blocked rotor current)
zero−torque speed
(due to back e.m.f)
speed
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
Vo
I
D R
L
C
V
A
Figure 4.4: A simple circuit to illustrate the flyback effect of an inductor.
with
τ =
JR
K
T
K
ω
(4.11)
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
ω(s) =
1
K
ω

V
M
(s) −
T
L
K
T
R

1
s
JR
K
T

+ 1
(4.12)
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,
V = L
di
dt
(4.13)
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 V
C
does not change for ∆t, the time that I flows. The current into the capacitor is
I −V
C
/R and the voltage change across the capacitor due to this current is
∆V
C

I −V
C
/R
C
∆t. (4.14)
To meet the assumption that ∆V
C
<< V
C
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 V
C
,
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 V
A
is sufficiently negative to turn on the diode. We are still assuming that the voltage
V
C
is relatively unchanged.
When V
A
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 E
L
stored
was
E
L
=
1
2
LI
2
. (4.15)
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
I
M
flows through the motor. When the switch is opened, what happens? The inductance of
the motor causes voltage V
S
to increase rapidly, until current I
M
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
switch
V
S
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
V
G
= K
ω
ω (4.16)
where V
G
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 V
G
. Then K
ω
is just V
G
/ω.
4.6.2 K
T
The torque constant K
T
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 I
a
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 I
a
yielding
P
E
= (K
ω
ω +I
a
R)I
a
(4.17)
Now, the K
ω
ωI
a
term represents power which is converted to mechanical power, and the
I
2
a
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
P
M
= K
T
I
a
ω. (4.18)
Again, we are looking at the energy conversion function only.
Now P
E
= P
M
, because the ideal energy converter neither creates not dissipates power, so
we have
K
ω
ωI
a
= K
T
I
a
ω (4.19)
from which we find that the numerical values of K
ω
and K
T
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 K
f
The speed-dependent torque loss coefficient K
f
can be determined by removing any external
load from the motor (so T
L
= 0), and then monitoring current I
a
and speed ω for two
significantly different speeds. If I
a,1
and ω
1
correspond to the first measurement, we get
from equation 4.5
T
o
+K
f
ω
1
= K
T
I
a,1
. (4.20)
Similarly, the second measurement yields
T
o
+K
f
ω
2
= K
T
I
a,2
. (4.21)
32 CHAPTER 4. MOTORS
Subtracting these equations, we get
K
f

1
−ω
2
) = K
T
(I
a,1
−I
a,2
) (4.22)
resulting in
K
f
=
K
T
(I
a,1
−I
a,2
)
ω
1
−ω
2
. (4.23)
4.6.5 T
o
Since all the other constants of equation 4.5 have been determined, solving for T
o
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
waveform of figure 4.6. We fit a decaying exponential with time constant
L
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
R
L
D
R
V
batt
motor
t
V
a.
b.
A
back e.m.f of motor
flyback ‘spike’
S
MOSFET on
MOSFET off
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 R
A
in series with a motor having a resistance R. With a supply
voltage of V
cc
, the voltage across the motor is V
cc
R/(R + R
A
). As we have seen in section
4, motor speed is a function of the applied voltage, and so by changing R
A
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 V
cc
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 V
cc
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
f
o
f
o
10
amplitude dependent on duty cycle
spectrum of pulse width modulator
frequency
response of
motor
f
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 K
T
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 beat
1
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
R
V
G
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 V
batt
is applied across
the motor if V
G
is raised to a sufficiently high voltage.
38 CHAPTER 5. MOTOR CONTROL
5.1.1 Determining the Required V
GS
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, V
G
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 V
G
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 R
DS
(on) of the
MOSFET for this current, drain-source voltage and gate-source voltage. You must find the
value of R
DS
(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
i
D
= K(v
GS
−V
T
)
2
(5.1)
and so the drain voltage will be
v
D
= V
CC
−Z
D
K(v
GS
−V
T
)
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
s
V
batt
L
R
D
Q
C
gd
C
gs
R1
I
s
I
I
2
1
motor model
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 V
s
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 C
gd
which causes current I
2
to flow from the gate to the drain. This
increase in I
2
‘steals’ current that would otherwise be used to charge C
gs
, 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 I
s
, I
1
and I
2
are
I
s
=
v
S
−v
G
R
S
(5.3)
I
1
= C
gs
dv
G
dt
(5.4)
I
2
= C
gd
d(v
G
−v
D
)
dt
(5.5)
where v
G
= v
GS
since the source is grounded. If we write the node equation at the gate and
substitute the equation for drain voltage, we get
v
S
−v
G
R
S
= C
gs
dv
G
dt
+C
gd
d
dt
[v
G
−V
CC
+Z
D
K(v
G
−V
T
)
2
]
= [C
gs
+C
gd
(1 + 2Z
D
K(v
G
−V
T
))]
dv
G
dt
(5.6)
Now for the approximation; if we assume that the gate voltage will only change slightly, then
v
G
−V
T
is essentially constant. Under these conditions, we can show that the low-frequency
voltage gain A
v
of the circuit is just 2Z
D
K(v
G
−V
T
). (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
[C
gs
+C
gd
(1 +A
v
)]
dv
G
dt
+
v
G
R
S
=
v
S
R
S
(5.7)
which has the solution
v
G
= v
S
(1 −e
−t/τ
) (5.8)
with
τ = R
S
[C
gs
+C
gd
(1 +A
v
)] (5.9)
If we express v
G
in terms of v
S
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 C
gs
+C
gd
(1+A
V
). (Try it and see.) The term C
gd
(1+A
v
) is called the Miller capacitance,
denoted C
M
. 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 v
G
−V
T
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 R
S
.
Clearly, if we make R
S
= 0 the Miller capacitance has no effect. This is because R
S
= 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 C
gs
and C
gd
.
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 R
S
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 V
CC
or ground because the device is either fully on or
fully off, then the current through C
gd
will be due to the rate of change of gate voltage only,
and so the A
v
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 V
G
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 D
1
and D
2
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
R7
R8
V
batt
V
batt
V
batt
V
batt
V
R
S1
S2
motor

D1
D2
I
M
V
M
a
R1
R3
R4
R5
R6
D2
Q1
Q3
Q4
D1
motor

b
V
F
R2
Q2
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 S
1
and switch S
2
is left open. When S
1
is
closed, current flows as shown through the motor as shown and voltage V
M
is essentially
the positive battery voltage. When we open S
1
, voltage V
M
almost instantaneously becomes
negative due to the inductance of the motor. V
M
decreases (becomes more negative) until
diode D
2
turns on, at which time the motor current can flow from the motor, through D
2
and into the lower battery. Thus, when S
1
is closed, the motor is powered by the upper
battery. When S
1
is opened, the energy stored by the motor inductance is transferred to the
lower battery. Clearly, a similar situation exists with respect to switch S
2
.
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 Q
1
and Q
2
drive the MOSFETs, Q
3
and Q
4
.
The MOSFETs are used as the switches S
1
and S
2
. 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 Q
3
, the freewheeling diode is the body diode of Q
4
.
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
I
2
D
R
DS
(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 R
3
and R
4
, and diode D
1
are used
to accomplish this. When V
F
is sufficiently high to turn on Q
1
, the collector of Q
1
goes to
zero volts. Diode D
1
is reverse biased, so the gate voltage of MOSFET Q
3
decreases to zero
volts because its input capacitance (C
gs
+ C
M
) is charged through R
5
. Thus, the turn-on
time constant is R
5
(C
gs
+C
M
).
When V
F
goes sufficiently low to turn off Q
1
, the collector of Q
1
can rise. Prior to turning off
Q
1
the input capacitance of Q
3
is charged with the supply voltage so the voltage at the gate
of Q
3
is about zero (since the input capacitance is measured between gate and source). Thus,
with Q
1
turned off, Q
3
’s gate voltage will rise to the supply voltage with a time constant of
R
3
(C
gs
+C
M
).
To achieve rapid turn-off and slow turn-on of the MOSFET, we see that R
3
must be smaller
(usually considerably smaller) than R
5
. We can pick suitable values by considering the
MOSFET drain current, the body diode reverse recovery time, the power dissipation of Q
1
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 S
1
and S
4
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 S
1
and S
4
and closing switches S
2
and S
3
. 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
V
batt
motor
I
M
D3
D4
S3
S4
S1
S2
D1
D2

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
V
ce
and negative numbers as decreases in V
ce
. Alternatively, the sign of the V
ce
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 V
o
is proportional to the
difference between the two input voltages V
+
and V

,
V
o
= 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 10
5
and 10
7
, 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 V
in
. This causes an increase in the
input to the box marked G. The output V
o
will increase correspondingly, which increases the
input to the H block. This in turn leads to an increase in V
fb
which reduces the difference
between V
in
and V
fb
and thus reduces the input to the G block. Thus, the circuit attempts
to make V
fb
match V
in
. This is a fundamental characteristic of negative feedback systems.
From equation 6.1, we can see that if the magnitude of V
o
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
G
H
Vo
op−amp
V
fb
V
in
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
V
in1
−V

R
1
+
V
in2
−V

R
2
=
V

−V
o
R
f
. (6.2)
Combining these two equations and solving for V
o
, we get
V
o
= −
¸
AR
f
R
f
+R
1
(A + 1)
V
1
+
AR
f
R
f
+R
2
(A + 1)
V
2
¸
(6.3)
50 CHAPTER 6. COMPUTING WITH ANALOG COMPONENTS

+
R3
R1
R2
R4
Vout V2
V3
V1
+Vcc
−Vcc
Figure 6.2: Inverting summing amplifier
Now if we let A go to infinity, we see that
V
o
= −
¸
R
f
R
1
V
1
+
R
f
R
2
V
2

(6.4)
In general, with multiple inputs and with A approaching infinity,
V
o
= −R
f
N
¸
i=1
V
i
R
i
(6.5)
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
V
out
= −
R
f
R
in
N
¸
i=1
V
i
(6.6)
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 V
ce(sat)
6.3. NEGATION 51

+
Vbias
These resistors convert input
voltages into input currents, since
the emitter is at approximately zero
volts.
Ic
I1
I2
I3
V1
V2
V3
Vb is approximately −0.7 volts
due to diode used for biasing.
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 V
e
−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 R
f
= R
in
,
V
out
= −V
in
(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
A
v
=
−h
fe
R
L
h
ie
+ (h
fe
+ 1)R
E
(6.8)
If h
fe
is sufficiently large, this reduces to
A
v
=
−R
L
R
E
(6.9)
52 CHAPTER 6. COMPUTING WITH ANALOG COMPONENTS
V
i
V
o
V
cc
V
i
V
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 R
L
= R
in
, 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
V
out
= V
1
−V
2
(6.10)
= V
1
+ (−V
2
) (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 V
in
/R
in
and the output current is −V
out
/R
f
and so
we see that the familiar gain equation for this circuit is given by manipulating
V
in
R
in
= −
V
out
R
f
(6.12)
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
I
D
= I
o

e
V
D
/ηkT
−1

≈ I
o
e
V
D
/ηkT
(6.13)
where V
D
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 I
o
is the reverse leakage current. Re-arranging this to solve for V
D
we have
V
D
= ηkT log
I
D
I
O
(6.14)
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 V
D
is given by
V
out
= −V
D
= −ηkT log
V
in
I
o
R
in
= −K log V
in
(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

+

+
R1
R2
R3 D1
A2
A1
Vin
Iin
Id
Vout(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 I
O
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

+

+
F
G
Vin
Vout
G
F
Vin
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

+
R1
R1
Vin
Vout
L.P.F.
KR (1−K)R
Vcc
−Vcc
R2
Figure 6.7: What is the effect on the circuit transfer function of varying the potentiometer?
6.8. MULTIPLICATION 57
log
log
exp
V1
V2
V1*V2
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
f(v) = f(v
o
) +
N
¸
i=1
a
i
(v −v
o
)
i
(6.16)
about some known point v
o
, then the expression for the output as a function of the sum of
two inputs is
f(v
1
+v
2
) = f(v
o1
+v
o2
) +
N
¸
i=1
a
i
(v
1
−v
o1
+v
2
−v
o2
)
i
(6.17)
where v
o1
and v
o2
are the values for which the function of their sum is known. Now if we
select our nonlinearity so that the only dominant coefficient a
i
is a
2
, v
o1
+ v
o2
= 0, and
f(0) = 0, then
f(v
1
+v
2
) ≈ a
2
(v
1
+v
2
)
2
(6.18)
≈ a
2
(v
2
1
+v
2
2
+ 2v
1
v
2
) (6.19)
If we can find a way (design a circuit) to ‘throw away’ the v
2
1
and v
2
2
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
I
d
= I
DSS

1 −
V
gs
V
P

2
(6.20)
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 a
2
is dominant. If we design our circuit so that V
gs
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 V
batt
D, where D is the
duty cycle.
Clearly, multiplication can be performed using the same concept. To do this. we replace
V
batt
with signal V
1
and make D controlled by signal V
2
. 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 V
1
V
2
, 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
i
C
= C
dv
C
dt
(6.21)
Using current summing at the inverting node, and assuming that op-amp gain A is effectively
infinite, the equation for the output is
V
o
=
−1
RC

t
x=0
v
i
dx (6.22)
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
−Vcc
V
o

+
Vcc
−Vcc
V
i
V
o

+
Vcc
−Vcc
V
i
V
o
Kv
i
V
o
V
i
C
R1
R2
R3
V3
V2
V1
R
L
C
R
a.
b.
c.
C
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 V
B1
is greater than zero and that V
B2
and V
B3
are greater
than V
B1
. Further, we assume that V
B4
and V
B5
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 m
0
and is just m
0
= −R
8
/R
1
.
As the input signal increases (becomes more positive), we reach a point were the voltage at
the anode of D
1
os zero. (What is this input voltage?) If the input increases further, D
1
turns on. Now the current through R
2
is just V
in
/R
2
and the current through R
3
is −V
B1
/R
3
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
V
in
/R
1
. This is equal to the current flowing out of this node, which is −V
out
/R
8
.
What has happened here? When the input voltage was very small, current in the input
circuit flowed through R
1
only. As the input voltage increased, diode D
1
turned on and the
current in excess of the (constant) current through R
3
. Thus, at this input voltage, and
for inputs greater than this voltage, R
2
is in parallel with R
1
. Clearly this means the gain
increases and this is shown in the lower figure by the slope m
1
= −R
8
/(R
1
R
2
).
For negative-going signals, D
3
will turn on at some voltage, resulting in R
6
being ‘switched’
in parallel with R
1
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 R
8
resulting in a gain decrease. It is clear that by
judicious use of the biasing sources (the various V
BX
) 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

+
Vcc
−Vcc
R2
R3
B1
V
V
out
V
B5
R11
R12
m
5
m
2
m
1
V
out
R8
R9
R10
R11
R12
D4
D5
V
B4
V
B5
V
in
R1
R2
R3
R4
R5
R6
R7
D1
D2
D3
V
V
V
B3
B2
B1
V
B2
R4
R5
V
B3
R7
R6
V
B4
R9
R10
V
in
m
3
m
4
m
0
A
Figure 6.10: a) A diode-break function generator. Diodes D
1
, D
2
and D
5
relate to positive
inputs and diodes D
3
and D
4
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 V
B4
and V
B5
are shown with respect to the output.
6.13. CONVERTING CURRENT TO VOLTAGE 63
Vcc
Vout
Iin
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

+
Iin
If
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
I
D
= I
DSS

1 −
V
gs
V
P

2
(6.23)
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 I
o
as a function of V
i
. 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 V
a
/V
o
? With this gain found, you should be able to solve this circuit easily.
6.14. CONVERTING VOLTAGE TO CURRENT 65
I
b
Ic
Vcc
V
o
V
s
Figure 6.13: Current-to-voltage and voltage-to-current conversions in a common circuit.

+
Vin
Iout
Ie
Figure 6.14: A common voltage-to-current conversion circuit.
66 CHAPTER 6. COMPUTING WITH ANALOG COMPONENTS

+
Vcc
−Vcc
V
V
I
o
i
R1 R2
R4
R3
V
a
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 V
U
and V
L
for ‘upper’ and ‘lower’ respectively. The device functions
as follows. As long as the input is greater than V
U
, the output is low. When the input goes
below V
L
, the output goes high, and stays high until the input goes above V
U
. The Schmitt
trigger is said to have hysteresis because of this behaviour. The circuit designer selects V
U
and V
L
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, V
o
will change from high
to low when the input exceeds V
U
. Lets analyze this. If the input V
i
is less than V
L
, then
V
o
is equal to V
max
, the maximum value that the comparator (or op-amp) output can reach.
With this output, the node voltage V
A
can be found from
V
o
−V
A
R
1
+
V
ref
−V
A
R
3
=
V
A
R
2
(7.1)
in which V
o
is V
max
. When V
i
rises to greater than V
A
, then the inverting input exceeds the
non-inverting input and so the output switches from V
max
to V
min
, the minimum value that
the comparator can reach. Thus, V
A
is V
U
in this case.
If the input is greater than V
U
, then the output is V
min
. The output will switch to V
max
when
the input decreases to less than V
L
. We can solve for V
A
in equation 7.1 with V
o
equal to
V
min
. This is the case for which V
A
is V
L
.
7.2. SCHMITT TRIGGERS 69
c.
d.
a.
b.
V
U
V
L
T
V
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
−Vcc
R1
R2
Vref
R3
V
A
Vo
Vi
Figure 7.3: A common Schmitt trigger using an op-amp.
Thus, the designer’s task is to select R
1
, R
2
, R
3
and V
ref
so that V
A
equals V
U
when
V
o
equals V
max
, and V
A
equals V
L
when V
o
equals V
min
.
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 V
U
and V
L
.
7.2. SCHMITT TRIGGERS 71
Vcc

+
Vcc
R1
R2
R3
Vo
V
i
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
t
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) = (V
U
−V
L
)(1 −e
−(t−t
0
)/τ
) (8.1)
where V
U
and V
L
are the maximum and minimum waveform voltages respectively, t
0
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) = (V
U
−V
L
)(e
−(t−t
1
)/τ
) (8.2)
where t
1
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
V
o
(t) = A(1 −e
−t/RC
) (8.3)
Now the slope of this function is
dV
o
(t)
dt
=
A
RC
e
−t/RC
(8.4)
76 CHAPTER 8. TIMERS AND TIMING
Vin(t)=AU(t) Vo(t)
R
C
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 V
U
, and high when the input goes below V
L
. If we
arrange the Schmitt trigger so that V
U
= 2/3 of the maximum amplitude and V
L
= 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
−Vcc
R
R1
R1
C
Triangle to Square Low−Pass
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 V
L
and +5 volts for V
U
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
V
triangle
(t) = 20(1 −e
−t/RC
) (8.5)
or, after re-arranging to solve for t and setting V
triangle
(t) to 10 volts,
t = −RC log

1 −
10
20

(8.6)
= 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 V
cc
− 3 and greater than
−V
cc
+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 Q
1
is on. This keeps the capacitor discharged, and
so the comparator output is low. When the input goes low, Q
1
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 R
1
and R
2
.
Note:
• Q
1
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 V
cc
. This is usually desirable. Why is it true for
this circuit?
• V
in
must keep Q
1
off during and after the timing interval. This is not an ‘edge sensitive’
or ‘latching’ timer.
• I
R
1
and I
R
must be much greater than I
bias
.
• You must ensure that Q
1
is fully turned on prior to the timing interval desired.
80 CHAPTER 8. TIMERS AND TIMING
Vcc
Vo
R
C
Q1
R1
R2
Vcc

+
R3
Vin
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
V
A
C
R
R1
Q1
Vin
Vcc
Figure 8.5: Part of a one-shot timer. If the voltage across the capacitor is initially zero, then
V
A
decays with time after Q
1
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 Q
1
is
turned on, voltage V
A
decreases toward zero with time.
If we compare this voltage to a reference voltage V
B
(see figure 8.6), we can produce an
output as long as V
A
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 V
B
change
when the input is high. Consider the enhanced circuit of figure 8.7. Note that resistors R
1
and R
2
are necessary to ensure that both transistors are turned on at the same time. If we
just connected their bases together, and V
BE
for one was lower than for the other, only one
transistor would turn on instead of both transistors. Resistors R
3
and R
4
are selected so
that voltage V
A
will be slightly lower than V
B
until the transistors are turned on. (Note that
V
B
will be equal to V
cc
when the transistors are off.) R
3
and R
4
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
Q
1
and Q
2
are turned on and off at the same time, we can consider using only one transistor
instead. If we do this, we see that R
3
is then in parallel with the series combination of R
5
and R
6
. 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 V
in
goes low to turn off
Q
1
. To accomplish this, R
2
+R
3
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
R
R1
Vin
Q1

+
V
A
C
R3
R4
Vcc
V
B
Figure 8.6: Comparing the voltage V
A
of figure 8.5 with a reference produces an output as
long as V
A
is greater than the reference V
B
.

+
V
A
C
R3
Vcc
V
B
R5
R6
Q2
Vin
R1
R
Q1
R2
R4
Figure 8.7: Here we are switching the reference circuit as well as the R −C circuit, and we
have added resistors R
3
and R
4
to the R − C circuit so that V
B
is always higher than V
A
until the input is asserted and Q
1
is turned on.
8.2. A SIMPLE TIME DELAY CIRCUIT 83
V
A
C
R1
Vin
R

+
V
B
Vcc
R2
R3
R4
D
Q1
Figure 8.8: This circuit is the reduced version of the one-shot circuit of figure 8.7.
the point that V
A
is
V
A
≈ V
cc
R
2
+R
3
R
2
+R
3
+R
4
(8.8)
• Take care that the currents through R
2
and R
3
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), R
4
must be much greater than
R
2
+R
3
.
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 (Q
1
turned on), the high output from the comparator is used to hold Q
1
on. Note that R
5
and
R
6
must be chosen so that Q
1
is on when either the input or the comparator output is high.
Also, select C
C
so that the time constant formed by it and the parallel combination of R
1
,
R
5
and R
6
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 V
i
to an amplifier which
has gain A and which has a maximum output voltage amplitude of V
max
. If V
i
is sufficiently
small, the peak magnitude of the amplifier output is |AV
i
| < V
max
. As the input voltage is
85
86 CHAPTER 9. SINUSOIDAL OSCILLATORS
frequency−
selective
network
gain
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
V
1
and V
2
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 V
i
, we find that the amplitude of the fundamental component in the output
does not change. If we define gain G
f
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 G
f
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
i
V
o
V
V
L
U
V
2
V
1
V
2
V
1
a
V
i
V
o
V
V
L
U
b
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 V
2
< V
i
< V
1
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 R
3
as a Norton source. We will
also model the R
1
− C
1
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
V
o
R1 R2 R3
C1 C2 C3
feedback circuit
−K
C1 C2 C3
R3 R2 R1 R
s
V
s
V
o
V
A
1 2
b
s
R
a
1 2
C1 C2 C3
R2 R1
V
A
R3
c
V
s
s
R3+R
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
¸
Vs
Ro+R
3
0
¸
=

sC
3
+
1
Ro+R
3
+
1
R
2

1
R
2

1
R
2
1
R
2
+sC
2
+
1
R
1
+
1
sC
1
¸
¸
¸
V
1
V
2
¸
(9.1)
With some practice, you can write this expression by inspection. The next The output
voltage V
A
of the network is solved by first solving equation 9.1 for V
2
, and then determining
V
A
using voltage division based on the R
1
−C
1
network. That is,
V
A
= V
2
1
sC
1
R
1
+
1
sC
1
. (9.2)
The op-amp output resistance R
o
is usually insignificant compared to R
3
and so it can be
assumed to be zero.
After all this, we can determine the phase and gain of V
A
with respect to V
o
as a function of
the resistor and capacitor values. We usually set R
1
= R
2
= R
3
= R and C
1
= C
2
= C
3
= 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
V
o
R
R
C
C
A
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 Z
s
given by
Z
s
= jωL +
1
jωC
(9.3)
When the two terms on the right have equal magnitude, Z
s
is zero. This occurs for
ωL =
1
ωC
(9.4)
which implies that the resonant frequency ω
o
is
ω
o
=
1

LC
(9.5)
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 R
s
. 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 Q
s
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
Q
s
=
ωL
R
s
(9.6)
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
R
s
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 R
o
of the driver and the resistance R
L
of the load are taken together with
the resistance R
s
of the R −L −C circuit to determine Q. Thus, the Q is
Q =
ω
o
L
R
o
+R
s
+R
L
(9.7)
9.2. RESONANT OSCILLATORS 93
R
s R
o
C L
R
L
inductor
L
I
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 Z
P
of a parallel resonant circuit (sometimes called a ‘tank’
circuit), we find that it is given by
Z
P
=
jωL
1
jωC
jωL +
1
jωC
. (9.8)
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
ωL =
1
ωC
. (9.9)
Again, the resonant frequency is just
ω
o
=
1

LC
(9.10)
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
Q
P
=
R
P
ω
o
L
(9.11)
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
R
o
R
L
C L
inductor
R
P V
o
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 R
o
and the load resistance R
L
are in parallel
with the resistive losses R
P
. Including these resistances in the calculation of circuit Q yields
Q
P
=
R
o
||R
P
||R
L
ω
o
L
(9.12)
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 v
s
, secondary current i
s
and the impedance of the driver as seen at the
secondary terminals Z
s
are given by
v
s
=
m
n
v
p
i
s
=
n
m
i
p
Z
s
=

m
n

2
Z
o
(9.13)
where v
p
and i
p
are the primary voltage and current respectively, and Z
o
is the output
impedance of the circuit driving the primary side of the transformer.
9.2. RESONANT OSCILLATORS 95
R
L
n : m
R
o
R
losses
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
R
L
=

n
m

2
R
L
. (9.14)
We can now replace the transformer with a resistance equal to R
L
and calculate the total
connected resistance R
T
as R
T
= R
o
+R
losses
+R
L
. 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 R
T
at the lowest frequency ω
m
that we wish to pass through the transformer.
Therefore, we choose the transformer primary inductance L
P
to be
L
P
=
4R
T
ω
m
. (9.15)
The inductance determines the number of turns required for the primary. (For toroidal cores,
inductance is proportional to n
2
.) 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
L
R
o
R
losses
m
n−m
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
V
o
V
o
C1
C2
a
A
L
b
A
m
n−m
L
C
V
A
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 V
A
is
V
A
= V
o
1
sC
2
1
sC
1
+
1
sC
2
=
C
1
C
1
+C
2
(9.16)
Now if V
A
is a fraction of V
o
, then there must be a point ‘in’ the inductor at which the voltage
V
A
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 V
A
is a fraction of V
o
. This voltage is presented across the load resistance.
Since V
o
is presented across the entire tank circuit, which, at resonance ‘looks like’ a resistance
R
e
, the power delivered to the tank by the amplifier is just V
2
o
/R
e
. 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 V
2
A
/R
A
where R
A
is the amplifier input resistance. Equating these, and using the expression for V
A
as a function of C
1
, C
2
and V
o
, we get
V
2
A
R
A
=
V
2
o
R
e
(9.17)
from which, after rearranging, we get
R
e
=

C
1
+C
2
C
1

2
R
A
=

C
T
C
2

2
R
A
(9.18)
where C
T
is the equivalent capacitance of the series combination of C
1
and C
2
. 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’ points
1
. 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

+
V
CC
V
o
−V
CC
V
CC
R1
R2
R3
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 R
1
and resistor R
2
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
source
a.c. voltage C L
loosely−coupled
conductive material
resistance of
R
parallel resonant
circuit
V
o
R
s
V
exc
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 V
o
across the tank circuit will be essentially V
exc
.
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 V
o
is just V
exc
R/(R
s
+R).
Resistances should be selected to make this change in voltage readily detectable.
10.5. ACCELERATION SENSING 105
metal to detect
electrodes
gap
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
E =
1
2
Li
2
. (10.1)
This energy must be released to the resistor in series with the freewheeling diode. This
energy is related to the voltage v
R
across the series resistor by
E
R
=
1
R

v
2
R
(t)dt (10.2)
Thus, by measuring v
R
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
a. b.
B
Figure 11.1: Determining the noise-equivalent bandwidth of a low-pass system.
The noise voltage e
n
is given by
e
n
=

4kTRB (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 i
n
is given by
i
n
=

2qI
dc
B (11.2)
where q is the charge on an electron, I
dc
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
A
V
o
V
s
R
s
e
en
i
en
source
Z
i
noiseless circuit
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 e
en
and an equivalent input noise current i
en
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 v
on
of the circuit in
figure 11.2 will be
v
on
= Av
e
= A
¸

e
en
Z
i
Z
i
+R
s

2
+

e
Rs
Z
i
R
s
+Z
i

2
+ (i
en
(R
s
Z
i
))
2
¸
. (11.3)
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
SNR =
Av
s
v
on
=
v
s
v
e
(11.4)
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
SNR =
deterministic component of signal amplitude
standard deviation of signal variation
(11.6)
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) +ζ
2
t
+ 2ˆ v(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 SNR
v
is just
SNR
v
=
ˆ v(t)
σ
v
. (11.9)
If we were to define our desired signal v
a
(t) as the sum of N signals v(t
i
), we could compute
the signal to noise ratio of v
a
(t). In each of the v(t
i
) 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 v
a
(t) given by
ˆ v
a
(t) = E{v
a
(t)}
= E

N
¸
i=1
(ˆ v(t
i
) +ζ
t
i
)
¸
= Nv(t). (11.10)
The new standard deviation σa is computed by substituting
v
a
(t) =
N
¸
i=1
(v(t
i
) +ζ
t
i
)
=
N
¸
i=1
v(t
i
) +
N
¸
i=1
ζ
t
i
(11.11)
into equation 11.7. Since we have assumed that the sequence of noise samples is uncorrelated,
it follows that
E{ζ
t
i
ζ
t
j
} = 0 (11.12)
for all i = j.
With this in mind, substituting v
a
(t) into equation 11.7 results in the standard deviation of
the averaged signal,
σ
a
= E{(v
a
(t) − ˆ v
a
(t))
2
}
= E{v
2
a
(t) + ˆ v
2
a
(t) −2v
a
(t)ˆ v
a
(t)}
= N
2
ˆ v
2
(t) +NE{ζ
2
t
} +N
2
ˆ v
2
(t) −2N
2
ˆ v
2
(t)
= E

N
¸
i=1
(ˆ v(t
i
) +ζ
t
i
)

2
+N
2
ˆ v
2
(t) −2

N
¸
i=1
(ˆ v(t
i
) +ζ
t
i
)

Nˆ v(t
i
)

= NE{ζ
2
t
} (11.13)
114 CHAPTER 11. NOISE AND INTERFERENCE
Thus, the signal to noise ratio SNR
a
of the sum of signals is just
SNR
a
=
N
2
ˆ v
2
(t)
NE{ζ
2
t
}
=

NSNR
v
(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 small
1
. 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
V
B
= M
di
A
dt
≈ M
∆i
A
∆t
≈ M
0.01
1 ×10
−8
(11.15)
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 itself
2
. 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
background
signal
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
0
0
.
5
1
.
0
0 0.5 1.0
Probability of False Detection
Improving performance
performance obtained of no
attempt is made to separate
the signal from noise prior
to detection.
increasing threshold
A
B
C
performance corner
P
r
o
b
a
b
i
l
i
t
y

o
f

C
o
r
r
e
c
t

D
e
t
e
c
t
i
o
n
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 R
1
and capacitor C
1
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 C
2
, raising
its voltage. When the AC input is not enough to forward bias the diode, the capacitor slowly
12.3. DETECTING AC SIGNALS 123
sig
V V
out
R
1
C
1
D
C
2
R
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 C
2
and R
2
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 V
sig
and the switch is operated by signal
V
switch
. 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
filter
V
out
V
switch

+
transducer
−1
A
1
AC excitation
transducer output
(the measurement)
low−pass
filter
V
out
V
sig
a.
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 excites
1
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 A
1
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 P
D
dissipated by
our conceptual power resistor is just
P
D
= (V
B
−V
L
)I
L
(13.1)
where
V
B
= voltage of the unregulated supply (13.2)
V
L
= desired load voltage (13.3)
I
L
= 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
V
o
G
H
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
f
o
f
o
supply
a
f
A
10
low−pass filter characteristic
spectrum of V
b
V
load
unregulated
switch
period T
duty cycle D
B
B
Figure 13.2: a. Conceptual switching regulator. b. characteristics of the low-pass filter
superimposed on the spectrum of V
B
. 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
Control
Circuit
unregulated
supply
L
C
load
V
o
V
B
Figure 13.3: Practical step-down switching regulator.
Control
Circuit
unregulated
supply
load
V
o
L
C
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, V
B
is greater than V
o
and
so the diode is not conducting. When the power MOSFET turns off, the voltage V
B
will
swing negative with respect to V
o
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. V
B
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
Control
Circuit
unregulated
supply
load
V
o
C L
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
E =
1
2
Li
2
L
(13.5)
where L is the inductance and i
L
is the inductor current. Because the voltage drop across
the MOSFET is essentially zero when it is conducting, the inductor current is
i
L
=
1
L

V
L
(t)dt
=
V
unreg
t
L
(13.6)
where V
L
is the inductor voltage, V
unreg
is the unregulated supply voltage, and t is the length
of time that the switch is closed. Thus, the energy per switch closure is
E =
(V
L
t)
2
2L
(13.7)
and so the power output is
P
o
=
(V
L
t)
2
2LT
(13.8)
where 1/T is the switching frequency.
Since the power P
L
delivered to load R
L
is
P
L
=
V
2
o
R
L
(13.9)
and this must equal P
o
(why is this so?), then the output voltage is
V
o
= V
L
t

R
L
2LT
(13.10)
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
V
o
= V
P
t
T −t
(14.1)
where V
P
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
schmitt trigger
one−shot
multivibrator
V
in
V
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
V
P
whenever it is triggered, then the output of this system will be nV
P
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 V
L
, 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 V
L
. 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

+
Vcc
−Vcc

+
Vcc
−Vcc

+
Vcc
−Vcc
V
thresh
V
thresh
V
o
V
o
V
V
V
1
2
3
V
V
V
1
2
3
R
R
R
R
a.
R
R
R
R
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
V
V
V
3
1
2
V
V
V
3
1
2
V
cc
V
o
V
o
D
1
a.
b.
Figure 14.3: More analog logic gates. a. A logic NOR. b. A logic OR. How do they work?
What does diode D
1
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 D
1
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 V
L
< 0.8 volts and the high voltage V
H
> 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
V
cc
logic gate
V
in
D
1
Figure 14.4: A simple interface for driving digital logic from analog circuits using a transistor.
What does D
1
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.

Contents
Table of Contents List of Figures 1 Introduction 2 Design 2.1 Philosophy of Design . . . . . . . . . 2.2 The Design Process . . . . . . . . . . 2.3 Understand the Problem . . . . . . . 2.3.1 What IS the Problem? . . . . 2.3.2 Decomposing The Problem . . 2.4 Identify the Key Concepts . . . . . . 2.5 Generate Many Candidate Solutions 2.6 Decide on a Candidate Solution . . . 2.7 Implement the Solution . . . . . . . . 2.8 Evaluate the Solution . . . . . . . . . 2.9 Strategy . . . . . . . . . . . . . . . . iv vi 1 3 3 5 5 8 9 9 10 11 12 13 14 17 17 18 19 21 21 25 26 28 29 30 30 30 31 31 32 32

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

3 Energy Storage 3.1 Batteries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 ‘Stretchies’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Other Energy Storage Techniques . . . . . . . . . . . . . . . . . . . . . . . . 4 Motors 4.1 Introduction to DC Motors . . 4.2 Steady-State Motor Operation 4.3 Motor Dynamics . . . . . . . 4.4 Motor Inductance . . . . . . . 4.5 The Motor as a Generator . . 4.6 Measuring Motor Constants . 4.6.1 Kω . . . . . . . . . . . 4.6.2 KT . . . . . . . . . . . 4.6.3 R . . . . . . . . . . . . 4.6.4 Kf . . . . . . . . . . . 4.6.5 To . . . . . . . . . . . 4.6.6 L . . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . . i

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

ii 4.6.7

CONTENTS Caveat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 35 37 38 38 38 41 41 41 42 42 45 47 48 49 51 52 52 53 53 54 55 55 55 57 58 58 58 59 59 59 61 63 63 67 67 68 70 73 73 73 78 79

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

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

6 Computing with Analog Components 6.1 Op-Amp Concepts . . . . . . . . . . . . . . . . . . . . . 6.2 Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3 Negation . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.4 Subtraction . . . . . . . . . . . . . . . . . . . . . . . . . 6.5 Logarithm . . . . . . . . . . . . . . . . . . . . . . . . . . 6.5.1 The Concept . . . . . . . . . . . . . . . . . . . . 6.5.2 The Circuit . . . . . . . . . . . . . . . . . . . . . 6.6 Exponentiation . . . . . . . . . . . . . . . . . . . . . . . 6.7 Other Interesting ‘Wrinkles’ . . . . . . . . . . . . . . . . 6.8 Multiplication . . . . . . . . . . . . . . . . . . . . . . . . 6.8.1 Logarithm-Based Multiplication - The Concept . 6.8.2 Non-linearity-Based Multiplication - The Concept 6.9 Switching-Based Multiplication - The Concept . . . . . . 6.10 Division . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.11 Integration . . . . . . . . . . . . . . . . . . . . . . . . . . 6.11.1 Inverting Integrator - The Concept . . . . . . . . 6.11.2 Interesting Wrinkles With Integrators . . . . . . . 6.11.3 Non-Inverting Integration - The Concept . . . . . 6.12 Computing An Arbitrary Function of an Input . . . . . . 6.13 Converting Current to Voltage . . . . . . . . . . . . . . . 6.14 Converting Voltage to Current . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . .

7 Some Non-Linear Circuits 7.1 Comparators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2 Schmitt Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2.1 Asymmetrical Power Supplies . . . . . . . . . . . . . . . . . . . . . . 8 Timers and Timing 8.1 Generating Timing Signals . . 8.1.1 The Concept . . . . . 8.1.2 Selecting Components 8.2 A Simple Time Delay Circuit

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Thermal of Johnson Noise . . . . . . . . .1 Resonant Circuits . . . . . . . . . . 10. . . . . . . . . . . 9. . . . . 10. . 11. . .7 Sensing Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .CONTENTS 8. . . . . . . . . . . . . . . . . . . . 9. . . . . . . . . . . . . . . 12. . . . . . . . . . 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9. . . . . . . . . . . . . .2 Wein-Bridge Oscillators 9. . . . . . . . . . . . 11. . . . . . . . . . 11.1 R − C Oscillators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Other Noise Sources . . . . . . . . . . . . . . . .2. . . . . . . . . . . . . . . . . . . . . . . . .1 Noise-Equivalent Bandwidth . . . . . . . . . . . . . . . . .1 Amplifying Low-Amplitude Signals 12.2 Resonant Oscillators . . . . . . . . . . . . . . . . . . . . . . . . .2. . . . . . . . . . . . . . . . 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Detecting Signals . . .11Decoupling Capacitors . . . . Noisy Signals 11. . . . . . . .3 Capacitance . . . . . . . . . . . . . . . . . . . . . . . . . . . 9. . . . . . . . . . . . . . . .2 8. . . . . . . . . . 12 Processing Low-Amplitude Signals 12. 11. . .1 Envelope Detector . 10. . .2. 11 Noise and Interference 11. .1 Optical Sensing . . . . . . . . . . . . .2. . . . . .4 The Concept . . . . . . . . .4. . . .2. . . . . . . . . . . . . 11. .1 Phase-Shift Oscillator . . . . . . . . . . . . . . . . . . .10Simple Wiring Precautions . . . . . . . . . .2 Synchronous Detection . . . . . .3 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Sensing Conductive Materials 10. . . . . . . . . . .3 Force Sensing . . . . . . . . . . . . . . . .2. . . . . . . . . . . . . 11. . . . . . . .7 Averaging and Filtering Low-Amplitude. . . . . . . . . . . . . . . . . . . . . . . . . . . .8 Non-White Noise . . . . .5 Computing Equivalent Input Noise . . . . . . . . .3. . . . . . . . . 10. . 11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12. . . . . . . . . . . . . . . .3 Hartley Oscillator . . . . . . . 11. . . . 10 Sensing The Environment 10. . . . 12. . . . . . . .6 Current Sensing . . . . . . . . . . . . .4. . . . . . 10. . . . . . . . . . .4 Colpitts Oscillator . . . .3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4. . . . . . . . . . . . . .1. . . . . . . . .3 Detecting AC Signals . . . . . . . . . . . . . . . . . . . . . . A Simple Delay Circuit . . . . . . . . . 9. . . . . . . . . . . . . . . . . . . . .6 Signal to Noise Ratio . . .1 Conductivity . . . . . . . . . . . . . . . . . . . .2 Eddy Currents . . . . . . . . . . . . . .9 Interference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Shot Noise . . . . . .5 Acceleration Sensing . . . . . . . . . . . . 11. . . .1. . . . . . . . .2 Tactile Sensing . . 10. . . . . . . . .2 Coupled Inductors . . . 9. . . . . . . . . . . . . . . . . . . . . . . . . .2. . . . . .1 8. . . . . . . . . . . . . . iii 79 79 80 83 85 88 88 90 91 91 94 96 98 101 101 103 103 103 103 104 105 105 105 106 109 109 109 110 111 111 112 112 114 114 115 116 119 119 120 122 122 123 9 Sinusoidal Oscillators 9. . . . . . A One-Shot Pulse-Output Timing A Latched One-Shot .

. . . . . .1 Linear Voltage Regulators . . . .iv CONTENTS 13 Voltage Regulators 127 13. . . . . . . . . . . . . . . . . . . . . . . 14. . . . . . 14. . 127 13. . . . . . . . . . . . . . . . . . 133 133 134 135 138 . . . . . .3 Using Analog circuitry for Logic Operations . . . . . . . . . .2 Pulse Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Switching Regulators . . . . . . .4 Connecting Analog Outputs to 7400-Series Logic . . . . . . . 128 14 A Hodge-Podge of Ideas 14. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.1 Measuring Frequency . . . . . . . . . . . .

. . . . . . . . . . .3 4. .6 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 4. . . . . . . A comparator-based Schmitt trigger with a single supply. . . . . . . A BJT transresistance amplifier. . . . . . . . . . . . . . . and the pulse width modulator spectrum. . . . . . . . . . .12 6. . . . . .6 6. .4 A conceptual DC motor. . . . . . . . . . . . Using a BJT as a signal inverter. . . . . . . . . . . . . . . .5 6. . . . .1 5. . . . . . . . . . . . . motor . . . . . . . . . . . . . . . . . . An interesting application of inverse functions . . . . . . . . . . . . . Summing current with a BJT . . . . . . and the importance of motor inductance. . . . . . A common Schmitt trigger using an op-amp. . . . . . . . . . . An op-amp transresistance amplifier. . . . Block diagram of a negative feedback system . . . . Multiplication with log-antilog conversions. . . . . . . . . . . . .11 6. . . . . . . Measuring motor inductance . . . . . . . . . . . .1 7. . . . . A common voltage-to-current conversion circuit. . . .7 6. . . . . . .5 6. . Switching motor current. . . . . . . . . . . . . . . . A MOSFET motor driver .3 6. Computing log V in with a diode in the amplifier feedback path. . Howland current source. . resulting in poor signal detection. . . A simple circuit to illustrate the flyback effect of an inductor. . . . . . . . Operation of a DC motor. . . . .4 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C. . . . . .4 6. . . . .2 6. . . . . . . . . . .1 6. A noisy signal. . 7 22 23 27 28 30 33 36 37 39 43 46 49 50 51 52 54 55 56 57 60 62 63 64 65 65 66 68 69 70 71 Motor frequency response. . . . . . . . . . . . . . . . . . . . . . . . . . . . 4. . . . . . . . . . . . .4 5. . . . . . . .15 7.9 6. . . A simple uni-directional motor driver.2 7. . Typical characteristics of a D. . . . . . . . . . . .14 6. . . . . . .13 6. . .5 4. . . . . . . . . .2 5. . . . . . . . . . . A diode-break function generator . . . Various integrator circuits . . .3 5. . . . . . . . . . . . . .1 Comparison of the time spent by expert and novice problem solvers on various aspects of problem solving. . . . Computing inverse functions . . . . . . . . .2 4. . . . . . . . . .8 6. . . . Inverting summing amplifier . . . . . . . . . Output circuit of a common comparator. . . . . . . . . . . . . . . .10 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 7. . . A half-bridge motor driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . with a detection threshold. . . . . . . . . . . . . . . Current-to-voltage and voltage-to-current conversions in a common circuit. . . . . . . . . . v .List of Figures 2. . . . Conceptual circuit for a full-bridge driver. . . . . . .

. . . . . . . . . . . . . . . . A simple delay circuit . . .3 A capacitance probe. . Receiver Operating Characteristic curves. . . . .3 13. . . .5 13. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 Block diagram of a relaxation oscillator. . . . . . . . . A more advanced one-shot timer . . . . . . . . . . . . . . . . . . A simple linear voltage regulator. . . Some resonant-circuit oscillators . . . . . .2 Modeling the equivalent input noise of a circuit. . . 102 10. . .2 12. . . . . . . . . . 105 11. .4 8. . . . . . . . . . . .2 8. .3 8. . . . .1 13. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Characteristics of hard and soft clippers . . . . . . . . . . . . . . . . . . . . .1 A simple phototransistor circuit. . . . . . . .3 9. . . . . . . . . . . 104 10. .2 13. . . . . Analog logic gates. . . . Practical step-down switching regulator. . . . . . . . . . with driver A transformer used to couple to a load. . . . . . . . . . . . . . . . . . . . . . . . . . Differential processing of time-localized signals. . . . . . . . . . . . A simple relaxation oscillator based on an op-amp. . . . . . . . . . . . . . . . . . . . . . . . . . 110 11. . . . . . . . . An envelope detector. . . . . . . . . . . . . . . . . . Forming the delayed signal . . . . . . . . . . . .1 Determining the noise-equivalent bandwidth of a low-pass system. . .5 8. . . . . . An autotransformer used to couple to a load. . . . . . .4 12. .7 8. . . . . . . . . . . . . . . . . . . . . . . . . . More analog logic gates. . . . . . . . . . . . . . . . . . . . . .4 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Differential processing of space-localized signals. . . . . . . A boost regulator . . . A basic phase-shift oscillator. . . . . . .6 8. A buck-boost regulator . . . . . . . . . . . . . . . . . . . . . 119 120 121 123 124 128 129 130 130 131 135 136 137 139 A pulse accumulator. . . . . . . . . . . . . . . . . . . . . . . or ‘tank’ circuit. .8 9. . . . . . . . A basic Wein bridge oscillator. .1 14. . . . . . . . A parallel resonant circuit. . . . . .3 12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . and load. . . . . .vi 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 8. . . . .1 12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 12. . . . . . . . . . . . . . . . . . 75 76 77 80 81 82 82 83 86 87 89 91 93 94 95 96 97 The concept behind a sinewave oscillator. . . . . . . . . . . . .8 9. . . . . . . . . . . . . . .2 The concept behind a resonant metal sensor. . 10.5 9. . . . . . . . . . . . . . . . . . . . Low-pass RC circuit. . . . .7 9. . . . . . . . . . . . . . . . . . . LIST OF FIGURES . . . . . . . . . . . . . . . . . .4 13. . .2 9. . . . .3 14. . . . . . . . . . . . . . . . . . . . . . . . . . . Switching regulator concepts . . . . . . A portion of a one-shot timer . . . . . Synchronous detection . . . . . . . . . . . . . . . . . . . . . A series resonant circuit with driver and load. . . . . . . . . . . . . . . . . .1 9.6 9.5 14. . . . . . . . . . . . . . . . . . . . . A simple interface for driving digital logic from analog circuits. . . . . .2 14. . . A simplified edge-triggered one-shot timer . . . .

Chapter 1 Introduction The Annual Analog Electronics Design Competition in Electrical Engineering provides an opportunity for students to explore circuit design. Electronics should be no different. Chapter 2 covers design and how to go about it should be read by all students. 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. not a replacement for it.c. Timers and timing circuits are presented in chapter 8 and sinusoidal oscillators are discussed in chapter 9. however. on circuit concepts and on circuits to address this need. Chapter 3 discusses energy storage including batteries and ‘stretchies’. Some insights into sensing the environment are presented in chapter 10. Noise and interference are discussed in chapter 11. Students do not have a rich repertoire of design experience or of circuits with which to design their systems. I do not claim that the presentation is comprehensive. a ‘hodge-podge’ of ideas is presented in chapter 14. Techniques for computing with analog circuits are presented in chapter 6 and some useful non-linear circuits are presented in chapter 7. Many of the concepts are presented with reference to specific functions to be performed. Finally. You learn the techniques. you do not learn all the techniques prior to making anything. These notes should be considered to be an adjunct to a good textbook. and so they are ‘tossed in at the deep end’. albeit in little depth. and the approach to the ‘cooking problem’ as you attempt to make specific dishes. and processing and detecting low-amplitude signals are touched on in chapter 12. They should provide some insight into the circuit designer’s approach to electronics design. motors and motor control. Chapters 4 and 5 discuss the steady-state and dynamic characteristics of d. When learning to cook. This handbook attempts to provide information on design. These notes attempt to cover a number of areas. viz. The ubiquitous power supply and voltage regulator are found in chapter 13 which discusses both linear and switching regulators. These notes do stress fundamental concepts more than most texts. 1 .

INTRODUCTION .2 CHAPTER 1.

power consumption. Optimality can be measured in many ways and so conveys little information. the time and facilities available for design and production facilities are invariably limited. accuracy. process or product to meet the needs of a user. Design is the process of using knowledge and resources to generate an economical and reliable device. size. In consumer electronics. these constraints can include the desired measure of optimality. Getting a good definition is somewhat like ‘nailing jelly to a tree’. For small-volume consulting projects. Cost is almost always a concern. It is entirely necessary for a design to meet the constraints of a particular problem. I welcome any and all insights on a good definition. weight. size. The design process attempts to solve a design problem. 2. facilities. and power consumption are significant issues (consider a cellular telephone). All engineering design problems have constraints.Chapter 2 Design What is design? Design has been described by many individuals in different ways. 3 . Constraints may be imposed by limitations on money. In military projects. However. time. improve a process or provide a capability not currently available. reliability. while simultaneously meeting various constraints. I will attempt one definition. reliability and compatibility with existing equipment are important constraints. etc.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. subject to internal and external constraints. I have purposefully left out the word ‘optimal’ in this definition.

yes. You should be aware that a proposed solution rarely solves the whole problem. You may decide that you do not have the time. postulating many solutions. or some of your components performing better than their specifications. If you make this decision. ’. From this perspective. implementing and evaluating the proposed solution. you are pinning your chances of success on these situations not arising. or ‘I hope that their machine . You can make this decision only after you have explored these situations and estimated their likelihood of occurrence. If you are successful. deciding on a proposed solution and then 5. In addition. or . the best solution may be to rearrange the situation so that a perceived problem disappears. There will always be problems with any solution.4 CHAPTER 2. but rather a careful assessment of the risks and benefits of changing your design. materials or knowledge to make your design capable of handling all possible situations. solutions require 1. In general. a proposed solution solves the main part of the problem. This is not hope. professors. mentors. . but you will have to make changes to it to handle related issues and unwanted side effects. . 2. . Do not try to make your design ‘as good as possible’ for this phrase may be translated to ‘it is never finished’. careful analysis of the problem. 4. . 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’. . there is no such thing as the perfect answer. . This is worse than not starting to solve the problem because you will waste a great deal of time without achieving a solution. Design is the process of removing the requirement for hope. Results of the evaluation are then used to make decisions on modifying the proposed solution. You may not realize that the success of your strategy or design depends on some other machine failing. you should not have to say ‘I hope that my machine . identification of the key concepts that are operational. competing team members is essential. 3. ’. Generally. however. DESIGN One approach to solving a problem is to avoid it. This is where consultation with team members. Your task is to propose and implement a solution in which the remaining problems are tolerable. and. . . you are finished. Hope plays no part in good design.

2. recursive and concurrent. deciding on possible solutions. A good imagination is necessary both for coming up with new candidate solutions and for mentally ‘exploring’ the performance of those solutions. 2. 6. In the latter case. It is generally impossible to find a unique solution which solves the problem and meets the constraints. Imagination is essential for interpreting the measurements that you make on the solutions you are evaluating. Identify the underlying key concepts. 5. Evaluate the solution. THE DESIGN PROCESS 5 2. you must relax one or more constraints by re-casting the problem or changing the specifications. 4. Note that this must be done in cooperation with the ‘client’. Decide on one solution to explore further.2. implementing and evaluating the solutions. 3. Both the novice and the expert will spend time looking at a problem. you must be sensitive to the implications of your decisions and actions on the other stages and on the performance of the complete solution. In the former case. determining the underlying essential concepts involved. .2. This is totally unlike analysis. Understand the problem. Generate many candidate solutions. The design process requires you to: 1. you can make sufficient additional constraints by making new constraints out of additional desirable qualities of a proposed solution. engineering or in any other problem-oriented field. physics. in which there is only one solution to the problem given. Let’s look at a graph of how a novice problem solver and an expert problem solver allocate their time when solving problems. Implement the solution.2 The Design Process Design is iterative. This happens in mathematics.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. the individual or group who has the problem for which you are seeking a solution. invariably there are either too many solutions (an under-constrained problem) or too many constraints (an over-constrained problem). At every stage.

Once the novice proposes a solution. 4. Time spent in each activity (problem understanding. The ‘take home’ messages from all this are: 1. 2. and the start times of the activities are shown by the starting times of each line segment. Try to find several. The expert. We see from the graph that the novice spends little time in understanding the problem and exploring essential concepts. on the other hand. The expert then starts to implement the solution. 3. Frequently he/she will ‘mock up’ or model key parts of an idea to test the essential concepts of the proposed solution. Brainstorming sessions are excellent for gaining problem understanding and proposing solutions. A typical graph would look like figure 2. a short time proposing a solution. in exploring the concepts and in proposing solutions. we see from the graph that the expert is continually implementing a solution. If the critical parts won’t work. Evaluate your solutions constantly. proposing solutions. The number of times that the activity was performed is shown by the number of line segments. This ‘prototyping’ activity does not take much time and provides a great deal of additional information about the problem and potential solutions. implementing solutions. Most teams comment at the end of the contest that . There are many solutions to any problem. evaluating solutions) is shown by the total length of the line segments opposite each activity. Make ‘mock-ups’ or prototypes of critical parts of your proposed solutions. The expert then starts to implement the solutions. but constantly reviews his/her understanding of the problem and evaluates the solution as it is being implemented.1. This is why the expert spends so much time initially in problem understanding. Thus. The graph shows the time spent at each activity and also the times when the activity was performed. gaining further understanding of the problem and proposing new modifications and solutions. he/she rarely considers other solutions and only infrequently reviews the problem again. She/he proposes solutions and mentally ‘tests’ the solutions against the problem. the solution won’t work.6 CHAPTER 2. 5. evaluating the solution. determining concepts. Constantly review the problem and its sub-problems to determine the underlying concepts. Use them. spends large amounts of time understanding the problem. Use the results of these evaluations to steer your thinking for future solutions. and a great deal of time attempting to implement the solution. the expert will usually find a solution to the problem whereas the novice will frequently not finish the task in the allotted time. Spend time in trying to understand the problem. Finally. It will save time overall. DESIGN We can graph the time that a novice and an expert spend on various parts of the problemsolving process.

UNDERSTAND THE PROBLEM 7 Problem exploration Determining key concepts Proposing solutions Implementing solutions Evaluation Problem solved Time spent by expert problem solver t Problem exploration Determining key concepts Proposing solutions Implementing solutions Evaluation Problem not solved Time spent by novice problem solver t Figure 2.1: Comparison of the time spent by expert and novice problem solvers on various aspects of problem solving. .2.3.

it may not be the only one.3. DESIGN they should have done more planning. Consider interfering with your opponents such as ‘blinding’ their sensors. 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? .8 CHAPTER 2.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. gained a better understanding of the problem. 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. This is not true because the contest was won by the team which won the most heats. This may not require speed on your part and may nullify any speed advantage that they have. or get closer to the end than your opponent by the end of the heat. like the SwampRunners competition. If the task is a race. If you had assumed that the task was only based on speed. 2. This means that while high speed is one winning strategy. you might think that the task is to get from the start to the end in minimum time. then you wouldn’t consider this strategy and your performance might suffer. and looked further for the solutions to problems that they found. This means that the task is to get from the start to the end before your opponent does.

IDENTIFY THE KEY CONCEPTS 9 This competition is a classical example of a real engineering problem. When you have properly broken the problem into sub-problems. knowledge and time. this means that you need a variable which is time-dependent. All engineering problems suffer from a shortage of money. You should attempt to decompose the project into sub-problems which are easily described. unique value of the variable for each time instant.2 Decomposing The Problem After you gain an initial understanding of the problem.4 Identify the Key Concepts You must identify the key concept operating in each sub-problem in order to find suitable candidate solutions. integrating a step function. Successful engineering requires careful consideration of all of these limitations. you should break the problem into a set of sub-problems. such as . 2. You then design solutions to these sub-problems. 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. you will find that it is easy to describe the connections between the components of the solution. or using the first half cycle of a cosine function as a form of lookup table will all accomplish this. As we will see. For example. 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. but a rectangular wave. 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. low-pass filtering a step function. resources.2. 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’. a delta function and a full sinusoid will not. This implies monotonicity. These solutions are then components of the solution to the whole problem.4. if a particular sub-problem requires a time delay. The components will perform a single task and will be easier to design and implement.3. then the key concept is measurement of the passage of time. 2. 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. which itself is based on the measurement of time. With circuitry.

DESIGN Once you have the concepts identified. • Sense the 60-Hz electric field present in most buildings. • make motor speed proportional to input voltage. Consider solutions to a sub-problem for which the key concept is measuring time. Lets look at an example. the Canadian National Research Council official time signal at 8. • Use a microprocessor to keep track of timing in software. What are a few of the ways to measure time? • Use a pre-built time-keeping module. • Build a digital counter with a crystal oscillator time-base. • Build a radio receiver tuned to CHU. and count the cycles. • sense proximity to metal. and build the circuitry necessary to decode the time signal. • measure light intensity • sense contact with obstacles • sense slope • provide a sequence of time steps.10 • convert time or some other variable to current or voltage. • Use a radiation source and a Geiger counter to count emissions over a fixed time. Don’t hesitate to come up with ‘off-the-wall’ ideas. • Measure the period of a pendulum (an electronic ‘grandfather’ clock?) . the design task can become much more focused. they may not be any good. you can then explore many relevant candidate solutions. 2. but parts of them may be the breakthrough that you are looking for. • Integrate a step function with an op-amp integrator and compare the voltage to a predetermined threshold.5 Generate Many Candidate Solutions Having identified the key concept relevant to a particular sub-problem. CHAPTER 2.00 MHz. • measure time.

then consideration 12 of solution 5. One of the toughest parts is to separate yourself from your decisions. Note that you should assess each consideration of each potential solution in random order (consideration 5 of solution 2. or you have a good idea as to how you would implement it. DECIDE ON A CANDIDATE SOLUTION 11 Clearly some of these are more appealing than others. you must decide which one you will attempt first. Using a pre-built time-keeping module has its charms but it may be quite expensive. etc. Brainstorming is a great way to generate ideas. relevant and appropriate candidate solutions. The most important consideration might have a weight of 10. The radiation-source idea may seem far-fetched. Estimate the relative importance of each consideration. You should explore each candidate solution until you rule it out because it violates a constraint. Don’t worry about generating good ideas initially. look at each potential solution with respect to each consideration on the list. but it might actually be simple although its time accuracy would be poor (especially over short times.6 Decide on a Candidate Solution Once you have a selection of candidate solutions for solving a particular problem. Now.2. Just because an idea is yours doesn’t mean that it is the best idea! There are techniques to help make decisions. Decision-making is tough. They take a little time. One technique follows this sequence of events: 1. 3. Make a list of all the considerations that you want to incorporate into your decision. but sorting the considerations two-at-a-time into a list can be very helpful. What good ‘ideas people’ usually do is generate lots of ideas. and then sort out the good (few) from the bad (many). you may rule out a candidate solution on ‘first blush’.2. but the only way to get that experience is in the course of ‘hands-on’ design. but you might find that careful study of it shows it to be quite acceptable.) so that your wishes don’t influence the results. 2. but they take much less time than you lose if you make the wrong decision. They settled on two candidate solutions to explore further.6. In one contest. This is difficult. 2. the next most important consideration might have a weight of 6. Assign a weight to each consideration which reflects its relative importance. This step benefits greatly from experience. Both of these were really parts of other ideas ‘cobbled together’ to form viable. why?). and the least important consideration might have a weight of 0. the design team generated 43 ways to solve one particular problem. without looking at the weights. Assign a number to each consideration which reflects how well you feel the solution addresses the consideration. . In addition. Constraints will rule out most of these candidate solutions but there are insights to be gained by exploring them just the same.

the currents are low. Consider the time you would waste doing all the easy parts. Instead. In the second example. the signals have fairly high amplitude (tens of millivolts to a few volts). Design is different. In the case of implementing a potential solution. Using a breadboard for this circuit is entirely appropriate.7 Implement the Solution You must implement your chosen solution in some manner so as to test it. and the supply voltage is 24 volts. do the hard parts first so that you find out as soon as possible if your proposed solution can work. This is because your design will not work without all the parts working. Good designs are ‘trashed’ by bad implementation. This could save you huge amounts of time. this principle dictates that you should implement and test blocks that are as small as possible. Lets look at three examples. This principle states that you commit as little time and as few resources as absolutely necessary to accomplish your goal. We admonish you to do the easy stuff first on exams and tests so that you receive as many marks as you can. and should be appropriate for the task that the circuit is to perform. but it will be a great help. The easy parts will work. do not ‘do the easy stuff first’. Finally. In design you should do the difficult bits first. 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.12 CHAPTER 2. 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. The voltages are low. and the frequencies are low (below about 100 KHz). 2. This method is not perfect (no method is). resistors and transistors. only to find out that all the time spent on them was wasted because the hard part can not work for previously unseen reasons. Actual construction of a circuit is important. any one functional block that cannot be made to work will jeopardize your whole solution. 5. You know this. So. The blocked rotor current of the motor is 10 amperes. In the first case. multiply the consideration values by the weights for each solution and compute the total for each potential solution. you should pay attention to circuit construction. the circuit consists of a few op-amps. Constructing and testing this circuit on a breadboard is entirely inappropriate because the . Unlike undergraduate engineering. no matter how well-conceived the design. Therefore. Remember. You can usually do this with relatively little effort with ‘off-the-shelf’ circuits and equipment. The best solution is the one with the highest score. I recommend employing what I call ‘the principle of minimum commitment’. There are many ways to implement your potential solutions. test the concept very early on. we are trying to implement a power circuit for driving a motor. Circuits which physically do not stay together cannot work. DESIGN 4.

your ’scope coupling is correct. by all means use a voltmeter WITH an oscilloscope. It lies.This will quickly confirm that you are making the measurement properly (you have the right time-base setting.). etc. the voltmeter lies to you. paying particular attention to component and wire layout.2.. Important concept: You must know what measurements and signals to expect from your circuit when it is working properly. electrons do not care about appearance. testing! Its a pain. Using a breadboard to implement and test this circuit will result in invalid test data due to contact resistance. the capacitance between wires on the breadboard. At these frequencies. Further. care must be taken in construction. EVALUATE THE SOLUTION 13 breadboards are not designed to accommodate component leads which are large enough to properly handle 10 amperes.8 Evaluate the Solution Ah. . the mutual inductance between wires can cause unwanted coupling of signals. currents are small. the connecting straps in the breadboards cannot carry 10 amperes. etc. 2. This circuit should be constructed on ‘perf board’ or a printed circuit board. A breadboard is inappropriate for this case because the inter-contact capacitance of the breadboard will significantly affect circuit operation. the contact area in the breadboard is insufficient for 10 ampere currents. The signals on bundled wires ‘talk to each other’ due to stray capacitance and mutual inductance. Students assume that a voltmeter tells them the voltage.). Keep wiring neat. and in some circuits. and finally. make sure that you make them properly. When you make measurements. Do not bundle wires together for neatness. signals are small. The oscilloscope tells you the real story. This circuit should be constructed on ‘perf board’ or printed circuit board. Remember. you have accounted for the ×10 ’scope probe. USE AN OSCILLOSCOPE!! I cannot stress this enough. voltages are small. If in doubt. a power supply. The oscilloscope confirms that the signal is appropriate for measurement with the voltmeter. If there is any kind of unusual waveform involved. we should talk about ‘lead dress’. close to the breadboard. Finally. but it works better. the inductance of the wires. and make wires go ‘point-to-point’. and the operating frequency of the circuit is about 2 MHz. If you need more accuracy. etc. perf board or printed circuit board (whichever you use). It looks ugly. In the third example. try a ‘test case’ for which you know what the measurement should be (measure the signal generator output. a damaged breadboard and quite possibly destroyed components.8. but it is fun if you approach it as a puzzle to solve.

about ±10%). If the actual and predicted signals do not agree. you have to do some detective work. This is a bad idea because it confuses you and diminishes your confidence in your circuit design. predict what the signal should be like. robustness. You might remove a device to test it. cost. or a broken wire. You cannot fix these devices. if you don’t know what correct circuit operation looks like. then continue with the next circuit. Manipulate the input signal to see if the signal that you are measuring changes as it should. could easily cause your problem. When you see a signal that agrees with your expectation of it. after careful consideration of the circuit. This is where the fun begins. Start making measurements at the input of your circuit. Everyone emphasizes different trade-offs and so we get a large variety of designs. non-panicked thinking solves problems. These are standard trade-offs. then move closer to the output. Make enough measurements at different parts of the circuit so that you can decide what works and what doesn’t. Calm. You should select your strategy with these trade-offs in mind. you don’t want to test all devices initially. THROW IT AWAY! A team last year destroyed their entire controller by using a faulty device. They couldn’t compete. Then make the measurement to see if the actual signal matches your prediction. When you confirm that a device is bad. Make sure that you understand why each signal appears as it does. If measured signals match expected signals (within measurement error. inspect your circuit carefully first. ease of implementation. you won’t be able to recognize incorrect operation. At the problem site. A fragment of wire. Students invariably make convoluted arguments to convince themselves that the signals they observe are correct. cool. but since this is so time-consuming.9 Strategy Like any engineering problem. etc. Instead. performance. Remember Every measurement is telling you something about the circuit. When you find a signal that does not agree with your expectation. You should attempt to consider all . this contest lets you explore the trade-offs concerning complexity. DESIGN After all.14 CHAPTER 2. Good luck! 2. Then make sure that your devices are operating properly by checking their bias conditions. you have found the source of the problem. so don’t keep bad ones.

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

DESIGN .16 CHAPTER 2.

air. nickel-metal-hydride.0 high extremely low Table 3. This whisker cannot grow if the cell voltage is in excess of 1. alkaline. gelled lead-acid. You should be aware of the nature of these batteries.1 Ω) fairly low 3. The primary form of energy storage is the batteries used to power the motors and all other circuits. causing a short-circuited cell. Technology Rechargeable Nominal Voltage Internal Resistance Self Discharge Rate nickel-cadmium alkaline carbon-zinc lead-acid lithium yes no no yes no 1. etc. 3. The major disadvantage of any of the lead-acid batteries is that they will be destroyed if they are discharged to below 1. including nickel-cadmium.5 moderately high quite low 2.0 very low (0. Internally. lithium. carbon-zinc. Their terminal voltage does not change a significant amount from fully charged to almost completely discharged.25 very low high (2%-4%/day) 1. The batteries used in this contest are lead-acid types because they have a very low internal resistance and a flat discharge profile.1 Batteries There are many battery technologies.Chapter 3 Energy Storage Energy may be stored in many ways in this contest.81 volts per cell. and of batteries in general.1 contains a summary of the characteristics of some of the common battery types. mercury.1: Battery characteristics 17 . Table 3.81 volts per cell. sealed lead-acid. Each technology has specific characteristics.5 moderately high very low 1. leadacid. a lead whisker grows between the plates.

3. Kinetic energy is 2 mv 2 where m is projectile mass and v is the ‘launch’ velocity. Lets say we have a spring with a spring constant of 10 Newtons per centimeter. After manipulating and solving. the distance the projectile travels is about 15. It could easily blind someone. This is an arc welder! It may also be an explosion or a fire.8 millimeters. When this nail hits an object. 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.2 centimeters to lift a pound of butter. Lets assume that it decelerates uniformly to a stop in 1 millisecond. This would easily pierce flesh and might damage bone. it releases all its energy. 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 pressure that it exerts on the target is the force divided by the area of the nail head. and pre-tensioned materials can all store energy. and of any batteries with a low internal resistance. The fundamental problem with ‘stretchies’ (springs and elastics) is that their stored energy may be small but their rate of energy release is enormous. The same is true of springs.18 CHAPTER 3. The stored energy is thus 5 Joules. and the force it exerts on the target is about 316 Newtons. The acceleration is about -31. res. the current that flows is given by Vopen Ishort = (3. Lets assume a simple example. or about 19. which is about 120 amperes for a nominal 12 volt battery. These are very good energy storage devices. This energy will be completely converted 1 to kinetic energy on release of the spring. The mass of this nail is about 10 grams and the head has an area of about 16 × 10−6 square meters. This pressure is equivalent to the pressure exerted by a 32 kilogram mass supported on an area the size of the nail head. it can be awesome). we get a velocity of 31.) Now say that we made a catapult to shoot a typical 2-inch common nail with this spring. resulting in huge instantaneous power. elastics. A projectile will .6 meters/second. 1 The potential energy is 2 kx2 where k is the spring constant and x is the amount the spring is stretched. (This spring would stretch about 2.8 × 106 N/m2 .600 meters/second2 (negative denotes deceleration). The energy is always released in the direction in which the elastic relaxes. ENERGY STORAGE You should be extremely careful of these batteries. and other ‘stretchies’. so it is equivalent to a moderately strong elastic band. If a short circuit is connected between the terminals. Consider our batteries. Don’t do it. ever. 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.2 ‘Stretchies’ Springs.1) Rint.

fuel cells. Some of these are more appropriate for a particular application than others. This is the line of energy. etc. nuclear reactions. 3. etc. . If something goes wrong. Never position yourself on it. 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. you don’t want to be a projectile’s ‘target’. forms of chemical energy storage other than batteries (gasoline or other combustible liquid for internal or external combustion engines. and compressed air. chemo-thermal reactions.3. if complex force-redirecting mechanisms are not used. Beware of the line of energy.).3 Other Energy Storage Techniques Other forms of energy storage include gravitational (starting with a raised mass and allowing it to fall).3.).

20 CHAPTER 3. ENERGY STORAGE .

the motor will not run.1). This torque is what turns the motor (if it is not too heavily loaded).2a and b.2. the largest motor manufacturer. it is clear that the torque must be proportional to the magnetic field strength of the stator poles. The result is that the motor armature will remain aligned with the poles. There are far more of them than you might imagine.000 DC motors per day. there will be a torque applied to the armature due to this force. The commutator and brushes are responsible for reversing the direction of the current as the 21 . From these fundamental concepts. When the armature coil is aligned with the poles. As a result. proportional to the number of armature turns. look at figure 4. To gain some understanding of the operation of a DC motor. and proportional to the sine of the angle made by the armature with the pole faces. then the torque will not change direction. there will be a force on the conductors of the armature because of Ampere’s Law. This will result in the motor spinning in one direction.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. This is shown in figure 4. In figures 4. If the direction of the armature current is reversed at the instant that the armature coil becomes aligned with the poles.Chapter 4 Motors 4. worldwide. proportional to the armature current.000. proportional to the distance of the armature turns from the armature center of rotation. very simple devices. If the armature rotates further and the direction of the armature current is unchanged. where we see that the armature current flows in the opposite direction through the armature coil. then the torque will reverse direction. Since the armature conductors are positioned away from the armature’s center of rotation. These are low-cost.2c. Mabucchi. then there is no further torque on the armature because the angle made by the armature with the poles is zero. produces 3. current flows in the armature coil in one direction.

. MOTORS permanent magnet poles coils rotor armature shaft commutator N brushes S stator Figure 4. but it illustrates the principles.1: A conceptual DC motor.22 CHAPTER 4. No-one would use this motor as it cannot be guaranteed to start. Note especially the commutator region.

the current in the armature coil must be reversed to maintain the same direction of the torque. As the armature rotates past the pole face. .4. The armature rotates with current flowing in its coil in one direction.2: Operation of a DC motor. P2 n N s P1 S c. 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. Figure 4.1. c. and b. P1 n N s P2 S b. INTRODUCTION TO DC MOTORS 23 P1 N n S s P2 a. a.

This leads to two conclusions: 1. then a voltage will be generated. lets start to put it all together. the induced voltage is zero. 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. But if there are no motor losses. Further. and 2. then electrical power would be delivered to the motor. the motor will start to turn and current will flow in the armature. Clearly this will be the case when the armature rotates. no voltage would be generated. Lets consider what should happen if we apply a voltage to a DC motor. You should carefully study figures 4. What else can we say about these motors? We notice that the armature is a coil of wire. and assuming that it is not connected to any mechanical load and that motor friction is zero. With zero load at steady state. This induced voltage is the basis for DC generators. the armature current is zero and so there are no I 2 R losses in the armature.2 to see how this works. The motor is developing the maximum possible torque. resulting in the motor’s internal energy growing without bound. MOTORS motor turns. turns and magnetic field strength of the poles. but the load is so large that the motor doesn’t turn. Why? Because if the current were not zero. In a real motor. the generated voltage will be of one sign only. because the commutator changes the connections to the armature coil every 180 degrees of armature rotation.1 and 4. (the output torque would be zero) and so the motor itself must be dissipating power. and so the armature current for the ideal motor must be zero at steady state. What will this voltage depend on? Clearly it depends on the magnetic field strength of the stator poles. motor speed is controlled by the applied voltage. If we allow this coil to cut magnetic flux. we can say that under the no-load condition. Thus. the induced voltage ‘bucks’ the applied voltage. Now lets look at the case of an infinite load. When the motor reaches its steady state running speed for the voltage we have applied. the armature current should drop to zero.24 CHAPTER 4. motor speed is sufficiently high that the induced voltage exactly equals the applied voltage. then this power must be stored as energy in the motor. (If the field strength were zero. and if this coil is not connected to anything. the motor cannot turn. We have seen that the torque is proportional to motor current.) It must depend on the number of conductors. . Thus. This is clearly not possible. the applied voltage must be equal to the voltage drop across the armature due to the armature resistance. hence on the number of armature turns. Under these conditions. For the moment we will neglect frictional losses in the motor itself. Without a mechanical load. Now. no mechanical power would be produced. In this case.

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 dimensions, 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. In this equation, VM Kω ω Ia R = = = = = the applied motor voltage motor speed constant (volts per radians/sec) angular speed of the motor (radians/sec) armature current (this is the motor current) 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 where TM = motor torque, neglecting losses KT = motor torque constant (Newton-meters per ampere) (4.4) (4.3) (4.1)

26 A more realistic equation for the torque TL applied to a load is TL = KT Ia − To − Kf ω where

CHAPTER 4. MOTORS

(4.5)

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. VM = Kω + Kf R R ω + (TL + To ) KT KT (4.7)

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 TL,ω=0 = ωTL =0 = KT VM − To R KT V − To R M Kω +
Kf KT

R

KT R

(4.8)

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 VM = Kω ω + JR dω TL + R KT dt KT (4.9)

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 Kω KT 1 − e−t/τ (4.10)

4.3. MOTOR DYNAMICS

27

zero−speed torque (due to blocked rotor current)

torque

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.

MOTORS V A I D L Vo C R Figure 4. and we assume that the capacitor is large enough that its .11) KT K ω We have ignored the inductance of the motor because the inertia of the load and armature are usually dominant.12 are equal. You should recall that an inductor builds a magnetic field when current flows through it. The equation for an inductor. with JR (4. When the current I flows in the source.13) dt implies that the inductor will try to make the voltage across it sufficient to maintain the current flow. the motor should exhibit inductance because the armature consists of coils of wire.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. di V =L (4. the diode is reverse biased. This frequency is 1/τ radians per second.28 CHAPTER 4. 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. Clearly. Consider the circuit in figure 4.12) from which it is readily apparent that the transfer function relating speed to applied voltage is a first-order low-pass filter. the inductor current is I.4: A simple circuit to illustrate the flyback effect of an inductor.4. 4. we can write the transfer function as ω(s) = 1 TL 1 VM (s) − R JR Kω KT s KT Kω + 1 (4. τ= Expressing this system as a black box with motor voltage as the input and motor speed as the output.

Explain why to yourself. .5. we must select C appropriately.14) To meet the assumption that ∆VC << VC as stated above. until current IM flows. the inductor current does not change greatly since the inductor changes its terminal voltage so as to keep current flowing. what happens? The inductance of the motor causes voltage VS to increase rapidly. Is there any voltage for which this current will flow if the switch is open? What will happen? This circuit is a ‘smoke generator’. current IM flows through the motor.5. With respect to the D.15) EL = LI 2 . By pulsing I with the appropriate pulse width and rate. it must deliver this energy when the source current is zero.5. C (4.4. when the source current I was flowing. and through the load to ground. and the diode is reverse biased. The current into the capacitor is I − VC /R and the voltage change across the capacitor due to this current is ∆VC ≈ I − VC /R ∆t. we can cause the voltage across the load resistor R to be nearly constant at whatever value we wish. the torque output of the motor is negative. energy was stored in the magnetic field of the inductor. Where does the energy come from to supply this current? Well.4 with a diode. and so di/dt starts to increase in magnitude. When VA is low enough to turn on the diode. motor in the circuit of figure 4. The inductor current starts to drop. This is clearly seen from equations 4. Thus. the magnetic field decays to provide the current required. 2 Since the inductor does not dissipate energy nor create energy. So we now have the situation that current is flowing through L.5 The Motor as a Generator A DC motor behaves as a generator when it is driven by its shaft. The energy EL stored was 1 (4. Thus. from ground. the time that I flows. This circuit is one form of switching voltage regulator.1 and 4. In this circuit. we see that the inductance of the motor is important. We are still assuming that the voltage VC is relatively unchanged. 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.C. through the diode. From this. the diode is frequently called a ‘catch’ diode or a ‘freewheeling’ diode. When the switch is opened. there is a current path for the inductor current. the voltage across C is VC . through the inductor. When driven by the shaft. Now we turn off the current source. We solved this problem in the circuit in figure 4. when the switch is closed. THE MOTOR AS A GENERATOR 29 voltage VC does not change for ∆t. How could we solve the problem in this circuit? 4.

Further. Disconnect the motor from the circuit. With this in mind. we can measure motor speed. then the motor current is zero and the second term on the right of equation 4. and the Ia R term represents losses. The generated voltage is then just given by VG = Kω ω (4. 4.6. we also note that the mechanical . and ω is the angular velocity at which the motor shaft is driven.2 KT The torque constant KT has the same numerical value (although different units) as the speed constant Kω .6 4.1 relates to energy conversion.30 CHAPTER 4.1 is zero. 4. Then Kω is just VG /ω. MOTORS V Batt Motor V S switch Figure 4.16) where VG is the generated motor voltage.5: Switching motor current. By measuring the generated voltage. and the importance of motor inductance. The ‘velocity constant’ Kω is found first.1 Measuring Motor Constants Kω Measurement of motor constants is fairly straightforward. spin the armature at a known angular velocity and read the terminal voltage VG . To see this. we have to separate the losses from the energy conversion function of the motor.6. If the motor is not connected to an electrical load. we see that the Kω ω term in equation 4.

1 by Ia yielding PE = (Kω ω + Ia R)Ia (4.5 by ω. the second measurement yields To + Kf ω2 = KT Ia. If Ia.19) from which we find that the numerical values of Kω and KT are equal. While we should be able to merely measure the current when the armature is not moving.3 R We can determine the armature resistance R by connecting the motor to a known voltage source. the motor current. because the ideal energy converter neither creates not dissipates power. (4.2 . this yields erroneous values because the measurement is sensitive to the relative position of the commutator segments with respect to the motor brushes. the Kω ωIa term represents power which is converted to mechanical power. we get from equation 4. Now PE = PM .1 to solve for R. and the 2 Ia R term represents losses.21) . These losses will not be considered further because we separate them from the energy conversion function of the motor. we are looking at the energy conversion function only.6. We measure the voltage. The mechanical power produced is found by multiplying equation 4.1 and ω1 correspond to the first measurement. 4.4. and the angular velocity. yielding PM = KT Ia ω.17) Now. so we have Kω ωIa = KT Ia ω (4.4 Kf The speed-dependent torque loss coefficient Kf can be determined by removing any external load from the motor (so TL = 0). We find this current by solving equation 4.6.1 for the case of ω = 0.5 To + Kf ω1 = KT Ia. (4. and rearrange equation 4.20) Similarly. The ‘blocked rotor’ current is the current that flows when the armature is not rotating. The electrical power supplied by the power source is determined by multiplying equation 4.6. and then monitoring current Ia and speed ω for two significantly different speeds.1 . MEASURING MOTOR CONSTANTS 31 power produced must be identical to the electrical power flowing into the motor.18) 4. (4. if losses are neglected. Again.

the inductance of the motor will result in a flyback spike. When the MOSFET is turned off. we can compute L. Since R is known. (Explain why.6. We have neglected the voltage drop across the diode and we assume that its forward resistance is negligible compared to the two resistances.6.6. because we must measure the L/R time constant of the motor.23) 4. This minimizes the impact of the assumptions made in the various models that we have used. solving for To is straightforward. The time constant is L because the motor inductance discharges through the series combination of the motor 2R resistance R and the resistor in series with the diode.22) (4.1 − Ia. observing the voltage L waveform of figure 4. ω1 − ω2 CHAPTER 4.1 − Ia. 4. we get Kf (ω1 − ω2 ) = KT (Ia.) We monitor the voltage across the MOSFET during this sequence.6 L Determining motor inductance is a little tricky. MOTORS (4.6. This is accomplished by turning on the MOSFET in figure 4.7 Caveat Good engineering practice is to determine the constants when operating the motor as near to the actual operating conditions as possible. and the assuming that the motor is linear. 4.2 ) . letting the motor reach its steady-state velocity.2 ) resulting in Kf = KT (Ia. .32 Subtracting these equations.5 To Since all the other constants of equation 4.6. and then turning the MOSFET off. We fit a decaying exponential with time constant 2R to segment A of the voltage waveform.5 have been determined. such as ignoring ‘stiction’.

A simple circuit to measure motor inductance. .m.6: Motor inductance. The voltage observed at the drain lead of the MOSFET when it switches the motor on and off. MEASURING MOTOR CONSTANTS 33 V batt motor L D R R a. MOSFET on MOSFET off VS flyback ‘spike’ A t back e.6. b.f of motor b. a. Figure 4.4.

34 CHAPTER 4. MOTORS .

With a supply voltage of Vcc . Lets assume that we operate the switch with a period of T seconds per switching cycle and with a duty cycle of D. (Explore this. There are basically two types of speed controller. You can think of them as electronically-controllable high-power resistors. (Duty cycle is the ratio of the time the switch is closed to the period of switch operation. and so by changing RA we can change motor speed.Chapter 5 Motor Control Precise motion control requires accurate control of motor speed. or analytically. If we calculate the Fourier transform of this voltage. Another approach to motor control exploits the low-pass characteristic of motors. Consider placing a switch in series with the motor. and the first term in the Fourier series). the voltage across the motor is Vcc R/(R + RA ).) Thus. and every odd harmonic of the fundamental component.) 35 . if we close the switch we place full supply voltage across the motor. MathCad. we find that it has a D. linear controllers are used only with very small motors. For these reasons. In this scenario. For the moment. motor speed is a function of the applied voltage. a fundamental frequency component at frequency 1/T . make the signal and compute its Fourier transform either numerically using MatLab. Consider putting a resistor RA in series with a motor having a resistance R. This wastes power in battery-powered systems. or some other package. As we have seen in section 4. Linear controllers are useful for very small motors. ignore the inductance of the motor. and when it is open there is no current through it. When the switch is open. large heatsinks and/or cooling fans are required to remove the heat due to this power dissipation. the voltage applied to the motor is a rectangular wave of amplitude Vcc with period T and duty cycle D. Thus. the control resistor must dissipate significant amounts of power. There are two problems with this approach.C. term of Vcc D (the average of the waveform. power dissipation in the switch is always zero and so no energy is wasted. In either case the switch dissipates no power. Firstly. the applied voltage is zero. Secondly. because when it is closed there is no voltage drop across it.

How much higher must the operating frequency be than the cutoff frequency? Note that the motor exhibits a first-order low-pass characteristic. and components at 100 Hz and 150 Hz. Generally we must go higher in frequency than this because of an effect due to the brushes and commutator of the motor. which is 100 revolutions per second. has a commutator rate of 300 Hz.12 that this frequency is KT Kω /(JR). term the only significant component. ‘rolling off’ at -20 db per decade.C. Why? (Consider a Taylor series expansion of the system. This is called Pulse Width Modulation control.m. 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. You should do the math to show this to prove it to yourself.1: Motor frequency response. 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. Other non-linear systems exhibit similar behaviour. we select the operating frequency to be much higher than the cutoff frequency of the motor. To make the D. component only. We recall from equation 4. the commutator segments pass under the brushes at a rate equal to the rotational frequency times the number of armature poles. Thus.36 CHAPTER 5. When the motor runs. if we want the attenuation of all the non-D. MOTOR CONTROL amplitude dependent on duty cycle spectrum of pulse width modulator frequency response of motor f fo 10 f o Figure 5. then we can control motor speed by varying the duty cycle. The motor controller should be operated at a frequency which ensures that the beat1 frequency caused by the commutator rate and If two signals at different frequencies are passed simultaneously through a square-law system. we must ensure that the switching frequency 1/T is at least 2 decades above the motor cutoff frequency.C.p. We are interested in the D.C. and the pulse width modulator spectrum.. This means that a three-pole motor turning at 6000 r. terms to be at least 40 db (reducing them by at least a factor of 100). 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. the output will have components containing each input frequency.) 1 . If we can operate at a sufficiently high frequency. Thus.

UNI-DIRECTIONAL DRIVER 37 V batt motor V G R Figure 5.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. Its major advantage is that it is simple.2. If the operating frequency is too low. it can only drive the motor in one direction. As an example. The uni-directional driver is shown in figure 5.1 Uni-Directional Driver This simple unidirectional motor driver has the disadvantage that its name implies. A switching speed controller consists of timing circuitry and motor driver circuitry. 5. Thus. the motor will sound as if it is breaking up and will twitch and jerk. . 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). The supply voltage Vbatt is applied across the motor if VG is raised to a sufficiently high voltage.1. if the 6000 r.2: A simple uni-directional motor driver. We will first look at several configurations of motor drivers. the switching frequency is well above the cutoff frequency of the motor.5.p.

1. MOTOR CONTROL 5. 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.1.3. and then use the transconductance curves for the MOSFET which are found in its specifications. VG must be large enough to ensure that the MOSFET will carry the maximum current required by the motor. To do this.1. discussed below.38 CHAPTER 5. Thus. You must find the value of RDS (on) from the spec. you must determine the maximum motor current (the blocked rotor current).2) (5. sheet. any FET) has a capacitance from drain to gate.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. In the figure. drain-source voltage and gate-source voltage. This capacitance is the limiting factor on the speed of operation of the device. 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. Another source of power dissipation in the MOSFET is due to the reverse recovery current of the diode.2 Determining MOSFET Power Dissipation As usual. Be conservative in your design. Power dissipation occurs when the motor cannot turn (blocked rotor condition) and the controller keeps the motor on constantly.3 Miller Capacitance and Gate Resistance Power MOSFETs (indeed. we must design for the worst-case situation. The power dissipation is then due to the blocked rotor current and the RDS (on) of the MOSFET for this current. (What is the worst-case situation?) You must also ensure that you do not exceed the maximum permissible gate-to-source voltage. This is illustrated in figure 5. You should recall that the expression for the drain current of a MOSFET is given by iD = K(vGS − VT )2 and so the drain voltage will be vD = VCC − ZD K(vGS − VT )2 (5. 5. we can see that the MOSFET inverts the input signal. . ensure that you have a large enough VG for the worst-case situation.1) From the -ve sign in front of the second term on the right.

single MOSFET motor driver with the gate-drain and gate-source capacitances made explicit. UNI-DIRECTIONAL DRIVER 39 V batt motor model L D R C I gd 2 Is R1 I 1 Q Vs C gs Figure 5.3: A simple.5.1. .

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 ))] dt (5. If we were to increase Vs suddenly by a small amount.3) (5. This would turn the MOSFET on more. with the result that the output voltage would start to drop.) The term Cgd (1 + Av ) is called the Miller capacitance. Now that we have the concept clear. (5. (You should derive this to prove it to yourself. The equations for Is . We will make one simplification.6) Now for the approximation.4) (5.8) dvG vG vS + = dt RS RS (5. When this happens. The result of the Miller capacitance is that the gate voltage will rise slowly and so the drain voltage must fall slowly. lets look at the math. MOTOR CONTROL Now lets look at our circuit conceptually. thereby slowing the rate at which gate voltage rises and thereby slowing the rate at which drain voltage drops. denoted CM .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 ). If we write the node equation at the gate and substitute the equation for drain voltage. This certainly supports our previous conceptual look at the circuit. I1 and I2 are Is = I1 I2 vS − vG RS dvG = Cgs dt d(vG − vD ) = Cgd dt (5. there is a changing voltage across Cgd which causes current I2 to flow from the gate to the drain.40 CHAPTER 5. This increase in I2 ‘steals’ current that would otherwise be used to charge Cgs .7) . we can show that the low-frequency voltage gain Av of the circuit is just 2ZD K(vG − VT ). but this does not change the nature of the effect. This clearly affects the speed of the circuit. the voltage at the gate would start to rise. then vG − VT is essentially constant. (Try it and see. Re-arranging the node equation.) 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. if we assume that the gate voltage will only change slightly.5) where vG = vGS since the source is grounded. Under these conditions. we get [Cgs + Cgd (1 + Av )] which has the solution vG = vS (1 − e−t/τ ) with τ = RS [Cgs + Cgd (1 + Av )] (5.

DIODE SPECIFICATIONS 41 Our assumption of vG −VT being constant is only true for the small signal case. If we don’t make the assumption. 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 must make sure that your design does not exceed either specification. and so the Av term in equation 5. This is made possible by the diode across the motor which provides a path for this current. when the motor is on and running. then the current through Cgd will be due to the rate of change of gate voltage only.2 Forward Current When the MOSFET is switched off. Finally.2. the diode must be capable of carrying the maximum motor current. the magnetic field around the motor armature coils will decrease at a rate which maintains the current flow through these coils. 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 . the diode is reverse biased by the supply. if we make RS = 0 the Miller capacitance has no effect. Since the inductance works to prevent instantaneous changes in motor current.2. Clearly. You should note that the Miller effect only occurs if the drain voltage is changing. Some diodes have a repetitive peak current specification as well as a continuous current specification.5. If the MOSFET drain voltage is either at VCC or ground because the device is either fully on or fully off. In many circuits. 5. you may wish to control the rate of change of drain current to let it rise slowly. The repetitive peak current specification relates to the maximum current that the device can .2 5. the maximum operating frequency is limited by the Miller capacitance unless the circuits are specially designed to minimize its effect.9 that the time constant is controlled in part by selection of RS .1 Diode Specifications Peak Reverse Voltage Clearly the diode must have a peak reverse voltage in excess of the power supply voltage. this Miller effect occurs for any and all systems.9 will not be present. This is especially true for radio frequency circuits. the differential equation is harder to solve because it has a non-constant coefficient. 5.2. We can see from equation 5. In some applications. 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. It is not just a characteristic of MOSFET power circuits.

4a and typical circuit is shown in figure 5. Thus. Since the diode voltage is essentially zero when the MOSFET is first turned on. MOTOR CONTROL carry. If we select VG so that the maximum current that the MOSFET will conduct is only slightly greater than the maximum motor current. As this current drops. especially with increasing operating frequency (more turn-ons per second).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. The half-bridge driver is shown conceptually in figure 5. In the circuit on the left. This can result in the MOSFET conducting excessive current. It will get too hot and burn up if you exceed the continuous specification for a long time.2. the MOSFET drain current will consist of the motor current and the diode’s reverse recovery current. then the initial current that it conducts will be predominantly the diode reverse recovery current.3 Reverse Recovery Time Diodes have one more specification that is of interest to us. There is also a way to overcome this problem in the design of the circuit. we note that the motor current will not rise instantaneously. 5. only one switch is closed at a time. The shape of the motor current curve with time is a function of the inductance and armature resistance. the motor current will constitute an ever-larger portion of the MOSFET’s drain current. Finally. then excessive drain current is avoided. For the unidirectional motor driver. This is called the reverse recovery time. The continuous current specification really relates to the maximum power dissipation of the diode.4b. the diode will continue to conduct for a very brief period of time. if we insist that the MOSFET turns on relatively slowly. When the diode voltage is switched from forward bias to reverse bias. Its major disadvantage is that it requires a split power supply. 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. this is important because it means that for a brief period of time after turning on the MOSFET. . Further. One way to limit reverse recovery current by selecting appropriate diodes. Usually it is not possible to pick a diode for which the decay of reverse recovery current matches the rise of motor current. the diode will conduct. By closing only one switch we can make the motor run either forward or backward. This is a major cause of power dissipation in the MOSFET. the instantaneous power dissipation of the MOSFET is given by the supply voltage and the reverse recovery current. and so the total drain current will be dominated by reverse recovery current initially.42 CHAPTER 5. Lets see how this works. 5.

3. HALF-BRIDGE DRIVER 43 V S1 D1 motor V M D2 IM batt S2 − Vbatt a R3 R5 R7 VF R1 R2 VR R8 D2 Q2 R6 R4 Q4 −V Q1 D1 Q3 motor Vbatt batt b Figure 5. . a) Conceptual design.5. b) Example of a simple design.4: A half-bridge motor driver.

Our reasoning might be something like ‘when the gate signal is high. In our implementation of the half-bridge driver. If we are pulsing MOSFET Q3 . The only problem with it is that it has a long reverse recovery time because it has a large capacitance.44 CHAPTER 5. When S1 is closed. we might be tempted to connect the gates of the two MOSFETs together and to drive them from a single drive signal. Lets further assume that we are controlling switch S1 and switch S2 is left open. When we open S1 . Clearly. the energy stored by the motor inductance is transferred to the lower battery. Q3 and Q4 . however. We would like the MOSFET to turn off quickly. 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). transistors Q1 and Q2 drive the MOSFETs. (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. We would like to ensure that the MOSFETs do not conduct too much current when they are turned on. when S1 is closed. the N-channel MOSFET will be on and the P-channel device will be off. The instantaneous power is considerable during these . We don’t see any freewheeling diodes in this figure however. through D2 and into the lower battery. the motor is powered by the upper battery. sheets. the P-channel device will be on and the N-channel MOSFET will be off’. This is because a diode is present in the MOSFET itself. the drain voltage also falls or rises at the same time. We know that during the reverse recovery time the freewheeling diode will be conducting and the motor current will start to flow. The body diode can carry the same current that the MOSFET can carry and so it makes a good (and free) freewheeling diode. to minimize its power dissipation. MOTOR CONTROL Lets assume that the motor speed is controlled by a pulse-width modulation scheme. at which time the motor current can flow from the motor. 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. This diode. current flows as shown through the motor as shown and voltage VM is essentially the positive battery voltage. the freewheeling diode is the body diode of Q4 .4. While this is a problem in high-frequency power switching circuits. When the gate signal is low. voltage VM almost instantaneously becomes negative due to the inductance of the motor. it will be quite considerable when the MOSFET is switching on or switching off. As the current rises or falls. called the ‘body diode’. it should not be a problem in motor drive applications if care is taken in the design of the rest of the circuit. 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. a similar situation exists with respect to switch S2 . When S1 is opened. Thus. we would like the MOSFET to turn on slowly. Analysis of the currents and times may reveal that we want to limit the MOSFET drain current to safe values during this time. The MOSFETs are used as the switches S1 and 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. VM decreases (becomes more negative) until diode D2 turns on. Thus. is created because of the internal structure of the MOSFET.

. not both switches. Thus.4 Full Bridge Driver If we want more motor power. 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 . Therefore.6b. with Q1 turned off. you only need to pulse one switch. By closing switches S1 and S4 and opening the other two switches. The best time to measure this voltage is just prior to turning on a MOSFET. we want to apply more motor voltage.4. we can cause the motor current to flow as shown. Thus. the body diode reverse recovery time. the collector of Q1 can rise. we see that R3 must be smaller (usually considerably smaller) than R5 . When VF goes sufficiently low to turn off Q1 . 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). Therefore. the collector of Q1 goes to zero volts. We can pick suitable values by considering the MOSFET drain current. If you look carefully at the conceptual circuit of the full bridge. We can do this by opening switches S1 and S4 and closing switches S2 and S3 . . only one battery is used to power the motor at any time. you should notice that it is essentially two half bridges. Notice that in the halfbridge driver. Finally. and the MOSFET input capacitance. we must either increase battery voltage or make better use of the batteries. The longer the duration of the transitions (the longer the rise and fall times of current and voltage). we would like the MOSFET turn-on to be slow to limit drain current. the design issues that you need to consider are . Why is this? See figure 4.5. Are there any other considerations? By controlling which switches are on and (possibly) by pulsing switches. Thus.5. When VF is sufficiently high to turn on Q1 . Lets look at the conceptual circuit in figure 5. and diode D1 are used to accomplish this. To reverse the motor. For a given direction. To achieve rapid turn-off and slow turn-on of the MOSFET. the turn-on time constant is R5 (Cgs + CM ). we need to reverse the current through it. Q3 ’s gate voltage will rise to the supply voltage with a time constant of R3 (Cgs + CM ). 5. FULL BRIDGE DRIVER 45 transitions because both voltage and current have significant values. the power dissipation of Q1 and the MOSFET. but we want the turn-off to be fast to reduce power dissipation. you can control . the greater the average power dissipation. we can determine the motor speed by measuring the motor voltage when the MOSFETs are turned off. Make sure that when changing motor direction you open switches before you close other switches (Why?). Resistors R3 and R4 .

motor speed and direction.46 CHAPTER 5.5: Conceptual circuit for a full-bridge driver. You might want to look into these aspects of motor control further. . permit the motor to ‘coast’ or apply braking. See the reading list. MOTOR CONTROL V S1 D1 motor D3 S3 batt S2 D2 IM D4 S4 − Vbatt Figure 5. or consult one of the mentors.

as do neural networks and other speed-sensitive or very-high-density applications. Some advanced computer vision and image processing systems use analog computation. we may represent the number by the collector current and not by collector-emitter voltage. the sign of the Vce change may not agree with the sign of the number being represented. strain. Alternatively. we can perform the computations required for a system by representing the system variables (numbers) by voltages or currents. Voltage across a resistance and 47 . Any system’s variables may be represented by analog signals. You will frequently wish to convert voltage to current or vice versa. and then inputting these signals into the appropriate circuitry. The circuit is biased at some operating point (Q point). The circuit output will be a representation of the desired result of the numerical computation. When representing numbers with signals.Chapter 6 Computing with Analog Components Voltages and currents may be used to represent numbers so that circuits can perform computations. We can consider this operating point to represent the number zero if we wish. it is not always necessary to make the signal directly proportional to the number to be represented. analog computation was taught as part of the Electrical Engineering program in most universities and was a major research tool for system simulation and testing. and any and all variables internal to a system may be represented this way. heat flow. Positive numbers might be represented as increases in Vce and negative numbers as decreases in Vce . and cheaper than testing the real system. The absolute simplest circuit for converting voltage to current and current to voltage is a resistor. Consider a transistor amplifier circuit. This allows us to ‘model’ system performance with an electrical system which is usually faster. pressure. Force. In years gone by. Temperature may be represented as a voltage (so many millivolts per degree Kelvin). Thus. This is called ‘analog computing’ because voltages and/or currents are used as ‘electrical analogs’ of physical quantities. easier. 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. or as a current. torque. As another alternative. although analog computing is making a come-back. Digital computers have usurped analog computers for simulation in most fields.

also approximated as being infinite. The output voltage Vo is proportional to the difference between the two input voltages V+ and V− . as A gets bigger the difference between V+ and V− must get smaller. The output resistance is usually assumed to be zero. we can see that if the magnitude of Vo is to be less than the supply voltage. This is a fundamental characteristic of negative feedback systems. the op-amp and associated components are configured to prevent the two inputs from being similar. In these circuits. and is often approximated as infinite.1 Op-Amp Concepts An operational amplifier. but new circuits are being developed which can swing rail-to-rail because of demand for lower operating voltages. then it is a voltage to current converter.1) where V+ and V− are the voltages on the non-inverting and inverting terminals respectively.48 CHAPTER 6. In one large class of circuits. The output Vo will increase correspondingly. is an amplifier with two inputs. In the limit as A approaches infinity. Many amplifiers cannot do this because of their internal circuitry (see an equivalent circuit of any common op-amp). one input . (Why would this require rail-to-rail output swings?) The op-amp can be used in a vast number of ways. From equation 6. that is. The op-amp’s output usually cannot exceed the supply ‘rails’ because the op-amp has no internal mechanism for boosting voltage.1. the op-amp and associated circuitry is configured so that the op-amp forces its two inputs to be almost identical. or op-amp. 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. not of op-amps generally. This causes an increase in the input to the box marked G. An op-amp (or any other circuit) whose output can go to the supply voltages is said to ‘swing rail-to-rail’.1. In switching circuits. but is usually in the range of 25 to 100 ohms. 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. which increases the input to the H block. 6. These circuits employ positive feedback. These are called negative feedback circuits. Thus. The input resistance of the amplifier is extremely large. and one output. 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. Because of this. Consider a small increase in Vin . called the inverting and non-inverting inputs. the circuit attempts to make Vf b match Vin . COMPUTING WITH ANALOG COMPONENTS current through it are related by Ohm’s Law. Vo = A(V+ − V− ) (6. The block diagram of such a system is shown in figure 6. The gain A is typically between 105 and 107 . this difference must go to zero. This is a characteristic of negative feedback circuits.

is driven by the amplifier output (usually through additional circuitry) so that it does not match the other (usually external) input.1: A negative feedback system.2). Disturbances or noise on either op-amp input cause the output to change in a manner which corrects or compensates for the initial disturbance. If the two inputs should match at any time.6. To analyze the circuit. This circuit is based on the concept of current summation. feedback is not sufficient for oscillation. More discussion on oscillators will follow. ADDITION 49 op−amp V in G V fb Vo H Figure 6.2.3) (6. At other frequencies.2) . The voltage at the inverting terminal can be found by solving the node equation at this point Vin1 − V− Vin2 − V− V− − Vo + = . and zero (or very low) output resistance. 6. the circuit changes its output. the op-amp may be considered to have infinite (or at least very large) gain and input resistance. This results in the oscillator generating one frequency only. See the section on Schmitt triggers for further discussion on circuits of this type. The voltage at the non-inverting terminal is zero. lets assume a finite gain A for the op-amp and then take the limit as A goes to infinity. Oscillators employ sufficient positive feedback at one frequency only to maintain oscillation.2 Addition We will look at an inverting op-amp summing circuit as an example of a simple analog computation (figure 6. At low frequencies. we get Vo = − ARf ARf V1 + V2 Rf + R1 (A + 1) Rf + R2 (A + 1) (6. R1 R2 Rf Combining these two equations and solving for Vo .

6) in which we see that the output is merely the negative of the scaled sum of the inputs. Thus.50 CHAPTER 6.3. with multiple inputs and with A approaching infinity. If the input resistors all have the same value. then we can use current summation to add the numbers. Numbers may be represented in many ways. we see that Vo = − Rf Rf V1 + V2 R1 R2 (6. Consider the BJT transistor circuit in Figure 6. 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. In concept. Many circuits can be used for this. Vo = −Rf Vi i=1 Ri N (6. the collector current is virtually identical with the emitter current (for a high-gain device).4) In general. Generating these currents will be fairly easy because the emitter-base voltage is quite constant at about 0. then the collector current will be equal to this sum. This circuit is very useful for adding two or more numbers if the numbers are represented by voltages. Note that biasing must be considered carefully in this circuit since the collector voltage cannot be more than Vce(sat) .7 volts. generating the input currents need not be difficult. If this total emitter current is the sum of several independent current sources. then the equation above becomes Vout = − Rf Rin N Vi i=1 (6. If we make currents proportional to the numbers which we wish to use in a computation. we may compute a weighted sum of the inputs if the input resistors have different values.2: Inverting summing amplifier Now if we let A go to infinity.5) Clearly. COMPUTING WITH ANALOG COMPONENTS R4 R1 V1 R2 V2 R3 V3 −Vcc +Vcc − + Vout Figure 6.

we wish to represent the negative of a number by changing the sign of its representation. Looking at figure 6. the collector voltage must be less than about Ve − 0. Note that the collector current is proportional to the sum of the currents injected in the emitter. 6.3 Negation Clearly.5. From equation 6. − Vbias + Figure 6. NEGATION These resistors convert input voltages into input currents. less than the emitter voltage (that is.7 volts due to diode used for biasing.9) . this reduces to Av = −RL RE (6. Many other computations may be performed. The most obvious way to do this is with an op-amp inverter. we see that the gain equation is given by Av = −hf e RL hie + (hf e + 1)RE (6.4.7) Other options for inversion may also exist. since the emitter is at approximately zero volts.3.6.2 volts). 51 V1 I1 V2 I2 Ic V3 I3 Vb is approximately −0. with N = 1 and Rf = Rin .3: BJT current summing. Vout = −Vin (6.8) If hf e is sufficiently large. The BJT is an inverting device when used as a common-emitter amplifier.

This is -1 for RL = Rin .10) (6. COMPUTING WITH ANALOG COMPONENTS Vcc V Vi o V i V o Figure 6. and so this circuit is an inverter. 6. You should note that there will be an ‘offset’ to the inverted signal which you must compensate for. . Subtraction is merely adding one signal to the negative of the other.52 CHAPTER 6. This corresponds to multiplication of the waveform by -1 followed by a level shift. Note the inversion between the input and the output.4 Subtraction Now we will see the advantage of looking at signal processing in a conceptual framework.11) 6. but it can be accomplished with reasonable accuracy. (6. or Vout = V1 − V2 = V1 + (−V2 ) Both of the circuits to do this have been discussed above.4: Using a BJT as a signal inverter.5 Logarithm Taking the logarithm of a number is a little tricky and requires some care in the circuit design and implementation. but the circuit is essentially an inverter.

then the input current must equal the diode current and so VD is given by Vout = −VD = −ηkT log Vin Io Rin (6.15) = −K log Vin where K is a constant containing all the fixed terms. This should result in a different input-output relationship for the circuit. Note that this will work only for positive input voltages because current can only flow through the diode for positive inputs. if we replace the feedback resistor with the diode as shown in figure 6. If negative inputs were required. 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. the input-output relationship is found by equating currents at the summing junction.5. η is a scaling constant. In the inverting amplifier having one input resistor and one feedback resistor (from the output to the inverting input). LOGARITHM 53 6.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. k is Boltzmann’s constant. 6.14) Now.5.6.5.5). what would you do? . The fundamental concept employed in the op-amp summer is current summation at the inverting input. and Io is the reverse leakage current. T is absolute temperature in degrees Kelvin.5. 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 =− Rin Rf (6. Re-arranging this to solve for VD we have VD = ηkT log ID IO (6. We used resistors to convert input and output voltages to current so as to perform current summation.13) where VD is the voltage across the diode and is assumed to be much larger than 26 millivolts. The equation for the current through a diode is ID = Io eVD /ηkT − 1 ≈ Io eVD /ηkT (6.12) Clearly.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.

Note that this circuit is not very good. if we place a diode in the feedback path of an op-amp. 6. the resulting circuit computes the logarithm of the input. It is highly sensitive to temperature since IO is a temperature-dependent function. but it does work. Additional circuitry may be added to improve performance. This will lead to temperature-dependent errors. 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). There is a general principle here: The two circuits of figure 6.54 CHAPTER 6. .6 compute inverse functions of one another because the feedback function of one is the input function of the other. Note that the voltage across a diode changes by about -2. COMPUTING WITH ANALOG COMPONENTS Id D1 R3 R1 Vin Iin − R2 − + A1 + Vout(A2) A2 Vout(A1) Figure 6. try it and see! Again. 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. this function makes use of the diode’s nonlinear relationship between voltage and current.2 millivolts per Celsius degree when diode current is kept constant.6 Exponentiation This uses the same concept as the logarithm calculation. As we have seen.5: Computing log V in with a diode in the amplifier feedback path.

OTHER INTERESTING ‘WRINKLES’ 55 G F Vin F − + Vout Vin G − + Vout a b Figure 6. but we will look at a very simple method.6: Circuit b computes the inverse function of circuit a. each with a different nonlinearity? 2. Consider the circuit of figure 6. 6. 6. and many methods have been used to compute products.7. What would happen if you had a circuit with two inputs. 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. Thus. we might perform multiplication of two signals by first .8 Multiplication Multiplication is more difficult.8. What other types of non-linearities might you consider? 3.6 were a low-pass filter.6.1 Logarithm-Based Multiplication . What would happen if function F in figure 6. and function G were a resistor? 4.7.7 Other Interesting ‘Wrinkles’ 1.The Concept We recall that we can multiply two numbers by adding their logarithms and then taking the inverse logarithm of the sum.

56 CHAPTER 6.7: What is the effect on the circuit transfer function of varying the potentiometer? . R2 R1 Vcc Vin R1 − + Vout −Vcc Figure 6. COMPUTING WITH ANALOG COMPONENTS KR (1−K)R L.F.P.

If the nonlinearity may be expressed in a power series as N f (v) = f (vo ) + i=1 ai (v − vo )i (6.16) about some known point vo . Now if we select our nonlinearity so that the only dominant coefficient ai is a2 . Consider the transconductance curve of a junction FET.8. (Note that the form of this relationship is similar for a MOSFET. then f (v1 + v2 ) ≈ a2 (v1 + v2 )2 2 2 ≈ a2 (v1 + v2 + 2v1 v2 ) (6. vo1 + vo2 = 0. The block diagram for this approach is shown in figure 6. we will then have an output proportional to the product of the inputs. and f (0) = 0.) The drain current is given by Id = IDSS 1 − Vgs VP 2 (6.The Concept Another approach to multiplying two values is to pass their sum through a suitable nonlinearity.8. then adding them.20) .8 6. MULTIPLICATION 57 V1 log exp V1*V2 V2 log Figure 6. and finally taking the inverse log of the sum.2 Non-linearity-Based Multiplication . then the expression for the output as a function of the sum of two inputs is N f (v1 + v2 ) = f (vo1 + vo2 ) + i=1 ai (v1 − vo1 + v2 − vo2 )i (6.17) where vo1 and vo2 are the values for which the function of their sum is known.6. taking their logs.8: Multiplication with log-antilog conversions.19) 2 2 If we can find a way (design a circuit) to ‘throw away’ the v1 and v2 terms.18) (6.

you will realize that the pulse width modulation used for motor speed control is really multiplication. COMPUTING WITH ANALOG COMPONENTS This is the kind of nonlinearity that we are looking for. The DC term of the Fourier transform will then be proportional to V1 V2 . . then the drain current will contain a term proportional to the product of the inputs. the unwanted terms may be removed by first generating them in additional circuitry and then subtracting them from the output. 6.The Concept If you think about it. and a ‘proper pain’ to implement in digital circuitry. and so the unwanted terms may be filtered out. we controlled the duty cycle of a switch in series with the motor (see figure 4. multiplication can be performed using the same concept.10 Division If multiplication is performed by adding logarithms of inputs. See the beginning of chapter 5. we replace Vbatt with signal V1 and make D controlled by signal V2 . Lets look at the concepts involved. To control motor speed. Various methods of ‘throwing away’ the unwanted terms exist. We also design a filter to severely attenuate all frequency components other than the DC component. .58 CHAPTER 6. If we design our circuit so that Vgs is proportional to the sum of the inputs. In other cases. This is the technique used in the modulator of superheterodyne radio receivers. . where D is the duty cycle. Clearly.9 Switching-Based Multiplication . We saw that the DC component (the first term) of the Fourier transform is just Vbatt D. then division can be performed by .5). .11 Integration This is an easy function to implement in analog circuitry. In some cases. 6. and no other terms will be significant. To do this. and then finding the anti-log of the result. because it is a ‘square law’ device and so a2 is dominant. the particular application results in the spectra of the unwanted terms being significantly different from the spectrum of the desired product. and used the motor to filter out all frequency components other than the DC component. 6.

Thus. Several suitable voltage-to-current converters can be used.9c. the equation for the output is Vo = −1 RC t x=0 vi dx (6. 6.6. we can perform integration by converting voltage to current. What happens if we make the feedback element a capacitor and the input element a resistor? The circuit is shown in figure 6. We have used resistors and diodes as input and feedback elements.11.22) You should derive this for yourself (its good practice).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.The Concept We have seen that the fundamental concept behind inverting op-amp circuits is current summation at the inverting node.14). passing the current through a capacitor. INTEGRATION 59 6.9b? • Are there any other components that could be used as input or feedback elements to achieve integration? 6.) Why? (This is a 3 minute answer.21) Using current summing at the inverting node.) • What is the equation for the output voltage in figure 6.3 Non-Inverting Integration .11. and assuming that op-amp gain A is effectively infinite.1 Inverting Integrator .The Concept The voltage across a capacitor is proportional to the integral of the current through it.9a. (Why should the emitter resistor be fairly large?) . One option is a Howland current source (discussed in section 6. Another option is a BJT circuit with a significant emitter resistor. The current through a capacitor is iC = C dvC dt (6. This is shown in figure 6.11. and measuring the voltage across the capacitor.11.

b. Inverting integrator with multiple inputs. Figure 6. c.60 CHAPTER 6. COMPUTING WITH ANALOG COMPONENTS C R V i − + Vcc Vo −Vcc a. R Vcc − + V L i Vo −Vcc c. V1 V2 V3 R1 R2 R3 − + C Vcc Vo −Vcc b. V i C Kv i Vo d. Concept for a non-inverting integrator. Inverting integrator. What is this? Why? d. .9: a.

The gain of the circuit is given by the slope m0 and is just m0 = −R8 /R1 . a circuit which permits a user-defined non-linearity.6. (What is this input voltage?) If the input increases further. One possibility is to use an op-amp and diodes to make a ‘diode-break function generator’. We will assume that the diodes are ideal for simplicity. Clearly this means the gain increases and this is shown in the lower figure by the slope m1 = −R8 /(R1 R2 ). As diodes are turned on. It is clear that by judicious use of the biasing sources (the various VBX ) and resistors. at this input voltage. and for inputs greater than this voltage. write the Thevenin equivalent model of a resistive divider across a fixed voltage source. What has happened here? When the input voltage was very small. 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. (To see this. 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. We assume that VB1 is greater than zero and that VB2 and VB3 are greater than VB1 . This circuit consists of an input subcircuit and a feedback subcircuit. Consider the following circuit. D3 will turn on at some voltage. As the input voltage increased. First. nonmathematical understanding of it. For a first-level. (Why is this negative slope a required condition? How would you add or modify circuitry to get around this?) Two additional points. Now the current through R2 is just Vin /R2 and the current through R3 is −VB1 /R3 and so is constant. With these assumptions. we see that for very small input signals.12. all diodes are reverse biased. The difference current flows through the diode to the summing junction of the op-amp. Thus. The total current flowing into this node is then this difference current plus Vin /R1 . there is no need for the input circuit diodes to turn on before feedback circuit diodes. D1 turns on. Further. Second. so we will assume that the voltage at point A is zero volts. which is −Vout /R8 . For negative-going signals. we will look first at the input subcircuit. As the input signal increases (becomes more positive). we reach a point were the voltage at the anode of D1 os zero. COMPUTING AN ARBITRARY FUNCTION OF AN INPUT 61 6. we assume that VB4 and VB5 are fairly large. current in the input circuit flowed through R1 only. diode D1 turned on and the current in excess of the (constant) current through R3 . the various bias sources and their series resistors may be realized with resistive dividers across the power supply. the corresponding resistors are switched in parallel with R8 resulting in a gain decrease.12 Computing An Arbitrary Function of an Input Sometimes we want to compute some arbitrary function of an input.) . almost any transfer characteristic can be realized as long as it has a local negative slope. This is equal to the current flowing out of this node. R2 is in parallel with R1 .

62 CHAPTER 6. . b) The transfer characteristic of the circuit. This is why thresholds with respect to VB4 and VB5 are shown with respect to the output.10: a) A diode-break function generator. D2 and D5 relate to positive inputs and diodes D3 and D4 relate to negative inputs. Diodes D1 . Note that the feedback circuit imposes thresholds on the output voltage. COMPUTING WITH ANALOG COMPONENTS R8 V R1 in R2 R3 R4 V B1 R5 R6 V B2 R7 V B3 D3 A − + D4 D1 D5 D2 R10 R9 V B4 R11 R12 V B5 Vcc Vout −Vcc V out V R9 B4 R10 m 4 m 3 m0 R6 V B3 R7 V R2 B1 R3 V R4 B2 R5 Vin m 1 m2 V R11 B5 R12 m 5 Figure 6.

12).13 Converting Current to Voltage The absolute simplest current to voltage converter is a resistor.14 Converting Voltage to Current Converting voltage to current is equally easy. CONVERTING CURRENT TO VOLTAGE 63 Vcc Iin Vout Figure 6. The underlying concept of current to voltage conversion is correct.6.11: A BJT transresistance amplifier. and the input current must be into the base as no bias is otherwise provided. Hence it expects a current and produces a current. and so the complete circuit converts current to voltage. 6. The transistor is a current-controlled current source. The transistor is a current to current converter (a current-controlled current source). It also depends on Ohm’s Law. 6. The input is a voltage source. We can see both roles in the following circuit.11).13. A common transresistance amplifier circuit uses an op-amp (figure 6. The problem with this circuit is that both the input and output have resistances that are too high for true current-tovoltage converters. is just a BJT common-emitter amplifier. The circuit also inverts. or transresistance amplifier although not a very good one. . you get a voltage across it). Its collector is connected to a resistor. You should try to determine how it works by expressing the feedback current in terms of the input current and the output voltage. which is a current to voltage converter (push a current in. with the collector connected to the supply through a moderately-valued resistor (figure 6. You should try to explain this to yourself in terms of Ohm’s Law. however. and so we want to convert voltage to current so as to provide the BJT with its base current. The next simplest current-to-voltage converter. however.

64 CHAPTER 6.12: An op-amp transresistance amplifier. Also remember that the base current is much smaller than the collector and emitter currents. What is the gain. and so this circuit can be considered a voltage-to-current converter for input voltages of very low amplitude (effectively linearizing the circuit). It is not a linear conversion however. the two inputs are at the same voltage. Consider the circuit of figure 6. you should recognize that the circuit within the dotted outline is just a gain stage. The equation for the FET’s drain current in terms of the gate-source voltage is ID = IDSS 1 − Vgs VP 2 (6.15. or stated another way. To get an idea of how it works. the voltage between the inverting and non-inverting inputs is essentially zero. .14. A final circuit is the Howland current source. one obvious voltage to current converter is a junction FET transistor. (It is the output of a currentcontrolled current source. To simplify things. the collector current is the independent variable with respect to the collector resistor. what is Va /Vo ? With this gain found. The collector of the transistor looks like a current source.23) and so it is clear that the FET converts voltage to current. so it had better look like a current source!) Thus. and so this resistor acts as a current to voltage converter. Remember that for a linear op-amp circuit at sufficiently low frequency. that is. 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. COMPUTING WITH ANALOG COMPONENTS If Iin − + Vout Figure 6. A better voltage to current converter is shown in figure 6. you should be able to solve this circuit easily. you should find Io as a function of Vi .

6. . CONVERTING VOLTAGE TO CURRENT 65 Vcc Ic I b Vo Vs Figure 6.13: Current-to-voltage and voltage-to-current conversions in a common circuit.14.14: A common voltage-to-current conversion circuit. Iout − + Vin Ie Figure 6.

15: Howland current source. COMPUTING WITH ANALOG COMPONENTS R1 R2 Vcc − Vi R3 Vo + Va −Vcc R4 I o Figure 6.66 CHAPTER 6. .

Look at figure 7. However. however. which means that the output circuit does not have a means of generating a high voltage. They have two inputs and one output. Designers of the chip did this so that the outputs of several comparators could be wired together without damage. if this transistor is turned off. If the inverting input is less than the non-inverting input. are comparators and Schmitt triggers. It is clear that if the output transistor is turned on by the rest of the circuit (not shown). Comparators frequently have ‘uncommitted outputs’. 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. Some of the most useful. then the output will be high. 7. Integrated-circuit comparators are quite similar to op-amps. however.1. at least in concept. You could get the same behaviour with an op-amp in which the feedback circuit was disconnected.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. because it is optimized for speed. 67 . If the inverting input (marked on the schematic diagram by a ‘-’ sign) is greater than the non-inverting input (marked with a ‘+’). The comparator is different from an op-amp.Chapter 7 Some Non-Linear Circuits There are many circuits which exhibit non-linearities. The circuit we would use is called a comparator. then the output will be a low level. then it will sink current and so the output voltage will be low.

then it is obvious that too many events will get counted.1 with Vo equal to Vmin . then Vo is equal to Vmax . Lets analyze this. When Vi rises to greater than VA . we will get many false detections of the signal. A common Schmitt trigger is shown in figure 7. We need to ‘clean up’ the signal first.2. the node voltage VA can be found from Vo − VA Vref − VA VA + = R1 R3 R2 (7. then the inverting input exceeds the non-inverting input and so the output switches from Vmax to Vmin . If the input is greater than VU . SOME NON-LINEAR CIRCUITS − + Figure 7.1: Output circuit of a common comparator.68 CHAPTER 7.3. When the input goes below VL . With this output. The device functions as follows.1) in which Vo is Vmax . Consider the signal in figure 7. Vo will change from high to low when the input exceeds VU . and stays high until the input goes above VU . This is the case for which VA is VL . then the output is Vmin . As long as the input is greater than VU . the output is low. Thus.2 Schmitt Triggers Schmitt triggers are used to ‘clean up’ a signal and to decrease the rise and fall times of the signal. . which we will call VU and VL for ‘upper’ and ‘lower’ respectively. the output goes high. In this circuit. If we attempt to detect the signal in the noise. The Schmitt trigger is said to have hysteresis because of this behaviour. We can solve for VA in equation 7. If the input Vi is less than VL . the maximum value that the comparator (or op-amp) output can reach. The output will switch to Vmax when the input decreases to less than VL . The circuit designer selects VU and VL to detect the signal as well as possible while rejecting noise as much as possible. If it were necessary to count external events and the measurements of the events were noisy. the minimum value that the comparator can reach. 7. VA is VU in this case. Schmitt triggers are used for this task. A Schmitt trigger is a circuit which uses two thresholds.

Figure 7.7. d. resulting in poor signal detection. c. with a detection threshold.2: A noisy signal. a) Noisy signal (signal shown dotted). b) recovered signal using the threshold shown in a. c) Actual signal.2. . Signal recovered using Schmitt trigger with thresholds shown. d. b. SCHMITT TRIGGERS 69 V V U T V L a.

the voltage on the capacitor can never be less than the voltage at the non-inverting comparator input.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.70 CHAPTER 7. chances are that you will not use bipolar supplies. it will become apparent how the resistor values determine VU and VL . the designer’s task is to select R1 . R3 and Vref so that VA equals VU when Vo equals Vmax . 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. the Schmitt trigger output goes low. and VA equals VL when Vo equals Vmin .2. 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. SOME NON-LINEAR CIRCUITS Vcc Vi − + Vo −Vcc R1 V A R3 Vref R2 Figure 7. Thus.1 Asymmetrical Power Supplies The Schmitt trigger discussed above depends on having bipolar power supplies. From these equations.3: A common Schmitt trigger using an op-amp. Will the circuit work in this case? The answer is that it won’t work. This problem can be solved with the circuit of figure 7. . R2 . Note that the Schmitt trigger circuit discussed here inverts the signal. that is. and so the comparator output will remain low indefinitely. If you choose to use a comparator rather than an op-amp. when the signal exceeds the upper threshold. The circuit may be analyzed (and designed) by writing the node equations for this node for both comparator output levels (high and low). Thus. 7. When the comparator output is low.

SCHMITT TRIGGERS 71 Vcc Vcc Vi − + R3 Vo R1 R2 Figure 7. .7.2.4: A comparator-based Schmitt trigger with a single supply.

SOME NON-LINEAR CIRCUITS .72 CHAPTER 7.

but pulses are by far the most frequently used waveform. 8. Lets take a look at various waveforms (figure 8. Consider a square wave.1 Generating Timing Signals It is frequently necessary to design a circuit which generates a signal so that you can measure the passage of time. one pulse per millisecond.1. we want the output to go from a low level to a high level. 8. Clearly we want a voltage (or current) to change as a function of time. For example.Chapter 8 Timers and Timing Circuits which provide time delays.. at which time the circuit output will change from high to low. When the voltage (or current) reaches some predetermined level. They are frequently integral components of the circuitry used to implement strategy. triangles. 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. etc. The circuit might generate timing signals of some other waveform such as sinusoids. and they are used to adjust the timing of various signals.1 The Concept Consider the problem of generating a timing waveform. We want this cycle to repeat endlessly. While this waveform changes level at fixed times. or which generate signals which you can use for timing purposes are very useful. it does not change continuously with time and so its level cannot be compared with an arbitrary 73 . Such a signal might output one pulse per second.1. they can be used for clocking latches and flip-flops. We then want more time to pass so we want another voltage-as-a-function-of-time waveform to change to another predetermined level.1) to see if they are applicable to this circuit. or pulses at some other convenient frequency.

1) where VU and VL are the maximum and minimum waveform voltages respectively. On each slope of the triangle. A negatively-sloped portion of the waveform may be expressed as v(t) = (VU − VL )(e−(t−t1 )/τ ) (8. and proportional to the difference between the present waveform voltage and the waveform voltage at the time of the most recent slope change. Finally. This waveform is composed of two alternating exponentials. the voltage is a linear function of the time elapsed since the last time the slope changed. TIMERS AND TIMING t fixed value to measure the passage of time. fixed value to measure the elapsed time since the slope last changed. t0 is the time from the preceding change from negative to positive slope and τ is a time constant. The waveform level (voltage or current) can be compared to an arbitrary. This elapsed time is clearly inversely proportional to the slope of the waveform. if we had a square wave already. A positive-slope exponential may be expressed as v(t) = (VU − VL )(1 − e−(t−t0 )/τ ) (8. we wouldn’t need to build the circuit in the first place!) Now look at a triangle wave.2) where t1 is the time of occurrence of the last slope change from positive to negative slope. Why? . Is this waveform useful for generating timing signals? Yes it is. (In addition.74 CHAPTER 8. lets look at the third waveform in the figure.

If a step of amplitude A is applied to the input. 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.1. the triangle-wave-to-square-wave converter takes a square wave and generates a triangle-wave from it.8. Now lets arrange a block diagram of the timing-generation circuit that we want. We know that this circuit attenuates high frequencies.4) (8.1: Block diagram of a relaxation oscillator. Lets write the expression for the output of this circuit when a step is applied. What is a simple circuit that can do this? Consider a ‘low-pass’ RC circuit (figure 8.3) . GENERATING TIMING SIGNALS 75 Square to Tri−Wave Tri−Wave to Square Figure 8. then the output can be expressed as Vo (t) = A(1 − e−t/RC ) Now the slope of this function is dVo (t) A −t/RC = e dt RC (8. In this figure.2).

This circuit implements the concepts essential to this relaxation oscillator.405RC and 1. you should consider what would happen if the slope at either threshold was very small.333A/RC. the slope is A/RC.666A/RC and 0. In this case. Now lets look at a complete circuit for this relaxation oscillator (figure 8. The R − C circuit that converts the square wave into a rough approximation of a triangle wave is composed of R .2. The slopes at these times are 0. TIMERS AND TIMING R Vin(t)=AU(t) C Vo(t) Figure 8.10RC respectively.76 CHAPTER 8. (Why?) We find that these times are 0. lets assume that this performance is acceptable. Remember that its output switches low when the input goes above VU . the circuit response may be considered to be an approximation to a ramp. Connect this output to the assumed input. To see why. If we arrange the Schmitt trigger so that VU = 2/3 of the maximum amplitude and VL = 1/3 of the maximum amplitude. These aren’t wonderfully close. For the moment. For a good design. 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. 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. and high when the input goes below VL . We solve for the times at which the output rises to one third and two thirds of the input amplitude. An oscillator is thus a ‘self-fulfilling prophecy’. and the Schmitt trigger threshold was somewhat noisy (slightly uncertain). Have we seen a circuit that will satisfy this requirement already? Consider a Schmitt trigger. the circuit can be considered to be a form of integrator. we don’t care about the shape of the supposed triangle wave. then its output will have the correct polarity to drive the input to the RC filter.3). we want the input to the Schmitt trigger to change rapidly with time..2: Low-pass RC circuit. Our circuit will work as long as the input to the Schmitt trigger changes continuously with time. Note that the design strategy for this (and any other) oscillator is Assume an input to the first block. then over this range of output voltage. Design circuitry to produce the desired output and also generates a second output identical to the assumed input. At t = 0. If the slopes are sufficiently similar. Since we want a square wave for timing purposes (remember how we got into this discussion?).. but they might well suffice. which will generate the triangle which will switch the Schmitt trigger output which .. and then compute the slopes at these times.

3: A simple relaxation oscillator based on an op-amp. GENERATING TIMING SIGNALS 77 R − + Vcc C −Vcc R1 R1 Low−Pass Triangle to Square Figure 8. .8.1.

722/RC. after re-arranging to solve for t and setting Vtriangle (t) to 10 volts. slew-rate). we have used an op-amp to make things simpler. then the instantaneous voltage across the R − C low-pass circuit is 20 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. When the triangle wave is at its minimum value (−5 volts) and the op-amp output switches high (to +15 volts). and so the frequency is 0. Thus. Lets determine the period of oscillation of this circuit.693RC (8. but left the lower threshold at -5 volts? Try some of these ideas to get an understanding of the circuit.386RC. the circuit meets the assumptions that we made above. the time to charge the capacitor C to +5 volts from −5 volts is found by solving Vtriangle (t) = 20(1 − e−t/RC ) or. Why do these considerations apply? What would be the consequences of violating them? Explain this to yourself. then the maximum and minimum inputs to the low-pass filter are also ±15 volts.78 CHAPTER 8. 10 t = −RC log 1 − 20 = 0.1. • The capacitor C should have leakage current much less than the current through R. and why? What would happen if we changed the upper threshold to 10 volts. (How did we do this? Analyze the circuit.7) The period of the oscillator will be twice this time because one period requires that it alternately charge the capacitor to +5 volts and −5 volts. If we were to change the threshold voltages to other values.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. Thus the period is 1. and each of these charging operations take the same time.) Thus.5) (8. TIMERS AND TIMING and C. what would happen. • The op-amp or comparator have certain frequency-response limitations (power bandwidth. Make sure that your design is not trying to exceed them.6) (8. In this circuit. Make sure that you account for this in your designs. If we assume that the maximum and minimum output voltages of the op-amp are ±15 volts. 8. . • 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 output voltage of most op-amps usually is less than Vcc − 3 and greater than −Vcc + 3 due to internal circuitry.

A SIMPLE TIME DELAY CIRCUIT 79 8. we need to convert time to a voltage (or current) which other circuitry can measure and compare with a fixed threshold.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. We must also have a means of resetting the time-to-voltage conversion so that we can initiate new timing intervals. and will either generate an output for a predetermined time or wait a predetermined time before generating an output. 8. We have seen these concepts before with respect to the relaxation oscillator. When the input goes low. • The time delay is independent of Vcc . To do this. and the voltage comparison function is the function of a comparator. Q1 turns off and the capacitor starts to charge.2. you need a timer function. or a FET (with a change in trigger voltage). 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). 8. Note: • Q1 could be replaced by a semiconductor switch (1/4 of a 4016). In that application.2. This is usually desirable.8. This type of circuit is frequently referred to as a ‘monostable multivibrator’ or a ‘one-shot’.2 A Simple Delay Circuit There are many ways to make such a circuit. In this circuit. R − C timing. This is not an ‘edge sensitive’ or ‘latching’ timer. .1 The Concept Again. • You must ensure that Q1 is fully turned on prior to the timing interval desired. • IR1 and IR must be much greater than Ibias . 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 . because it has one stable state (untriggered) and produces a single pulse for each event (one-shot operation). and using a transistor as a switch to discharge the capacitor.2. so Q1 is on. This keeps the capacitor discharged. the input is usually high. Two key concepts are employed in this circuit. One very simple technique is shown in figure 8. Why is it true for this circuit? • Vin must keep Q1 off during and after the timing interval. The circuit will be triggered by an initiating event. and so the comparator output is low.4.

Again. and 2. we use the transistor to enable current flow through the R − C circuit. not to discharge the capacitor. simplify the circuit to reduce costs and complexity This circuit compares the output voltage of the R − C circuit with a reference voltage. using a transistor as a switch. TIMERS AND TIMING Vcc R R1 Vcc − R3 Vin Q1 C R2 + Vo Figure 8. 2. and 4. 3. however. In this case. the key concepts are 1. This circuit is an excellent example of the design process. 8.80 CHAPTER 8. determine the key concepts. We perform the following steps.2. we want the comparison to result in an output for a fixed length of time only. modify the implementation to meet additional constraints. in sequence: 1. just like in the previous circuit. . In the case of this circuit. using an R − C time constant to control the time delay.4: A simple delay circuit. implement and test the concepts.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. The output goes high a predetermined time after the input goes (and stays) low. however.

If we do this. and incomplete circuit. Consider the following. rather unusual.7. and more difficult. (Note that VB will be equal to Vcc when the transistors are off.8. the new circuit is shown in figure 8. Now we look at simplifying the circuit. If we compare this voltage to a reference voltage VB (see figure 8. If the voltage across the capacitor is initially zero (don’t worry yet about how we accomplish this). Consider the enhanced circuit of figure 8. If the voltage across the capacitor is initially zero.) R3 and R4 should be selected so that little current flows through them compared to the capacitor charging current. Resistors R3 and R4 are selected so that voltage VA will be slightly lower than VB until the transistors are turned on.8. If we just connected their bases together. since it is more complex than it needs to be. Note that resistors R1 and R2 are necessary to ensure that both transistors are turned on at the same time. • The time between triggers must be long enough to allow the capacitor to discharge to . Making these changes.8: • The diode D is used to discharge the capacitor rapidly when Vin goes low to turn off Q1 .2. then when Q1 is turned on. we can produce an output as long as VA is higher than the reference. Notes for figure 8. we see that R3 is then in parallel with the series combination of R5 and R6 . and VBE for one was lower than for the other. R2 + R3 must be much less than the timing resistor R. then VA decays with time after Q1 is turned on. prior to it going high. Since Q1 and Q2 are turned on and off at the same time. only one transistor would turn on instead of both transistors. A SIMPLE TIME DELAY CIRCUIT Vcc C V A R R1 Vin Q1 81 Figure 8. To accomplish this. voltage VA decreases toward zero with time. we can consider using only one transistor instead. is that this circuit will produce a high output even when the input is low.6).5: Part of a one-shot timer. Two problems remain. The first. We can fix this by having VB change when the input is high.

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.5 with a reference produces an output as long as VA is greater than the reference VB .82 CHAPTER 8.7: Here we are switching the reference circuit as well as the R − C circuit.6: Comparing the voltage VA of figure 8. TIMERS AND TIMING C V A R R1 Vin Q1 R3 VB − + Vcc R4 Figure 8. . C V A R3 Vcc R5 VB − + R Q1 R1 Vin R4 R2 R6 Q2 Figure 8.

7.4 A Latched One-Shot This circuit works identically to the preceding one-shot except that once it is triggered (Q1 turned on). R5 and R6 is much less than the duration of the output pulse. 8.8. to use the smallest (and hence cheapest) capacitor possible). A SIMPLE TIME DELAY CIRCUIT 83 Vcc C V A R2 VB − + R D R3 R1 Vin Q1 R4 Figure 8. the high output from the comparator is used to hold Q1 on. R4 must be much greater than R2 + R3 . Note that R5 and R6 must be chosen so that Q1 is on when either the input or the comparator output is high.2. You should be able to explain to yourself why these considerations are so.2.8: This circuit is the reduced version of the one-shot circuit of figure 8. • For a large change in the capacitor voltage while timing (and equivalently. What does diode D1 do? . select CC so that the time constant formed by it and the parallel combination of R1 . Explain how the circuit works to yourself. the point that VA is VA ≈ Vcc R2 + R3 R2 + R3 + R4 (8. Also.8) • Take care that the currents through R2 and R3 and through the capacitor are much greater than the comparator bias currents.

TIMERS AND TIMING .84 CHAPTER 8.

stable amplitude. assume that the desired sinewave is present at the input of the amplifier. In the conceptual circuit of figure 9. of course. The output of nearly all amplifiers cannot exceed the supply voltages for the amplifier. loop gain must be less than unity and/or loop phase must be other than zero. How can we implement this? The most common method is to use the limited output voltage swing of the amplifying device. or shifts the phase of the signal by a known amount at the desired frequency and shifts all other frequencies by a different amount. stable oscillation is maintained at the amplitude that provides just the right gain for the oscillation to be stable. As the input voltage is 85 . In practice. How do we cope with this problem? The ideal solution is to use amplitude-dependent gain. For a sinewave oscillator. It is then passed to the feedback network. Thus. As the amplitude increases. the gain is slightly higher than that required for oscillation. we want to generate a single frequency with a known. the peak magnitude of the amplifier output is |AVi | < Vmax . For all other frequencies.1.Chapter 9 Sinusoidal Oscillators Sine-wave oscillators are also ‘self-fulfilling prophecies’. If Vi is sufficiently small. To do this. frequency-selective feedback circuit. this is not possible. 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. Now consider a sinusoidal input signal Vi to an amplifier which has gain A and which has a maximum output voltage amplitude of Vmax . the gain is reduced to slightly less than that required for oscillation. The feedback network is assumed to be a frequency-selective circuit which either passes the desired frequency and attenuates all others. When the amplitude of the signal is lower than some value. This sinewave is amplified by the amplifier without distorting it in any way. we typically use an untuned amplifier and a tuned. The foregoing assumes that you can set the amplifier gain exactly. or both.

If we were to find the spectrum of the output.2a. increased. This is the transfer characteristic for ‘hard’ clipping. SINUSOIDAL OSCILLATORS gain frequency− selective network Figure 9. This points up a consideration when exploiting non-linear phenomena. However. Is it ‘legitimate’ to define gain this way? Well. or ‘dynamic’ gain.1: The concept behind a sinewave oscillator.86 CHAPTER 9. The transfer characteristic of such a device is shown in figure 9. 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. The output gets clipped. an interesting thing happens. and so Gf is reduced with increasing input amplitude. Thus. we find that the amplitude of the fundamental component in the output does not change. The problem with using hard clipping by the amplifier (as discussed above) is that the harmonic content of the output is increased. and we can arrange the feedback portion of the circuit to attenuate any harmonics as much as required. the dynamic gain is zero. this is not good. we would find that the first term occurs at the frequency of the input signal. For a sinusoidal oscillator. and there would be significant amounts of the odd harmonics. the gain for inputs between V1 and V2 is 3. If the input is increased still further. We note that the ‘incremental’ gain. For any input outside this range. is the slope of the transfer characteristic at the point under consideration. So this is a legitimate definition in this application. a point will be reached where the peak magnitude of the amplified input is equal to the maximum peak output magnitude. then we see that increasing the input does not increase the output. meaning that the peaks get removed. 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 . This is an amplitude-dependent gain of the type that we want. you must make sure that approximations and assumptions are appropriate for the task at hand. continuing to increase the amplitude of Vi . 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. in this application we are interested in the fundamental frequency only.

The characteristic of a soft clipper.2: a.87 V o V U V2 V1 Vi V L a V o V U V 2 V 1 Vi V L b Figure 9. The transfer characteristics of a hard clipper. . b.

the dynamic gain is 2 for V2 < Vi < V1 and 1 for all other voltages. We will keep our discussion quite conceptual at this point.88 practical applications. The R − C network shifts the phase of the output by 180 degrees at the desired oscillating frequency. In figure 9. Off-diagonal elements are the sum of the admittances connecting the corresponding nodes. The gain of these feedback circuits does not change greatly with frequency. we could reduce the distortion further by using the input signal to the amplifier as the oscillator output. Clearly. We will also model the R1 − C1 branch as an equivalent impedance. The basic phase-shift oscillator is shown in figure 9.3. This means that we will start by assuming that we have the output signal that we desire. transistors or FETs. but show how it can be extended to phase-shift oscillators implemented with op-amps. By doing this. we model the output of the op-amp.1 Phase-Shift Oscillator Remember. Now lets look at a variety of oscillators. (Why? Explain how the change in gain could cause distortion. then use this signal as the input to the feedback portion of th circuit to create the input to the amplifier. This is most easily accomplished by writing the admittance matrix for the circuit. and slightly less than necessary for high amplitude inputs.2b. One very successful way is to use ‘soft’ clipping. 9. If you recall. 9. we can model the circuit as a 2-node circuit instead of a 4-node circuit. We will make the feedback the frequency-dependent portion of the circuit. Now we will write the admittance matrix.1 R − C Oscillators One group of sinusoidal oscillators uses R − C networks to implement a frequency-dependent phase shift in the feedback circuit. How is this connected to the Fourier transform of the output? How would you determine the amplitude of the oscillations?) Again. Since the gain is approximately constant. but there . Dependent sources must be handled carefully. together with R3 as a Norton source. each diagonal element of the matrix is the sum of the admittances which are incident on the corresponding node. CHAPTER 9. the dynamic gain is changed only slightly. These circuits depend on achieving the phase shift required to satisfy the Barkhausen criterion. You can see this by solving the expression for the feedback circuit. First. SINUSOIDAL OSCILLATORS There are other ways of controlling gain. an oscillator is a self-fulfilling prophecy.1. In this case. we could envisage a soft clipper in which the gain is slightly greater than necessary for oscillation for low amplitude inputs. the distortion should be very small.

.9.3: A basic phase-shift oscillator. R − C OSCILLATORS 89 V A −K Vo R1 C1 C2 R2 C3 R3 feedback circuit a Rs Vo Vs R3 1 C3 R2 2 C2 R1 VA C1 b 1 C3 R2 2 C2 R1 VA C1 R3 Vs R3+Rs Rs c Figure 9.1.

The fundamental circuit is shown in figure 9. After all this.4. however. We select R and C to provide a 180 degree phase shift at the desired frequency of oscillation. They are not the oscillators of choice. why?) . Solving the equations is tedious. We assume that this has been taken care of. at only one frequency. From this. however. SINUSOIDAL OSCILLATORS The matrix equation for the network is therefore Vs Ro +R3  0 = sC3 + 1 Ro +R3 1 − R2 + 1 R2 1 R2 1 − R2 + sC2 +  1 1 R1 + sC  1 V1 V2 (9. you can write this expression by inspection. CHAPTER 9. but they are beyond the scope of this presentation. A second option is to use an amplifier that exhibits soft clipping. Phase-shift oscillators are usually used at low frequencies. (There are also good design reasons for making all the resistors and capacitors the same.90 is really nothing special about them. and then determining VA using voltage division based on the R1 − C1 network. one option is to use the clipping due to power supply voltages.1. These are equal and hence cancel. therefore. we can select K so that the closed-loop gain is unity at the frequency of oscillation. must be non-inverting. while the shunt arm causes a phase lag. VA = V2 1 sC1 R1 + 1 sC1 . We usually set R1 = R2 = R3 = R and C1 = C2 = C3 = C for simplicity. That is. (Why?) The amplitude-dependent gain required for oscillation has not been shown in this figure. We substitute these values of R and C into the equation for gain magnitude. (9. (An inverting amplifier has a 180 degree phase shift.2) The op-amp output resistance Ro is usually insignificant compared to R3 and so it can be assumed to be zero. A phase-shift oscillator can also be designed with the resistors and capacitors interchanged in figure 9. we can determine the phase and gain of VA with respect to Vo as a function of the resistor and capacitor values.1) With some practice.1 for V2 . resulting in a net zero phase shift. The phase shift is accomplished by the bridge. The next The output voltage VA of the network is solved by first solving equation 9. clearly. because they use more components than strictly necessary to achieve the desired phase shift. They are fairly simple to design. The amplifier. The series arm of the bridge causes a phase lead.2 Wein-Bridge Oscillators Wein bridge oscillators also use Rs and Cs to cause a phase shift. consider using Maple or one of the other equation solvers.) We then solve for the complex gain from which gain magnitude and the phase shift are determined as a function of frequency.3. 9.

2 Resonant Oscillators Resonant oscillators use a resonant circuit to achieve a very large change in gain as a function of frequency. 9.2. coupled inductors are used. Again.1 Resonant Circuits Inductors and capacitors can be connected in series and parallel combinations. Frequently.2. . 9. And again.9. RESONANT OSCILLATORS 91 R A C Vo R C Figure 9. this oscillator is useful up to frequencies of about 1 MHz. This is the most common circuit for low frequency oscillators. This will also show you the gain that is necessary to sustain oscillation.4: A basic Wein bridge oscillator. we must understand resonant circuits. 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. we have not shown how to implement the amplitude-dependent gain required. These circuits consist of inductors and capacitors in both series and parallel combinations. Each topology has its own characteristics. To understand the fundamentals of these oscillators.

its bandwidth at its resonant frequency. Now. assuming that the voltage amplitude of the driving signal is independent of both frequency and the connected resistance. Indeed. the Q is Q= ωo L Ro + Rs + RL (9. In this circuit. making the circuit less frequency selective. there are losses in any circuit. and thereby increase bandwidth. or. This occurs for 1 ωC which implies that the resonant frequency ωo is ωL = ωo = √ 1 LC (9. This is usually desirable in tuned circuits (within reason). equivalently. A resonant circuit consisting of a series-connected inductor and capacitor has an impedance Zs given by Zs = jωL + 1 jωC (9. This can be expressed as Qs = ωL Rs (9. this resistance can be modeled as being in series with the inductor.) 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. 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. Therefore. Zs is zero. and it should drive a low-resistance load which measures current (ideally a load with a zero ohm resistance). Thus.5. Lets look at an example.92 Series Resonance CHAPTER 9. The low input impedance at resonance means that the current through the circuit will peak at resonance. so the impedance cannot be exactly zero. (You should derive the equation for the impedance of a series-resonant R − L − C circuit.3) When the two terms on the right have equal magnitude. the inductor is a coil of wire which has a resistance. SINUSOIDAL OSCILLATORS We define the resonant frequency of a circuit as that frequency for which the complex component of the impedance is zero. the impedance at resonance is really this series resistance Rs . Remember that any resistance in series with the L − C portion of the circuit will lower circuit Q. For series resonant circuits. Circuits with higher Q have narrower bandwidth and so they are more frequency selective.7) .4) (9.6) The Q is a measure of the ‘sharpness’ of tuning of the circuit. 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).5) Clearly. 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. Consider the resonant circuit of figure 9. This resistance is usually quite small.

9.2. RESONANT OSCILLATORS

93

R

o

Rs

L

C

I

L

inductor

RL

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 ZP =
1 jωL jωC

jωL +

1 jωC

.

(9.8)

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 ωL = Again, the resonant frequency is just ωo = √ 1 LC (9.10) 1 . ωC (9.9)

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 QP = RP ωo L (9.11)

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 inductor

L

C

RL

V

o

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 QP = Ro ||RP ||RL ωo L (9.12)

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 ip is = m m 2 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

o

R

losses

n

: m 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. (Transformers 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 RL = n m
2

RL .

(9.14)

We can now replace the transformer with a resistance equal to RL and calculate the total connected resistance RT as RT = Ro + Rlosses + RL . 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 LP = 4RT . ωm (9.15)

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
R o R

CHAPTER 9. SINUSOIDAL OSCILLATORS
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 n−m L m C

Vo

a

A C1 V A C2 L

Vo

b
Figure 9.9: Oscillators using resonant circuits. a. Hartley oscillator. b. Colpitts oscillator.

we get Re = = C1 + C2 2 RA C1 CT 2 RA C2 (9. The second approach to seeing how a capacitive tap can transform impedances is quite simple. at resonance ‘looks like’ a resistance Re . we can consider this point on the inductor to be the ‘tap’ at which the output is connected. making use of the passive nature of the tank circuit. untapped inductor and two capacitors in series to form a tank circuit. which.4 Colpitts Oscillator The Colpitts oscillator is shown in figure 9. then there must be a point ‘in’ the inductor at which the voltage VA is to be found. Equating these. consider the following. Thus. Satisfy yourself that the capacitance values behave as the reciprocal of the turns in the Hartley oscillator.9b. Since Vo is presented across the entire tank circuit. but this time we have used a ‘capacitive tap’. using only fundamental concepts. We can see how this works in two ways.16) Now if VA is a fraction of Vo . Again. and using the expression for VA as a function of C1 .98 CHAPTER 9. after rearranging. (They are in parallel across a common voltage. this must be true. This voltage is presented across the load resistance.17) from which. . and so all the impedance transformation characteristics of the tapped coil must apply. For the first way to see this. The Colpitts oscillator uses a single. we have ‘tapped’ the tank output across only part of the tank circuit to perform impedance transformation. C2 and Vo .2. It is also an oscillator used to generate sine waves at frequencies up to about 100 MHz or more. we get 2 VA V2 = o RA Re (9. But the power delivered to the tank must be equal to the power delivered by the tank to the load since the tank does 2 not dissipate any power and it is not a power source. we argue that the voltage VA is a fraction of Vo . Thus. the load power must be VA /RA where RA is the amplifier input resistance. the power delivered to the tank by the amplifier is just Vo2 /Re .) Thus. impedance transformation occurs with a capacitive tap. SINUSOIDAL OSCILLATORS 9. Again. We know that the capacitors form a capacitive voltage divider since the voltage VA is VA = Vo = 1 sC2 1 sC1 + 1 sC2 C1 C1 + C2 (9.18) where CT is the equivalent capacitance of the series combination of C1 and C2 .

you need only consider the resistive components of the amplifier impedances. 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. Its not that difficult.2. Try it and see. you select values for L and C which.9. result in the oscillating frequency that you desire. together with the amplifier reactances. RESONANT OSCILLATORS 99 In all discussions of oscillators to this point. Thus. we should be able to implement oscillators with series-resonant circuits. There are many other forms of oscillator. Clearly.

SINUSOIDAL OSCILLATORS .100 CHAPTER 9.

Phototransistors use light to control collector current. 1/ 2 amplitude results in 1/2 power. The ‘receiver angle’ for these sensors is about 20 degrees (±10 degrees of the nominal optical axis) to the ‘half power’ points1 . sheet for these devices for more information on the receiver angle and the wavelength sensitivity. See the spec. Some phototransistors also have a base lead with which you can bias the phototransistor. They are √ also the -3db points since at the -3db √ points. but you should know about them before you make that decision. and so it can be difficult to distinguish from noise. Sources of variation include the 120 Hz ripple due to room lights The ‘half power’ points are the points at which the power is one half of the maximum power. These points are referred to as the half power points because light is measured in terms of power.1 Optical Sensing Your kit contains a number of phototransistors which are equipped with lenses.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. the amplitude is 1/ 2 of the mid-band gain. 10. Since power is proportional to amplitude squared. You can think of the light incident on the phototransistor as a form of base current. 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. The change in collector current for a moderate change in light level is usually quite small. Care must be taken to minimize noise when designing circuits for processing phototransistor (and other sensor) signals. 1 101 . You may decide that some of the sensing techniques may not be suitable for your strategy. A major difficulty with photosensing is the variation in ambient light from place to place and with respect to time.

and changes in the light level from place to place. the phototransistor generates a current. however. Usually. if you are trying to detect a black surface marking against a lighter background. (Can you see how this works? Use superposition. you must find a way to make the signal due to surface markings easily detectable in spite of the background variations in illumination. For reliable detection performance.1.1: A simple phototransistor circuit. we must compensate for this ‘dark current’. changes due to objects moving in the room casting shadows. A simple phototransistor circuit is shown in figure 10. not 60 Hz?). . finding lights.102 CHAPTER 10. 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. When you do this. are sensitive light level and so they are sensitive to these changes. changes in average illumination through the day in rooms with large exterior windows. − + V o (why is it 120 Hz. Optical sensing systems. the op-amp is a current-to-voltage converter. For example. with respect to the phototransistor. since. While these changes may not appear large to you (if you can perceive them at all). 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. Potentiometer R1 and resistor R2 allow the output voltage corresponding to the zero-light condition to be set to any arbitrary value. etc. A phototransistor will output a current even when there is no light shining on it. The op-amp converts this current to a voltage.) The optical sensors can be used for sensing changes in colour and/or surface reflectance. you usually find that the signal that you want is superimposed or ‘riding on’ a varying ‘baseline’. SENSING THE ENVIRONMENT VCC R3 VCC R1 R2 −V CC Figure 10. finding shadows. however. In this circuit.

and does not run into it. etc. To use whiskers effectively. These two whiskers (if properly implemented) will ensure that the vehicle follows the wall. does not stray from it. the vehicle should turn left. Consider whiskers mounted on a vehicle that is intended to follow a wall on the right hand side. essentially to make the material part of the circuit. the vehicle should go straight. A shorter whisker is used to ensure that the vehicle does not get too close to the wall.2. Tactile sensors can be very easy to implement. the vehicle should go straight. but its reliability is likely to be poor because it depends on sufficient pressure . but may not be overly reliable. A short and a long whisker can be used to control the position of an object relative to the whiskers. When significantly compressed. A simple method is to measure the conductivity. 10. elastic. LVDT (you can look this up). a long whisker can be used to detect the presence of the wall. This sensing is useful for detecting the presence of objects or obstacles. this resistance can drop to below 10 kilohms.2 Tactile Sensing Tactile (or touch) sensing can be performed with ‘whiskers’ and switches. it is cheap. If the shorter whisker is activated. and significant nonlinearity. This can be accomplished with a spring-loaded switch in which the spring is calibrated. When very lightly compressed. fatigue.1 Sensing Conductive Materials Conductivity There are many ways to sense the presence of conductive materials. If it is not activated. This is certainly cheap.4 10. and suffers from hysteresis. If the whisker does not sense the wall. A crude direct force sensor employs a piece of the conductive foam used for protecting integrated circuits from electrostatic discharge. the vehicle should turn right. moderately robust and readily available.3 Force Sensing In some applications it may be appropriate to measure force. In this case.10.4. 10. If it senses the wall. you need several of them of differing lengths. It can also be accomplished with a position sensor (capacitive.) and a mechanical component that converts force to a position change (spring. etc). inductive. The sensor is mounted so that the force to be measured will compress the foam by squeezing the electrodes closer together. the resistance of the sensor is in the order of several hundred kilohms. While this sensor is very crude. TACTILE SENSING 103 10. The sensor is made by placing the foam between two metal electrodes.

c. moderately thick material of significant size. This is equivalent to coupling a resistance into the tank circuit. then energy will be transferred to the material. then the voltage Vo is just Vexc R/(Rs + R). and if we bring this coil close to a conductive. At resonance. the a. 10. current of sufficiently high frequency flowing in it. voltage Vo across the tank circuit will be essentially Vexc . If we have a coil with an a. voltage source C L V o R parallel resonant circuit loosely−coupled resistance of conductive material Figure 10. If this resistance is R. This is because the time-varying magnetic field of the coil will cause ‘eddy currents’ to flow in the conductive material. the conductive material acts as a short-circuited single-turn winding coupled loosely to the coils. . Now lets suppose that the coil is part of a parallel resonant circuit or ‘tank’ circuit as shown in figure 10.2 Eddy Currents A much more complex method is to couple the conductive material into a tuned circuit. Resistances should be selected to make this change in voltage readily detectable. When the coil of the tank circuit is brought near a conductive material. and so there is a transfer of energy from the coil to the material.c. making it an R − L − C circuit. energy is transferred to the material.2. however. We drive the tank circuit with a source with a fairly high source impedance because tank circuits present very high impedance at resonance.4. Because the material is not infinitely conductive. the coupled energy is dissipated.104 CHAPTER 10. This approach is much less sensitive to alignment and pressure is not necessary.c. SENSING THE ENVIRONMENT Rs Vexc a. It requires careful design. Thus. for a good contact and accurate alignment of the sensing probes. the capacitive and inductive reactances cancel.2: The concept behind a resonant metal sensor. Lets explore the underlying concept. leaving just the coupled resistance. In essence.

and so the acceleration can be determined. This can be useful to determine if the motor is stalled or heavily loaded.5. increase the reference mass or use a spring with a lower spring rate. But F is proportional to the amount that the force element is extended or compressed. and might be used for controlling a drive motor for a vehicle or gripper. and this can be measured with the position sensor.3.5 Acceleration Sensing To sense acceleration. then a = F/m.4. you need to use an accelerometer. Since F = ma. 10. 10. . 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. 10. 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. The mass m is known. a reference mass and a force element such as a spring or an elastic. A simple method of determining motor current is to measure the voltage drop across a reference resistor. You can make a crude one with a force sensor and a reference mass. ACCELERATION SENSING 105 electrodes gap metal to detect Figure 10. For more sensitivity. You can also use a position sensor.6 Current Sensing Sensing motor armature current gives an indication of the load on the motor.3: A capacitance probe. An example sensor configuration is shown in figure 10. You want to make the reference resistor very small so that there is a very small drop across it.10.3 Capacitance Another technique for sensing a conductive material is to sense a capacitance change. A large drop will dissipate power that is better applied to the motor.

f.106 CHAPTER 10. 2 (10. Note that the addition of the resistor will raise the required breakdown voltage (maximum permissible voltage) of the MOSFET or other switching element. If the mechanical time constant of the motor is large compared to the electrical time constant due to armature inductance and resistance. this current will be the blocked rotor current. etc. you can determine the armature current. The problem with using the back e. This means that the motor cannot run at maximum speed (the motor driver constantly on) if you must measure its speed. magnetic saturation-based devices. however.5. then measurement of the voltage across the series resistor after a known time (one electrical time constant. 10. . 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.m. Thus. Another approach is to measure the commutator noise. then the motor will be essentially stationary when the current reaches its maximum magnitude. Another way to sense motor currents might be to measure the energy dumped in the freewheeling diode circuit when the motor is shut off. of the motor indicates the motor speed.2) Thus. You might want to look into what is involved in these techniques if you think that current sensing is an option. The energy E stored in an inductor is 1 E = Li2 . For direct currents. every time that you start the motor.f. Control strategies that sense current should be designed to account for this behaviour. This energy is related to the voltage vR across the series resistor by ER = 1 R 2 vR (t)dt (10. SENSING THE ENVIRONMENT Remember that the inertia of the motor prevents it from starting instantaneously.6 and discussed in 4. There are many other methods of sensing current.1) This energy must be released to the resistor in series with the freewheeling diode. current-sensing relays. If you are merely trying to detect excessive current. The current will decrease as the motor begins to turn. Because the motor is stationary.7 Sensing Speed As shown in figure 4. Measurement of this motor voltage must be made after the energy stored in the motor inductance has been dumped. If you monitor the voltage across the motor with enough sensitivity. by measuring vR and computing the integral above. there are Hall effect devices. say) should permit you to determine if motor current is too high.m. This is easier if there is a resistor in series with the freewheeling diode as in figure 4. the back e.6 because you can measure the voltage across the resistor. the peak current will be the blocked rotor current. For alternating currents you can use current transformers as well as the direct current methods. you will see what appears to be a noisy square wave.

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

SENSING THE ENVIRONMENT .108 CHAPTER 10.

there are other types of noise. we must first draw the frequency response on a linear-linear graph instead of the more frequently used log-log graph. 109 . 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. but we will not concern ourselves with their specifics here. We then draw a rectangle with the same passband gain and with the same area as the frequency response.1). The width of the rectangle is the noise-equivalent bandwidth. In addition. This is shown in figure 11.1b. The frequency response will look a little weird when drawn this way (see figure 11.2 Thermal of Johnson Noise Thermal.1 Noise-Equivalent Bandwidth The noise-equivalent bandwidth can be thought of as the bandwidth of the ‘filter’ through which the noise is passed. There are many types of 1/f noise. Thermal noise is a ‘white’ noise since its amplitude is independent of frequency. noise is generated thermally as the first name implies. 11. 11.Chapter 11 Noise and Interference We will greatly simplify the discussion by classifying noise as either ‘thermal’ noise or ‘shot’ noise. A concept that we must understand first of all is the noise-equivalent bandwidth. or Johnson. but these two types predominate in our analysis. It is a noise voltage which is generated by the ‘friction’ of current flow in resistive elements. How do we determine the noise-equivalent bandwidth for a system? To determine this bandwidth.

2) where q is the charge on an electron. The noise voltage en is given by √ en = 4kT RB (11. R is the resistance in ohms that is generating the noise. and B is again the noise-equivalent bandwidth. the noise voltage is proportional to the square root of both resistance and noise-equivalent bandwidth. . we make the bandwidth as small as possible as long as we do not attenuate the desired signal. and so it is also ‘white’.1: Determining the noise-equivalent bandwidth of a low-pass system.1) where k is Boltzmann’s constant (1. NOISE AND INTERFERENCE B a. Only resistive terms can generate it. A good strategy for the design of a low-noise system is to keep resistance values and bandwidth small. 11. T is the absolute temperature in degrees Kelvin.110 CHAPTER 11. This noise is also independent of frequency. b. and B is the noise-equivalent bandwidth in hertz. Figure 11. Ideal inductors and capacitors do not generate this noise.3 Shot Noise Shot noise is due to the discrete nature of current flow in semiconductor p-n junctions.38 × 10−23 ). Idc is the dc current flowing through the device under consideration. The noise current in is given by in = 2qIdc B (11. Thus. Ideally.

Since noise is a function of measurement bandwidth. junctions and any other sources to just two sources.2 will be von = Ave = A een Zi Zi + R s 2 + eRs Zi R s + Zi 2 + (ien (Rs Zi ))2 . how do we combine noise sources? Since the noise sources are uncorrelated. 11. we compute the output as the square root of the sum of the squared outputs due to each source alone. OTHER NOISE SOURCES 111 source Rs e en noiseless circuit Vo A Vs i en Z i Figure 11. would result in the same noise at the output.4. we see that the output noise voltage von of the circuit in figure 11. but the power spectra of these sources generally exhibit a ‘1/f’ dependence on frequency (at least to a point). You can see that this is really a superposition of noise power.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. 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. This approach is really quite helpful as it reduces the noise contributions of all the resistances. (11.2: Modeling the equivalent input noise of a circuit. These are the noise voltage and current which. Note that the noiseless circuit must have the same bandwidth and input impedance. if connected to a noiseless circuit which was otherwise identical to the circuit under consideration.11.3) . 11.4 Other Noise Sources There are other types of noise. Now. and the source must have the same impedance for us to be able to model noise this way.

we find that it is just SN R = Avs von vs = ve (11. but the noise power does increase with the square root of bandwidth. Thus. NOISE AND INTERFERENCE The second term on the right-hand side is due to the thermal noise generated by the source resistance. at the output. but cannot be described as a function of time.4) 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’.6) . the signal to noise ratio or SNR per unit bandwidth. 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. all other things being equal. as v(t) = v (t) + ζt ˆ (11. 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 .7 Averaging and Filtering Low-Amplitude.6 Signal to Noise Ratio If we compute the ‘spot signal to noise ratio’. this would be used instead of the source resistance. This variation is expressed by the standard deviation. When computing the overall signal to noise ratio. 11. The signal to noise ratio is defined as SN R = deterministic component of signal amplitude standard deviation of signal variation (11. a wider bandwidth system will always be noisier than a narrow bandwidth system. If the source had a complex impedance. 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. we must remember that the signal power does not change as a function of the measurement bandwidth (assuming that the measurement bandwidth is always at least sufficient to pass the signal). of course. 11.112 CHAPTER 11.5) where we have expressed the noise term as ζt to denote the fact that the random component changes with time.

11) into equation 11. 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.7. it follows that E{ζti ζtj } = 0 (11. we could compute the signal to noise ratio of va (t). In each of the v(ti ) the deterministic components would be the same. AVERAGING AND FILTERING LOW-AMPLITUDE.10) = N v(t). Thus.13) . With this in mind.9) If we were to define our desired signal va (t) as the sum of N signals v(ti ). σv (11. Since we have assumed that the sequence of noise samples is uncorrelated. The new deterministic component va (t) is just the expectation of va (t) given by ˆ va (t) = E{va (t)} ˆ N = E i=1 (ˆ(ti ) + ζti ) v (11.7. but the random components would differ. σa = E{(va (t) − va (t))2 } ˆ 2 = E{va (t) + va (t) − 2va (t)ˆa (t)} ˆ2 v 2 2 2 2 2 = N v (t) + N E{ζt } + N v (t) − 2N 2 v 2 (t) ˆ ˆ ˆ = E    N 2 N (ˆ(ti ) + ζti ) v i=1 + N 2 v 2 (t) − 2 ˆ i=1 (ˆ(ti ) + ζti ) N v (ti ) v ˆ    = N E{ζt2 } (11.11. σv = E{(v(t) − v (t))2 } ˆ = E{v 2 (t) + v 2 (t) − 2v(t)ˆ(t)} ˆ v 2 2 = E{ˆ (t) + ζt + 2ˆ(t)ζt + v 2 (t) − 2(ˆ2 (t) + ζt )ˆ(t)} v v ˆ v v (11.7 results in the standard deviation of the averaged signal.7) But E{ˆ(t)ζ} = 0 since the noise is uncorrelated with the noiseless signal.8) as might be expected. The new standard deviation σa is computed by substituting N va (t) = i=1 N (v(ti ) + ζti ) N = i=1 v(ti ) + i=1 ζti (11.12) for all i = j. substituting va (t) into equation 11. or. and so this reduces v to σv = E{ζ 2 } (11. the signal to noise ratio SN Rv is just SN Rv = v (t) ˆ .

A classic culprit is digital Frequency shifting requires modulation. are all sources of EMI/RFI. by selecting an appropriate filter.2. we need a non-linear element. NOISE AND INTERFERENCE Thus. any radio transmitters. it can be useful to shift the frequency at which you are making your measurements into a region with low interference. We will see one way to shift the frequency of sensor outputs in subsection 12. The signal is amplified. and then shifted to a frequency at which it is easily processed. Radio stations. then another possibility is to shift the signal to a frequency in which the electronics noise amplitude is small1 . 1 .8 Non-White Noise The previous section suggests that the SNR can be improved by averaging or filtering. to the rest of your circuitry. Broad-spectrum interference (such as automobile ignition noise) tends to have a 1/f characteristic. poor fluorescent light ballast transforms. cell phones. either radiated or conducted. it has a large 1/f component). What would happen with a band-pass function? A high-pass function?) 11. Clearly. one form of which is multiplication. . The electromagnetic interference/radio-frequency interference (called EMI/RFI) generated by your motor brushes is a classic form of interference. . Interference can also arise when one part of your circuit generates signals. you would also try to avoid the frequencies of local radio and television broadcasters as well as other radio sources. (How much can we improve it? What controls the amount of improvement? Averaging is a low-pass function. which interfere with another portion of the circuit. the signal to noise ratio improves by N . its just interference. (Why?) But what is signal averaging? Not surprisingly. it is a form of filtering. Even though you may use this signal for measuring motor speed. automobile ignition systems. 11. the signal to noise ratio SN Ra of the sum of signals is just SN Ra N 2 v 2 (t) ˆ = N E{ζt2 } √ = N SN Rv (11. If your problem is electronics noise and this noise is not white (for instance. Thus. Note that we get the same performance improvement by averaging the signals as well as adding them.9 Interference Interference can come from many sources. . M >> N point sequence look like?) Thus. (What does the Fourier transform of a N -point averaging function in a M. we should be able to improve the SNR. For any frequency shifting to occur.3.114 CHAPTER 11.14) √ We see that by adding N signals.

Suppose that parallel to wire A is wire B. A large alternating current flowing in one of the wires will result in a voltage induced in the second wire. 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. and sources zero current whenever the gate output is high. How do you fix this? • Don’t make parallel wire runs if you can help it. 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. and also a function of the length over which the wires are parallel and their proximity. probably a function of frequency (there will be no induced voltage if the current is a DC current). which is connected at one end to an ideal voltage source.10 Simple Wiring Precautions When two wires are placed parallel to each other and close together. Suppose further that this gate changes state in 10 nS (a rather slow gate).) The voltage induced in wire B due to transformer action will be given by VB = M diA dt ∆iA ≈ M ∆t 0. 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. Mutual inductances of 2 microhenries and greater are easily created with quite short parallel wire runs. or vice versa. grounding and decoupling. However.15) We see from this that a mutual inductance of 2 microhenries will result in 2 volts being induced in wire B. How big is the voltage? Clearly it is a function of the current amplitude. This is sufficient to change a logic low input to the gate to a logic high. and at the other to the input of a gate which has an input resistance of 1 megohm (this is not at all uncommon. 11. This form of interference can also be handled with proper design. Note that we have not even considered the effects of capacitive coupling.10.11. The best approach to dealing with interference is to avoid it with adequate shielding.01 ≈ M 1 × 10−8 (11. a few simple ideas will certainly help you. SIMPLE WIRING PRECAUTIONS 115 logic creating noise on the power supply rails which is then picked up by other circuits. How can this affect our design? Consider the following.

resulting in degraded performance. this power supply ‘noise’ (its really interference) will be coupled into the output of these other circuits. Frequently. Since there must always be some non-zero impedance to the power supply rail due to its inductance and resistance.116 CHAPTER 11. (Think about this. It crops up in electronics very frequently. changes the state of a logic gate. Secondly. but primarily the 2 In transformer design. and the impedance looking into wire B back toward the circuit of wire A would have a large component due to the transformer itself2 . The capacitors are small because larger capacitors tend to have larger lead inductance and larger internal resistance. Typical values would be 0. .11 Decoupling Capacitors When a circuit demands current from the power supply (such as when it turns on a motor. Since these decoupling capacitors are electrically close to each chip. With these. This will cause a change in the power supply voltage seen by the rest of the circuit. • Keep low-amplitude signals as far as possible from high-amplitude signals. if we loaded wire B with a low-valued resistance to ground. • Use signal sources and inputs with the lowest impedances possible commensurate with your design requirements. 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. it may cause these other circuits to malfunction. This is just the problem that we are trying to fix!. but large enough to store sufficient charge to supply the integrated circuit until the power supply can compensate for the increased current requirements. more current must flow in the power supply rail. or drives a load resistance). 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 chips do not ‘see’ the impedance of the power supply and its power distribution wiring. make sure that all power supply leads are as short and fat as possible. The capacitors must be small enough to have small internal inductance and resistance. there will be a voltage drop when the current is demanded. How do we stop this? Firstly. the induced voltage in wire B would be attenuated by the impedance divider consisting of this resistance and the transformer impedance. This minimizes both the resistance and the inductance. Thus. Look up ‘4-20mA current loop’ signal transmitters. Its coupling coefficient is poor. the signal is carried by the current flowing in the connecting wiring. especially for long wire runs. connect decoupling capacitors from the power supply leads to ground as close to your integrated circuits as possible. we try to minimize this impedance. NOISE AND INTERFERENCE • Don’t have wires carrying high current in close proximity to wires carrying low voltage signals.1 microfarad to 0. If this change is sufficiently great. Why is this good?) 11.01 microfarad.

DECOUPLING CAPACITORS 117 impedance of the capacitor to ground. .11. The current required by each chip is supplied by its associated coupling capacitor in the short term. the voltage fluctuations on the power supply rails are minimized and the interference with the rest of the circuit is reduced. and by the power supply in the longer term.11. Thus.

118 CHAPTER 11. NOISE AND INTERFERENCE .

Chapter 12 Processing Low-Amplitude Signals The signals from sensors are frequently of low amplitude. 119 . In the case of a sensing system for surface markings (which are localized in space). One sensor ‘looks for’ the surface marking and the other looks at the background. if we want to extract the maximum amount of information possible from our sensor measurements. and so they are subject to being corrupted by noise and interference. we need to gain an understanding of noise. or in some other domain which is easily handled. the two sensors must be looking at areas with very similar overall illumination.1: Differential processing of space-localized signals. In our example. This technique can be signal + background signal background Figure 12. the output is essentially zero until a mark is present. two sensors are required. Clearly. 12. we must minimize the effects of these disturbances. This technique is based on the concept that the signal is well localized in time. in space. With proper adjustment.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. we see the basic concept underlying this idea. In figure 12. To understand how to do this. in frequency.1. of interference. and of sensor characteristics.

however. We will state.2: Differential processing of time-localized signals. Lets assume that we have a noisy signal containing a 1 volt peakto-peak and noise with a standard deviation of 0. PROCESSING LOW-AMPLITUDE SIGNALS signal signal averager Figure 12. meaning that the time at which the signal occurs is well defined. so that either of these solutions might be appropriate for finding surface markings. then the signal may be detected even in the presence of variations in the background level. Suffice it to say that no system will perfectly detect the signal of interest and nothing else. the probability of false rejection and the probability of correct rejection. we will detect a pulse. only one sensor is required and we assume that the signal is well localized in time. In this case. When the detection circuit is preceded by one of the foregoing circuits. Lets assume that we will use a simple comparison with a threshold to detect the signal. Care must be taken to ensure that you detect all the signals and only the signals. These are defined as follows: We will not go into great detail here (there are many books written on the subject). that the goal of a signal detection system is to minimize the probability of false detection simultaneously with minimizing the probability of false rejection.120 signal + background CHAPTER 12. 12. Lets further assume that we don’t know how long the . we talk about the probability of false detection. thereby increasing the ‘signal to background’ ratio by a factor of 10.5 volts. the probability of correct detection. Remember that speed of the sensor in space can be used to convert space to time (think about this). compare it to a threshold using a comparator. Whenever the signal exceeds the threshold. probability probability probability probability of of of of correct detection detecting the signal when it is present false detection detecting a signal when it is not present correct rejection not detecting a signal when it is not present false rejection not detecting a signal when it is present used to easily attenuate the signal from the background by a factor of 10.2 Detecting Signals We have already seen a common method of detecting a signal. Another approach is shown in figure 12. In signal detection theory.2. Lets look at an example.

pulses will be.5 Improving performance performance corner performance obtained of no attempt is made to separate the signal from noise prior to detection. the less the chance that we might inadvertently miss a pulse. but the greater the chance that we will detect noise as a pulse. The likelihood of missing a pulse goes up. If we were to modify the system by adding a filter to suppress the noise and enhance the signal. If we plot the probability of false detection against the probability of correct detection for all values of the threshold. the probability of false detection decreases (this is good) but the probability of detection also decreases (this is bad). DETECTING SIGNALS 121 Probability of False Detection 0 1.5 1.3. . but the likelihood of detecting noise as a pulse goes down. This curve is called the Receiver Operating Characteristic (ROC) curve.12. we might have system performance represented by curve B in the figure. the opposite will occur.0 C Probability of Correct Detection B A 0. Thus we see that as we raise the threshold. 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 0 Figure 12. we get a curve such as curve A in figure 12.0 increasing threshold 0. the probability of correct detection increases but so does the probability of false detection. The ROC curve shows that as the threshold is decreased.3: Receiver Operating Characteristic curves. It should be clear that the lower the threshold.2. If we raise the threshold.

but under certain circumstances. To achieve the optimum performance. detecting thin spots in the steel for submarines. and detecting cancer tumors in medical images. Its output is proportional to carrier amplitude also. current flows to charge capacitor C2 . Examples include earthquake prediction. It is too expensive for the retailer to carry sufficient stock to ensure that he/she never runs out. To detect the signal. 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. a system designer first optimizes his system based on the ROC curves. you must have an idea of how the information is carried by the carrier. and the information to be carried will be called the signal.3 Detecting AC Signals When discussing carrying information on AC voltages or currents. the AC voltage or current will be called the carrier. We will look briefly at two detectors. the capacitor slowly . we see that better systems have performance curves which pass closer to the ‘performance corner’. The second detector is called a synchronous detector (and there are many types of these). Is our signal encoded by the carrier amplitude. Resistor R1 and capacitor C1 are merely used to remove any DC level. Thus our task is to separate the signal from the carrier. The detector itself has only three parts. we must be clear about our terms. When the AC input is not enough to forward bias the diode. In other applications. 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. and then selects a threshold suitable for the application.4). The output of the first detector. it can also be made to recover carrier phase information. 12.1 Envelope Detector This is the simplest of detectors (figure 12. In the following. An example is predicting the stock necessary in retail sales. PROCESSING LOW-AMPLITUDE SIGNALS detection. as in AM broadcast-band radio transmissions? Does the frequency carry the signal as in FM transmission? What about the phase. follows the amplitude of the carrier. raising its voltage. called an envelope detector.3. it may be crucial to detect all events even if this means that we will have a relatively high false detection probability. This is useful we attempted to detect the signal carried by a carrier which was quite close in frequency to other carriers (Why?.122 CHAPTER 12. 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. 12. Thus. When an input signal forward biases the diode. In some applications.

3. 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. This circuit works as follows. the switch signal is exactly in phase with the input. 12. The low-pass filter will find the average of the switch output. but considerably shorter than the time between the fluctuations in signal amplitude which carry the desired information.12. the input to the low-pass filter will be either zero or positive. Now. the switch is operated 90 degrees out of phase with the input signal. The resistor merely ensures that the input to the low-pass filter is zero when the switch is open. How can we be sure of this? Consider two scenarios. Assume that the filter just computes the average of its input every cycle of the carrier. The concept is outlined in figure 12. We assume that we know the frequency and phase of the input signal. and also.5a. For an AM broadcast-band a radio. and can control the switch so that it is closed only when the input is positive. and the information transmitted (voice and music) contains frequencies no higher than 20 KHz. If we select the filter so that it severely attenuates frequencies at the switching rate.4: An envelope detector. but it is cheap. and does work. which is the rectified input signal. what will it be? Try to develop the math. The input is Vsig and the switch is operated by signal Vswitch .) With these assumptions. This detector is the basis of the crystal radio. if there is a phase shift of θ between the input signal and the switch signal. then the filter output will be merely the average value of its input. In the second scenario. In the first. It isn’t great.3. (we will see one way to do this shortly.2 Synchronous Detection Synchronous detection permits us to have the frequency of the carrier closer to the frequency of other carriers. DETECTING AC SIGNALS 123 C V sig 1 R 1 D V C 2 R out Figure 12. . this is not too tough because the carrier signal (the AC signal) is no less than about 0. we should be able to see that shift in the output. the frequency of the signal much closer to the carrier frequency. and so we have seen above what will happen. This is proportional to the amplitude of the input signal.5 MHz.

. b) A block diagram of a system.5: Synchronous detection. Figure 12. a) Conceptual model. PROCESSING LOW-AMPLITUDE SIGNALS Vsig Vswitch low−pass filter Vout a. AC excitation transducer output (the measurement) low−pass filter A1 −1 − + transducer Vout b.124 CHAPTER 12.

The sensor output will now contain the AC excitation signal modulated by the physical measurement that we wish to make. Thus. Thus.5b. lets see how we could use this in a sensor system.8. The are that 1. noise from the switch may be larger than the noise that you were trying to avoid. you will see that the output carrier frequency of the sensor is just the AC excitation frequency. In the figure. as promised in section 11.12. we have met the assumptions required for synchronous detection. What does amplifier A1 do. and 2. we use the AC excitation (which is also the carrier) to drive the switch. With care. indeed. be careful of two things. We also know the phase and frequency of the carrier. How would you accomplish this? Finally. the switch comparator. 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! . and its amplitude contains the signal frequencies. You may have to compensate for this. we have shifted the frequency of the signal.and interference-free part of the spectrum. 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. DETECTING AC SIGNALS 125 This detector can be improved by using the negative half of the input as well as the positive half. If you write the equations (always a good idea!).3. or both. If you use this technique. we can shift it to a relatively noise. Consider figure 12. the phase of the excitation may be shifted through either the transducer.

126 CHAPTER 12. PROCESSING LOW-AMPLITUDE SIGNALS .

This is a circuit that can provide large currents at a fixed voltage. Thus. We showed that negative feedback attempts to minimize the difference between the two inputs to the summing block. This is unacceptable in battery-operated systems in general.3) (13. 127 . a known voltage which fluctuates little with changes in the supplied voltage and the connected load. It can be quite difficult to design an adequate heat sink. This is exactly the concept that we want. Voltage regulators come in ‘linear’ and ‘switching’ flavours.1 Linear Voltage Regulators In concept. A voltage regulator is used to perform this task. An additional problem is that energy from the unregulated source is wasted. If we were to make the input a constant voltage. this power can be quite considerable. We first look at linear regulators. it attempts to make the output track the input. then the output would be constant.2) (13. independently of the input voltage. Most equipment requires wellconditioned power. 13. 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.1. stated another way. variable resistor in series with the load.Chapter 13 Voltage Regulators Power supplies are essential for any electronic equipment. Look at figure 6.4) (13.1) For high-power applications. a linear regulator is just a high-power. the power PD dissipated by our conceptual power resistor is just PD = (VB − VL )IL where VB = voltage of the unregulated supply VL = desired load voltage IL = load current (13.

consider a zener diode. We need an element to compute a difference and amplify that difference. We need a constant reference voltage for the input. and hence the energy wasted.2 Switching Regulators In concept. is low. and the constant reference voltage is the input.1. consider a resistive voltage divider. The circuit of a linear regulator will therefore look like figure 13. Lets look at implementing the negative feedback structure using linear components. The op-amp and emitter follower together form a high-current. The feedback resistor network plays the role of the H block in figure 6.128 CHAPTER 13.1. Thus.1. And finally. The circuit diagram is labeled with G and H denoting the corresponding blocks in figure 6.1. 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.1: A simple linear voltage regulator. We require some means of controlling a large current because the op-amp cannot do it. VOLTAGE REGULATORS Vcc Vcc − + −Vcc G Vo reference H Figure 13. high-gain op-amp. consider an op-amp. linear regulators are used for very low power applications so that the power dissipated by the regulator. we need feedback from the output to the input which scales the desired output voltage to the reference input. a low-pass filter is placed between the switch and . This takes the role of the summing block and the G block in figure 6. consider an emitter follower. To prevent the load from being switched on and off. 13. switching regulators use a switch to control the power flow to the load.

This is the power sent to the load.2. characteristics of the low-pass filter superimposed on the spectrum of VB .c. To keep efficiency high and minimize losses.2. b. component has significant magnitude after the low-pass filter. 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. the low-pass filter is implemented with inductors and capacitors only. the regulator itself will dissipate no power and so no energy is wasted. This is shown in figure 13. Note that only the d. We should look a little more carefully at the switch in figure 13.13. Since there is a 90 degree phase shift between current and voltage in both of these devices. SWITCHING REGULATORS switch period T duty cycle D unregulated supply V B 129 load a A low−pass filter characteristic spectrum of V B fo b 10 fo f Figure 13.2: a. the load. Conceptual switching regulator. term is passed. no power will be dissipated by the filter. The -3db cutoff frequency of the filter is made much lower than the switching frequency so that only the d. In practice there is a little dissipation by the losses in the capacitors and coils. In theory therefore. In a practical application. We would find great .2.c. The expected efficiency of a switching regulator is very high since a switch does not dissipate any power either when open or closed.

difficulty implementing the switch as it is shown. You should try to determine how this circuit works. and so the combination of this diode and the MOSFET make up the single-pole.4: A Boost regulator. How can we come to this conclusion? Ask yourself what would happen if the control circuit caused the MOSFET to conduct continuously.2.4) provides an output voltage greater than the input voltage. we use the circuit of figure 13. What would happen if the MOSFET did not conduct at all? In the preceding regulator and the ones to follow.3. This regulator is a step-down regulator. When the power MOSFET turns off. and its minimum is zero. 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. 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. Note that the flyback inductor voltage adds to the unregulated input voltage. In this circuit. Other forms of regulator are possible. Its maximum output voltage is just the unregulated supply voltage. the inductor current will flow. Another form of regulator is the ‘buck-boost’ regulator which can provide an output either . VB will continue to go increasingly negative (very rapidly) until the diode is forward biased. The voltage drop across the diode will be small when it is conducting. VOLTAGE REGULATORS V B L V o C Control Circuit load Figure 13. double-throw switch of figure 13. Instead. unregulated supply L V o C Control Circuit load Figure 13. VB is greater than Vo and so the diode is not conducting.130 unregulated supply CHAPTER 13. when the P-channel power MOSFET is conducting.3: Practical step-down switching regulator. At this time. The ‘boost’ regulator (figure 13. sometimes referred to as a ‘buck’ regulator.

This regulator works somewhat differently from the previous ones. In the buck-boost regulator.8) (13. then the output voltage is Vo = VL t RL 2LT (13. Part of the price that you pay for this flexibility is that the output voltage is negative with respect to ground.13. the inductor current is iL = 1 VL (t)dt L Vunreg t = L (13. and t is the length of time that the switch is closed.5. Note that the output is due solely to the energy stored in the inductor. the energy per switch closure is (VL t)2 E= 2L and so the power output is Po = where 1/T is the switching frequency.5: A buck-boost regulator.9) (VL t)2 2LT (13.5) where L is the inductance and iL is the inductor current. this energy is dumped into the load.7) and this must equal Po (why is this so?). less than or greater than the input (figure 13.10) . Because the voltage drop across the MOSFET is essentially zero when it is conducting.2. Since the power PL delivered to load RL is PL = Vo2 RL (13.6) where VL is the inductor voltage. Thus. When the MOSFET turns off. energy is loaded into the inductor when the MOSFET is conducting. The energy stored while the MOSFET is conducting is 1 E = Li2 2 L (13. SWITCHING REGULATORS unregulated supply L Control Circuit C V o 131 load Figure 13. Vunreg is the unregulated supply voltage.

see a book on voltage regulator design. There are many other forms of switching regulator. VOLTAGE REGULATORS Thus. Some use transformers or coupled inductors to great advantage. For more information. enabling regulators with multiple outputs and permitting the designer to change the polarity of the output.132 CHAPTER 13. . the output voltage is a function of the load resistance. unlike the buck regulator.

Lets assume that we have a square wave. we can determine if the signal is really at 9 Hz or 11 Hz. (Why are these two sentences true? Explain it to yourself. The frequency measurement approach counts events (cycles) and so its resolution is limited by the discrete nature of the events in the signal. (This of course assumes that we cannot measure the fractional parts of a wave.Chapter 14 A Hodge-Podge of Ideas This chapter is not really a chapter at all. we can determine its frequency to arbitrarily high resolution. the resolution if the measurement increases with the number of cycles used in the measurement. Thus. 133 . 14.) However. we have a resolution of one cycle in 10. It is a collection of ideas on a wide variety of topics.) Note that there is another advantage to determining frequency by measuring the waveform period. then measuring period is not such a great way to do this. however. determining the waveform’s period is equivalent to determining its frequency if we want to compare the frequency with a fixed threshold. and we wish to determine its frequency. not by the signal. Clearly. If we measure frequency directly.1 Measuring Frequency Frequency can be measured in a number of ways. and so the resolution is limited by the measuring equipment. This assumption is valid since the ability to measure fractional parts suggest that the measurement technique is not based strictly on frequency measurement. limited only by system noise considerations. if we measure the period of the incoming waveform. but we cannot do better. The period-based measurement measures time. These two approaches represent fundamentally different concepts of measurement. which is a continuum. If we wish to have an output proportional to frequency. If we measure the number of positive-going (or negative-going) zero-crossings of a 10 Hz square wave for 1 second.

I it is of zero length.2 Pulse Accumulator Say that you want to count pulses. the basis for a pulse accumulator could be an integrator. Now. We have seen that the average output voltage of a rectangular wave is merely the peak output scaled by the duty cycle. then the output of the integrator will be a function of the number of pulses. however.134 CHAPTER 14. the average output voltage from this one-shot pulse generator will be t T −t where VP is the output voltage of the one-shot pulse generator. we will measure period of the signal. What can you do? Well. But what if we do want to measure frequency? Since period is just the reciprocal of frequency. A HODGE-PODGE OF IDEAS Lets assume for the moment that we wish to compare frequency of an incoming signal to a fixed threshold. (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. the output voltage will always be zero. Thus. it should be as long as possible. Lets further assume that the signal is a rectangular wave. 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. but strictly less than the minimum wave period possible. it must be sufficiently short that the pulse ends before being retriggered. We saw this in the pulse width modulator discussion for motor control. To do this. short duration t at every leading edge of the signal? Clearly. 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. 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. How do you select the width t of the one-shot’s output pulse? Clearly. If the signal consists of pulses of fixed amplitude and width. but you do not have any digital chips to do it with. Vo = VP (14. if the period of the signal is T . specifically pulse-width modulation to see. This assumption will not pose a problem as we have already seen ways to convert any signal to a rectangular signal. 14. Look in chapter 6. How can we do this? Other sections discuss the concepts and circuitry required.1) How do we get the average value of the one-shot’s output? Look at the section on motor control. Thus. first recognize that an integrator accumulates a signal. we might consider taking the reciprocal of the period measurement. we must condition the signal for use by the integrator. This can be done by the blocks .

4. In a practical application. Explain its operation to yourself. there are some very good reasons. 2. Consider these possibilities: 1.) Note that we must ensure that the input voltages are either zero or VL . we would need to account for the negation inherent in most integrator circuits. 14. you may not have any logic circuitry available. If the two comparator inputs are swapped.7 volts greater than the emitter voltage (for a NPN device). Figure 14.2. you don’t want the interfacing headaches between analog and logic. 5. (Do this for yourself to verify that it can be done. Clearly. then the output of this system will be nVP t. we can use a summing op-amp followed by a comparator which compares the sum to a fixed threshold. then NAND or NOR can be implemented. Lets consider an analog AND gate. First lets look at a simple . you have unused analog circuitry available (unused op-amps and comparators in multiop-amp and multi-comparator packages). then the comparator threshold can be selected to implement AND. If you have spare transistors but not spare op-amps or comparators. We note that the collector current is zero unless the base voltage is more than 0. How would we do that? This circuit is expensive in parts but it is conceptually easy.1: A pulse accumulator.1 If the one-shot multivibrator outputs a pulse of duration t and amplitude VP whenever it is triggered. If the input voltages are either zero or VL .3 Using Analog circuitry for Logic Operations Yuck! Why would you want to do this? Well. OR or majority logic. 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. What do the first two blocks do? in figure 14. as in figure 14. USING ANALOG CIRCUITRY FOR LOGIC OPERATIONS one−shot multivibrator 135 Vin schmitt trigger V o Figure 14. you have a perverse nature This list is not exhaustive.2b illustrates a simpler form of this logic circuit. and we need to be very careful of integrator drift.14. you can still implement logic functions.3. 3. look this up). These circuits are based on the concept that a transistor can perform a crude comparison.

How does it work? . Figure 14. majority logic. NAND and NOR functions.136 CHAPTER 14. OR. A less costly circuit. b. A HODGE-PODGE OF IDEAS R V V V R 1 R 2 R 3 − Vcc − + Vcc Vo −Vcc −Vcc V thresh + a. a. Vcc R R R V thresh − + V1 V2 V3 Vo −Vcc R b. By proper selection of the comparator inputs and the threshold. we can implement AND.2: Analog logic gates.

a. V cc V 1 V 2 V 3 D 1 Vo b. Figure 14.3: More analog logic gates. b.3. How do they work? What does diode D1 do in each circuit? . A logic NOR.14. A logic OR. USING ANALOG CIRCUITRY FOR LOGIC OPERATIONS 137 V cc V 1 V 2 V 3 Vo a.

etc. the transistor as turned on fully by the analog input signal with the result that it saturates. and so the base must be at 1.1 volts to generate a logic ‘1’ at the gate input. because each inversion will require one transistor. Designs which require that analog outputs be used to drive logic inputs are a different matter.8 volts to generate a logic ‘0’ at a gate input.7 volts above its emitter. Note that the input circuit is essentially the same. of course. Standard (TTL) logic levels require the low voltage VL < 0.2 volts or less.) 14. the transistor is off. and so the collector resistor sources the required input current to the logic gate. with the exception of the circuitry in the emitter of the NPN transistor. This results in the collector voltage being about 0. In this circuit.1 volts. Th simplest interface uses a transistor with a grounded emitter (14. Thus. The various logic families are designed to be able to drive a reasonable number of gates in the same family. (What is the expression for determining how high this voltage should be?) Now lets look at a NOR gate (figure 14. 74S. Now the transistor will be ‘on’ whenever its base is 0. although the numbers may differ. How would you implement AND and NAND functions with circuits like these? One option.8 volts and the high voltage VH > 2. Care must be taken to ensure that the gate inputs stay within the safe operating levels for the family. the analog circuitry must be able to source and sink the necessary currents at the required voltages if interfacing is to be reliable. Further.1 mA at a voltage greater than 2. however. This will be expensive in parts. also have similar drive requirements. you are . When the input voltage is too low. 74F. is to merely invert the inputs of the NOR gate to get the AND function. hence this is an OR gate.4 volts is a reasonable compromise. with the collector sinking significant current.7 volts. having the transistor turn on (and off) at 1. Lets assume that diode D1 is conducting regardless of whether or not the NPN transistor is ‘on’. Similarly.138 CHAPTER 14. and invert the inputs to the OR gate to get the NAND function. the driving circuit must be able to source 0.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. This will happen whenever a sufficiently high voltage is applied to any or all of the inputs.4). Is there a better(cheaper) way? (Hint: go back to the concepts of how to turn on a transistor and when a diode conducts. In this circuit.3b). When the transistor is ‘on’. Other popular logic families such as 74ALS.4 mA with a voltage less than 0. A HODGE-PODGE OF IDEAS NOR gate (figure 14. Both of these circuits could also be used to interface logic circuitry to analog circuitry.3a). The output of the first part of the circuit is used to drive a PNP inverter.4 volts to turn the transistor on. however. We should look further at the emitter circuit of the NPN transistor. This results in the transistor emitter being at a voltage of 0. 74AS. the output voltage is low. so interfacing considerations are minimal for designs employing one family only.

Some logic devices do not like to have slowly-changing inputs. . CONNECTING ANALOG OUTPUTS TO 7400-SERIES LOGIC Vcc 139 V in D1 logic gate Figure 14. Other circuits can be used.14. including comparators and schmitt triggers.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.4.