| A portion of this article was originally published in Circuit Cellar Ink, The Computer Applications Journal, June 1996. Email Scanning Devices Inc mail@scanningdevices.com to request a reprint of the article. Reprints include referenced figures, drawings and diagrams not found here. |
Suppliers of real-time weighing and force measurement systems now have an integration tool to connect weighing sensors to embedded PCs. Three criteria have been met, paving the way for PC-based weighing applications.
First, good quality, high performance analog-to-digital converters with emphasis on precision are changing the application limits in weighing, Applications can be implemented differently.
Second, microcontrollers with easy-to-use bus interfaces allow weighing applications to be segmented, using the vast processing, graphics, storage capabilities and presence of today's PCs to advantage.
And third, the emerging embedded PC bus standards, ISA and PC/104 have enabled effective industrial packaging, allowing the PC to be installed where weighing takes place.
Scanning Devices ISA- and PC/104-Compliant Load Cell Controllers use these new developments to enable embedded weighing systems.
This article describes weight and force measurement applications, tracing their evolution to today's microcontroller-based systems, and project the effect of these developments to tomorrow's embedded PC-based weighing systems.
The PC in today's weighing system
Until recently electronic weight and force measurement systems have been the domain of microcontrollers. The PC has been kept at arm's length, or more specifically, at the end of a serial communications line.
The highly valued portion of a weighing instrument is its ability to measure precisely a relatively small analog voltage signal representing the weight or force. The serial link to a PC to exchange data or the process parameters used for measurement was of less interest and often ended up being one-way. From the PC's point of view, input only!
System builders requiring the capabilities of both PCs and weighing indicators generally had no choice but to connect them via either EIA (RS232, RS422) or 20 milliamp current loop interfaces, with the PC system designer accepting the limited data exchange capabilities found in most digital indicators. (The weighing industry uses "indicator" to describe the instrument which works with a load cell to measure and display weight).
First some background on weight and force measurement
Mechanical weighing systems are typically either spring-based or lever-based instruments. The common dial bathroom scale or fruit stand produce scale is a spring-based scale which deflects a spring to rotate or displace a dial, displaying the weight. Spring-based scales are notoriously inaccurate - hence the old phrase "honest weight, no springs".
Lever-based instruments balance the unknown weight with a known weight on the end of a lever arm and are accurate enough to be used as legal-for-trade scales. However, reading and recording the weight is left to the interpretation of the viewer.
Figure 1 illustrates a typical electronic weighing system consisting of platform, load cell transducer and indicator.
Electronic weighing centers around strain gage transducers or load cells, sensing instruments which convert applied force to a resistance change.
The transducer is configured as a Wheatstone bridge made up of four resistive elements. Two are strain gages mechanically arranged to react positively to applied force, while the remaining two are arranged to react negatively to the same force. An excitation voltage applied to one pair of bridge terminals transforms to a measurement signal voltage on the other.
With no force or weight applied, the bridge is in balance and the signal voltage is zero. As force is applied, two strain gages are put in tension, the other two in compression; their effective resistances change in opposite directions. The Wheatstone bridge produces a signal voltage proportional to applied force.
Load cell specifications include capacity (the full load, such as 100 pounds) and output voltage ratio. The output is typically as 2 mV/V; ie, 2 millivolts of signal voltage per volt of excitation at capacity. If the excitation were 10 volts, the load cell signal would be 20 millivolts with 100 pounds applied.
The many capacities, mechanical configurations, and special features available with Load cells are provide almost unlimited application flexibility. Photo 1 shows a typical $350 beam style load cell. Excitation and the corresponding measurement signal voltages may be AC or DC, giving further design discretion to the transducer engineer.
By the nature of the Wheatstone bridge, load cells may be used individually or combined for additive weighing. For example, a platform may be supported on four load cells at its corners and the load cells electrically connected so that their signals sum to one equivalent load cell. The single measurement signal then represents the total weight on the platform, independent of the distribution of the weight on the four corners.
At first glance, the application seems straightforward: pass the signal through an analog-to-digital converter, do some math, drive a display or a printer, and if communications are needed, write to the serial port. Any PC with a general purpose analog input channel will do. Anybody could do this, you say.
Not so fast! Let's introduce some real-world requirements and complications which may illustrate why the PC-load cell combination is not installed in every scale. Let's also describe how a functional indicator deals with these complications. Scanning Device Load Cell Controller illustrated in Figure 2 shows the required components. Each has a purpose. Bypassing any compromises performance.
The signal is differential and its magnitude is typically measured in millivolts. A typical analog input channel in data acquisition systems delivers 12 bits of signal precision, measured with the assumption that the input signal spans a range of 0 to 5 volts. That is, the digital conversion is a 12 bit representation of a 5 volt input.
If the input were only 5 millivolts, (.001 of input range for the analog-to-digital converter, but not atypical of a load cell signal), the 12 bit conversion result would be 10 bits equal to zero followed by 2 bits of significant data.
Clearly an input amplifier stage is required. An input amplifier stage consisting of an instrumentation amplifier converts the small differential input into a range which is acceptable to an analog-to-digital converter. The amplifier also provides differential input and gain set by a single external resistor. Its offset control puts the amplifier output in the right range.
The Analog Devices Series 620 is an example of an instrumentation amplifier effective for this application. It is functionally equivalent to the three-amplifier configuration on the right in figure 3. Fewer parts, reduced noise and controlled gain favor the instrumentation amplifier most times.
Traditional electronic weighing systems offer input amplifier stages with dual adjustments, allowing a technician the flexibility to set the operating points of the input amplifier circuitry, zero and span, via some means.
The zero adjustment allows dead weight, that not significant for the measurement, to be removed via hardware. The zero adjustment sets the input amplifier to produce a minimum voltage when only the dead weight is applied.
The span adjustment sets the gain of the input amplifier so that the maximum voltage is generated when maximum weight of interest was applied to the load cell.
But if you are designing an embedded system, you don't want to provide adjustments. Why are zero and span necessary? Precision.
Quality load cell can achieve precision to 1 part in 5,000. Good ones can do even better.
To put that in the perspective of analog-to-digital converter specifications, that's 14 bits of precision in the result. Of course that statistic assumes the load cell signal spans the full input range of the analog-to-digital converter. In most cases it doesn't.
At a minimum, an input amplifier design must allow for over range voltages and negative measurements while producing a signal with which a converter can achieve 16 bits of precision. The high speed 12 bit sample and hold converter common on many computer I/O modules is just not the right tool for this task. What should we use?
Analog-to-digital converters using the delta-sigma technique are capable of precision extending to 24 bits. The Analog Devices AD7710 Series converters are examples of this type. These converters use successive approximation to achieve low frequency measurements with high precision, exactly the characteristics needed for weighing.
Conversion rates of 50 Hz are often adequate in static and quasi-static weighing. Giving up speed in return for precision is clearly the right choice for weighing applications.
The Analog Devices AD7712 Delta-Sigma Converter (see Figure 4) with serial digital interface satisfies the requirement. Surrounding the converter is linear input circuitry tuned to achieve high precision with acceptable speed and digital processing to interpret the conversion results.
Isn't 24 bits overkill? No. Let's examine how we can use the precision.
Scanning Devices has tested many good quality load cells to determine how much precision can reasonably be expected. Without presenting data, let's assume that a good quality load cell can deliver 18 bits of significant data. (That's 1 part in 262,000.) If we make a 24 bit conversion on a full scale signal, we will find 18 bits of significant data and 6 bits of random noise. We could argue at length about the data, how much significance can be extracted and by what means. But let's assume 18 bits and address the zero and span adjustments.
Making the weighing range span the converter's input voltage range assumes that the converter is the limiting factor in the precision of the measurement. If the weight range of interest spans 4 volts (for example, .5 to 4.5 volts at the input to the converter), the converter would produce a result with some significance.
If the same weight range of interest spanned 1 volt at the input to the converter, the result would have only one-fourth the significance. The result would be equivalent to taking the conversion from the 4 volt case and shifting it two bits to the right, causing the two least significant bits to be lost. The zero and span adjustments prevent this loss of significance, maximizing the precision of the measurement assuming the converter was the limiting factor.
But if we have more converter precision than can be used, why expose the application to adjustments? Load cells are specified so that the input range can be determined for a given load cell.
Let's make the input amplifier fixed so that it produces a reasonable span over the full range of the load cell. Also allow for both over range and negative signals. The application's weighing range of interest may be small, one fourth, one eighth or even less of the load cell capacity.
We effectively right-shifted the converter result by two, three or however many bits represent the unused converter input range. But if the least significant six bits are random noise, no significant data is lost.
We used the extra precision in the analog-to-digital converter to eliminate the necessity for input amplifier adjustments. We can put away the little screwdrivers and treat the load cell like a real computer peripheral!
Except, the measurement signal is at the load cell. The excitation voltage and millivolt level measurement signals must be routed to and from the measurement point, which might be some distance and through unfriendly environments. We don't have digital signals at the load cell to insulate the measurement from these conditions. Instead load cells use excitation sensing.
To compensate for possible voltage drops in the excitation wiring, load cells are often equipped with "sense" wires, connections to the excitation terminals which allow the weighing system to measure the applied excitation voltage at the load cell as well as the signal weight.
Remember, the load cell signal is specified as millivolts per volt of excitation. If the excitation voltage changes due to noise, voltage drops in the cable, or other causes, the measurement signal changes in proportion even if the applied weight does not.
How to compensate for excitation variation? The sense signal is brought into the measurement system via high impedance inputs so that little current flows in the sense leads. The sense signal is used to create a reference for the analog-to-digital converter. The reference defines the unit of measure in the analog-to-digital conversion. Think of the conversion as a digital number times the unit of measure defined by the reference. Changes in the excitation are compensated by equivalent changes in the converter's reference.
At last we have a measured signal in digital form. We've used an instrumentation amplifier, high precision analog-to-digital converter and excitation sensing operational amplifiers for the converter's reference. We have converter data in the on-board microcontroller, extracted with the portion of microcode detailed in Listing 1 and 2.
Traditionally, the process of weighing could be broken down into four more steps: tarring, conversion to engineering (weight) units, displaying and controlling. These steps were hard-coded into the indicator with no opportunity for adjustment.
With the entrance of the PC, these steps have become more modular. The developer can now program them to be automated or user directed.
I've broken the steps into more detail so the PC's new, more active role is visible:
The weighing system usually starts at some non-zero weight: a platform or mechanical mount for the load cell, the box or container for the item to be weighed, or the first ingredient in a two-ingredient recipe.
The measurement involves taking data from the load cell, storing and computing a tare or zero weight which must be subtracted from the gross measurement to obtain the net measurement.
When can the tare be measured? Having the user push a button when the platform is empty works for a microcontroller. Just route the button to a port pin and set up a loop to interrogate the button.
However, if the PC generates a tare command, then the system has more flexibility. Tare could come from a PC procedure, the user interface or any other means.
Here we have encountered the first need for bi-directional data exchange. The PC knows or can easily find out when to tare.
The load cell output is a voltage. The weight or force is in some other unit: pounds, kilograms, etc. The digital indicator multiplies to generate a weight in units of interest. But how are the calibration factors to be used in the calculation derived? And where are they stored?
The calibration procedure for an indicator - load cell combination specifies the calibration constants used for calculating the measurement from raw data. The PC can certainly be programmed to take an operator through the procedure and then store the results. Or down load the data on application startup. Or take the raw data and compute the weight itself. Suddenly we have several options.
Display is easy for a microcontroller as long as the display is on the board or in the same box with the microcontroller. Many varied digital displays are available with easy to program display driver chips.
Displaying data remotely is a different problem. Let the PC interpret weighing data, add date, time, batch number or whatever else is relevant and send the data on the network for display, print, incorporation into a report at another location.
Often, a measurement leads to process action. For example, if the weight is not between values 1 and 2, activate a reject mechanism. This kind of control action is easy for microcontrollers once the math as been established.
But where do the values come from? Are they programmed, computed from previous data, stored in a file, or downloaded from the network?
Notice that as we have come further down the list, the task extends beyond the traditional microcontroller. The application has become more than just measure a voltage generated by the load cell. The PC has readily available resources to augment the application while the microcontroller does not.
Scanning Devices Inc. manufacturers ISA and PC/104 compliant load cell controllers which takes advantage of these new developments. These use an 8051 derivative microcontroller with a "handshaking" port as the PC bus interface. The microcontroller uses a bi-directional 8-bit port for data transfers to and from the PC bus with a two bit port control status register.
The 754P-LC3 Load Cell Controller for example, is implemented as an 8-bit, stack-through PC/104-compliant module, providing excitation, sense inputs and measurement inputs for a single loadcell. Other models offer interfaces for four independent load cells and for the ISA bus. The key to measurement is a high precision analog-to-digital converter, Analog Devices AD7712. Controllers also offers four digital inputs and four digital outputs for process monitoring and control.
But what takes it a step ahead of the system with a digital indicator installed on the PC's serial port is the rich set of data exchange and control transactions possible between the PC and load cell controller. These transactions let the PC control the microcontroller and converter operations so the developer can maximize resources for each part of the application.
In photo three, you see the main-menu screen of the Lancelot PC-based demo program. The screen shows buttons for calibration and filter setup, setpoint control, mode selection, digital input/output control and measurement data transfer and display. All of these can be under user or program control.
Scanning Devices' software runs in the on board microcontroller to setup and control the analog-to-digital converter, implement post conversion digital filtering, compute weight from raw conversion data, compare weight to setpoints, monitor digital inputs and set digital outputs. With this capability and an on-board EEPROM for permanent storage, the indicator-module runs independent of the PC for much of the application.
However, when the PC writes a command to the controller's port address, its a different story. The controller is passive regarding the PC bus. All transactions are initiated by the PC. When the PC writes a character to the module's address, the microcontroller interprets the command and responds either accepting data from or transfers it to the PC.
Table 1 shows the thirteen transactions currently implemented, all related to setup and data transfers. Compare this level of PC communications and control to the one way serial output of traditional indicators.
The above commands refer to the following data variables stored and used in the indicator-module.
By making the raw data as well as the weight available, PC users can implement their own weight calculations, introduce different types of filtering, compare to more setpoints. By providing access to digital inputs and control over digital outputs, PC users control over the whole process.
So while the load cell controller may be setup to run independently of the PC, it may also be configured as a special purpose data acquisition module with calculations and logic done completely in the PC. The choice is the system designer's.
Because of the potential for industrial packaging. Scanning Devices is involved in industrial weighing for process control. This type of weighing occurs under the material, not on the desktop. Dirt, moisture, electrical noise and other irritants make short life of unprotected desktop PCs. Protecting desktop PCs is sometimes costly enough to discourage the application or move the PC to the office and connect the indicator via the serial port.
The PC/104 Consortium has specified a small form factor with relaxed bus drive characteristics. These characteristics allow systems to be built with smaller power supplies, limited cooling requirements and smaller enclosures. Development of a standard has encouraged many companies to build component level products. (Scanning Devices was an early member of the PC/104 consortium.)
Because not all applications need industrial packaging. Weighing with desktop systems becomes attractive when standard PC packages are available. "Add a module and a load cell to your PC and start weighing!".
And for application development. PC/104 and ISA are electrically equivalent. Scanning Devices modules are software compatible. Develop an application using a desktop PC with the ISA form factor, run it on an embedded PC/104 system. The software can be the same.
By using a microcontroller-based module with extensive PC data interchange and control capabilities, you can integrate weight and force measurement capability with embedded PCs. The load cell is a PC peripheral just like a disk drive or printer.
David Chanoux - Biography
David Chanoux is president of Scanning Devices Inc., Burlington, MA, a manufacturer of sensors, instruments and controls for industrial automation. He has been working with industrial and real-time computers since 1971 at Scanning Devices, Digital Equipment and IBM. He holds BSEE and MSEE degrees from Massachusetts Institute of Technology and an MBA from Harvard University. He can be reached at 781-272-5135, via Email: mail@scanningdevices.com or URL: www.scanningdevices.com
A portion of this article was published in Circuit Cellars Inc., June 1996.
Home Page | Application Stories | Product Information | Computer I/O | PC/104 | Engineering | News | Publications | Trade Shows | Employment
Copyright Ó 2000 Scanning Devices Inc.