Doing the Robot, 21st-Century Style

Growing up in the 1970s, the first robot I remember was Rosie from The Jetsons. In the 1980s, I discovered Transformers, which were touted as “robots in disguise,” I imitated Michael Jackson’s version of “the robot,” and (unbeknownst to me) the Arthrobot surgical robot was first developed. This was years before Honda debuted ASIMO, the first humanoid robot, in 2004.

“In the 1970s, microprocessors gave me hope that real robots would eventually become part of our future,” RobotBASIC codeveloper John Blankenship told me in a 2013 interview. It appears that the “future” may already be here.

Honda's ASIMO humanoid robot

Honda’s ASIMO humanoid robot

Welcome to the 21st century. Technology is becoming “smarter,“ as evidenced at the Consumer Electronics Show (CES) 2014, which took place in January. The show unveiled a variety of smartphone-controlled robots and drones as well as wireless tracking devices.

Circuit Cellar’s columnists and contributors have been busy with their own developments. Steve Lubbers wondered if robots could be programmed to influence each other’s behavior. He used Texas Instruments’s LaunchPad hardware and a low-cost radio link to build a group of robots to test his theory. The results are on p. 18.

RobotBASIC’s Blankenship wanted to program robots more quickly. His article explains how he uses robot simulation to decrease development time (p. 30).

The Internet of Things (IoT), which relies on embedded technology for communication, is also making advancements. According to information technology research and advisory company Gartner, by 2020, there will be close to 26 billion devices on the IoT.

With the IoT, nothing is out of the realm of a designer’s imagination. For instance, if you’re not at home, you can use IoT-based platforms (such as the one columnist Jeff Bachiochi writes about on p. 58) to preheat your oven or turn off your sprinklers when it starts to rain.

Meanwhile, I will program my crockpot and try to explain to my 8-year-old how I survived childhood without the Internet.

Industrial Temperature SBCs

EMACThe iPAC-9X25 embedded SBC is based on Atmel’s AT91SAM9X25 microprocessor. It is well suited for industrial temperature embedded data acquisition and control applications.
This web-enabled microcontroller can run an embedded server and display the current monitored or logged data. The web connection is available via two 10/100 Base-T Ethernet ports or 802.11 Wi-Fi networking. The iPAC-9X25’s connectors are brought out as headers on a board.

The SBC has a –40°C to 85°C industrial temperature range and utilizes 4 GB of eMMC flash, 16 MB of serial data flash (for boot), and 128 MB of DDR RAM. Its 3.77“ × 3.54“ footprint is the same as a standard PC/104 module.

The iPAC 9X25 features one RS-232 serial port with full handshake (RTS/CTS/DTR/DSR/RI), two RS-232 serial ports (TX and RX only), one RS-232/-422/-485 serial port with RTS/CTS handshake, two USB 2.0 host ports, and one USB device port. The board has seven channels of 12-bit audio/digital (0 to 3.3 V) and an internal real-time clock/calendar with battery backup. It also includes 21 GPIO (3.3-V) lines on header, eight high-drive open-collector dedicated digital output lines with configurable voltage tolerance, 16 GPIO (3.3 V) on header, two PWM I/O lines, five synchronous serial I/O lines (I2S), five SPI lines (two SPI CS), I2C bus, CAN bus, a microSD socket, external Reset button capabilities, and power and status LEDs.
The iPac-9X25 costs $198.

EMAC, Inc.
www.emacinc.com

Configurable Regulator

LinearThe LTM4644 quad output step-down µModule (micromodule) regulator is configurable as a single (16-A), dual (12-A, 4-A, or 8-A, 8-A), triple (8-A, 4-A, 4-A), or quad (4-A each) output regulator. This flexibility enables system designers to rely on one simple and compact µModule regulator for the various voltage and load current requirements of FPGAs, ASICs, and microprocessors as well as other board circuitry. The LTM4644 is ideal for communications, data storage, industrial, transportation, and medical system applications.

The LTM4644 regulator includes DC/DC controllers, power switches, inductors and compensation components. Only eight external ceramic capacitors (1206 or smaller case sizes) and four feedback resistors (0603 case size) are required to regulate four independently adjustable outputs from 0.6 to 5.5 V. Separate input pins enable the four channels to be powered from a common supply rail or different rails from 4 to 14 V.

At an ambient temperature of 55°C, the LTM4644 delivers up to 13 A at 1.5 V from a 12-V input or up to 14 A with 200-LFM airflow. The four channels operate at 90° out-of-phase to minimize input ripple whether at the 1-MHz default switching frequency or synchronized to an external clock between 700 kHz and 1.3 MHz. With the addition of an external bias supply above 4 V, the LTM4644 can regulate from an input supply voltage as low as 2.375 V. The regulator also includes output overvoltage and overcurrent fault protection.

