PSoC Microcontroller and LVDT for Position Measurement
Inexpensive composite signal processors eliminate external analog circuitry.
Connecting an LVDT (Linear Variable Differential Transformer) to a microcontroller is challenging because an LVDT requires AC input excitation and AC output measurements to determine the position of its movable core (Reference 1). Most microcontrollers lack dedicated AC signal generation and processing capabilities, so external circuits are required to generate sine wave signals with arbitrary harmonics, amplitudes, and stable frequencies. The amplitude and phase of the LVDT output signal are converted into a form compatible with the microcontroller’s internal ADC, generally requiring the addition of external circuits.
Compared to traditional microcontrollers, Cypress semiconductor‘s PSoC microcontrollers contain user-configurable logic and analog blocks that simplify the generation and measurement of AC signals. PSoC devices have the unique ability to generate analog signals without continuous CPU intervention. PSoC’s flexible analog and digital blocks can drive an LVDT and measure its output without external circuitry. Figure 1 shows the complete circuit of the LVDT interface, and Figure 2 shows the internal circuit block diagram of the PSoC microcontroller.
Figure 1 Complete circuit of LVDT interface
Figure 2 Internal circuit block diagram of PSoC microcontroller
PSoC uses multiple pairs of user-configurable switched capacitor blocks to implement bandpass and lowpass filters.By generating a square wave and superimposing it on a PSoC switched capacitor filter with a voltage regulator built into the first switched capacitor block, creating
High quality sine wave. The square wave removes most of the harmonics with a narrow-band bandpass filter centered at the square wave’s fundamental frequency.
To generate the highest fidelity sine wave from the PSoC switched capacitor bandpass filter, use the highest possible oversampling rate by a factor of about 33, or 33 orders per sine wave cycle. The resulting sine wave is smooth enough to drive an LVDT that attenuates residual higher harmonics. Adjusting the PSoC’s internal voltage reference with a programmable gain amplifier allows rough control of the square wave amplitude before filtering. To compensate for the waveform DC offset voltage, the amplifier buffers the 2.6V internal analog ground reference and drives the output pins that function as the LVDT analog ground return.
The LVDT output consists of a sine-wave voltage of variable amplitude that undergoes a considerable variable shift in phase angle relative to the sine-wave excitation voltage, sometimes exceeding 180. The LVDT signal drives the PSoC’s programmable gain amplifier, whose output is fed to a switched capacitor low-pass filter, followed by a voltage regulator for synchronous rectification. The rectified signal drives an output pin and the PSoC’s switched capacitor ADC.
The LVDT output is added to the synchronous regulator, followed by a low-pass filter, to generate a DC voltage to the ADC or directly drive the analog feedback control system. In a PSoC microcontroller, the low-pass switched capacitor filter connected to the ADC requires the same sampling clock to drive both circuits, resulting in the slew rate of the PSoC’s 11-bit delta-S ADC being approximately half the low-pass filter corner frequency . Synchronous regulation produces a ripple frequency twice the excitation frequency and is therefore easier to remove by a low-pass filter. By redesigning the corner frequency of the low-pass filter to be one third of the excitation frequency, it is possible to measure the LVDT output with 11-bit resolution at or below 1 LSB (least significant bit) standard deviation.
The 24MHz internal system clock of the PSoC is divided by a logic block configured as a counter chain to generate the digital clock signal required by the switched capacitor analog circuit block. After power-up or reset, the PSoC’s CPU configures all configurable analog and digital circuit blocks and begins operation. Since then, the hardware has been able to excite the LVDT and measure its output at 500 samples per second without CPU involvement. When the PSoC CPU runs at 12MHz, processing ADC internal actions and interrupts consumes less than 3% of the CPU’s resources.
Numerous PSoC resources are still available for calculating the LVDT position, as well as displaying the results in text form on the LCD module. Four analog circuit blocks, five logic circuit blocks, and many I/O pins are available to support more demanding applications. Figure 3 shows the configurable modules available for additional functionality.
Figure 3 Configurable modules available for additional functionality
references:
1. “Linear variable differential transformer,” Wikipedia
English original:
PSoC microcontroller and LVDT measure position
Low-cost mixed-signal processor eliminates external analog circuitry.
Sigurd Peterson, Sig3 Consulting, Aloha, OR; Edited by Brad Thompson and Fran Granville — EDN, 10/26/2006
Connecting an LVDT (linear-variable-differential transformer) to a microcontroller can prove challenging because an LVDT requires ac-input excitation and measurement of ac outputs to determine its movable core’s position (Reference 1). Most microcontrollers lack dedicated ac-signal-generation and -processing capabilities and thus require external circuitry to generate harmonic-free, amplitude- and frequency-stable sine-wave signals. Conversion of an LVDT’s output signals’ amplitude and phase into a form compatible with a microcontroller’s internal ADC usually requires additional external circuitry .
In contrast with conventional microcontrollers, Cypress semiconductor Corp’s PSoC microcontrollers include user-configurable logic and analog blocks that simplify generation and measurement of ac signals. PSoC devices have the unusual feature of being able to generate analog signals without demanding continuous CPU attention. The PSoC’s flexible analog and digital blocks can drive an LVDT and measure its outputs without requiring any external circuitry. Figure 1 shows the complete circuit of the LVDT interface, and Figure 2 shows the PSoC microcontroller’s internal circuit blocks.
The PSoC uses pairs of user-configurable switched-capacitor blocks to implement both bandpass and lowpass filters. You can create a high-quality sine wave by generating a square wave and applying it to a PSoC switched-capacitor filter through a modulator built into the PSoC first switched-capacitor block. Passing the square wave through a narrow bandpass filter centered on the square wave’s fundamental frequency removes most of the harmonics.
To obtain the highest fidelity sine waveform from a PSoC switched-capacitor bandpass filter, use the highest possible oversampling rate—a factor of approximately 33—or 33 steps per sine-wave cycle. The resultant sine wave is smooth enough to drive an LVDT, which attenuates any residual higher order harmonics. Scaling the PSoC’s internal voltage reference with a programmable-gain amplifier provides coarse control over the square wave’s amplitude before it undergoes filtering. To compensate for the waveform’s dc-offset voltage, an amplifier buffers the 2.6V internal analog-ground reference and drives an output pin that serves as the LVDT’s analog-ground return.
The LVDT’s output consists of a variable-amplitude sine-wave voltage whose phase angle with respect to the sine-wave excitation voltage undergoes a significant and variable shift that sometimes exceeds 180°. A signal from the LVDT drives one of the PSoC’s programmable-gain amplifiers, whose output feeds a switched-capacitor lowpass filter followed by a modulator for synchronous rectification. The rectified signal drives an output pin and o
ne of the PSoC’s switched-capacitor ADCs.
Applying the LVDT’s output to a synchronous rectifier followed by a lowpass filter produces a dc voltage that can feed an ADC or directly drive an analog feedback-control system. In a PSoC microcontroller, a lowpass switched-capacitor filter connected to an ADC requires that the same sample clock drive both circuits, resulting in a conversion rate for the PSoC’s 11-bit delta-sigma ADC that’s approximately one-half of the lowpass filter’s corner frequency. Synchronous rectification produces a ripple frequency twice that of the excitation frequency and thus is easier to remove with a lowpass filter. Relocating the lowpass filter’s corner frequency to one-third of the excitation frequency allows measurements of the LVDT’s output to 11-bit resolution with a standard deviation of 1 LSB (least significant bit) or less.
Dividing the PSoC’s 24-MHz internal system clock with logic blocks configured as counter chains generates all of the digital clock signals the switched-capacitor analog-circuit blocks require. After power application or a reset, the PSoC’s CPU configures all the configured analog and digital blocks and starts their operation. From then on, the hardware excites the LVDT and measures its output at 500 samples/sec without further intervention by the CPU. With the PSoC’s CPU running at 12 MHz, processing the ADC’s housekeeping activities and interrupts consumes less than 3% of the CPU’s resources.
Plenty of the PSoC’s resources remain available for calculating the LVDT’s position and for displaying the results in text format on an LCD module. Four analog blocks, five logic blocks, and many I/O pins remain available to support a more demanding application. Figure 3 shows configurable blocks that are available for adding features.
English original address:http://www.edn.com/article/CA6382647.html
The Links: G320ZAN011 CM200DU-24NFH