CSC 297 Robot Construction: Functional ICs

Functional Integrated Circuits

Introduction

Above the level of individual components, are functional integrated circuits. These are small-scale integrated circuits, typically employing a few dozen to a few hundred components designed to provide a specific, well characterized functionality. Examples include operational amplifiers, timing chips, discrete logic gates, motor controllers. Both analog and digital functionality is common as well as combinations. However, these circuits do not typically include large amounts of internal state, and hence are not generally considered "programmable" devices. When functional parameters are adjustable, it is commonly by means of external circuit components.

Single-chip functional circuits are mostly low power, with max output currents of tens of milliamps and output power of under one watt. Some "high power" devices in this class, especially motor drivers, can output a few watts, but generally any real power requires additional external amplification. Even driving an LED with an op amp or digital logic chip often requires a transistor switch on the back end of the circuit.

A huge variety of specialized functional integrated circuits are available for every application imaginable, including radio-frequency receivers, modulators, and amplifiers; audio frequency amplifiers and filters; time and frequency multiplexers; motor and other device drivers; and digital functions of all sorts. We describe here only a few of the best-known circuit types; ones that are particularly useful for the hardware end of robots.



Operational Amplifiers (Op-amps)

Operational amplifiers, in many ways, epitomize the concept of a functional IC. They were one of the first such circuits widely available, and can be used to robustly implement a wide variety of analog and digital functionality with the addition of a few external components. In particular, they can be used to implement accurate approximations of abstract devices such as linear amplifiers, analog arithmetic units, integrators, and a wide variety of linear filters, which require considerable complexity to implement from basic components. Because many of these abstracted devices can be easily analyzed mathematically, op amps are often used in introductory electronics courses to teach basic design principles.

Op-amp Symbol

The abstract model of an op amp is simply a differential amplifier with effectively infinite gain. Specifically, referring to the figure above, the difference of the voltages across a pair of inputs, V+ - V-, appears at the output Vout multiplied by a very large factor, but bounded by the input supply voltages VS+ and VS-. Experimentally, the output of an op-amp used in a so-called open configuration saturates near either the positive or negative supply, depending on tiny details of the inputs. The effective open-loop gain, if carefully measured near the point where the output flips, is usually above 100,000, and may be 1,000,000 or higher. In addition, the current drawn from the inputs is small, often 10 nano-amps or less, making the op-amp a high-input-impedance device.

Traditional op-amps are differential devices, meaning that they are not attached to any particular reference ground. In practice, there are usually limitations such as requiring that the input voltages not lie outside the range of the supply rails. Violating such constraints may result in damage to the device.

The canonical op-amp is the 741, a single-chip design that was introduced in 1968, and became fabulously successful. The circuit is still made today by several manufacturers, and is a de-facto standard against which other chips can be compared. The 20-transistor design is considered robust and elegant and is often encountered in textbooks as an example for teaching analog IC design principles. Data sheet for Texas Instruments LM741.

In application, op-amps are rarely used in an open-loop configuration, but with the output "fed back" to the inputs through various circuits. Their principle value lies in the fact that for non-saturated outputs, the voltage across the inputs can be taken to be essentially zero. Moreover, in many situations with output feedback, the op-amp behaves in a way that actively drives the input differential to zero. This fact can be used to write equations that accurately describe the behavior of the feedback configuration.

A very large number of clever op-amp circuits implementing useful analog functionality have been invented. You can find a number of them, along with corresponding mathematical models, by opening up any basic electronics textbook. A few basic ones useful in robotics are described below.

Wikipedia on op-amps

Selecting Op Amps

The underlying philosophy behind an operational amplifier is to eliminate the issue of having to match the specific hardware parameters to the application. In other words, an op-amp should be an op-amp. Within rather broad domains, this actually works, but as it is always possible to get out of the box, some considerations remain. Some of these are listed below.





Voltage Regulators

Voltage regulators do just what the name says. They regulate voltage. Usually the term refers to DC voltage regulation. They are important because the different sensors, actuators, and electronic circuits in a robot all require power, and usually several different voltages are needed.