The LTM4644 costs $22.85 each in 1,000-unit quantities.

Linear Technology Corp.
www.linear.com

Multi-Zone Home Audio System

Dave Erickson built his first multi-zone audio system in the early 1990s using C microprocessor code he developed on Freescale MC68HC11 microprocessors. The system has been an important part of his home.

“I used this system for more than 15 years and was satisfied with its ability to send different sounds to the different rooms in my house as well as the basement and the deck,” he says. “But the system needed an upgrade.”

In Circuit Cellar’s January and February issues, Erickson describes how he upgraded the eight-zone system, which uses microprocessor-controlled analog circuitry. In the end, his project not only improved his home audio experience, it also won second place in a 2011 STMicroelectronics design contest.

Several system components needed updating, including the IR remote, graphic LCD, and microprocessor. “IR remotes went obsolete, so the IR codes needed to change,” Erickson says. “The system was 90% hand-wired and pretty messy. The LCD and several other parts became obsolete and the C development tools had expired. Processors had evolved to include flash memory and development tools evolved beyond the old burn-and-pray method.”

“My goal was to build a modern, smaller, cleaner, and more efficient system,” he says. “I decided to upgrade it with a recent processor and LCD and to use real PC boards.”

Photo 1: Clockwise from the upper left, the whole-house system includes the crosspoint board, two quad preamplifiers, two two-zone stereo amplifiers, an AC transformer, power supplies, and the CPU board with the STMicroelectronics STM32VLDISCOVERY board.

Photo 1: Clockwise from the upper left, the whole-house system includes the crosspoint board, two quad preamplifiers, two two-zone stereo amplifiers, an AC transformer, power supplies, and the CPU board with the STMicroelectronics STM32VLDISCOVERY board.

Erickson chose the STMicroelectronics STM32F100 microprocessor and the work incentive of a design contest deadline (see Photo 1).

“STMicroelectronics’s excellent libraries and examples helped me get the complex ARM Cortex-M3 peripherals working quickly,” he says. “Choosing the STM32F100 processor was a bit of overkill, but I hoped to later use it to add future capabilities (e.g., a web page and Ethernet control) and possibly even a simple music server and audio streaming.”

In Part 1 of the series, Erickson explains the design’s audio sections, including the crosspoint board, quad preamplifiers, modular audio amplifiers, and packaging. He also addresses challenges along the way.

Erickson’s Part 1 provides the following overview of the system, including its “analog heart”—the crosspoint board:

Figure 1 shows the system design including the power supplies, front-panel controls, and the audio and CPU boards. The system is modular, so there is flexibility in the front-panel controls and the number of channels and amplifiers. My goal was to fit it all into one 19”, 2U (3.5”) high rack enclosure.

The CPU board is based on a STM32F100 module containing a Cortex-M3-based processor and a USB programming interface. The CPU receives commands from a front-panel keypad, an IR remote control, an encoder knob, RS-232, and external keypads for each zone. It displays its status on a graphic LCD and controls the audio circuitry on the crosspoint and two quad preamplifier boards.

The system block diagram shows the boards, controls, amplifiers, and power supplies.

The system block diagram shows the boards, controls, amplifiers, and power supplies.


Photo 2 shows the crosspoint board, which is the analog heart of the system. It receives line-level audio signals from up to eight stereo sources via RCA jacks and routes audio to the eight preamplifier channels located on two quad preamplifier boards. It also distributes digital control and power to the preamplifiers. The preamplifier boards can either send line-level outputs or drive stereo amplifiers, either internal or external to the system.

My current system uses four line-level outputs to drive PCs or powered speakers in four of the zones. It also contains internal 40-W stereo amplifiers to directly drive speakers in the four other zones. Up to six stereo amplifiers can reside in the enclosure.

Photo 2: The crosspoint board shows the RCA input jacks (top), ribbon cable connections to the quad preamplifiers (right), and control and power cable from the CPU (bottom). Rev0 has a few black wires (lower center).

Photo 2: The crosspoint board shows the RCA input jacks (top), ribbon cable connections to the quad preamplifiers (right), and control and power cable from the CPU (bottom). Rev0 has a few black wires (lower center).

DIYers dealing with signal leakage issues in their projects may learn something from Erickson’s approach to achieving low channel-to-channel crosstalk and no audible digital crosstalk. “The low crosstalk requirement is to prevent loud music in one zone from disturbing quiet passages in another,” he says.

In Part 1, Erickson explains the crosspoint and his “grounding/guarding” approach to transmitting high-quality audio, power, and logic control signals on the same cable:

The crosspoint receives digital control from the CPU board, receives external audio signals, and distributes audio signals to the preamplifier boards and then on to the amplifiers. It was convenient to use this board to distribute the control signals and the power supply voltages to the preamplifier channels. I used 0.1” dual-row ribbon cables to simplify the wiring. These are low-cost and easy to build.

