# Modify & Test a Phase Meter Calibrator

Charles Hansen described a DIY phase meter calibrator using all-pass, phase-shift filters in a November 2006 article published in audioXpress magazine. Being able to measure phase angle is often helpful, so I’ll begin by quoting from the beginning of his article:

“A phase angle meter is useful in audio work to determine the phase angle between a reference signal and a phase shifted signal, both having identical time periods. Typical uses include: Finding the phase angle between voltage and current to determine the phase shift and impedance of a loudspeaker over its frequency range. Finding the phase shift between the input and output of a tube amplifier to establish the HF (high frequency) and LF (low frequency) cutoff points needed to avoid instability in feedback amplifiers.”

In addition to these, there are other uses—for example, measuring the phase shift through any active or passive filter which includes equalization networks.

In his design, he chose a set of five calibrations frequencies: 10 Hz, 100 Hz, 1000 Hz, 10 kHz, and 100 kHz. He relied on an external oscillator to drive the calibrator at these input frequencies. I first built the calibrator as described, and then I made some modifications that better suited my needs. But first I will describe how the calibrator works. I think it’s best to just provide a bit more  from Hansen’s article:

“The Phase Angle Calibrator makes use of an op amp filter circuit called the all-pass circuit, which takes a sine-wave input and produces a constant amplitude phase-shifted sine wave output. The lag output version was used in Fig. 1. The theory behind the all-pass filter is available in many reference books and texts, but I found one by Walt Jung [1] that I believe is the easiest for a novice to understand. The phase shift angle is varied by the parallel combination of R3 and R9 through R19 with C3 through C7 in accordance with the formula:

θ = -2 arctan (2ΠRC)

where θ is the phase angle, and f is the frequency. After selecting a suitable value for C, you can solve for R by rearranging the formula:

R = tan(-θ/2) / 2ΠfC

This is hardly a linear relationship. Large changes in resistor value produce very little change in phase angle as you approach 0 or 180 degrees. It’s much easier to apply the input signal to both inputs of the phase angle meter for zero degrees, and use an op-amp inverter to generate the 180 degree signal.”

MODIFY THE CALIBRATOR

I added an internal Wein-bridge oscillator to simplify using the calibrator and I changed the set of frequencies to cover just the audio range: 20 Hz, 100 Hz, 1000 Hz, 10 kHz, and 20 kHz. (This range is also easier to cover with a single-range oscillator, the capacitor values stay reasonable.) The actual frequencies, shown in Table 1, vary somewhat from the ideal frequencies because I used standard 1% resistors and 5% capacitors.

Table 1: These are phase calibrator phase-shift measurements. The column labeled “305” refers to the Dranetz model 305 phase meter with 305-PA-3007 plug-in. The column labeled “5245L” refers to the Hewlett-Packard model 5245L frequency counter with a model 5262A time interval unit plug-in. Phase shift measurements at 19.6 kHz are not useful from the HP-5245L counter because the 10-MHz timebase does not provide enough significant figures.

Selecting and matching the capacitors would give closer results, but it’s more important to know what the frequencies are. Because I had already built a circuit board for the calibrator circuit, I used a second circuit board for the oscillator. Figure 1 and Figure 2 are the two circuit diagrams.

Figure 1: Phase angle calibrator using all-pass phase-shift filters. This is a Charles Hansen design, 2005, with circuit board design by the author (PHASECAL.PCB).

Figure 2: Wein-bridge oscillator with lamp amplitude stabilization. Adjust R6 for minimum harmonic distortion. (MAIN115.PCB)

Tables 2 and Table 3 are the parts lists. Please note that the calibrator circuit is unchanged from Hansen’s design, except for the values of the capacitors C3 and C7. In the original, C3 was 470 nF (for 10 Hz) and C7 was 47 pF (for 100 kHz). I put both circuit boards and a ±15-VDC power supply (any regulated supply will suffice) in a Wolgram MC-9 enclosure.

Table 2: Calibrator parts list

Table 3: Wein-bridge oscillator parts list