For small robots, the most useful devices are what are termed switching voltage regulators. Supplying different voltages from a single power supply using resistive voltage dividers burns power continuously in the resistors. The supplied voltage also varies linearly with the current drawn, and reducing this effect requires lower R resistors, which burn more power in V2/R losses. For small, battery-powered devices, resistive voltage regulation is not generally practical for any component consuming more than a few milliwatts. Voltage regulation using transistors operating in the linear region is characterized by similar, though less severe, current * voltage resistive losses in the transistors. Switching voltage regulators get around this problem by sensing the voltage across the output, and switching current on and off rapidly to keep that voltage at a specified level. Since the transistor "switch" is either completely on or completely off, the current * voltage product across it is always small, and the energy losses low.

For this switching scheme to work, there obviously has to be some capacitance on the output side. Some circuits have a (small) capacitor built in. Sometimes the stray pico-farad capacitances present in any electrical system suffice. But frequently an external capacitor is added to buffer the output. A capacitor is often placed on the input side as well to prevent rapid switching from causing the supply voltage to fluctuate. The size of the capacitors required depends on the output load characteristics and the switching rate of the regulator. Other filter and shielding components are sometimes needed to limit high-frequency interferance produced by the abrupt opening and closing of the transistor "switches". Data sheets for the particular device will often have recommendations.

Single-chip voltage regulators are available for a large range of input and output voltages and output current/power. Most output a constant voltage over a fairly wide range of supply voltages. Modern designs can have energy conversion efficiencies that exceed 90%. Somewhat surprisingly, there are small, solid-state regulators that can increase a low DC voltage to a higher value. These are referred to as boost regulators, or sometimes DC-to-DC converters. Ordinary voltage-reducing devices are called buck regulators. There are even buck-boost regulators that output a constant voltage over a range of inputs both lower and higher than the output. High-efficiency regulators, both of the boost and buck variety generally require at least one external energy-storage component. Usually this is an inductor, but there are implementations that use a capacitor.

Before using a voltage regulator, read the data sheets carefully to make sure it can supply the power and current you need. You generally want to install a output capacity at least twice what you expect the maximum draw to be. Regulators running constantly at their rated capacity get HOT. Single-chip regulators generally cannot supply enough power to operate anything larger than a small motor. To drive larger motors, the output must be coupled to heat-sunk power transistors, and fed into a large capacitor. In other words, you need to build a discrete-component power supply. Or you can buy one already assembled.

Wikipedia on switching regulators



Discrete Logic

Robots need to combine sensory information and take actions that depend on inputs and current state in complex, non-linear ways. In principle, all such "computational" activity can be carried out by a central, general-purpose processor with sufficient analog and digital output ports, with only linear amplification needed externally. In practice, robot systems often employ a considerable amount of peripheral digital processing. There are several reasons for this.

First, commodity general-purpose processors have restricted inputs and outputs. Such processors are easily usable only when combined with other hardware into a computational system and surrounded by a software operating system that provides access and control. Fully implemented systems-in-a-box, on-a-card, and even on-a-chip are amazingly powerful and cheap these days. On the down side, because all the work has been done for you, you need to play by their rules. In the case of robotics, the biggest issue is that the primary channels of external communication provided with such systems are complex serial protocols designed for fast interaction with other digital systems. These protocols must be implemented via custom digital hardware in any peripheral that wants to talk to the system. When simple I/O ports, either digital or analog are available, either as part of the base system or through added peripheral devices, the number of channels is often quite limited. Controlling a large number of actuators, or accepting input from a large number of sensors often requires implementing some additional, custom addressing scheme. Discrete logic circuits provide a flexible basis for doing this without needing to fabricate custom chips.

Second, any computation running on a central, general-purpose processor is implemented in software. Software implementations are susceptible to all sorts of failures, including buggy program mods, program crashes, loss of program data, operating system crashes, unexpected interaction with other system components, and failure due modification of (conceptually) unconnected system components. A good rule of thumb for experimental robot-constructors is, if a function is safety-related, don't put it in software. More generally, interlocks and checks designed to prevent personal injury or hardware damage should be implemented at as low a level as possible. Look at it as following Asimov's first and third laws of robotics.

