My working TouchDRO Arduino sketch, with a screen-shot.
Plus a few working Tacho circuits (near the end of this page).

I know this page is rough, it was hand-written in a hurry. (Version 2, 5 June 2014)
But pictures are downloadable at double sceen resolution.
And you can copy and paste the sketch into your Arduino if you want to try it
The screen shot indicates how I set my 'TouchDRO settings' to work with the sketch.

This version has 'jump detection' where it can display the 'jump rate' as a W-axis reading
(How it does this is explained in detail inside the sketch, which you can download below.)
Jumps are only displayed when this sketch thinks there has been an unreasonable jump in the scale's disance value on either the X or Z axis.
My purpose is to alert the machinist that they should check their zero values again, and not trust the DRO readout.

In TouchDRO, set the W scale to 2.56 CPI to display the size of jump should display in inches/sec (or mm/sec in metric mode)
The TouchDRO digital filter and summing features must be OFF on the W axis for this to work properly.

There may be some typos in the comments embedded in the sketch, but the code runs and does what I expect it to do.
If you have feedback, feel free to send it to gr-no-spam-eg@bettec.com. (Delete the '-no-spam-')

Heres the sketch you can copy and paste into your Arduino software:
It is heavily commented throughout the sketch.

ArduinoDRO_V3_3_Analog_Tacho_and_Detecst_Scale_Jumps.ino

Other stuff you might like to look at, if you use Yuriy's TouchDRO.

First we must satisfy the fun police:
"All pictures and videos are for your amusement only. They are not instructional. It is not recommended you emulate any of them.
Anything you do wtih live or working electrical or mechanical equipment completely and totally your own responsibility. "

My analog tacho page is here: Page_T There are 4 photos and the page is about 5 Meg.
My digital tacho page is here:  Page_D There are 4 photos and the page is about 0.8 Meg.
My X-axis setup page is here:  Page_X There are 4 photos and the page is about 5 Meg.
My Z-axis setup page is here:  Page_Z There are 4 photos and the page is about 5 Meg.
My completed project is here:  Page_F There are 4 photos and the page is about 1 Meg.

My first working TouchDRO Arduino tachometer. (Analog)

This works well, the output is averaged over half-second blocks by the Arduino sketch above.

My lathe runs from 40 RPM to 1000 RPM and I used 4 pulses per rev. Otherwise at 40 RPM I get less than 1 pulse per second.
Too few pulse means a larger C2 (filtering and averaging Capacitor) and the response time to RPM changes are way too slow.
These values will take about 2 seconds for the display to respond Full Scale, ie 0 - 5 Volts, ie 0 - 1000 RPM in my case.

Later testing with a different inductive sensor and a LM2917-8pin, I changed the filter cap (C2) from 10uF to 4.7uF
to make the RPM output voltage change faster, inresponse to input chages. The digital filter (averaging) in the sketch
seems to stabilize the display quite nicely, even though there is a little ripple on A0 at very low RPM.

These circuit JPGs are about 4 times as big if you download them, and much easier to read. (Click them)

My current working TouchDRO Arduino tachometer. (Digital)

