Android DRO Application Settings

Friday, August 2, 2013

This post refers to the old version of the application. Please refer to TouchDRO Settings Overview for the updated information.

As I mentioned in the last post, the new version of the Android DRO application has a lot of updates. In addition to the new functions there is a plethora of internal changes. Some of the new features are accessible through the “Settings” screen. The good news is that if you intend to use the application with one of the iGaging controllers, the default settings will be sufficient to make it usable out of the box. On the other hand, to take advantage of the new features, you will need to get your hands dirty. In this post I will try to explain what each of the settings does, hopefully making the setup pain-free.

General Settings

This category currently has a single setting: “Readout Display Format” that let’s you choose how many digits the main DRO screen displays per axis. The purpose of this feature is to save some screen real estate on smaller devices. I.e. if your mill has less than 10 inches of travel in each direction there is no reason to show two significant digits; similarly, you might not want to see the ten thousandths.

Digital Readout Display format can be set to match the scale's paramters
Readout display format can be set to match the travel and encoder resolution

Connection Settings

NOTE: This feature is still in “Beta” state. Unless you gave a compelling reason to use USB, I strongly recommend that you stick with BlueTooth.

USB Digital Readout Connection Settings
USB connection can be enabled with the "USE USB Connection" checkbox

USB connectivity has been one of the most frequently requested features that is included in the new version. To switch from Bluetooth to USB you will need to check the “USE Usb Connection”, set the BAUD rate to match your controller and restart the application.

USB transfer rate needs to match the controller

When the app is in USB mode the “Connect” button doesn’t bring up a “Select Device” dialog. Instead you will see a system confirmation box requesting a permission to use USB. If you grant the permission the DRO will connect to the controller.

Side Note: There appear to be two reasons people ask for USB connectivity: some inexpensive tablets don’t have Bluetooth support and some people don’t trust the wireless connection. If you’re in the second group, I recommend that you stick with BlueTooth, since in practice it’s no more error-prone than USB and in a noisy garage can in fact be less sensitive to interferences. Remember, this is the same Bluetooth you likely use in much noisier environments, such as in your car, etc.

X, Y and Z Axis Settings

Settings for the first three axes use the same pattern, so I’m lumping the descriptions together. W axis behaves differently, so it will be covered in a separate section.

Axis preferences are similar for the X, Y and Z axes

Axis Label

"Axis Label" setting can make the DRO display reflect the machine setup

By default the first three axes are marked X, Y and Z. This makes sense in a DRO for a milling machine but people using the app with a lathe might want to make the display match their machine. By changing this setting you can set the labels that appear next to the readout on the main screen.

Axis Label window allows changing the name of the DRO axis
Axis label can be set to any arbitrary text

Axis CPI

Digital scales, calipers, rotary encoders etc. work by counting clicks (pulses) that need to be translated to distance in inches, millimeters, palms etc.”Axis CPI” (Axis Clicks Per Inch) setting lets the application know what the resolution of your scales is, so the DRO can display the correct readout.

X Axis CPI determines the displayed digital readout
Axis CPI  is used to convert raw output to inches

Tip 1: Lathe users will notice that with default CPI the cross slide scale measures radius. In other words, when you moved the cross slide 0.001”, the lathe removes 0.002” of material (one thousandth on each side). The DRO can easily compensate for this by setting the CPI to 2x the actual value, i.e. 5,120 rather than 2560.

Tip 2: All iGaing AccuRemote and DigiMag scales use 2,560 CPI and the standard chinese scales use 20,480. On the other hand, if you don’t know the resolution of your scales, it’s easy to find out once the scales are mounted on the machine: set the CPI to 1000, zero out the display and move the axis exactly one inch using the graduated dials or a dial indicator. Now take the reading you get and enter it as the CPI for that axis (ignoring the period).

Axis Invert