The completed calibrator is shown in Photo 1 with a Dranetz Phase meter. (More about this later.) The unlabeled knob, lower left in the photo, is an oscillator output level control (R8 in Figure 2), which I added after making the front panel label.

Photo 1: A Dranetz automatic phase meter, model 305, is at the top. The phase meter calibrator is below. The calibrator, a Charles Hansen design, is not a TDL product, but construction details are included in this article.

Wein-bridge oscillator theory is discussed in many textbooks and is rather mathematical. I will describe it as simply as possible. In Figure 2 the oscillation frequency is set by the value of R and C connected between the op-amp non-inverting input (pin 3), the op-amp output (pin 6), and common. For a frequency of 1,000 Hz, C = 22 nF (C3 and C10) and R = 7235 Ω (the series combination of R1 + R2 and R3 + R4). The equation is:

f = 1/(2ΠRC) = 1/(2Π(22 x 10-9) (7235)) = 1000 Hz

For amplitude-stable oscillation to occur, the gain of the op-amp circuit must be 1/3. This is set by the impedance of the RC network and resistors R5, R6 and R7 and the incandescent lamp. The lamp is important because it stabilizes the gain at 1/3. If the output voltage (pin 6) tries to increase, the lamp’s resistance decreases and the output voltage decreases. This works very well, but it takes the output amplitude a small of amount of time to stabilize, especially at low frequencies. The CM6833 lamp is very small, so its thermal time constant is very low and stability happens very quickly. The trimmer pot, R6, is adjusted for minimum distortion in the output signal. You can get rather close by looking at the waveform with a scope, but it’s better to use a distortion analyzer or spectrum analyzer. Spectrum analysis software on a PC is fine, just adjust R6 to minimize the height of the sidebands or use a program that directly displays harmonic distortion.

At 1000 Hz, TrueRTA shows the second harmonic (2000 Hz) down 80 dB (0.01% distortion) with the higher harmonics even lower. AudioTester shows a total harmonic distortion of 0.0105% using the first ten harmonics.

TrueRTA is a spectrum analysis program available from True Audio. Demo versions and a free version (level 1) are available on its website. AudioTester is another spectrum analysis program.

TEST THE CALIBRATOR

The calibrator should be reasonably accurate when built using the 1% resistors and 5% capacitors in the parts list. But as with any other piece of test equipment, it would be satisfying to make some measurements to be sure. I will describe two methods that I used: all the measured values are presented in Table 1. As you can see, the calibrator is very satisfactory.

One method is to use a calibrated phase meter with an accuracy better than the calibrator. I used a Dranetz model 305 (five-digit phase angle display) with a model 305-PA-3007 plug-in.(The Dranetz phase meter is no longer manufactured but used units may be found on eBay or from used electronic instrument dealers.) This plug-in provides automatic operation for input amplitudes of 50 mV RMS to 50 V RMS and frequencies from 2 Hz to 70 kHz. Automatic operation means there are no operating controls. The plug-in scales the input voltage to the mainframe and provides the correct frequency compensation.

Another method is to use a time interval counter to measure the time between an amplitude zero crossing of the reference signal to the amplitude zero crossing of the phase shifted signal. Phase shift can be calculated from the time interval as:

θ = 360τf/1000

where θ is the phase shift in degrees, time delay τ is in milliseconds, and f is the frequency in hertz.

I used a Hewlett-Packard (HP) model 5245L frequency counter with a model 5262A time interval unit plug-in (see Photo 2).

Photo 2: Hewlett-Packard model 5245L frequency counter with a time interval plug-in unit below and my dual zero-crossing detector above.

The 10-MHz counter timebase gives a time resolution of 0.1 ms. The time interval plug-in has trigger-level controls for each channel but they are not calibrated and can’t accurately set the zero crossing with a sine wave input. The smaller “box” above the counter in the photo is a two-channel zero crossing detector. I designed and built this detector to output a pulse whose leading edge coincides in time with the input zero crossing. The counter measures the time between the leading edges of the two pulses: the reference and the phase shifted signal. The detector circuit diagram (see Figure 3) and parts list (see Table 4) are included. I packaged the Detector circuit board with a simple ±5-V regulated power supply in a Wolgram MC-7A enclosure.

