|Mixed Scale DRO Controller with MSP430 Launchap|
So far the DRO controllers I’ve designed have been able to read only the IGaging (Shahe) Remote DRO scales. Lately I’ve been getting an increasing number of requests for a firmware that could read the standard “chinese” linear scales.A few months ago I started working on a new version that would do just that. Although the project is still a bit rough around the edges, I’m pretty sure that the hardware will stay unchanged and any future updates will be done via firmware. Rather than holding off until the whole shebang is done, I decided to post the stable version of the firmware. In the next few posts I will provide details for the project, design considerations, build instructions and firmware implementation.
My main goal was to design a controller that could read a mix of common inexpensive digital scale types. After digging through my garage, couple of eBay orders and donations from few generous readers I was able to source about a dozen of different scales and calipers. The first thing I discovered (to my delight) was that all of them used the same 4-pin data port; pin functions appeared to be identical as well. Moreover, the power supply voltage was 1.5V [nominal] across the board.
After analyzing the output I discovered that majority of [better] digital calipers and linear scales use the 2x24-bit protocol; a few cheap calipers used a funky 24-bit protocol* I described in the post "Harbor Freight Caliper Data Format". One caliper used a 28-bit format, but it didn’t live long enough for me to decipher it. All of the caliper used data clock speed around 80-90 KHz. Interestingly, only two of the 2x24-bit scales worked in the “fast” mode with 50 Hz data refresh rate; the rest had refresh rate of 3 Hz or so.
*One of the readers told me that this protocol is called “BIN6”, so I will use that name for it from now on.
Since I wasn’t able to find another caliper that uses the 28-bit format, I decided to skip it for now. This meant that the new controller would need to support three different protocols: iGaging [Shahe] 21-bit, BIN6 and “standard” 2x24-bit. In future support for more protocols can be added as needed, as long as the scales use the same 4-wire connection. As a stretch goal, it would be nice for this controller to support quadrature encoders [glass scales] as well.
Some rough calculations suggested that the MSP420G2553 microcontroller [ that ships with the MSP430 Value Line Launchpad kit] should be capable of handling three or four scales, so I decided to use it for this controller.
There are two things that make this version of the controller different from the one used for iGaging scales:
- The scales use 1.5 Volt power supply. Although seemingly minor difference, it means that the voltage levels at the data port are below the threshold of what MSP430 can read. Similarly, the 5V that the glass scales output will damage MSP430 inputs. In other words the controller will require additional level shifting circuitry that will translate 1.5V and 5V to 3.3V or that the Launchpad can work with.
- Unlike the iGaging [Shahe] “Remote DRO”, standard scales provide their own clock. In other words the Launchpad has no control over when the data will arrive. In the worst case scenario all four scales might decide to send the data at the same time, and the firmware will need to be able to deal with it efficiently (without losing bits).
|Complete DRO controller setup with a "fancy" 1.5V power supply|
At this time the controller can auto-detect and read up to four iGaging [Shahe] Remode DRO scales, standard scales that use the 2x24-bit protocol and “Harbor Freight” calipers. It is set up to provide 1.5V, 3.3V and 5V power supply to the scales. The latter two voltages are provided directly from the MSP430 Launchpad board; 1.5V requires an external power supply (either using single 1.5V battery or a DC power converter). Current version of the firmware doesn’t have a way to switch the scales into the “fast” mode, but the if switched manually, the controller seems to keep up with the input pretty well.
The hardware is designed to work with 5V quadrature encoders [glass scales] but the firmware doesn’t support their input yet.
|Complete test setup with four types of scales|
The new controller will extend the capabilities of the Touch DRO Android application by offering support for more capacitive linear scale types. It appears that there are two common protocol that should cover a large portion of the scales on the market. Fortunately MSP430 chip that ships with the current version of MSP430 Value Line Launchpad kit should be able to handle it pretty well. In the next post I will explain what additional hardware is needed and describe one of the designs I came up with.