Android DRO Step By Step Overview

Wednesday, July 23, 2014

Since I added a DRO to my mill I can't imagine how I lived without one for so long; it makes working on the mill so much easier and more efficie. Since you're reading this post, you are probably looking into building a DRO as well, and if you feel lost, you're not alone. Although I've been trying hard to keep the project as simple as possible, so it remain accessible to people with little or no experience with electronics or computers, it might seem a bit overwhelming.I this post I will provide a quick summary of the steps needed to get a DRO up and running with links to more information where appropriate.

Before going further, I'd like to clarify some things, so we are on the same page. First of all, Android DRO consists of three functional components:

  • A free Android app called TouchDRO that provides the user interface similar to a commercial DRO unit
  • A scale interface controller that reads the raw input from the scales and sends it to the app
  • A set of scales/position encoders attached to the machine that provide the position to the controller

In order to obtain a working DRO setup you will need to purchase an Android device and a set of scales (if you don't already have them) and build a controller. The controller requires a very minimal amount of soldering. In my experience the process, start-to-finish, takes somewhere around 3-6 hours if things go as planned.

Step 1 - Select DRO Scales

At the time of this writing the project supports the several kinds of capacitive scales and quadrature encoders, such as:

  • 21-bit scales,i.e. iGaging/AccuRemote/Shahe Remote DRO
  • Sylvac 24 bit scales, AKA "Standard Chinese Scales
  • iGaging "SPI" protocol used by iGaging AbsoluteDRO+
  • Chinese calipers that use BIN6 protocol, i.e. common Harbor Freight digital calipers and alike
  • Glass DRO Scales, such as Ditron, Easson, etc.
  • Magnetic scales that provide quadrature signal

If you don’t already have a set of scales, selecting one should be your first step, since the type of scales you use will affect your choice if the controller etc. The two posts liked below provide more details on the important digital readout scale parameters and a give a brief comparison of different types of scales.

Step 2 - Build or Buy a Controller for the Scales

Once you've selected the scales, the next order of business is to build or buy a DRO scale controller, A.K.A. scale interface. Depending on the type of scales you've chosen, you can purchase a pre-assembled DRO adapter board or a DIY kit from the store, or build one from scratch. There are following purchase options:

  • iGaging - supports 21-bit iGaging DigiMag, AccuRemove and Shahe scales, as well the new iGaging AbsoluteDRO Plus scales
  • Quadrature - supports glass/magnetic scales and other quadrature encodes (double and single ended)
  • Mixed Scale Kit - supports most common types of capacitive scales

The choice between scratch-built controller, DIY kit, and pre-assembled board comes down to your budget. Scratch-building a controller is less expensive and doesn't require extraordinary electronics skills. On the other hand, pre-assembled boards are more convenient and in the long run will be more stable and reliable. Functionally both versions Quardature and Mixed Scale firmware are identical. iGaging version has some board-specific tweaks, so it can read the scales faster. Electrically, pre-made boards are superior though, since the they are designed and laid out to be much more immune to shop noise. Furthermore, the quadrature controller, have proper input signal processing circuitry that follow scale manufacturers' specifications and is designed to work with single- and double-ended input signal.
If you are short on money and know how to solder and upload firmware, there are four DIY DRO controller versions to choose from:

Please note, I don't intend to continue any develop of the Arduino version of the controller, so for iGaging scales I recommend that you stick with MSP430 version of the controller

A comparison of the four DIY DRO controller versions is posted on the Android DRO project page. for more information, build instructions and firmware downloads follow the links to each individual controller’s page

Please keep in mind that you will need to upload [flash] the firmware to the controller. The process can be a bit more challenging on non-Windows computers, though, so plan accordingly.

Optionally, once the controller is build and flashed, you can use a serial terminal app (such as BlueTerm, etc.) to make sure that the phone/table is receiving data stream from the controller. If everything goes well, you should see a string similar to the screenshot below.

Step 3 - Install the Scales

This step is pretty self-explanatory, and assuming that you were able to successfully finish all of the previous steps, shouldn't pose many headaches.

If you're using iGaging DigiMag or AccuRemote scales (or any other capacitve scales, for that matter), take a look at these two posts:

Many people never have any issues, but knowing what they are might save you some frustration down the road.

Step 4 - Install TouchDRO Application

TouchDRO is an Android application and will, quite obviously, require an Android device to run on. If you already have an Android tablet or a phone, please check the system requirements posted on the Android DRO Project page to make sure it will work with TouchDRO. If you don’t have one yet, the Project page has a list of suggested tablets as well.

The application is available as a free download from Google Play Store or from the DRO Project Downloads page. I strongly suggest that you use the former method, since the Play Store will automatically check system requirements and keep you up to date with updates. To install the application simply open the Play Store app on your device and search for "TouchDRO" (without quotes)

Step 5 - Perform the Initial Setup

If you're using BlueTooth to communicate with the controller, this is a good time to pair it to the phone/tablet.

At this point you should have a working scale interface controller and a phone or tablet with TouchDRO installed. Now it's time to perform a basic setup. At minimum, you should select the correct connection type, USB or BlueTooth, choose which axes you will be using and set the initial axis counts-per-inch values as described in the linked post. More detailed explanation of the settins is available on the TouchDRO Settings Overview page.

With the setup complete, connect to the controller and verify that the application is receiving data. If things are working correctly the application will connect to the controller and the title bar will display "TouchDRO - Connected" in green. If things went wrong somewhere, the app will either fail to connect altogether, or the title will be "TouchDRO - No Data" shown in orange font. The former indicates a failure to connect to the BlueTooth transceiver and the latter means that the connection was established but the app is not receiving valid data. After 30 second of no data the application will disconnect automatically to reduce battery consumption. More information on how to deal with those issues can be found in the "Troubleshooting Common DRO Connection Problems" post.

Step 6 - Calibrate the Scales

Finally we're in the home stretch. The DRO is set up, mounted and almost ready to go. In order to achieve best accuracy from your DRO setup you need to one last thing - calibrate your scales. The counts-per-inch values vary widely between different scale batches, and might not even be available for others. Moreover, you might've introduced some cosine error if the scales aren't absolutely parallel to the axis of travel, etc. The in-place calibration takes care of those issues. The process is described in detail in the "DRO Scale Calibration" post and should take only a few minutes.

Step 7 - Play With the DRO

Seriously, before using the DRO on an important workpiece, spend some time playing with it. There is a lot of features hiding behind the simple user interface, so poke around the screen a bit; you won't break the app by clicking the wrong thing. To find out how to use various TouchDRO functions please visit TouchDRO YouTube channel.

Conclusion

Putting a DIY DRO together pretty straightforward, but requires several steps. This post is just a brief summary, but it should give you an idea of the overall process. If you end up hitting a snag, please feel free to ask questions; I will try to help as much as I can.

55 comments :

  1. What controller do I need to get for two glass scales and one chinese scale?

    ReplyDelete
    Replies
    1. I started working on a version for the LaunchPad but it's still "work in progress", so I don't know when (if at all) it will be ready. I'm having trouble sqeezing enough horsepower from the MSP430G2553 chip to handle the protocol detection and there aren't enough pins to set it explicitly. I might end up creating an ARM-based version for that.
      Regards
      Yuriy

      Delete
  2. Thank you for this! I've been following your project for some time and just measured my mill and ordered a bluetooth module for this. Will try this building with AccuRemote scales. This post puts the pieces together. Good clean fun!

    ReplyDelete
    Replies
    1. Wow! Everything worked the first time!

      I bought an Arduino UNO, proto shield, Bluetooth module, a little blue plastic Arduino case, three AccuRemote scales, some mini USB cables, and a Nexus 7 tablet, all from Amazon.

      I modified the protoshield so it would also fit into the little plastic case with the Arduino (2.375" x 3" x 1"). Wired up the circuit according to your diagram and photos (more or less). Plugged a USB cable into one of the scales with the shield grounded only on the scale end, soldered the other end to the proto board. I dumped your sketch to the Arduino and used the serial monitor to see it was reading the scale. Then disconnected the Arduino from the laptop, plugged in the Bluetooth module, powered up the Arduino with a 9v 1A power supply, enabled the Nexus Bluetooth, and fired up the TouchDRO app.

      I got numbers the first time! And they seem correct and stable. I didn't even have to debug!

      Thank you^3! Such a clever, simple, beautiful, and inexpensive solution, and good clean fun as well. :-)

      Now to test the other scales and figure out how to mount everything on my little mill, then calibrate. I have the Little Machine Shop HiTorque solid column mill.

      Hey, if anyone wants details of my mods to the proto shield and little case to make everything fit in a snug package, let me know and I'll write it up and take some photos. I don't have a web site but maybe I could put it on Facebook. This is the case:
      http://www.amazon.com/SB-Enclosure-Transparent-Computer-Compatible/dp/B00HSDOVB6

      Hey, one display problem with using the TouchDRO with my 2013 Nexus 7:
      The "Hole Pattern" button is partially cut off, in line with the right end of the 7-segment numerical display. I see this is the same as in a photo in your post about the X3 mill. Anything to do about that? Get different tablet? Wait for updated app?

      Thanks again! Now where is that contribute button...


      John K Jordan

      Delete
    2. Never mind about the display issue. I see the row of buttons can slide left and right.

      Delete
    3. JKJ, glad that it worked so smoothly :) You'll like your mini mill much more once the DRO is all mounted...

      Delete
  3. Glad to see your updates Yuriy. Out of curiosity, what is the limiting factor(s) that prevents a setup using an Arduino and the calipers that use BIN6 protocol?

    ReplyDelete
    Replies
    1. Marmil,
      I was resisting the move to "native" AVR code, so the sketch stays portable, so it was the 2 interrupt limit that was the issue. Actually BIN6 should (in theory) work. The calipers are slow enough, so Arduino would keep up. The problem is actually the "fast" mode of the Sylvac scales ("standard" 24x2 bit scales).

      Regards
      Yuriy

      P.S. Keep in mind, my definition of "works with XYZ" is pretty strict: the firmware has to work with *any* configuration, or I will hear about it in a hurry :). Making it work with *a* configuration is much simpler...

      Delete
  4. Hi Yuriy
    Is there anyway to use a 1st generation iPad as the display?
    1st generation iPads are now basically "junk" and cheap as a result and I have one.
    Regards
    Ken

    ReplyDelete
    Replies
    1. Ken,
      No, the app is written in Java specifically for Android and isn't portable. I.e. I would need to rewrite it from scratch.
      You can still sell your iPad on eBay for more than some Android tablets cost, though :) They seem to be going for around $100 and there are usable Android tablets that cost under $100.
      Regards
      Yuriy

      Delete
    2. Hi Yuri
      Thought that would be the answer just thought I would ask.
      Great project.
      Best regards
      Ken

      Delete
  5. Hi Yuri
    I see that Android 4 has been ported to PC X86.
    Will TouchDRO run on a PC with this port installed?
    Great project
    Ken

    ReplyDelete
    Replies
    1. Ken, honestly, I don't know. It might. I haven't used any low-level stuff, so if the Dalvic APIs are all there, the app should work.

      Delete
    2. Yep that it will, I've been using it like that since I first heard of this project around March or April. I had issues with the USB connection, which I didn't bother to investiagte, but it works flawlessy with BlueTooth.

      Rob

      Delete
  6. Hi Yuriy,
    You made an incredible work here,
    I'm little ignorant and just learning about arduino etc.. I have a big Mill Machine with Haidenhain Encoders already installed, model LS 603 (x2) and LS 303 precisely this: http://nees.berkeley.edu/Facilities/pdf/Instrumentation/Heidenhain.pdf
    I like to ask you what type of DRO scales I will have to choose?
    This App has position memory about holes, circumefernce calculation etc...?
    Good Job
    Bob

    ReplyDelete
    Replies
    1. Bob,
      It looks like these scales can output quadrature signal On Ua0 and Ua1 lines, so they should work fine.
      Yes, the app has point memory (organized into workspaces)..
      Regards
      Yuriy

      Delete
  7. Hello,

    I'm looking forward to buying a mini-mill and implement this project.
    I just received a LaunchPad kit from TI.
    I was wondering:
    1: Is there any documentation for the communication protocol between the Arduino/MSP420 controller and the Android tablet? Did you invent that protocol?
    2: How do you actually hook up a direct USB connection? Is it simply a matter of using a USB cable and a OTG adapter to connect the tablet's USB port to the controller board's USB port? Or is it more complex than that?

    Thanks,
    Doug

    ReplyDelete
    Replies
    1. 1. Yes. Take a look at this post: http://www.yuriystoys.com/2012/09/android-dro-communication-layer.html (yes, I "invented" it)
      2. For Arduino Uno/Nano etc. yes, you can simply plug them in. For MSP430 you need to use FTDI useb-to-serial chip.

      Thank you
      Yuriy

      Delete
  8. The link "comparison of different types of scales" appears to be broken--that is, it points to the page on which it appears.

    ReplyDelete
    Replies
    1. Joe,
      Good catch. It's fixed now.
      Thank you
      Yuriy

      Delete
  9. Yuri,

    Great project! Thanks for making your work available to others. I've just completed mine, and it appears to be working great! One question I have is, is it possible to zero one display only; without effecting the others? Perhaps the function is there, and I simply have not found it out yet...(?)

    Best regards,
    -Vern

    ReplyDelete
    Replies
    1. Vern,
      Long-press the abs/incr button next to the axis.
      Thank you
      Yuriy

      Delete
  10. Hi Yuriy,
    I happen to have a cheap 7" Pendo pad tablet which I wanted to use for the DRO, it has the 3.4.67 kernel, android 4.4.2 and will easily pair with the HC-06 Bluetooth module.
    Unfortunately it will not 'connect' to the module, not sure what the differences are.
    Before I rush out and by one of your recommended Samsung devices, do you have any clue as to why it will pair but not connect?
    stuck with using my Samsung phone for now which is inconvenient.

    Thanks
    Eric

    ReplyDelete
    Replies
    1. Eric,
      Try v 2.0.1 from the downloads section. I redid the BT communication layer there so it works more reliably with "weird" tablets. Please let me know if it makes any difference.
      Thank you
      Yuriy

      Delete
  11. Yuriy,

    Thank you for all the work you put in on this project. Quite impressive

    am new to machining and obviously to DROs. I do not have the controller built yet, parts are on order, but I went ahead and downloaded TouchDRO. Just going around what I can see with it in disconnected mode, I find it very friendly and intuitive. I was able to config it for a 2 axes lathe and added the tach window.

    It will be a tremendous challenge for me to put the controller together, given that I do not even own a soldering iron at the moment.

    Though I pretty much get most of the feature, one thing I could get my head around is workspace. What is that about? I can see there are points coordinates associated with it, how are those used in a lathe?

    BTW, I am willing to make a couple of $ contribution to the maintenance of the site, how do I do that.?

    Thank you.

    Nez

    ReplyDelete
    Replies
    1. Nez,
      Welcome to the hobby (and to the site). The controller is pretty easy to build, even if you haven't done that sort of work before. There isn't much magic in it, so you have a good amount of wiggle room to get things working.

      Regards
      Yuriy

      P.S. The "Donate" button is on the right side on the top of this page. Your donation will be appreciated and (in this case) will go toward buying a touch probe so I can start working on that function.

      Delete
  12. Hello
    I have a question. As a machinist who has lost most of his vision. I'm wondering if you turn on talk back in accessibility and talks (audio) the DRO values? This would be a huge help. Any answers please email me. Thank you

    ReplyDelete
  13. There is an Android for sale that uses 4.4 Kit Kat operating system. Will that work with this project?
    Thank you, Paul

    ReplyDelete
  14. Yuriy,

    Fantastic work, which I am looking forward to implementing soon. I have an old Viewsonic 10e tablet which is running Android 4.0.3, kernel 3.0.8 so I think it should work. However these tablets cannot access the Google Play store.
    I have downloaded your TouchDROHD_1.0.2 Zip file, expecting to find an APK file within, but there isn't one. I can cope with lathes and mills, but tablets leave me a little lost!
    Can you explain how to install the application from the zip file?
    Many thanks, ANdy

    ReplyDelete
    Replies
    1. Andy,
      That should be an APK file, not a zip. Try downloading it again (form the downloads section).
      Thank you
      Yuiry

      Delete
  15. Yuriy,
    Thank you for your very quick response. For some reason my device was seeing the file as a Zip file.
    By right-clicking on the file and choosing 'save as' I could change the file type to .apk and have successfully installed it.
    Just need to get some scales now, arduino's already on the bench!
    Again, many thanks for your generous work. I will donate shortly.

    Andy

    ReplyDelete
  16. If I choose to use serial to USB, will the tablet be charged during use?

    ReplyDelete
  17. Could you pleee confirm if the Igaging Absolute scales which I believe are also remote work with your TouchPd and your Arduino / Bluetooth adapter? I read they will not would you expand on this?
    Thanks in advance.

    ReplyDelete
    Replies
    1. No, they will not work. The are very different scales, using different protocol, etc.

      Delete
  18. First many thanks for sharing this project! Are the igauging scales that can be used the ones that have a display included with them or are there others available that come without the displays? I just picked up a Nexus7 to use for the project and am anxious to order the other components and get started.

    Thanks!

    ReplyDelete
    Replies
    1. I now see that I just discard the displays that come with the Igaging scales. I have everything to complete the build now and am looking forward to getting started. I already have all the scales mounted to their axis'. Only did that part first because the scales arrived first. Thanks again for sharing this project.

      Delete
  19. Yuriy, what is the minimum screen resolution of the tablet screen to get all the display on the screen without having to scroll?

    ReplyDelete
  20. Is there a way to save the setup in touchdro imcuding tools and work spaces

    ReplyDelete
  21. Do you plan on supporting the igaging Absolute scales?
    Tom

    ReplyDelete
  22. Oh no! Are the Absolute scales transferring information in a different format!? I just bought two of them today. Great project Yuriy.

    Also, could someone point me to where I can find information on RPM sensor and setup information.

    Thanks.. Paul

    ReplyDelete
    Replies
    1. Paul,
      I just finished the firmware for the Absolute scales, so they are now officially supported. I just need to post the info on how to connect them to the Launchpad.
      RPM sensor is basically anything that can send pulses to the right pin. I will try to post some info "soon" (I've been busy up to my ears with work and school. Trying to catch up during the winter break).
      Regards
      Yuriy

      Delete
  23. Yuriy, I hope my message wasn't misread as "I have run into problems thanks a lot Yuriy!" I should have spaced "Great project Yurily." by a line. I am super excited to have found your excellent project. Thanks for all the work you have put into this and thank you for responding to all the questions from so many.

    Paul F.

    ReplyDelete
  24. Yuriy
    I really like your project and I'm interessed in build one.
    I have found a BT adapter for arduino that I'm not sure if it will work.
    On ebay it's shown as "Interface Base Board Serial Transceiver Bluetooth Module For Arduino IT".
    Would it work or it's better to search for other adapters ?
    Thanks

    Pigi

    ReplyDelete
  25. You are awsome!
    Thanks :)

    ReplyDelete
  26. Yuriy:
    Very interesting project. I already put together the MSP430 version.
    One detail that i noticed is when you set the zero all axis goes to zero (all axis). That characteristic makes the device almost impractical to use.
    Is there a way around? Or there are plans to set selective zero axis?
    Thanks
    Lwding

    ReplyDelete
    Replies
    1. Lonmg-pressing the "Abs/Incr" button zeroes out individual axis.

      Delete
    2. Yuriy:
      Thank You.
      Regards,
      Lwding

      Delete
  27. If I hook via USB only, will it keep my tablet charged?
    What part would I need and how to connect it, step by step please I'm quite slow in this department.

    ReplyDelete
  28. Holy cow, I thought I was pretty decent with a soldering iron, but the mixed scale kit almost got the best of me. Finally got all the axis and bluetooth working. If you're not ready to spend some quality time with this, I'd recommend an already built version.

    ReplyDelete
  29. I have a TouchDRO BlueTooth Adapter Board for iGaging Scales, I have it basically working OK. have to do the adjusting to my mill, but it works. I'like to put my RPM counter on it, but can't figure out how to wire it to the board. It's one of the Chinese type Hall sensors, I had it working OK with it's own display. Would appreciate any help. I really like this project, and think it is going to be a good addition to my mill. Thanks, Pierre

    ReplyDelete
  30. Gday,
    I am trying to interface the igaging board 4th axis with and indexer to read angles, but am having trouble trying to find out a rotary encoder that will work.

    Do you have any suggestions? I guess could but the quad rather board and new scales but would rather not.

    Cheers Mike

    ReplyDelete
    Replies
    1. Mike,
      Right now the only board that can natively read rotary encoders is the "Quadrature" board. I will be adding a 5th axis to the "iGaging" board for that exact reason - so people can use rotary encoders. Hardware is already there. You can either wait for a few weeks and get the board with the new firmware or if you want it now, send it back to me for re-programming. (I do that at no cots; you cover shipping). If you're in the states, that's easy. Judging by "Gday" you might be "down under", which makes back-and-forth shipping more annoying...
      New version of the app has some new functionality for the "Angular" axis, by the way, such as "Gear Cutting", etc...

      Regards
      Yuriy

      Delete
  31. Hi Yuriy
    Just a quick thanks for what have provided. Did my interface using a 74HC4050 Hex Non-Inverting Buffer to level shift some ttl glass scales. All worked without any dramas following the pages you created. Going to revolutionise my making not to be fighting the backlash on my old mill anymore.
    Many thanks
    Adrian

    ReplyDelete
    Replies
    1. Adrian,
      Glad you found this useful. I can't imagine living without a DRO on a mill.
      Regards
      Yuriy

      Delete