How generic are glass-scale linear encoders? - Page 1
Forum section: electronics / general

author: jpanhalt
author_rank: Super Contributor
timestamp: October 17, 2023, 05:39:39 pm
content: I am planning to add a linear encoder to the"Z" axis (bed) of the lathe shown in the "New Shop" thread. My plan will involve using the data to control threading and other similar operations. It seems most glass encoders output a TTL quadrature signal, and the display does all the interpretative work. Whatever I get, I will be modifying the display unless it gives something like an SPI output (or 12C).Thus, has anyone used a cheap display with a higher quality encoder? Which brands?Regards, John

author: thm_w
author_rank: Super Contributor
timestamp: October 17, 2023, 09:14:44 pm
content: It looks like its semi-standard in that they mostly use DB9 connection, but the pinouts and signaling can vary:https://www.touchdro.com/resources/scales/glass/glass-scale-pinout.htmlSingle ended or differential.Usually you'd buy the DRO and scale together as a kit, for a slightly cheaper price. So you wouldn't have to worry about compatibility.https://www.touchdro.com/resources/scales/glass/overview.htmlMost of the cheap DRO's have optional RS232, just make sure its actually fitted before buying.I don't know if that or just grabbing the quadrature signals directly would be easier.How are you going to push the carriage though? Usually you'd just convert that to ball screw and base the threading off of the rotation of that.

author: langwadt
author_rank: Super Contributor
timestamp: October 17, 2023, 09:31:43 pm
content: Quote from: thm_w on October 17, 2023, 09:14:44 pmor put an encoder on the spindle and a stepper/servo on the leadscrew, a.k.a. "electronic lead screw"

author: TimFox
author_rank: Super Contributor
timestamp: October 17, 2023, 09:38:45 pm
content: Of course, an advantage to a true linear encoder over a rotary encoder on a lead screw is that the lead screw may have backlash.Quadrature linear and rotary encoders (except for absolute rotary encoders, possibly in Gray code) usually need an initialization to an index mark on a third channel to be used for absolute position measurements.

author: langwadt
author_rank: Super Contributor
timestamp: October 17, 2023, 10:11:10 pm
content: Quote from: TimFox on October 17, 2023, 09:38:45 pm"electronic lead screw" doesn't need an encoder on the leadscrew: It has an encoder on the spindle, the leadscrew just follows the spindle at a set ratio like it was a gearbox, like is is on most lathes

author: thm_w
author_rank: Super Contributor
timestamp: October 17, 2023, 10:19:39 pm
content: Quote from: langwadt on October 17, 2023, 09:31:43 pmYeah that would be good, but I'm guessing OP wants to combine functionality to try to save a bit of money? Or for extreme accuracy?I don't know, I feel electronic leadscrew as you say and just run the glass scale DRO separately is the way to go. Given a smaller budget.

author: jpanhalt
author_rank: Super Contributor
timestamp: October 17, 2023, 10:23:33 pm
content: Thanks for the comments.@thm_wI suspected that a lot are SPI or modified SPI (e.g., Mitutoyo, which is not compatible to true SPI). My idea is to save a little money. The DRO (3-axis) on my mill is Mitutoyo and was bought years ago. It was nowhere near the current price. (The quill DRO has not been installed.) Whatever I get will involve writing my own code and probably adding and/or replacing the board in the display. So, a cheap display would give me a nice box and screen (LCD) at a minimum plus something to test my idea before getting too deeply into it. Why just 1-axis? That's all I need, and mounting a scale to by cross slide would be much harder. RS232 is OK, if fast enough, but speed is not an issue with SPI. I think at my age, I can handle changing pinout, if that information is available or figure it out.Main reason is to save a little money and the fact that the control box will be butchered in any event. It's easier on the budget to butcher a cheap box.@langwadtI want DRO, as measuring the actual position effectively eliminates backlash compensation and the need for ballscrews. Ballscrews are or can be a real real disadvantage for a manual machine, because they are too damn smooth and don't hold. I watched a lot of Clough42's videos and actually got the servo encoder he used from Stepperonline. Then I thought, that doesn't really help when making a RH thread and working off the front. My lathe has a threaded spindle, and I am uncomfortable running it in reverse. Moreover, the quick change covers almost any conceivable imperial thread. I have the change gears for metric, but haven't used them. I don't consider setting the gear and using the thread counter a big hassle. What is becoming more difficult is my coordination and timing to disengage the half nuts. My plan is to make that electronic. First, just by stopping the lathe (VFD stops it pretty quickly), then later adding a timing belt and stepper/servo to the threading lever. I thought of starting a separate thread, "OMC machining" (OMC = old man's crutches).@TimFoxI agree on the DRO linear encoder advantage, which is why I chose that approach. It will also be very easy to mount to the back of my lathe. There are ground ways and a T-slot for a taper attachment, which I don't have. So, T-muts and some setting blocks will take care of mounting. The linear encoders I have so far looked at are absolute; however, that probably won't matter as I will set the zero for stopping.Refining my question: Has anyone made a hybrid setup of good encoder and cheap display, without regard to whether changing pinouts was needed?