After seing Rysiu M's comments online (here), I though I'd download and try his Arduino sketch and matching Android app.
(You can find them at: http://www.rysium.com/rysium.docs/)

To use his variation on the theme of adding a tacho, I needed to 'go digital', so I designed a quick test circuit that worked well, so I kept it as the final version.
The circuit is remarkably simpe. I used a Hall effect ratiometric (ie linear anlalog ouput) sensor. (About AU$3.50)
I suppose you could find a digital output device, but this linear chip has a few advantages, in my opinion. It's cheap and

it enables you to add a sensitivity control, and also choose whether you want the output pulses to the "HIGH' or LOW".

Tacho

I can detect RPM at about 1 cm from the magents with this circuit, but I used less, as you can see in the pictures.

Attempt 6 - Making iGaging 'anti-jump' modifications to the hardware.

(Late news: 1 month later, still not a single jump since putting a capacitor inside the scales, as per the photo below.)

This lists my attempts to resolve the issue of scale readings randomly 'jumping'.
It will take a while to see if the problem has gone away, as it is so intermitent (not to mention so frustrating).

I have also tried:

1.	Running the Arduino DRO on batteries.
2.	Shielded leads.
3.	Insulating the scales from the lathe
4.	Adding ferrite chokes around the cables.

My new approach uses this logic (logic?):

1.  The scales are read many times per second, and its a 21 bit code.
     It can't be a data transmission error (ie interference on the data lead), as the next read would either be 'right' again, or a different wrong value.
     Its impossible for the 'noise/interference' to consistant effect the 21 data bits in the same way and produce a consistent error.
     It can't be on the clock lead either, as that would effect the readigs for every axis, not just one.

2.   Therefor it must be either:  the data becomes corrupted in the scales or the Android, as it can't be on the USB data wires. 
     Lets consider the scale's read head first.
     That would most be effected via the power feed. (Eg. Intermitent pulses and transients or induced noise on into power feed.)
     The scales draw 22~25 microAmps, therefor they present a high impedance to imduced noise.
     Therefor the noise might be able to corrupt the power line (3.0 - 3.3 volts) and pollute the reading stored in the read head's memory chip.
     Hence I have added a  1.0 uF (Mono/50 Volt rating) across the power pins inside the scale read head.  (See photo below.)
2a. If this doesn't work, I will add a 3.3 Kohm resistor to increase the the current flow from 25 uA to 1 mA to try and 'swamp' any induced currents and noise. I don't beleive it's an earth loop problem in my case, as the scales are insulated from the lathe. Plus I am running of batteries with no earth connected at all. Plus I use a Bluetooth link to the Android. For while, I did try deliberately earthing the USB shield wires to teh lathe, but I still got an occasional jump. Always on the Z axis, strangely. 3. The other possibiliy is the data is getting corrupted inside Yuriy's Android app. This seems unlikely and I wouldn'y know where to start with that one. But if the TouchDRO app thinks its meant to 'zero' (or part zero) one axis the effect would be the same. But then everyone would be seeing the intermitent jumping problem, so I think we can safely assume Yuriy's software is bug-free. 4. I hope the 'jump detection' in my sketch (link above) will shed some light on where the corrution is coming from. At least (with this sketch) I will have some evidence if it is originating within the scale read head, if the capacitor mod which I have done at the same time, hasn't already fixed it. 5. As the problem is intermitant and only happens rarely, but always during motor-start-up on the lathe, it could be a while before I know if it has been cured. For anyone that might still be reading, I use an 1 horsepower 240V AC, single phase motor. So it has a bit of a kick on start, and you can see it effect the fluro workshop lights. The lights are one a different feed and different circuit breaker, but they are on the same phase. (Its a pity I don't have a choice about that!)

6. New update, no more jumping! I removed the pull-down resistors on the Arduino shield board, which reduces the load on the scales (as well as doing the mods above),
and I haven't had a jump in over a week. The logic works like this:
This is a photo of the modified scale for any curious reader.

Please send any suggestions or errata and speling corrections you may find in this blog.

Greg

 

Hits <% on error resume next ' Create a server object set fso = createobject("scripting.filesystemobject") ' Target the text file to be opened set act = fso.opentextfile(server.mappath("asp_count.txt")) ' Read the value of the text document ' If the text document does not exist then the on error resume next ' will drop down to the next line counter = clng(act.readline) ' Add one to the counter counter = counter + 1 ' Close the object act.close ' Create a new text file on the server Set act = fso.CreateTextFile(server.mappath("asp_count.txt"), true) ' Write the current counter value to the text document act.WriteLine(counter) ' Close the object act.Close ' Write the counter to the browser as text Response.Write counter %>