TouchDRO Supports new Chinese DRO Scales

Monday, February 4, 2019
TouchDRO "Black" Adapter Support All of The Shown Digital Readout Scales Now 

A few weeks ago, I finally found some time to experiment with the new Shahe Digital Linear Scales 5403-xxx and 5404-xxx. Electrically these scales are compatible with other 3V capacitive DRO scales such as iGaging DigiMag, EZ-View DRO and iGaging Absolute DRO. This means that adding support for the new scales is a matter of updating the firmware of the TouchDRO adapter for iGaging and Shahe DRO scales. After cursory check of scale protocol, I was expecting this to be a relatively easy addition to the existing firmware since they use the familiar BIN6 protocol. In practice, supporting Shahe "Remote DRO" scales ended up requiring a complete rewrite of large portion of the firmware. While at it, I decided to invest some more time into adding several other improvements that have been on my "to do" list for some time now. After several weeks of testing and debugging, the new firmware is ready to be released. In addition to the added protocol support, the updated firmware includes a few major performance and stability tweaks that will make capacitive DRO scales behave much more reliable in a shop environment.

Supported Protocols

Obviously, the biggest change in this version is a support for the new scales. The board now supports three capacitive scale protocols:

  • iGaging 21-bit protocol that is used by the iGaging EZ-View, older DigiMag "Remote DRO" scales and their generic/rebranded counterparts, including AccuRemote and Shars
  • Modified Digimatic SPC protocol used by iGaging Absolute DRO Plus scales
  • BIN6 protocol used by the new Shahe 5403 and 5404 remote digital readout scales

Supporting the new scales went well beyond the ability to parse the protocol and convert the data bits to some normalized units. To operate with best stability and reliability, each scale type has to have data and clock lines set up slightly differently. For instance, iGaging EZ-View scales work best with the clock line in Push/Pull mode and data line floating. Absolute scales won't even send the position if both lines are not pulled up to Vcc. In contrast, the new Shahe scales go nuts if the data line is pulled up, but need the clock input pin pulled up. Making things even more complicated is the fact that 21-bit scales need to be read on the falling edge of the clock signal, Shahe scales need to be read at the raising edge, and the absolute scales need to be read a few microseconds after the raising edge.

All this required multi-stage initialization routine that manipulates the clock line, reads the input, tries to guess what the scale type is, adjusts the data line to the state appropriate for the given scale and check that the data stream matches the expected pattern. Once the scale type is determined, the firmware applies optimal pull up/down resistors configuration and interrupt edge for each axis. It then disables any unused lines and starts processing position updates and sending them to the application.

Improved Tachometer Accuracy

Stable Tachometer Reading With 0.3Hz Input

Second major improvement in the new firmware is a new tachometer implementation that can handle very low RPMs without sacrificing high-RPM performance. Up to this point, TouchDRO firmware had a relatively naive implementation of tachometer. The processor counted the number of incoming pulses for a second and multiplied the result by 60 to get pulses per minute. This approach works pretty good for higher pulses per minute (PPM), especially with fine encoder disks at the cost of choppy low PPM performance.

Handling low RPM tachometer input is simple in theory. The algorithm is roughly as follows:

  • Get the number of milliseconds between pulses
  • Average a few values for stability
  • Divide the number of milliseconds in a minute by the averaged value

The problem is that this approach requires two division operations, one to get the average and another to get the PPM. MSP430 lacks division hardware so division is extremely slow. I spent several months before this update experimenting with various tricks and was able to design a solution using in-memory lookup tables and bit shifting operations that completely avoid software division. The result is a tachometer implementation that can handle low-PPM input faster than the old version could with far superior accuracy. It also eliminates a small drift that was present in the old version. I.e. as the number of pulses per second increase the tachometer timing could drift up to 2-3% due to the computational overhead. While this irrelevant for any day-to-day usage scenario, it bugged me a bit; so, in the new implementation, I got it to within 0.4% over the 20 PPM to 10,000 PPM range.

Faster Position Update Rate

Another area where I've improved the firmware is the position refresh rate. Previous version refreshed all four axis positions at 10Hz. This results in maximum delay of 100 ms in the worst case scenario, which should result in no perceivable lag. There is a decent amount of research done on this subject suggesting that an average human can perceive a delay of about 150 ms between "subject simulated motor input and the resulting visual stimulus". This concept is called "horizon of simultaneity" and in plain english means that if, for example, you flip a switch and it takes less than 150 ms for the light to come on, you will not notice any delay.

But why leave well enough alone? In the new firmware I decided to bump the refresh rate to 20Hz and implement a smarter position refresh logic. First, the controller won't send position to the app for disconnected scales. Second, and more importantly, the firmware uses dynamic refresh rate for active scales. In other words, after a data stream from a scale is received the firmware checks if the position has changed. If it has, the controller will send it to the app up to 20 times per second, or 2x faster than the old version. On the other hand, if the scale hasn't moved, the controller will drop the refresh rate to 4Hz. The good news is that even if you are somehow able to move four axes at the same time, all four will refresh at full 20 Hz.