author: langwadt
author_rank: Super Contributor
timestamp: October 17, 2023, 10:27:14 pm
content: Quote from: thm_w on October 17, 2023, 10:19:39 pmI've considered making a combined DRO and electronics leadscrew, have parts laying around but it's yet another of those projects

author: jpanhalt
author_rank: Super Contributor
timestamp: October 17, 2023, 10:34:19 pm
content: This is my "Winter" project. My other project began a couple of years ago is just about wrapped up.

author: langwadt
author_rank: Super Contributor
timestamp: October 17, 2023, 11:07:04 pm
content: Quote from: jpanhalt on October 17, 2023, 10:23:33 pmif the scale connections to the DRO is DB9 it is probably quadrature, it should be possibly to just use a couple of connectors to sniff those wires and connect them to an MCU to do your controlplenty of MCUs will do quadrature counting in HW, STM32 at least 4this is as far as I got when I looked at something like it,

author: jpanhalt
author_rank: Super Contributor
timestamp: October 17, 2023, 11:18:26 pm
content: I've done quadrature decoding for a rotary encoder with a PIC. I am not worried about doing that. Do you have a link to the project associated with the picture? It looks very similar to what my first step will be.I had done a search before posting. Maybe I used the wrong search, but that project didn't pop up on Google.

author: langwadt
author_rank: Super Contributor
timestamp: October 17, 2023, 11:37:06 pm
content: Quote from: jpanhalt on October 17, 2023, 11:18:26 pmI don't have a link. It's mine, I just pulled it out of a box and took a pictureit's a "blackpill" STM32F411, a 7" display with SPI interface and I2C capacitive touchThe software doesn't do much, just quadrature decoding and showing tabs, numbers, buttons using LVGL

author: thm_w
author_rank: Super Contributor
timestamp: October 17, 2023, 11:58:00 pm
content: Quote from: jpanhalt on October 17, 2023, 10:23:33 pmI've not heard of SPI, but they mention a few variations here:https://www.mitutoyo.com/webfoo/wp-content/uploads/DROsystem_2217-1.pdfSerial RQ/DT (maybe what you are talking about) or some kind of analog sine output. I would just get a chinese scale kit from a known brand, then you know it works and the output is quadrature. There are lots available under $300 (https://www.aliexpress.us/item/2251832719664379.html) which ones are decent or not I can't say.Quote from: jpanhalt on October 17, 2023, 10:23:33 pmI would consider:- building a mechanical thread disengagement stop- using a die to thread where possible- building a tab to lock the spindle (example:youtube.com/watch?v=hv2UyFNZUEY)

author: jpanhalt
author_rank: Super Contributor
timestamp: October 18, 2023, 10:09:43 am
content: @thm_wYou identify exactly the problem with buying a generic, relatively cheap complete setup. I suspect there are few actual encoder manufacturers in China and many sellers with various brand names. Telling real junk (like the cheapest on Amazon) that can't even get units straight versus an easily affordable adequate design is the issue. Reviews mean almost nothing as we know how some sellers are able to puff them up. For the scale, I came up with the following: Sino, Acu-Rite, Ditron, Mitutoyo (expensive and a little different), and maybe iGaging. For display, I would also consider "ToAuto," and others but it's hard to know whether they are any good. I am quite familiar with Mitutoyo, have a lot of its stuff, and have done an interface with its electronic dial indicator with the unusual SPI.Does anyone have experience with the lower end brands and can make a recommendation?As for a mechanical stop, that was considered and rejected. The lathe has a very nice mechanical stop for feeds. It activates with a relatively small obstruction, but it is not active for threads. Forces for threads are more and the risk of completely wasted work is greater. As for taps and dies, they are fine for smaller standard threads, but for odd or large pitches,e.g., 1" x 32 (or finer) on tubing, 1-3/4" x 8 and so forth, they just don't work well in a manual shop.I used the Mitutoyo electronic dial indicator mentioned above in a electromechanical stop for a smaller lathe (Prazi) without half nuts. Basically, I zeroed the indicator at the end of the thread. A small MCU detected zero and stopped the lathe. Modifying that for my larger lathe is a possibility; however, rather than using zero detect, which was really easy (i.e., the sign bit), I would probably do a full read and process that data. Rather than stopping the lathe, I would far prefer to disengage half nuts. That will be a mechanical challenge, but I think it is doable. My current thinking is to stack the hand lever and a cogged timing pulley on the same shaft. Then, add a small mount for a servo/stepper to work. It will need free wheeling, so I can control with the threading dial manually, if wanted. I will find a picture of that saddle and edit this post later. I am afraid of losing it, if I do too much Goggling with this open.EDIT: Here's a link to my lathe:http://www.lathes.co.uk/smartbrown/page2.htmlAttached is photo of the threading lever. I would extend the shaft and probably mount the pulley closest to the saddle with the lever nearest the user.