To transmit high-quality audio along with power and logic control signals on the same cable, it is important to use a lot of grounds. Two 34-pin cables each connect to a quad preamplifier board. In each of these cables, four channels of stereo audio are sent with alternating signals and grounds. The alternating grounds act as electric field “guards” to reduce crosstalk. There are just two active logic signals: I2C clock and data. Power supply voltages (±12 and 5 V) are also sent to the preamplifiers with multiple grounds to carry the return currents.

I used a similar grounding/guarding approach throughout the design to minimize crosstalk, both from channel to channel and from digital to analog. On the two-layer boards, I used ground planes on the bottom layer. Grounded guard traces or ground planes are used on the top layer. These measures minimize the capacitance between analog traces and thus minimize crosstalk. The digital and I2C signals are physically separated from analog signals. Where they need to be run nearby, they are separated by ground planes or guard traces.

To find out more about how Erickson upgraded his audio system, download the January issue (now available online) and the upcoming February issue. In Part 2, Erickson focuses on his improved system’s digital CPU, the controls, and future plans.

Reduce EMI on a Micro (EE Tip #109)

Electromagnetic interference (EMI) on a typical microprocessor board is related to the clock. If the clock is a square wave, it contains frequencies at the clock frequency and harmonics. A perfect square wave clock would have harmonic frequencies at f, 3 × f, 5 × f, 7 × f, and so on. For a perfect square wave, or any string of pulses with a fast rise time, the strength of the harmonics declines inversely with frequency.

So, the eleventh harmonic would be one-eleventh as strong as the fundamental frequency. This corresponds to a decline in harmonic amplitude of 20 dB per decade.

Real time clocks are not perfect square waves, and pulses do not have infinitely fast rise times. As a result, the higher harmonics of any real waveform start dropping faster than 1/n at higher frequencies, generally dropping as 1/(n2), or 40 dB per decade, after the frequency is high enough.

You can see this in Figure 1. The antenna efficiency of PC board structures or cables increases 20 dB per decade as frequency increases and wavelength gets shorter and closer to the size of structures found on typical PC boards.

Figure 1—Here you can see the sources of EMI in a typical microprocessor and the resulting spectrum.

Figure 1: Here you can see the sources of EMI in a typical microprocessor and the resulting spectrum.

As a result, the beginning part of the radiated spectrum tends to be uniform, the 20 dB per decade decline in harmonic strength being balanced by the 20 dB per decade increase in antenna efficiency, until a high enough frequency is reached where the curve takes a bend and harmonics start declining at 40 dB per decade zone (see Figure 1).

Above this frequency, the radiated spectrum starts declining by 20 dB per octave. But, the amplitudes of the real harmonics of a real device are often quite irregular because of resonances that weaken some and reinforce others.

What is not usually understood is that the biggest source of EMI is not the clock directly, but a train of pulses generated on both edges of the clock when current surges into the microprocessor for a nanosecond or two when the clock transitions up or down. This pulse train has a frequency that’s double the clock frequency. It seeps out of the processor chip into the power supplies and generally infects the board with high-frequency EMI. It also gets into the output lines emanating from the processor package; therefore, it’s further spread around the board and to cables and devices connected to the board.

The current surges on both clock edges are related to the clock tree. The clock tree is a system consisting of a branching network of buffers that distribute the internal clock around the silicon die. Because these buffers drive considerable capacitance and have both polarities of the clock present, there is a surge of current on both edges of the clock. This occurs as current flows into the chip to charge up the capacitance in the part of the clock tree that is transitioning from 0 V to the power supply voltage. On-chip devices, such as flip-flops, also contain internal gates and buffers where both polarities of the clock are present and contribute to the current surge.

An additional current surge is related to the crossover current when both the N and P transistors in a CMOS buffer are momentarily conducting during a logic transition. The silicon chip tries to suck in the required current to service these fast transients through its power supply pins. However, these connections have inductance created by the bond wires and lead frame, so the voltage drops briefly on the die, creating an on-chip power supply voltage drop with an amplitude on the order of a few tenths of a volt and the duration of a nanosecond or so.

If this same on-chip power supply drives the output buffers that carry signal lines out of the chip, these lines will also be infected with the fast pulses present in the power and ground supplies. This is because the power supply noise is directly transmitted through the buffer power inputs to the output lines. The on-chip current surges create fast noise that passes out through the power supply pins to the power and ground planes on the PC board, further spreading the infection.

The amplitude of the harmonics of the periodic noise pulses, at least at lower frequencies, declines inversely with frequency (1/f). Unfortunately, the effectiveness of a short antenna, such as a PC board trace, increases directly with frequency (~f). The result is that the radiated EMI tends to be flat across the spectrum.

Fortunately, the amplitude of the harmonics starts declining more rapidly than 1/f; it’s more like 1/(f2) at some higher frequency determined by the finite rise time of the pulses in the pulse train. The balance of these countervailing effects is such that the most trouble is often found in the area of 100 to 300 MHz for lower-speed 8- and 16-bit microprocessor boards.

Decoupling capacitors and the intrinsic capacitance of the power and ground planes can be used to short circuit or filter noise on the power supply. However, this technique loses effectiveness above 100 MHz, because the decoupling capacitors have inductance of about 1 nH, giving an effective resistance of about 0.5 Ω at 200 MHz. The large currents involved will develop millivolt-level voltages across such capacitors.

REDUCTION TRICK #1

The problem of noise on the I/O lines of a processor can be addressed with two sets of power supply pins. One set is used for the processor core; the other is for the output drivers that are located in the I/O ring on the periphery of the die (see Figure 2).

Figure 2: The connection of separate power and ground pins for the core and I/O ring of a processor is shown here. A PC board filter blocks core noise from power planes. You can also see how I/O buffers spread power supply noise.

Figure 2: The connection of separate power and ground pins for the core and I/O ring
of a processor is shown here. A PC board filter blocks core noise from power planes.
You can also see how I/O buffers spread power supply noise.

If the I/O buffers are supplied with the same power that is made dirty by the fast transients in the processor core, every output pin of the processor will spread EMI. The EMI that tries to come out of the power pins for the core can be blocked by a combination of decoupling capacitors and PC board trace inductance. This keeps the PC board power planes a relatively clean source of power for the processor I/O ring. The design team figured this feature decreases EMI amplitudes by 10 dB, which is a factor of three in EMI electrical field strength measured by the prescribed calibrated antenna. This is a lot because it’s common to flunk the tests by 5 dB.

REDUCTION TRICK #2

Most microprocessors have I/O and memory devices connected to the same bus with distinct control signals for the devices. Generally, there is a lot more activity at a higher frequency for the memory devices. For instance, a Digi International Rabbit 3000 microprocessor has an option to use separate pins for memory and I/O devices, both address and data. The advantage is that the physical scope of the high-speed memory bus is limited to the memory devices. A separate address and data bus handles I/O cycles and has a much lower average operating frequency. In particular, the address lines toggle only during I/O bus cycles, greatly limiting the emissions from the I/O bus. This avoids the situation where the fast-toggling address and data lines of the memory bus have to be run all over the printed circuit board of a large system. This scheme also limits the capacitive loading on the memory bus, which does not have to extend to numerous I/O devices.

REDUCTION TRICK #3

A line spectrum is the spectrum generated by a square wave clock or by a train of short pulses. All of the energy is concentrated in a narrow spectral line at the harmonic frequencies.

When the FCC EMI measurement tests are performed, the spectrum analyzer measures the amplitude of the signal from a 120-kHz wide filter that is swept across the frequencies of interest. With a line spectrum, all of the energy in a single line passes through the filter, resulting in a strong signal. If the energy in the line could be spread out over a wider frequency, say 5 MHz, only one-fortieth the energy would pass through the 120-kHz wide filter, considerably reducing the reading (by 16 dB in amplitude for one fortieth of the energy). This is what a clock spectrum spreader does. It modulates the clock frequency by a little so as to smear out the spectral line in frequency.

The idea to do this for the purpose of reducing EMI was patented by Bell Labs in two patents during the 1960s. There are numerous ways to modulate the clock frequency. One method is to use a voltage-controlled oscillator and phase-lock loop so that the frequency sweeps back and forth at a low modulation rate (e.g., 50 kHz).

Another method is to insert random delays or dithers into the clock. These methods are all covered in the original Bell Labs patents. The Bell Labs people were probably interested in EMI because telephone switches involve a large amount of equipment in a small space. In addition, it’s conceivable that the early computerized switches suffered from EMI problems. We installed a clock spectrum spreader in the Rabbit 3000 based on a combination of digital and analog techniques. The spectrum spreader reduces FCC-style EMI readings by around 20 dB, which is a lot.

A control system makes sure that the modulated clock edge is never in error by more than 20 ns compared to where the clock edge would be if it were not modulated. This prevents disruption in serial communications or other timing functions. For example, a UART operating at 460,000 bps can tolerate about 500 ns of clock edge error before it will be near to generating errors. This is far less than our 20-ns worst error in clock edge position.—Circuit Cellar 146, Norman Rogers, “Killing the EMI Demon,” 2002.

This piece originally appeared in Circuit Cellar 146, 2002. Author: Norman Rogers, who was President of ZWorld, Inc. and Rabbit Semiconductor.