Depending how you mounted your scales they might read right-to-left or left-to-right. The DRO uses the “right hand” rule for the position as shown in the diagram below and having the scales reversed will make things pretty confusing. Using the “Axis Invert” setting you can reverse the direction so the DRO reads the positions with the right polarity.

W Axis Settings

Android DRO W Axis settings
W Axis settings are different from the other three axes

The fourth “axis” is handled different from the other three since it’s readout is not displayed directly. Instead it can be added to one of the other three axes. This feature might be useful for people that will use this DRO on a milling machine that has two movements on the Z axis, such as Bridgeport (and clones), RF-45, Sieg X3 and similar machines. In such case the knee or the head scale can be assigned to the Z axis and the quill can be connected to the W axis. The DRO will add the positions up and display a combined readout.

W Axis Enable

This settings does just that: enables the W axis so the application starts paying attention to it.

W Axis Target

As I mentioned above, W axis is not displayed by itself. Using the “W Axis Target” setting you can choose which axis will be summed with it.

W Axis Target dialog allows two axes to appear on the same DRO line
Use W Axis Target dialog to combine two axes into one readout

Axis CPI and Axis Invert settings behave identically to those of the X,Y, and Z axes, so I won’t repeat myself here.

Conclusion

A lot of changes that I’ve made to the application were designed to make it more flexible and lay groundwork for future expansions. On the other hand they add complexity to the application. I hope that this post will clarify what the purpose of each setting is and how it can be used. If you find the new additions useful or can think of other features you’d want to see in the coming version, please leave a comment or send me an email.