author: jpanhalt
author_rank: Super Contributor
timestamp: October 18, 2023, 03:11:59 pm
content: UPDATE: After 4 hours +, here's what I have found:1) If you want RS232 output, find a DRO for EDM or some bigger name, like Mitutoyo2) The Sino SDS6-2VF has RS232 output according to emails with sales. Be sure to specify -VF, not just V. The latter does not have that option.3) I do not know whether ALL EDM DROs have serial outputs, but a lot do.I found some pictures of one of my very first microcontroller projects (circa 2007-2009). It used the Mitutoyo electronic dial gauge #543-252B (series ID-C112EB) (attachment) and a PIC12F509. Second attachment is the SPI-like output.Here is a quote on my notes about the Mitutoyo serial protocol:Quote

author: mendip_discovery
author_rank: Super Contributor
timestamp: October 18, 2023, 08:04:00 pm
content: Not sure if this helps but there us a UK firm that sells kits for lathes. They are a budget place but for home use it might just do.https://www.machine-dro.co.uk/lathe-kit/universal/with-optical-encoders/2-axis-easson-digital-readout-package-including-2-linear-optical-encodersDoesn't seem all that expensive. I have seen some of these display units and some has RS232 so you might be able to use that as part of design. Though 5um is the resolution.

author: jpanhalt
author_rank: Super Contributor
timestamp: October 18, 2023, 08:27:22 pm
content: £370 is about $450 USD today. A full setup direct from Sino is $391 including its shipping. I just bought the scale from Aliexpress for $69.70 including shipping It is supposed to be "Sino," but it is also from an unidentified international seller and Aliexpress. I'll probably find out in 14 days whether Aliexpress' "free returns" holds. Otherwise, I'll just skip lunch at McDonalds on Monday and call it a wash.This is mostly a Winter project to keep from getting S.A.D. The only pending project for the lathe is to fit a newer Buck 3-jaw adjust-tru chuck. I don't have any projects for the lathe itself aside from that. When doing an 8 tpi thread (about 3mm), the cutter is moving pretty fast. This project is to help me deal with that.

author: mzzj
author_rank: Super Contributor
timestamp: October 29, 2023, 07:13:40 am
content: Quote from: jpanhalt on October 18, 2023, 10:09:43 amOlder brand name DRO's have some crazy interface options to scales but these generic chinese scales use pretty much 100% TTL quadrature signaling. Pinout differs in between some brands but mostly same as Sino.I have installed 3 cheapo DRO's to different equipment and probably followed two dozen projects on forums, youtube or via friends.No major issues in any of them, display setup typically has some quirks that manuals are not up to date or translation is incomprehensible.And unfortunately no experience with RS-232 outputs.

author: mzzj
author_rank: Super Contributor
timestamp: October 29, 2023, 07:25:28 am
content: Quote from: jpanhalt on October 17, 2023, 10:23:33 pmI guess each to their own but leaving cross slide without scale sounds really weird. Typically highest accuracy demands for turning work relate with diameter and proper DRO just makes itso mucheasier.

