# Anyone know where to find in depth technical details of DRO scales?



## ScrapMetal (May 26, 2013)

What I am looking for is the method in which the reader heads return position information to the main unit.  I assume that different brands use different (maybe proprietary?) protocols but I need a place to start.

About the only information I've been able to find so far is that one "standard" is to use a double sine wave where the signals are 90 degrees out of phase with each other.  That's great and all but I still haven't read any where just how that is used to relay position.  Phase change?  Amplitude?  Frequency?  I don't know.

What I have in mind with this is to see if I can use a micro-controller (that I've been learning/experimenting with) to create an inexpensive DRO system for a lathe that is fully functional and has "professional" quality accuracy.  Basically the next level up (or a couple of levels :biggrin from using the iGaging stuff.  If I can make a unit that can be used with a number of different manufacturer's scales it would just be that much better.

Now, I could just hook up the scales I have to the oscilloscope, and I will, but that could prove to be a bit tedious and only give me limited information for one brand.  If I can speed up the information gathering it will be a "good thing". 

All tips and info will be much appreciated.

Thanks,

-Ron


----------



## Tony Wells (May 26, 2013)

I think it depends largely on the style of scale. Glass scales use (or used to, been a while) 3 LED's if I remember right, and phototransistors to "see" the engraved scale as it moves. Some read magnetic patterns similar to swiping a credit card or playing an audio tape. The tape contains digital information in a steady on and off pattern. Capacitive scales do a constant measurement of capacitance and sense changes in position by differential comparison.

Then to steppers and servos have rotary encoders which have their own signal count method.


----------



## Codered741 (May 26, 2013)

Making your own DRO readout is fairly simple, especially with a micro-controller. There are multiple ways to do this, and just as many different types of scales. It would be difficult to make one system to handle them all, but the controller is not usually the expensive part, as they are fairly simple to make even with analog components.  

As with most types of industrial sensors, DRO use some form of digital or analog sensor, or encoder,  to extrapolate a position value.  The simplest of these is the quadrature incremental encoder. This is one of the cheapest and easiest sensors to find. It can be found in multiple styles, the most common being rotary, but easy enough to make linear.  These work by shining an LED through a glass disc, which has lines printed on it radially.  As the led shines through it, it is systematically blocked, and un-blocked. A sensor picks this up on the other side of the disc. This creates a square wave. The longer each plateau, the slower the object is moving. Each rise and fall is commonly referred to as a "count". Taking the raw value of the counts and applying a scaling factor, will return a position. Then it is just a matter of determining direction. 

This is where the Quadrature part of the name is used. There are two sensors in the encoder, offset by 90 degrees, as you found. This allows the sensors to be blocked and lit at slightly different times.  A micro controller reads which one changes first, and is thereby able to determine if the count values should be subtracted, or added to the current count. 

The major drawback to this style of encoder is that it does not have an inherent way to determine its position on its own. Because all of the lines are equal, and all the controller does is count pulses, if the controller is powered down without saving this data, or the machine moved without controller power, the position is no longer accurate. Therefore this type of encoder is called a non-absolute, or relative encoder.  Some controllers use a small battery to backup the controller data, but will not power the encoder itself. 

There are multiple types of "absolute" encoders, really too many to go into detail here, but another common one in DRO scales is the Gray code encoder.  Again found in both rotary and linear styles, these use a very similar technology to the plain incremental encoder.  However these has more than two sensors. Usually 4-8. Each sensor reads a "track" printed on the scale.  Each of these tracks is very simply interpolated as a binary bit, and reading all of these together, gives a position. The longer and more accurate the scale is, the more sensors and more tracks it will have. (Wikipedia has an excellent article describing how Gray code works) 

The main advantage should be fairly obvious, the position in read accurately on power up, and no counting is required. The machine can be moved while powered down, and the position will still be accurate. 

There are literally hundred different ways to measure position. If you want something REALLY fancy, and a really good technical term, look up the "magneto-restrictive linear displacement transducer". (There is a mouthful!) Amazing technology that sends electric pulses down a wire which has a magnet near the line. The magnet literally "restricts" and partially reflects the pulse, which the controller reads, and can, through the onboard timer, determine how far away the magnet is from the reference point. As the magnet moves, the pulses get shorter or longer, depending on which way the magnet is moving relative to the sensor.  But you will NOT see this kind of technology, unless you are working on a half million dollar machine. 

Wow, I know way too much about encoders....

Sorry to ramble, 

-Cody


----------



## Old Iron (May 26, 2013)

Oryou could take the easy out if you have the scales by just getting one of these. http://www.ebay.com/itm/261217206389?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1438.l2649


----------



## ScrapMetal (May 27, 2013)

Tony Wells said:


> I think it depends largely on the style of scale. Glass scales use (or used to, been a while) 3 LED's if I remember right, and phototransistors to "see" the engraved scale as it moves. Some read magnetic patterns similar to swiping a credit card or playing an audio tape. The tape contains digital information in a steady on and off pattern. Capacitive scales do a constant measurement of capacitance and sense changes in position by differential comparison.
> 
> Then to steppers and servos have rotary encoders which have their own signal count method.



My description of what I a looking for is lacking (As usual. Hey!  It's hard work being the village idiot!)  While it does help to understand how the data is collected in order to use that information I need information about the signal output of the reader heads.  I was considering using the old Sargon scales/readers that came with my mill (they are or _were_ glass) but they aren't in salvageable condition.  Thanks Tony.




Codered741 said:


> Making your own DRO readout is fairly simple, especially with a micro-controller. There are multiple ways to do this, and just as many different types of scales. It would be difficult to make one system to handle them all, but the controller is not usually the expensive part, as they are fairly simple to make even with analog components.
> 
> As with most types of industrial sensors, DRO use some form of digital or analog sensor, or encoder,  to extrapolate a position value.  The simplest of these is the quadrature incremental encoder. This is one of the cheapest and easiest sensors to find. It can be found in multiple styles, the most common being rotary, but easy enough to make linear.  These work by shining an LED through a glass disc, which has lines printed on it radially.  As the led shines through it, it is systematically blocked, and un-blocked. A sensor picks this up on the other side of the disc. This creates a square wave. The longer each plateau, the slower the object is moving. Each rise and fall is commonly referred to as a "count". Taking the raw value of the counts and applying a scaling factor, will return a position. Then it is just a matter of determining direction.
> 
> ...



At this point I haven't gone completely mad with the idea of making my own scales/encoders (Don Quixote comes to mind)  Thanks much for the "ramble".   It reinforces my thoughts that I just need to get a couple different brands of encoders/scales and hook them up to the O-scope and start taking readings. 




Old Iron said:


> Oryou could take the easy out if you have the scales by just getting one of these. http://www.ebay.com/itm/261217206389?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1438.l2649



Yeah, it's hard to justify the time and effort when you can buy a complete unit cheaper than my parts will probably cost.   There's no fun in that though!  (I can probably trace this "build" desire to growing up in the "Heathkit" days.)  What I have in mind is coming up with an "open source" DRO that could easily be reconfigured/programmed to work with just about any old scales a person might have lying around.  I'm also going to "cost it out" and see if I can't come in at least a bit cheaper than the one you posted.

Thanks,

-Ron


----------



## Codered741 (May 27, 2013)

Still not sure why I wrote half a thesis on encoders... But anywho, I think the point hat I was trying to make is that you are most likely to be dealing with digital signals.  

But the o-scope might not be the easiest way to figure this out.  If you can, carefully take the scale apart, and look at its sensing mechanism. Most just have a cover that is fastened by a few screws. If you can actually see the scale, and it matches one of the ones that I have described, then you are good to go! 

There is always the possibility, though rare and probably found on more advanced and expensive scales, that the scale itself has circuitry which does the counting and transmits data via a communication protocol. I dealt with one that used CANbus communication between the scale and the readout.  

Im going to stop myself before I write the second or third page of this thesis. 

Let us know what you find! 


-Cody


----------



## kd4gij (May 27, 2013)

Ron

Check out " open sorce DRO " It is a project using a PC for a dro. Shumatech also uses it for his kit and has some info on his sight. There is a open sorce dro group on yahoo I bleave.


   Marty


----------



## ScrapMetal (May 27, 2013)

I doubt that many read heads produce a digital output as it would be easier to do all the hard processing in the main unit but I've been wrong before (after and in-between ).  I will definitely take a look at it though.

Marty, I'll be looking that up.  That may be very useful.

Thanks guys,

-Ron


----------



## lens42 (Jun 8, 2013)

Or another very cool approach:
http://www.yuriystoys.com/search/label/DIY DRO Project


----------



## ScrapMetal (Jun 8, 2013)

lens42 said:


> Or another very cool approach:
> http://www.yuriystoys.com/search/label/DIY DRO Project



Yes, I've seen Yuri's project and it is interesting.  My problem with that approach is two (or three :biggrin fold.

I appreciate being able to use the processing power of the smart phone/iPad/android device BUT in order to use them they would need to be in close proximity to my lathe or mill both of which tend to fling oil, coolant, and hot metal in every conceivable direction.  While "tough" by carry standards they still aren't designed for this kind of exposure.

Speaking of exposure, they are also all "touch screens".  As this is pretty much a hands-on activity I know my hands get full of oil and grunge/metal filings/etc.  A single afternoon of use in my shop would see the screens and probably the cases covered in muck and oil or scratched beyond use (I need things _clear_, my eyes aren't as good as they used to be ).  Not a good thing.

I can go on but I think you get the general idea of how I feel about it.  This is just my opinion though and shouldn't be seen as a criticism of what Yuri has been working on.

Thanks,

-Ron


----------



## kd4gij (Jun 8, 2013)

Or you could put the tablit in a ziplock bage. Just a thought.


----------



## jgedde (Jun 8, 2013)

ScrapMetal said:


> What I am looking for is the method in which the reader heads return position information to the main unit.  I assume that different brands use different (maybe proprietary?) protocols but I need a place to start.
> 
> About the only information I've been able to find so far is that one "standard" is to use a double sine wave where the signals are 90 degrees out of phase with each other.  That's great and all but I still haven't read any where just how that is used to relay position.  Phase change?  Amplitude?  Frequency?  I don't know.
> 
> ...



A linear scale works just like an incremental rotary encoder (that you'll find a lot of info about) with decoding done by a relatively simple digital circuit.

Let's talk about a digital scale first...  Usually scales use two signals in quadrature (90 degrees apart in phase) to indicate movement.  Let's call the two signals A and B.  Every time a transition occurs on either A or B, that increments or decrements a count value by one.  If the A track leads the B track, that's one direction.  If B leads A, that's the other direction.  With a 4X quadrature detector, you can get resolution 4 times (4X) the number of pulses per unit length.  Basically, they work like this: if a transition is seen on one track, the level of the other track determines whether to count up or down.

So, what circuit does this?  In its simplest form, it's just A XOR B.  But that doesn't give you direction, just relative movement with the count going in the same direction regardless of direction.  Adding one more XOR gate and four flip flops and a clock source, along with a counter gives you position.  The c ount value just needs to be scaled into engineering units (inches, mm, etc).  This is also readily done in a small microcontroller with an input capture feature (or maybe even just digital inputs)

So what I've described can measure relative distance.  Some scales also have a third signal, the Z track which is used to reset the count for absolute position sensing.

Sinusoidal encoders are very similar in concept, except the fact that they are outputing analog signals (sine and cosine) allows for more than 4X resolution by a process called interpolation.  Think of a digital encoder as described above where every zero crossing resynchronizes the interpolator (just like the 4X quadrature detector) to prevent cumulative error.  You can use a circuit to square up the sine and cosine outputs and sinple feed them into the digital circuit described above.

OK, that's how typical higher end scales work. 

 Many Chinese scales use a serial output because the interpolation and quadrature detection happens in their circuitry and position is the output.  They use a variety of protocols.

https://en.wikipedia.org/wiki/Linear_encoder


John


----------



## ScrapMetal (Jun 10, 2013)

kd4gij said:


> Or you could put the tablit in a ziplock bage. Just a thought.



That would help to keep the screen from getting oiled but it would bring it's own issues with it.  Still wouldn't help much with the hot metal either. 

Thanks. 

-Ron




jgedde said:


> A linear scale works just like an incremental rotary encoder (that you'll find a lot of info about) with decoding done by a relatively simple digital circuit.
> 
> Let's talk about a digital scale first...  Usually scales use two signals in quadrature (90 degrees apart in phase) to indicate movement.  Let's call the two signals A and B.  Every time a transition occurs on either A or B, that increments or decrements a count value by one.  If the A track leads the B track, that's one direction.  If B leads A, that's the other direction.  With a 4X quadrature detector, you can get resolution 4 times (4X) the number of pulses per unit length.  Basically, they work like this: if a transition is seen on one track, the level of the other track determines whether to count up or down.
> 
> ...



John, thanks much.  Lots of good information and many things to consider.

-Ron


----------



## lens42 (Jun 11, 2013)

Not sure why you think a touch screen would fair that poorly in a shop environment. They _are_ made of glass after all. Something like an iPad of course was not designed for an industrial environment, but a more robust touch screen device wouldn't look much different - it's a glass screen with a metal case. In fact with the right design for one of those after-market cases, I think a tablet would do fine. Sure the screen would get dirty, but glass is easy to clean. Also a good software design would have you touching only button areas and not readout numerals, so the end result would be no worse than greasy buttons on a conventional DRO. 



ScrapMetal said:


> That would help to keep the screen from getting oiled but it would bring it's own issues with it.  Still wouldn't help much with the hot metal either.


----------



## ScrapMetal (Jun 11, 2013)

lens42 said:


> Not sure why you think a touch screen would fair that poorly in a shop environment. They _are_ made of glass after all. Something like an iPad of course was not designed for an industrial environment, but a more robust touch screen device wouldn't look much different - it's a glass screen with a metal case. In fact with the right design for one of those after-market cases, I think a tablet would do fine. Sure the screen would get dirty, but glass is easy to clean. Also a good software design would have you touching only button areas and not readout numerals, so the end result would be no worse than greasy buttons on a conventional DRO.
> 
> 
> 
> ...


----------



## kd4gij (Jun 11, 2013)

You can get 10" taplits for under $ 100.00 now days thus his choice to go that rout. But hay it is your shop and your money so what ever soots you. Just anouther option for some people not so much for outhers.


----------



## ycroosh (Jun 12, 2013)

ScrapMetal said:


> lens42 said:
> 
> 
> > Not sure why you think a touch screen would fair that poorly in a shop environment. They _are_ made of glass after all. Something like an iPad of course was not designed for an industrial environment, but a more robust touch screen device wouldn't look much different - it's a glass screen with a metal case. In fact with the right design for one of those after-market cases, I think a tablet would do fine. Sure the screen would get dirty, but glass is easy to clean. Also a good software design would have you touching only button areas and not readout numerals, so the end result would be no worse than greasy buttons on a conventional DRO.
> ...


----------



## ScrapMetal (Jun 12, 2013)

Thanks Yuri.  I've been on your site for a couple of quick "look arounds" and I'm very impressed with all the work you've done.  I plan to go back and spend a lot more time there as you've provided a lot of information that I may find useful to my own project.  Thank you very much for that.

My issues with the iPads, etc. probably come down to the fact that I'm morphing in to an "old fogey" (or setting the standard, not sure which :biggrin.  It seems everyone wants to do "everything" with their smart phone or iPad, etc. but I really don't see the point even though I respect being able to do it.  I'm more of an "the right tool for job" kind of guy and it just seems that if you are dedicating a device for a particular job it's best to have one that is designed for doing that job.

If, say you're are using your iPhone for everything, internet access, DRO, phone, etc. and it falls out while you are mountain biking and smashes on the rocks (if it doesn't get destroyed while using in a shop).  You are absolutely dead in the water, can't do work (DRO is out), can't get online, or call for assistance, etc. etc.  Granted, a dedicated DRO can take a dump as well but at least I can get online and order a new one or call the local distributor to see if they have one in stock. 

I see the allure of creating this as I went to college for electronics engineering and spent the last 30 years as a programmer.  I love to play with stuff.  For a dedicated tool in the shop for the average guy?  Not really, they just want to push the button and get an answer not tweak the code for their own wants/needs.  It's almost a waste to see computing devices like these dedicated to mundane shop functions.  It seems to me like taking a $500 computer and programming it to be a $20 calculator.

Still, thanks again for your site.  It is much appreciated.

The old fogey,

-Ron


----------



## kd4gij (Jun 12, 2013)

Ron

  Yuriy does have a stand alone dro that he built you can find it here. It might help in your project.
http://www.yuriystoys.com/2012/02/diy-digital-readout-project-update.html


----------



## ycroosh (Jun 13, 2013)

kd4gij said:


> Ron
> 
> Yuriy does have a stand alone dro that he built you can find it here. It might help in your project.
> http://www.yuriystoys.com/2012/02/diy-digital-readout-project-update.html



Yep 
Just got a new batch of boards as well.
I've built 5 Android-based units so far (not counting prototypes) and about two dozen of the simple "3 readouts with 6 buttons" for friends (and friends of the friends)  

Here is the supreme irony:
Android version's total cost is $20 + tablet ($4.50 for MSP430 Launchpad, $11 for the BT module and the change for the connectors). With a cheap tablet (assuming you don't already have an old phone laying around) it's $120-$150 tops and takes about an hour to build.
Standalone version's cost is over $150 (3 LED driver chips alone are $50, + $35 for the Arduino + $77 for the PCB) and I can put one together in about 6 hours, including the machining of the case, etc.

Thank you
Yuriy


----------