Figure 3: The ual zero-crossing detector circuit board

Table 4: The two-channel zero crossing detector's parts list

Looking at one of the detector’s channels in Figure 3, U1 is an input buffer. Resistors R5, R6, and D1 clip the negative-going half of the input sine wave. The comparator circuit (U2) outputs a very short pulse at the input zero crossing. This pulse is “stretched” by the monostable multivibrator in U3 to about 12 ms as set by the time-constant of C1 and R19. Two front panel toggle switches select either the positive-going or negative-going output pulses. The reference and shifted pulses—45° at 10 kHz—are shown in Photo 3.

Photo 3: The digital storage scope display of reference pulse (above) and phase shifted pulse (below) for 45 degrees of shift at 10 kHz. The pulse width is 12 us. The pulse amplitude is 5 V. Pulse baselines are shifted for clarity.

FINDING A PHASE METER

New phase meters are expensive but used models can sometimes be found on eBay or from used electronic test equipment dealers, just try a Google search. In addition to the Dranetz 305 (which I found on eBay), other useful models include:

• Aerometrics model PM720 phase meter, 5 Hz to 500 kHz, analog meter display. Aerometrics  denies any association with this unit but it is often listed under this name.
• Hewlett-Packard model 3575A gain-phase meter, 1 Hz to 13 MHz, four-digit display
• Wavetek model 750 phase meter, 10 Hz to 2 MHz, four-digit display