author: jpanhalt
author_rank: Super Contributor
timestamp: October 29, 2023, 12:40:20 pm
content: @mzzjThank you for the response.The "devil is in the details." That lathe has a threaded spindle, which makes RH threading from the rear with the spindle reversed either impossible or very tricky. I do not want to put a sufficiently tight grub screw on the chuck back to prevent it from unscrewing.The main purpose for the single Z-axis is for threading, particularly RH internal threads. On another lathe I used a digital dial indicator with output* to indicate "zero" and stop the lathe (it didn't have half-nuts). On the present lathe, I plan either to stop the lathe or electromechanically open the half-nut. The saddle is made so that attaching a glass scale to it would be very difficult. I have a Digimatic (Mitutoyo) spindle DRO that is apparently inductive or capacitive and much smaller than a glass scale. It has the same type of digital output*, and I might be able to adapt that.My glass scale arrived last Thursday from Aliexpress. It is branded "Yusino" and is presumably made by Sino. I also ordered an Aikron A30P DRO, which has a RS232 output at 115200 baud. That should be more than fast enough for anything I do. Shipping has been a little slow, but I should get it early next week.*Mitutoyo series 572 circa 1990's. It has a synchronous, serial output of 13, 4-bit bytes in BCD. Clock is only 1.56kHz, and the output is easy to read.

author: mzzj
author_rank: Super Contributor
timestamp: October 29, 2023, 04:02:36 pm
content: Quote from: jpanhalt on October 29, 2023, 12:40:20 pmGrub screw is definetely not the preferred way to do it.I did it this wayhttps://bbs.homeshopmachinist.net/forum/general/1836336-threaded-lathe-spindle-lock(5th post)some other options:https://www.youtube.com/watch?app=desktop&v=hv2UyFNZUEYhttps://bbs.homeshopmachinist.net/forum/general/56390-stopping-a-threaded-lathe-chuck-from-unscrewing/page2https://www.axminstertools.com/eu/axminster-woodturning-asr-locking-ring-109370?glCountry=FI&glCurrency=EURNote that even if you don't plan to cut on reverse you need to swith your lathe forward-and-reverse constantly if you ever need to make metric threads on a imperial machine or vice versa.

author: jpanhalt
author_rank: Super Contributor
timestamp: October 29, 2023, 04:45:32 pm
content: I like that Axminster design with the smaller pressure points. I will definitely consider a clamp for my chucks and would definitely prefer that rather than removing the spindle and machining it.

author: jpanhalt
author_rank: Super Contributor
timestamp: October 29, 2023, 04:54:59 pm
content: Quote from: mzzj on October 29, 2023, 04:02:36 pmI have never done metric threads with a thread counter. I thought one would just mark the number used and always go forward at that exact spot before engaging the half-nuts.Of course, on my little Prazi without half nuts, one has to go forward and reverse constantly when threading, but it does not have a threaded chuck. Chuck bolts onto a flange, and that flange is bolted to the spindle.

author: mzzj
author_rank: Super Contributor
timestamp: October 29, 2023, 06:38:32 pm
content: Quote from: jpanhalt on October 29, 2023, 04:54:59 pmIIRC the problem was that if you thread metric threads on imperial machine the correct engagement points can be VERY far apart as the inch-millimeter ratios hardly match anywhere.Today you might be able to use microcontroller to do the math and let the spindle turn to correct index before engaging the half-nuts.Too much headache at the moment to think this trough but for 1 mm pitch the correct engagement points occur every 127 spindle rotations with imperial lead screw? and for M6 fine with 0,75mm pitch the correct engagement points are every 9525 spindle revolutions.Or every 7143.75mm on carriage movement so you need LONG lathe to find the next correct engagagement point!

author: jpanhalt
author_rank: Super Contributor
timestamp: October 29, 2023, 07:05:04 pm
content: Good points. I guess I will just back it out. I don't have any metric threading in my immediate plans.

author: langwadt
author_rank: Super Contributor
timestamp: October 29, 2023, 08:23:10 pm
content: Quote from: mzzj on October 29, 2023, 06:38:32 pmhere's a trick,https://youtu.be/HXt4TWa382Q?si=lEPwSvisvSh1sO1P

author: langwadt
author_rank: Super Contributor
timestamp: October 29, 2023, 08:27:24 pm
content: Quote from: jpanhalt on October 29, 2023, 12:40:20 pmso a carriage stop with a microswitch would do the job simply and reliably

author: jpanhalt
author_rank: Super Contributor
timestamp: October 29, 2023, 10:45:24 pm
content: Re: MicroswitchYes, that accomplishes the same thing. But using a dial indicator/linear sensor will give positive feedback in half-thousandths. It's also fun. During my long Winter days, I write code just for fun -- sometimes for no real purpose other than to see whether I can do it. Nothing else to do.I have a contribution on PICKList* that is the product of that and for which no other immediate purpose.JohnUnfortunately, PICList was taken down and everything is now on mirror sites. It was probably a bad idea to post my email here. Just look for base conversions and 17-bit binary to BCD.