Third, sometimes it is just easier to put in a circuit than to implement low-level program control.

Wikipedia on logic gates

Types of discrete logic chips

As mentioned above, an extremely large variety of logic ICs are available, even if we restrict the discussion to "non-programmable" circuits with limited internal state.

At the simplest functional level are basic logic gates: AND, OR, NAND, NOR, inversion etc. These typically come several to a chip and in various multiple-input configurations (e.g., quad 2-input NAND, dual 4-input NOR, triple 3-input AND, 13-input NAND, to name a few configurations in our local collection.) Multiple inputs reduce local wiring effort needed to create, e.g., a 4-input gate from 2-input primitives. Other basic gates include small decoders (e.g. 2-4 or 3-8 ) and small multiplexers (e.g. 2-1 or 4-1). These are useful for switching and addressing when processor I/O lines are limited. More exotic logical combinations are also available for special purposes e.g., 4-input AND-OR-INVERT = ~(AB + CD).

Another class of basic digital logic circuits are those that store state in standard ways. Simple examples useful in the robotics periphery include D, JK, and SR flip-flops (usually several to a chip); small shift registers, particularly ones with parallel read or write ports; small counters; and small memory chips. Large shift registers, counters, memory, etc., are available. They are useful when you need to implement a hardware interface to, say, a bare imaging chip, or the 10,000 tactile sensors in your novel artificial skin, and for custom I/O interfaces, controllers and processors.

Basic Logic Symbols

<
AND OR NOT NAND NOR XOR

Selecting Logic chips

Gates are rated according to the voltages that count as high and low, for example a gate might be nominally specified as 5V, with a guarantee that anything above 4V will always count as high, anything below 2V will always count as low, and in between the behavior is unspecified.

The output current of most discrete gates-on-a-chip is limited to a few mA or tens of mA at most. This means that the output needs to be amplified to drive anything other than perhaps a small LED.

An important distinction exists between CMOS gates, and other (usually bipolar, but sometimes MOSFET) gates, referred to as "open collector" or "open drain" circuits. A CMOS logic gate will actively drive an output load in both high and low states. In contrast, an open collector configuration has a transistor switch that connects the output to ground in the low state, and disconnects (opens) in the high state. In order to drive a load in the high state, the output must be connected via a "pull-up" resistor to a positive voltage source. An open drain configuration is analogous, but of reverse polarity. Open collector circuits have the disadvantage that if they drive a load in the high state, they draw continuous additional power through the pull-up resistor in the low state. On the other hand they can be more flexibly configured, for example, they can drive a load at higher voltage than the logic high.



Timing Circuits

Timing comes up frequently in robot construction. Lights flash. Speeds vary. Actions must be synchronized and coordinated. Many configurations of electronic components exhibit temporal behavior that can be exploited, including charging capacitors, oscillating LC circuits, op-amp-based integrators and signal generators, etc. Rather than having to custom-build a discrete-component circuit for every timing application, the smart IC boys have come up with timing chips that provide robust and easily customizable implementations of a variety of standard timing functions. Examples include driving a line high or low a given interval after a trigger signal, generation of variable-duty-cycle, variable-frequency square waves, ramp generation, sawtooth waves, etc.

The canonical example of a timing chip is the 555 integrated circuit. The design was introduced in 1971, and is still made by several manufacturers (e.g., Texas Instruments NE555 and LM555). The original is bipolar technology with 25 transistors and a handful of other components on a single die. It is provided in an 8-pin package. Low-power CMOS equivalents are currently available as well, as are chips with containing 2-4 555-equivalent timers.

The 555 IC provides three basic operations. The first two have parameters that are customizable by configuring an external network containing a capacitor and one or two resistors with the appropriate component values. The first (monstable mode) generates a single pulse of customizable duration on reception of a trigger signal. The pulse length is set using a capacitor and a resistor. The second (astable mode) generates a string of pulses (a square wave) with adjustable frequency and duty cycle. The parameters are determined by a capacitor and two resistors. Some settings require a diode in addition. The chip can also be used in a third way (bistable mode) to provide a noise-resistent latch, also known as a Schmitt trigger. This is useful in alarms and other applications that need to be triggered by a momentary fluctuation in a signal.