In addition, you can find application notes and magazine articles that describe how to build your own phase meter. These are usually fairly simple designs. The following appear to be useful: Intersil Application Note AN9637 (This is identical to Design Idea #1890 that was published in the July 4, 1996 issue of EDN); Elliott Sound Products Project 135; and Salvati, M. J., “Phase Meter Profits From Improvements,” Design Idea, Electronic Design magazine, April 11, 1991.

TAILOR THE DESIGN

I sent a copy of this article to Hansen for comments. He agreed that having the oscillator built-in is a good feature. He also commented as follows:

“A problem with my phase meter calibrator design is that the distortion increases with phase shift, and the amplitude drops as well. It might be possible that the zero-crossing detector might be fooled by the higher order distortion harmonics. I’d be interested in what you find out in this regard.”

So, I measured the amplitude drop and distortion at 150°, which should be worst case. I set the 20-Hz variable output to an arbitrary 2.00 V. Keeping the output level control unchanged, I measured what you see in Table 5. This amount of drop seems acceptable.

Table 5: I set the 20-Hz variable output to 2 V, and I kept the output level control unchanges as I measured these.

I used a Hewlett-Packard model 3581A wave analyzer to measure the harmonics. Refer to Table 6. These numbers look acceptable and the zero-crossing detector output at 20 kHz and 150 degrees measures 22 ms on an oscilloscope with a calculated 21.5 ms at the actual frequency of 19.61 kHz.

Table 6: I used a Hewlett-Packard 3581A wave analyzer to measure the harmonics. These numbers are acceptable and the zero-crossing detector output at 20 kHz and 150 degrees measures 22 ms on an oscilloscope with a calculated 21.5 ms at the actual frequency of 19.61 kHz.

I am very satisfied that the calibrator is suitable to troubleshoot and calibrate any phase meter you are likely to find, either new or used. Without overdoing the math, there is enough design information here to allow you to tailor the design to a specific frequency range, keeping in mind the 1000:1 practical frequency range of the Wein-bridge oscillator, without using range switching.

The circuit board designs listed in the parts lists are available in CIRCAD format and are posted on the TDL website. (CIRCAD is a circuit board design program available from Holophase. The boards in the pmcalpcb.zip file were designed with Version 4, a free download of which is available on the Holophase website.) The physical boards are not available.

Ron Tipton lives in Las Cruces, NM. Visit the TDL Technology website for more information about his audio designs and services.

REFERENCE

[1] Jung, W. and Sams, H., Audio IC Op-Amp Applications, 2nd Edition, Sams Publishing, 1978.

Editor’s note: audioXpress, like CircuitCellar.com, is an Elektor International Media publication.

# A Workspace for Radio & Metrology Projects

Ralph Berres, a television technician in Germany, created an exemplary design space in his house for working on projects relating to his two main technical interests: amateur radio and metrology (the science of measurement). He even builds his own measurement equipment for his bench.

Ralph Berres built this workspace for his radio and metrology projects

“I am a licensed radio amateur with the call sign DF6WU… My hobby is high-frequency and low-frequency metrology,” Berres wrote in his submission.

Amateur radio is popular among Circuit Cellar readers. Countless electrical engineers and technical DIYers I’ve met or worked with during the past few years are amateur radio operators. Some got involved in radio during childhood. Others obtained radio licenses more recently. For instance, Rebecca Yang of Tymkrs.com chronicled the process in late 2011. Check it out: http://youtu.be/9HfmyiHTWZI and http://tymkrs.tumblr.com/.

Do you want to share images of your workspace, hackspace, or “circuit cellar” with the world? Click here to email us your images and workspace info.

# Issue 262: Advances in Measurement & Sensor Tech

As I walked the convention center floor at the 2012 Design West conference in San Jose, CA, it quickly became clear that measurement and sensor technologies are at the forefront of embedded innovation. For instance, at the Terasic Technologies booth, I spoke with Allen Houng, Terasic’s Strategic Marketing Manager, about the VisualSonic Studio project developed by students from National Taiwan University. The innovative design—which included an Altera DE2-115 FPGA development kit and a Terasic 5-megapixel CMOS sensor (D5M)—used interactive tokens to control computer-generated music. Sensor technology figured prominently in the design. It was just one of many exciting projects on display.

In this issue, we feature articles on a variety of measurement-and sensor-related embedded design projects. I encourage you to try similar projects and share your results with our editors.

Starting on page 14, Petre Tzvetanov Petrov describes a multilevel audible logical probe design. Petrov states that when working with digital systems “it is good to have a logical probe with at least four levels in order to more rapidly find the node in the circuit where things are going wrong.” His low-cost audible logical probe indicates four input levels, and there’s an audible tone for each input level.

Matt Oppenheim explains how to use touch sensors to trigger audio tags on electronic devices (p. 20). His design is intended to help visually impaired users. But you can use a few capacitive-touch sensors with an Android device to create the application of your choice.

The portable touch-sensor assembly. The touch-sensor boards are mounted on the back of a digital radio, connected to a IOIO board and a Nexus One smartphone. The Android interface is displayed on the phone. (Source: M. Oppenheim)

Two daisy-chained Microchip Technology mTouch boards with a battery board providing the power and LED boards showing the channel status. (Source: M. Oppenheim)

Read the interview with Lawrence Foltzer on page 30 for a little inspiration. Interestingly, one of his first MCU-based projects was a sonar sensor.

The impetus for Kyle Gilpin’s “menU” design was a microprocessor-based sensor system he installed in his car to display and control a variety of different sensors (p. 34).

The design used to test the menU system on the mbed processor was intentionally as simple as possible. Four buttons drive the menu system and an alphanumeric LCD is used to display the menu. Alternatively, one can use the mbed’s USB-to-serial port to connect with a terminal emulator running on a PC to both display and control the menu system. (Source: K. Gilpin)

The current menU system enables Gilpin to navigate through a hierarchical set of menu items while both observing and modifying the parameters of an embedded design.

The menU system is generic enough to be compiled for most desktop PCs running Windows, OSX, or Linux using the Qt development framework. This screenshot demonstrates the GUI for the menU system. The menu itself is displayed in a separate terminal window. The GUI has four simulated LEDs and one simulated photocell all of which correspond to the hardware available on the mbed processor development platform. (Source: K. Gilpin)

The final measurement-and-sensor-related article in this issue is columnist Richard Wotiz’s “Camera Image Stabilization” (p. 46). Wotiz details various IS techniques.

Our other columnists cover accelerated testing (George Novacek, p. 60), energy harvesting (George Martin, p. 64), and SNAP engine versatility (Jeff Bachiochi, p. 68).

Lastly, I’m excited to announce that we have a new columnist, Patrick Schaumont, whose article “One-Time Passwords from Your Watch” starts on page 52.

The Texas Instruments eZ430 Chronos watch displays a unique code that enables logging into Google’s Gmail. The code is derived from the current time and a secret value embedded in the watch. (Source: P. Schaumont)

Schaumont is an Associate Professor in the Bradley Department of Electrical and Computer Engineering at Virginia Tech. His interests include embedded security, covering hardware, firmware, and software. Welcome, Patrick!

Circuit Cellar 262 (May 2012) is now available.

# Weekly Elektor Wrap Up: Laser, Digital Peak Level Meter, & “Wolverine” MCU

It’s Friday, so it’s time for a review of Elektor news and content. Among the numerous interesting things Elektor covered this week were a laser project, a digital peak level meter for audio engineering enthusiasts, and an exciting new ultra-low-power MCU.

Are you an embedded designer who wants to start a laser project? Read about “the world’s smallest laser”:

What is the biggest constraint in creating tiny lasers? Pump power. Yes sir, all lasers require a certain amount of pump power from an outside source to begin emitting a coherent beam of light and the smaller a laser is, the greater the pump power needed to reach this state. The laser cavity consists of a tiny metal rod enclosed by a ring of metal-coated, quantum wells of semiconductor material. A team of researchers from the University of California has developed a technique that uses quantum electrodynamic effects in coaxial nanocavities to lower the amount of pump power needed. This allowed them to build the world’s smallest room-temperature, continuous wave laser. The whole device is only half a micron in diameter (human hair has on average a thickness of 50 micron).

The nanolaser design appears to be scalable – meaning that they could be shrunk to even smaller sizes – an important feature that would make it possible to harvest laser light from even smaller structures. Applications for such lasers could include tiny biochemical sensors or high-resolution displays, but the researchers are still working out the theory behind how these tiny lasers operate. They would also like to find a way to pump the lasers electrically instead of optically.

Be sure to check out Elektor’s laser projection project.

In other news, Elektor reached out to audio engineering-minded audio enthusiasts and presented an interesting project:

Are you an audio amateur hobbyist or professional? Do you try to avoid clipping in your recordings? To help you get your audio levels right, in January 2012 Elektor published a professional-quality peak level meter featuring 2x 40 LEDs, controlled by a powerful digital signal processor (DSP). As part of the eight-lesson course on Audio DSP, all the theory behind the meter was explained, and the accompanying source code was made available as a free download.

The DSP Board has been available for a while, and now we are proud to announce that the Digital Peak Level Meter is available as an Elektor quality kit for you to build. Although the meter was designed as an extension module for the Audio DSP board, it can be used with any microcontroller capable of providing SPI-compatible signals. So get your Peak Level Meter now and add a professional touch to your recording studio!

And lastly, on the MCU front, Elektor ran interesting piece about the Texas Instruments “Wolverine,” which should be available for sampling in June 2012:

Codenamed “Wolverine” for its aggressive power-saving technology, the improved ultra-low-power MSP430 microcontroller platform from Texas Instruments offers at least 50 % less power consumption than any other microcontroller in the industry: 360 nA real-time clock mode and less than 100 µA/MHz active power consumption. Typical battery powered applications spend as much as 99.9 % of their time in standby mode; Wolverine-based devices can consume as little as 360 nA in standby mode, more than doubling battery life.

Wolverine’s low power performance is made possible by using one unified ferromagnetic RAM (FRAM) for code and data instead of traditional Flash and SRAM memories, allowing them to consume 250 times less energy per bit compared to Flash- and EEPROM-based microcontrollers. Power consumption is further reduced thanks to an ultra low leakage  process technology that offers a 10x improvement in leakage and optimized mixed signal capabilities.

MSP430FR58xx microcontrollers based on the Wolverine technology platform will be available for sampling in June 2012.

Circuit Cellar and CircuitCellar.com are part of the Elektor group.