Smaller Tweaks

There are two smaller tweaks that will be useful with the next version of the TouchDRO app. First, once per second the controller sends a small message to the app that contains the information about which scales are active and what protocol they use. This will make it possible for the app to load better defaults during the initial setup and prevent issues where the users don't set correct scale resolution.

Second, probe status is handled slightly different in the new firmware. Previously, once the probe was activated, the board would send its status to the app at the same cadence as the rest of the axes. New firmware does it a bit better: the moment probe is activated, the processor takes a snapshot of scale positions, sends the position to the app, and sends the probe status immediately after the position readout. As long as the probe is activated, the board will keep sending the "probe is on" message to the TouchDRO app every 50 milliseconds. Once the probe is deactivated, the board will send the "probe is off" message to the app for one more second and stop. This does two things:

  • Reduces the lag between the time probe is activated and the app has a chance to handle the message
  • Saves a bit of bandwidth by not blasting probe status while it's off


As you can see, besides the obvious benefit of having support for the new Shahe Linear Digital Readout scales, the new firmware has a number of other enhancements. Probably the most noticeable will be the effect of improved scale detection logic since each scales input will be optimized for best stability. More stable tachometer reading will not make a huge difference for many users, but those who need high precision, low RPM tachometer on their mill or lathe this will definitely be a nice the improvement. Faster and smarter position refresh logic and probe status reporting won't be something that most people will notice and is will mostly help make other features in the new TouchDRO version more responsive. Overall the new firmware version will improve stability, accuracy and responsiveness of a do-it-yourself DRO setup that uses the supported capacitive scales.


  1. This comment has been removed by the author.

    1. This comment has been removed by the author.

    2. Please contact Al at Blu-DRO. He is pretty good about addressing hist customer's issues. Also, this issue has nothing to do with the current post, so you are more likely to get help on the Help and Support forum (link on the top of the page).

  2. This comment has been removed by the author.

  3. Is the new firmware available for the MSP430 launchpad? I need a new scale for the lathe.

  4. I'm really looking forward to seeing this, Yuriy. It's good to see you back on it.

  5. Good evening, I wanted to know the power supply voltage of the TouchDRO BlueTooth Adapter, and if the positive and the central one.
    Thank you

  6. Good evening
    I have 2 scales like the gray ones in the picture, I tried to connect the scale to the touch dro with a mini-b to micro-b adapter, but it does not read.

    1. This firmware comes on the pre-made boards only right now. The first batch of boards with V2.0 firmware shipped out last Saturday, so I think you are either using a board with the old firmware, of a DIY board. Neither will read the new scales.

    2. You sent it to me on January 28, 2019.
      How can I upgrade the firmware to V2

    3. I can reprogram it for you if you want to send it back to me.

  7. I have a Sieg sx2p milling machine that I equip with new digital scales shahe. They will be connected to the Msp 430 "Igaging" controller.
    The milling machine has a tachymeter output. Is it possible to connect it to the controller?

    Thank you and congratulations for all your work!
    Bests regards.

    1. I don't think there is a direct way. I haven't had a chance to play with SX2, but on SX4 there is no techometer sensor on the spindle. The machine uses signal from the motor driver to infer the RPM. I asked SIEG if they have any documentation on the pinout, so I can just tap into the pulse, but they didn't respond.


    2. On this site you will find, I believe, all possible information

      Best regads Guiu

  8. Yuriy,
    I have a question on the tach. I bought my board from Al and once I got the tach working it has an error of 3%. The motor speed is 1764 rpm and the tach readout is 1710 rpm. This is with 20 ppr (I've tried less ppr but it seems to make no difference on the percentage it is off). My question is can the updated software you are talking about make a difference in what I'm experiencing or is it not worth it. And can the newer software be installed on my board. Just so you know I'm the dunderhead who could not get the tach working until I used shielded wire and grounded the shield to the board (and by the way, that blog about bonding was very informative and I thank you for posting it). Please let me know your opinion

  9. Hello yuriy. I have been searching your site for a contact email to ask you a question .I ordered your igaging board last week and I was just curious to know when do u think I could be expecting it. I can give you the order number if you need it. I live in northern Indiana. Thank you for your time .

    1. HI, I usually ship the orders over the weekend but had a bit of a "situation" yesterday. Your order will be in the mail later today. If you are in the USA, you will have the board by Thursday or Friday. Sorry for the delay.

  10. Thank you so much for responding so quickly. Yes I am in the USA. Indiana actually. Thanks again. Can't wait to get the board. I tried the launch pad approach and that turned into a disaster. Lol.
    Somehow I killed my scale in the process. Figured buying your board would save me stress and scales. Lol