By clever modification of the basic modes, the 555 can be used to implement many functions useful in robotics (and elsewhere). A simple application is buzzers and flashers whose frequency can be varied by changing a resistance, which might be a potentiometer, a photocell, or a pressure-sensitive resistor. In another configuration, a variable resistor can control the duty cycle of a square wave, providing a simple pulse width modulation (PWM) generator. A series of single pulse generators configured to trigger each other can be used to sequence timed actions. For many more ideas, see this collection of 555 applications

The 555 circuit operates on 4.5-15 V, and can supply a maximum output current of about 200 mA. Pulse widths shorter than 10 us may problematic, so the data sheet for the particular device should be read carefully if operation above 50KHz is needed. Depending on the exact chip and manufacturer and the care with which the external components are selected, it may be possible to generate frequencies of a few hundred KHz with a bipolar chip. CMOS analogs are typically much faster and, with care, may give you a few MHz. However, if you need high-frequency signals, you are probably better off using a specialty clock chip. Data sheet for Texas Instruments LM555.

Other ICs are available having similar or additionally complex functionality, and generating a variety of pulses and waveforms. Some of the more complex circuits are digitally adjustable, and start overlapping with high-internal-state programmable devices, for example, the Analog Devices AD9833 waveform generator, which can produce square, triangle and sinusoidal signals over a wide range of frequencies.

A very wide variety of clock chips are made, running up to many MHz, and reflecting the importance of clocks in digital processing. They generally put out a square wave, but often provide considerable flexibility in producing precise starts and stops, and otherwise controlling the output. If you need a timing signal that is faster or more flexibly controllable than can be provided by the 555 IC and its brethren, it is time to look at clocks.

Analog delay lines are another common timing circuit. Though not seen so much in simple robots, they can be essential if you ever have to implement digital communication protocols in hardware. They are also used to construct sensors that depend on the measurement of very short intervals, such as time-of-flight distance sensors. These devices delay a signal by a fixed or programmable interval, usually in the pico- to nano-second range, and are typically used to line up digital pulses (often clock signals) that have become de-synchronized due to varying transmission delays. The circuits attempt to preserve the analog character of the rising and falling edges of a pulse, which means they can also be used to delay analog signals as long as they are appropriately band-limited. Most current "delay line" ICs are restricted to delays that are shorter than the pulse length (half a cycle at the highest frequency), and thus have no effective digital memory capacity.

Extended mechanical and electrical media, e.g. acoustic conductors and long co-axial cables can support long, complex signals in flight. Delay lines can be made employing such media that can accept many pulses or oscillations during the delay interval, and reproduce them faithfully at the other end. This behavior is qualitatively different from the shorter-than-pulse delays described above. Such devices effectively do have digital memory. Prior to IC technology, mechanically realized, recirculating delay lines were a practical method for storing high speed digital data, e.g., by using acoustic signals in tubes of mercury(!!). These days, clocked digital delay lines, known as shift registers are generally used when multi-cycle delays are needed.



D to A and A to D Converters

Originally, digital to analog (D to A) converters were simple, asynchronous circuits that took parallel digital inputs representing a binary-coded value (e.g. 0-255 on eight pins) and output a linearly proportional analog voltage over some range (e.g. 0-5V). Analog to digital (A to D) converters did the opposite (analog in, parallel digital out).

Modern A to D converters tend to be programmable, serial-protocol chips that sample data at a specifiable rate, buffer the data, and send it to the host as it is needed or can be accepted. Many can handle multiple channels simultaneously. They are frequently used to sample sound or other relatively quickly changing signals, including old-style analog video. Devices are available that can sample up several hundred MHz. Read a whole lot on Wikipedia

Modern D to A converters are similarly sophisticated. They are used extensively to synthesize signals from the audio to high radio frequencies. They are common in audio output devices, and before direct digital video, were important in synthesizing analog video output. A not-quite-as-big Wikipedia article



Motor Drivers and Controllers

This subject gets its own chapter.


Back to Robot Construction main page