36 comments :

  1. Thanks for posting the new Beta!
    To connect my Launchpad controller to the tablet's USB OTG cable, I just plug it into the controller'sUSB socket, right?
    What's the baud rate of the Launchpad contoller please?
    I take it I have to disconnect the Bluetooth transmitter as well?

    First series of try-outs were unsuccessful. I've emailed you with details.
    Cheers,
    Joe

    ReplyDelete
    Replies
    1. Joe,
      It might not work with LaunchPad's build in Serial-to-USB hardware. I think the best bet could be an FTDI-based adapter connected in place of the BT module. I'm still testing the USB code and haven't made it to LaunchPad yet... I know it works with Arduino UNO and Nano so far... :)

      I've used a third party library for USB and it in itself needs some "help", unfortunately...

      Thank you
      Yuriy

      Delete
    2. You are right, Yuriy - it doesn't work with the LaunchPad.
      The LaunchPad powers up from the OTG USB port of my cheap Android Tablet and I can configure the App. But at all baud rates the message "USB device not found" comes up.
      Do you mean something like this to use as the USB interface:
      http://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_TTL-232R_PCB.pdf
      There must be cheaper options.... :)
      I'll await your advice.
      Everying else in the Beta2 seems to work as expected :) getting closer!
      Cheers,
      Joe

      Delete
  2. Would this work: http://www.ebay.com/itm/221248867340
    cheap enough to try :)
    Joe

    ReplyDelete
    Replies
    1. Joe,
      I have a few different USB-to-Serial boards laying around. I'll test them after work today and will let you know if I find any "pattern".

      Thank you
      Yuriy

      Delete
  3. Much appreciated Yuriy! Pity the Launchpad can't handle that on its own...
    Cheers,
    Joe

    ReplyDelete
  4. Dear Mr. Krushelnytskiy:

    Are there any plans to convert your DRO program to run in a native Linux environment instead of Android ?

    I ask as an individual interested in Linux modding- particularly some of the mini-Linux PC boards.

    I thank you.

    V.E.

    ReplyDelete
  5. V.E.
    No, I wasn't planning to port this to a real Linux. I don't think it would be "practical" to port the thing, instead of just rewriting it. Most of the code is written against Android-specific libraries...

    Thank you
    Yuriy

    ReplyDelete
  6. Thank you Yuri.

    I've purchased a cheap Android tablet to move ahead with this project.

    I wanted to try to do a piece of software for linux that would capture the caliper output. I've determined that is out of my league.

    Thank you for all the work you've put into this.

    ReplyDelete
  7. I am now sending the cheap tablet back, it came, was supposed to have a Bluetooth, and there is no Bluetooth. So I am looking at getting another HP Touchpad and repairing it. They're fairly stable and I like them.

    So I have one more dumbass question: Do you know of any reason why your DRO app would not work with Cyanogen Mod Android ?

    I'll be using Igaging Scales.

    I've UTFSE. I've also LMGTFY.

    Thank you

    ReplyDelete
    Replies
    1. V.E.
      The app works just fine on Nook Color with CM10.
      It needs Android 4.0 or newer, so CM9 and 7 won't work, obviously...

      Thank you
      Yuriy

      Delete
  8. Dear Yuriy,

    I know that you collect a lot of thankyous for your efforts but I wanted to tell you that you are my new HERO. I am retired and living on a fixed income and my passion for CNC and all things electronic is tempered by my limited toy budget. Finding your site was the best thing that has happened in quite some time and allows me to press onward with a DRO setup on my HF 920 & my HF 42827 Gear Head Mill Drill. I have been reading your posts from the beginning and was excited when I read that you were going to include USB support in a future build so I could use my 7 or 10 in tablet, both without bluetooth. I just about jumped up and danced when I read this post and found out that it already exists. Time to breakout my Arduino stash and get busy.

    DRO is in my (near) future WooHoo!
    You are THE MAN!!!

    Sincerely,
    MisterFixIt1952

    ReplyDelete
    Replies
    1. Bruse,
      Thank you for the feedback :) It's nice to know that my little hobby project is helping the community.


      Regards
      Yuriy

      Delete
    2. I was reading your blog posts on hobby-machinist.com and was delighted to see that you hale from the silicone forest (Beaverton). I live just over the hill in NE Portland. It constantly amazes me when I find out how much talent resides in our part of the country. Have you ever attended any of the Dorkbot meetings (arduino community). I met the author of Wikipedia at one of the meetings and I hear that Linus Torvoldt (Linux) lives in the valley. Lots of inspiring people around here.

      I just got my Igaging scales for my 9x20 HF lathe and have ordered an UNO off of eBay so I should have all of the parts needed to build my DRO (USB version) for Xmas. I just stopped by here to check my parts list to make sure I get the right USB module and to wish you a Merry Xmas and happy holidays. If there is ever anything I can help you with, please let me know. I have every tool in the known universe (or pretty close to it) and know how to use them. I used to be a mechanical engineer (in another life) and was the IT network field tech for the Portland Public School System. I can fix or repair almost anything (just rebuilt my brothers water well) and would love to give you a hand if needed.

      Bruce (MisterFixIt1952)

      Delete
    3. Bruce,
      Nice to hear from you again. No, I haven't been to the Dorkbot meetings (yet)...
      I might end up taking you up on your offer actually :)

      Have a merry Christmas yourself as well.
      Regards
      Yuriy

      Delete
  9. Big sincere thanks from me as well for this project Yuriy, I can't wait to follow in your footsteps over the next few weeks. I haven't picked a tablet, and I'd like to go as cheap as possible. It looks like anything in the $60-$100 range is going to be non-bluetooth. With bluetooth I had been planning to leave the tablet powered by USB; without it, will it be possible to both power/charge the tablet and have USB data to the Arduino?

    ReplyDelete
    Replies
    1. Greg,
      It depends on the tablet. I know that it's possible on my Samsung Galaxy Tab 2 (because there is a grossly overpriced adapter that you can get online). Other tablets have the USB host broken out as a separate port.
      There are "double headed" USB cables (often used with external hard drive enclosures) that can probably used to power both (they have only Vcc and Vdd on one of the plugs... Basically I'm pretty sure there is a way but I don't know exactly what it is :)

      Thank you
      Yuriy

      Delete
  10. Having USB input for the tablet opens a world of inexpensive alternatives unavailable in the under $100 range of tablets unless you could transmit the serial info over an IP connection using WiFi. I have an Ematic 9.7in tablet with front & rear cameras capacitive touch 16GB flash WiFi 1.2Ghz CPU w/HD screen and Android 4.1 that I got on Ebay for just over $100 delivered. This would make a great controller screen for my DRO and for the price I can just leave it connected. I can also use the camera for taking Utube videos If I want to post anything. I also have a 7in Ematic with the same specs except the screen is 800 X 600 that only cost $55 delivered. For these prices It is very cheap to build dedicated DROs for each machine. I guess I could also watch streaming videos from my WDlive hub while I work ;-)

    ReplyDelete
    Replies
    1. Hey, that's an idea that hadn't occurred to me :)
      If the data was transmitted via WiFi, my cheap tablet would work too!
      And maybe a bonus ;) - you could go back to the loungeroom and watch the machine's progress from there. When the DRO stops you know it's finished or crashed - in any case you need to go back to the shop :)
      (Just kidding about leaving a working machine alone).
      Cheers,
      Joe

      PS: keenly awaiting progress with USB implementation.... and mixed scale driver....

      Delete
    2. Joe,
      WiFi would be great but the cost of a "WiFi shield" is more than a differentce between a "cheap" tablet and a good one :) It did cross my mind, though at one point...

      I'm waiting for a shipment of a few Arduino boards but at this point USB is stable with Uno, Nano, Mini and Mini Pro (with Sparkfun FTDI breakout). Once the rest arrives I will post a list of "compatible devices".

      Thank you
      Yuriy

      Delete
  11. I love the idea of the bluetooth hookup, but the lower cost of USB is also quite attractive to this also-retired-living-hand-to-mouth guy (!!). Does the data from all 3 axis travel on a single USB? That WOULD be sweet!
    =Alan R.

    ReplyDelete
    Replies
    1. Alan,
      Data from all three or four encoders travels over a single USB.

      Thank you
      Yuriy

      Delete
  12. Will you have the ability to also support tachometer for spindle?

    ReplyDelete
  13. Hi Yuriy,

    Firstly a big thanks for all the work you have done on this project, especially since you aren't charging for it...
    Should one use some kind of galvanic isolation when using the USB option ?

    Again, thank you

    Shaun

    ReplyDelete
    Replies
    1. Shaun,
      You''re welcome :)
      In my experience *most* issues with stability are caused by ground loops of various kinds. At the very minimum I would try to use an isolating power supply. I haven't plaid with the USB connection too much, though, so I don't know what scheme one would use to power the tablet and the Arduino through USB.

      Thank you
      Yuriy

      Delete
  14. Part I

    I tried USB based decoding. It was horrible.

    I've wanted to build a USB driven version of Yuriy's project for Linux for a long time, so I could use WebOS and so I could use a cheap laptop.

    The reality is that the USB is way too unstable. I have 3 different scales by 3 manufacturers & they hated USB.

    My LP build with BT, Breakout Boards, & new USB & servo cables was around $33. That is $10 free shipping LP off Ebay, the USB boards were $10 w/ FS, & the cables were $6, & I found a killer deal on a Bluetooth transceiver, cable, and external antenna. All told for two builds(ie two Launchpads with Bluetooth): $66.xx

    If you research the use of USB in decoding these scales, you'll find out a bunch of problems. (1) The real time nature of the data transfer gets wonky in some cases (2) The data doesn't read correctly depending on the quirks of the Chinese scales (3) the USB's on cheap electronics leave much to be desired.

    I went through this, I am not trying to rain on anyone's parade, it's just cutting off your own nose to spite your face when you buy the $70 Chinese tablet and try to run it off USB.

    that comes close is a $300 Chinese 2 glass scale DRO setup. And honestly, with the improvements that are coming with the Chinese scales, it is the best low buck solution out there.

    ReplyDelete
  15. Part II:
    Let me put it this way, as well, decoding these scales via USB with Windows and Linux is a nightmare, and that's why along with cost that Caliper2PC has never caught on. And until Yuriy did this project, there was never a better solution than Caliper2PC.

    Don't buy a cheapo Chinese tablet. Many of them cannot be rooted(No shit). Many of them advertise Android 4.0 plus and display info stating a 4.0+ build and newer version number. Careful inspection reveals hacked versions of older Android, and that's why they've blocked rooting. If you get one that is actually running old Android, before 4.0 you're screwed- Yuriy's app won't run. Their hardware build is so cheap you will never get any peace trying to run the scales off USB- when you play hell doing simple file transfer from USB via Linux or Windows, what do you think is going to happen when the data transfer of the scales has breaks and disconnects and resets ? Because I tried a cheap Walmart tablet, I tried a 4Sight, and I tried a well reviewed Chinese $90 10" tablet. None of them were worth a shit.

    You can get an HP Touchpad that is softbricked for $70 shipped or less. One of mine was $50 shipped, the other was $68 shipped. I used the directions on the internet to fix the softbrick, I keep them charged up, and I added CM 10.1. The time involved: 2 hours total. Including waiting for my downloads, fixing the softboot issues,

    I'll say it again: No one has come out with a stable solution running a direct connection between the scales and PC's USB. Consider that all the solutions out there for PC necessitate a "decoder" box of one kind or another, and there are still real time read issues on those systems. They're find for recording a single position or a list of output showing a series of positions. Otherwise, forget it.

    Consider that Android is Java running on top of Linux and that tablets are not standardized by any means, their hardware builds are not standardized, and the scales are not standardized.

    If you want to spend a whole bunch of time & money with USB to save a few bucks, it's a free country.

    But you are money ahead to build a Launchpad, & have a stable solution using Bluetooth.

    If you get a tablet with Bluetooth built in and use it, it is standardized because you have to conform to a certain build to have Google App Store access. And you end up saving time and money.

    I already slammed my dick in the door jamb trying Windows, Linux, and WebOS in combination with USB based solutions for decoding these scales. It was throwing good money after bad.

    I wasted $100+ building one of Scott's Orphaned DRO-350's.

    Yuriy's solution is honest to god the best thing out there. The only thing that comes close is a $300 Chinese 2 glass scale DRO setup. And honestly, with the improvements that are coming with the Chinese scales, it is the best low buck solution out there.

    ReplyDelete
    Replies
    1. Wow, thanks for a thorough comments :)
      For the purposes of my DRO design USB and BlueTooth *should* work the same (the controller sends the data to a converter chip at a leisurely 9600 BAUD). In practice there is one catch: Bluetooth SPP (Serial Port Profile) is VERY well supported in Android 2.2.3 and on. It's very stable, well debugged and safe. USB is a completely different ball of wax: the drivers are out right "crappy" and when the USB code crashes, it takes the OS with it. (you can't imagine how many times I rebooted my tablet while adding the USB support :) )
      On Windows and Mac OS the same hardware works beautifully (haven't tried Linux, but I'd imagine it would work as well).
      Now on the subject of a controller box: there is no physical way to connect a non-USB device to a USB host, so there will be (by definition) a "controller box". The Android/Launchpad board is just a version of such controller box, as is Yadro, Caliper2PC and a few others. They do the same things, in essence: convert the output from the scales into something a PC can read. Yadro relies on the PC for the heavy lifting, so it requires an OLD (read: "real time") PC while my Arduino version does the timing-critical stuff on the Arduino and then sends it to a PC over a simulated serial connection. Other than that they are very similar...
      Finally on the subject of "Chinese" tablets: based on the emails I get from people, it looks like $120 is the cheapest price for a "decent" tablet. The sub-100 devices are hit-or-miss (still waiting for a hit, though).

      Hope this makes sense.
      Yuriy

      Delete
  16. Final Comment:

    If Yuriy offers a step by step BOM and build, I believe his USB solution will be fine. But, it will necessitate you duplicate that solution exactly for those of you wanting to build a USB based solution, otherwise you may run into the problems others have with USB based decoding.

    And, it does not appear based off of Yuriy's equipment and designs that he cheaped out on his tablets or equipment.

    So to duplicate his USB solution may be more expensive that getting a good, used Bluetooth capable tablet.

    Either way:
    I got 7 Scales in the sizes I needed for $141 shipped total(I found a sale going on currently). My two tablets cost $140 roughly. My Bluetooth setup is bulletproof and it was $66. I have $341 for two complete DRO setups, one for my mill and one for my lathe. Nothing else comes close, and I had zero drama following the Bluetooth build.

    The law of the world is do what thou wilt. So choose wisely fellas.

    ReplyDelete
  17. Vaughn E, FWIW, I found this tablet at Walmart of all places:

    Hisense Sero 7 Pro - $129
    http://www.walmart.com/ip/Hisense-Sero-7-Pro-7-Tablet-Quad-Core-Processor-with-8GB-Memory/24805142

    It came with Android 4.2 & is supposed to get 4.3 this fall some time... it works great with BT, never even tried USB.

    ReplyDelete
  18. Anon: Thank you. For the folks who want new equipment, that's exactly what I'd do in their shoes.

    I used $140 and that bought two Touchpads. I'm currently buying two more, as Yuriy's system works so well.

    I know a little bit about Linux, I know a little about Java, and I know enough to use a logic analyzer.

    I've gotten a book on Android and I hope to be able to add some functionality for a lathe and surface grinder.

    What killed Shumatech was (1) Scott's unwillingness to let everything be 100% open source and more so (2) which was the free rider problem of everyone wanting and expecting features and changes, when they don't pay anything. Eventually, the creator literally gives out, and because no one contributes, you get a failure.

    I'm learning Android so I can hope to contribute to the project. I encourage others to do so, as once your hobby becomes a chore, and once you get pestered one too many times- you find a new hobby that can remain a hobby.

    PS: I have the schematics and PCB design for an improved version of the DRO 550, one that takes a readily available processor. It is a $250-$400 project, all told, with cheap scales. You can get out much cheaper and have a much better project with Yuriy's design.

    THANK YOU YURIY !

    ReplyDelete
  19. It might be possible to use Yuri's App via an emulator / VM on Linux or Windows.
    Such as: http://www.cnx-software.com/2013/03/01/how-to-run-android-apps-in-linux-with-androvm/
    I have a PC sitting right next to my mill, so there is some attraction.

    ReplyDelete
  20. Yuriy, love the work you have done. I just completed the build and it work great. One thing I did notice was if you have your display to turn off after a certain time of non activity it can become quite cumbersome in reactivating to continue on working. I would like to suggest possibly adding a keep awake function to the program.

    Again thanks for all your hard work.

    ReplyDelete
  21. Yuriy..
    A note to thank you for the time you have invested in this impressive DRO project.
    A friend gave me his almost new Chinese Android tablet when he learned I was following this project, unfortunately no Bluetooth to be found on it
    . Your DRO app runs nicely but am now working on the communications issues. I will experiment with a set of USB to BT modules I bought on a closeout or 2 XBee modules from Parallax..
    . I have 3 iGaging scales. Also I am trying to get the source codes to understand the key issues and maybe contribute something worthwhile.

    jwcc8

    ReplyDelete
  22. In the above you state that the Chinese scales use 20,480 CPI is that correct or did you mean 2048 CPI?

    ReplyDelete
    Replies
    1. Geoff,
      That's correct, the "resolution" is 20,480, but in reality the last 4-5 bits have a lot of jitter, so 20,480 is a purely academic number. In practice these scales are accurate roughly to 0.0005" on a good day.
      Thank you
      Yuriy

      Delete