MadModder

Gallery, Projects and General => Project Logs => Topic started by: vtsteam on March 26, 2015, 11:24:36 PM

Title: Electronic Leadscrew for the New Lathe
Post by: vtsteam on March 26, 2015, 11:24:36 PM
I just spent a discouraging evening looking up electronic leadscrews on the internet. They don't seem to work very well, and, they cost multi $, or both. Or they need a big computer, too. Any suggestions to get past both of those problems would be greatly appreciated!

I read that standalone units don't make sense, and that a supposedly DIY open source unpopulated standalone board costs $250.

I read that a full fledged CNC program can work (and actually, more cheaply, since I already have steppers, stepper drivers, and spare older computers with parallel ports).

BUT a computer and associated gear and wiring is practically the size footprint of the lathe.

BUT also the single pulse per revolution of the spindle in most stepper CNCs is NOT accurate.

BUT some say it is and the reason it isn't accurate is because Mach 3 has bugs in the threading portion of the code.

But TurboCNC has been used for threading for over a decade.

But is it accurate enough?

But LinuxCNC uses a quadrature signal besides the single pulse, so maybe it is acceptably accurate.

But GRBL a simple CNC program that can run with very simple compact computers like Raspberry Pi to control an Arduino has no lathe threading capability.

Most threads devoted to this kind of thing seem to deteriorate after the first two or three pages into arguments about closed loop and open loop theories and the number of pulses per revolution or inch, etc. and end up nowhere.

Here's what I'd like:

A small box that had a small display and a few buttons, that would hook to a sensor on the headstock, and to a driver for the stepper motor, and would allow you to enter the feed rate desired, direction, and if needed threading input requirements. That's all. And that there was a board available for doing that for about $100 or less.

Is there such a thing? My guess at least from reading so far, is no.

Yes?

Title: Re: Electronic Leadscrew?
Post by: Brass_Machine on March 27, 2015, 12:44:32 AM
I did see something like that awhile back. It was essentially a cnc "lite".

I will see if I can find it again.

However, why not use an arduino and make your own?
Title: Re: Electronic Leadscrew?
Post by: Brass_Machine on March 27, 2015, 12:48:39 AM
I can't understand what he is saying... but something like this? Arduino control...

Title: Re: Electronic Leadscrew?
Post by: bertie_bassett on March 27, 2015, 03:27:14 AM
Ahh the good old ELS problem.  I remember getting just as frustrated trying to find a simple solution.

What do you actually want it to do though??

Do you want it to do the whole threading job?? Or do you want to do the threading yourself and just have the speed controlled electronically ?

If you want to do it yourself, all you need to replicate electronically is the change gears,  so a simple spped control circuit would be the main part, tie it to the headstock speed with a comparator and bobs your uncle!  Then for threading either keep the half nuts engaged or use a thread dial.

If you want the electronics to do the whole job, then you'll need to have something keeping track or where everything is plus drive 2steppers, so then you getting into big enclosures with lots of parts. In fact you'll be jusst pn the edge of a full cnc machine.

Personally I'm going to go stick with change gears for now ( if i ever make any). And in the future have a simple speed controlled lead screw 
Title: Re: Electronic Leadscrew?
Post by: lordedmond on March 27, 2015, 03:38:12 AM
This may be a completely dumb question but

If you use the system as Bertie speced out you have to reverse the lathe , so with a single encoder pulse from the headstock how does the system know how to reverse the lead screw ?

In my mind a single pulse will give position but not direction , but I may be wrong again


Stuart
Title: Re: Electronic Leadscrew?
Post by: SwarfnStuff on March 27, 2015, 03:57:21 AM
I subscribe to the KISS principle wherever possible.  If I were to go ELS I think Bertie's idea would be my choice so I would like more info from Bertie, AKA explain a bit more please B. This is one of those good to have mods in my one day do list. 
Title: Re: Electronic Leadscrew?
Post by: PekkaNF on March 27, 2015, 04:09:43 AM
Damn you VT :lol:

Few years back I did some armchair engineering and went trough the whole google over and found arguments/flames/missing the point and you name. It came pretty obvious that: Whole lot is pretty simple at first sight, but you need to make and informed decision on following approaches:
* KISS = limited, but least you have some chance in success. When it is comes mostly programmable project there is a great temptation to add way too many conflicting features. Deside what you want and stick to it. I went other way and didn't complete it.
* Do you want only to eliminate change gears, or also with spindle start/stop? How about automatic threading with multipass? Do you have temptation to make taper and taper threads....see where I'm getting?
* Mechanical or system inaccuracies - acme screw, backlash, lightweight? Or ballscrew and great stiffness.
* Brute force or a lot of fiddling, esitmation and cheesy math. Like this spindle speed caculation: Do you have enough spindle gear inertia and stiff (AC drive or constant rpm servo) to keep the spindle near constant velocity and can get by with one pulse per revolution. Or do you have lightweigh mechanics and fluctuating DC-drive and really need all the pulses you can get and processor to cope with vartying spindle speed and beeffy servodrive to keep up the feed with this fluctuation. Like shooting moving target that chances it's speed all the time?

The big question that dawned to me is: If you lathe and gear is big enough to make electronics and calculus simple it is likely to have threading feeds. If your lathe does not have it you have to make it CNC way and then this ecological niece is not that big.

Anyway, I don't see any fundamental reason it would not work simple if carefully designed. Therefore I'm tooling up slowly to make one of my lathe "ready" for some sort of ELS.

Pretty sure my ramblings will not add much, but here is one eager watcher.

Pekka
Title: Re: Electronic Leadscrew?
Post by: JHovel on March 27, 2015, 04:17:21 AM
What's wrong eith the ELS here http://autoartisans.com/ELS/
What made you say "they don't seem to work very well"?
I've built it and converted my lathe. Not only is it dead easy, but it also has a port to connect to a CNC controller if you want to go that way for some jobs. And you can continue to ue the lathe manually.
When threading, it does not reverse the spindle. It retracts the tool and reverses it quickly back to the starting point, feeds it back in with a setable increment and runs down the thread again. It moves the tool along the flank of the thread so it cuts only on one side - the 'proper' way.
I lave the fact that it has its own look-up tables for just about all standard threads, can do taper threads, turn standard tapers  and can broach without the spindle running.
What more do you need?
Joe
Title: Re: Electronic Leadscrew?
Post by: John Rudd on March 27, 2015, 04:53:52 AM
Full kit available here....

http://medw.co.uk/wiki/index.php?page=ELS+Price+List
Title: Re: Electronic Leadscrew?
Post by: John Stevenson on March 27, 2015, 05:59:15 AM
Been thru this and touched on most of what has been mentioned here.
Got the tee shirt, been sick all over it and it's now a shop rag.

Unfortunately got to go out today so wont be able to post until later tonight but there are answers.
Title: Re: Electronic Leadscrew?
Post by: RussellT on March 27, 2015, 09:02:34 AM
I made an electronic taper turning device which used a geartooth position sensor to detect the spindle speed and then stepped the top slide motor every x pulses for each tooth.  The software was very simple and runs on an old laptop but would easily fit on a Pic or similar.

The difficult bit in extending that idea is picking up the thread on subsequent cuts.  You could use a gear with a wide tooth to detect spindle position as used on some engines for crankshaft position sensing but the software would be more complicated.

My initial thought would be to use a stop to set a consistent start point and then start the cut on the wide tooth.

From a software point of view it would be easier to make it work with two sensors.

Russell
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 27, 2015, 10:14:31 AM
Wow, I thought I'd wake up to maybe 2 replies.

Answers to various posts:

I don't mind a simple threading function. I don't plan to add an X stepper, and I don't lathe thread often.

A straightforward lathe (the one I'm building) with conventional acme screws. Anti-backlash nuts or spring or weight per ancient TurboCNC practice.

Reasonable practical thread accuracy for model engineering, not commercial/NASA/theoretical micron air bearing
ultimate spare no expense, etc. hooha.

Under $100 for a functional board so a 175 UK pound board, plus accessories doesn't fit spec.

I don't want to design and code something. I want to finish my lathe and build engines. Building the lathe is fun and rewarding, but it is in the way of building engines. I don't want now start also learning enough to design a circuit and program a microprocessor and have that get in the way of finishing the lathe so I can build engines. Hope that makes sense....

I don't mind soldering/populating a simple board kit if absolutely necessary, and if $100 or less. Or connecting up existing components (ie. an arduino, RPi, breakout board, stepper driver, steppers, power supply -- and I already have all of those components, or an encoder, which I don't have yet)

What I mean is the thread controller board -- whatever that is.

I have no prejudice against what is called a "Full CNC" solution vs an "Electronic Leadscrew" solution other than the size and comlpexity of an old honkin computer and monitor and cables all over the place in a tiny overcrowded shop on a small lathe. Actually, some of the electronic leadscrews actually look as big and messy as a full CNC rig so this may not even make sense.

The closest parallel to what I want is the ancient TurboCNC lathe at DAK, and if it worked well enough for reasonable threads and could run on a small Arduino sized board and interface with a couple line LCD would completely do it for me. I've used TurboCNC otherwise, and I speak DOS, so no problems at all and no prejudices about lack of bells and whistles.

John, I trust you know all of this, have been through it and probably do have a solution or the reasons to stop wishful thinking and get on with it.

Also, one more thing. I don't mind a mechanical rather than electronic leadscrew.

I just don't want to have to read a chart in tiny numbers in dim light on the left hand side of the lathe inside a cover with my head turned sideways, memorize those numbers on a particular line, find a wrench to fit gear retaining bolts, grab ahold of blackened oily gears remove them, loosen a greasy cast iron banjo and have it flop onto my thumb, put keyed spacers into the right hubs for doubled up gears, figure out which way they face -- behind or in front of each other, figure out which of three slots they go in, get that all wrong, remove the gears, wipe safety glasses with grease, apply to forhead, try gears again in a different slot, put a piece of paper in between gears to set correct spacing try to hold it in place while adjusting banjo, sliding gear in place, and holding a wrench to tighten simultaneously with only two hands, etc.

Then when finished threading, repeating the process to return to fine feed.

Is there an easier way -- and I don't want to make a conventional QC gearbox -- which project would seem to delay building the lathe to build engines even further.

Maybe something with timing belts to at least get rid of the grease?

Or what about a master thread deal, like Unimats had?


Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 27, 2015, 10:35:20 AM
Somebody needs to come out with a 5 volt single board computer the size of a credit card that runs DOS natively and has a CNC compatible parallel port and a B/W LCD display capability. Doesn't even have to be more than 100 Mhz  and look like a 486.

Or better yet, we need a DOS tablet, with a parallel port!  :lol:
Title: Re: Electronic Leadscrew?
Post by: John Rudd on March 27, 2015, 12:19:52 PM
Rasberry pie......small board computer.....Doable?
I'd have thought so.... :zap:
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 27, 2015, 12:36:55 PM
John, I've got one but the available CNC package, a GRBL interpreter which sends instructions to an Arduino board running GRBL itself, does not do threading.

The (or a) problem probably lies in the fact that communication is via USB, and so realtime monitoring and adjustment would be slower than some kind of parallel interface with lots of data in and out lines.

One other reason (said a GRBL developer) that threading is also a low priority, honest, I read this online, is because "lathes are more dangerous than milling machines," and the code would need to be more robust. These guys are 3D printer oriented.

Apparently this hasn't stopped other CNC programmers, and I'd hate to be locked inside the cabinet with a running Fanuc machining center.

Heading out now to cut some firewood wth the chainsaw......truly....


 
Title: Re: Electronic Leadscrew?
Post by: awemawson on March 27, 2015, 12:57:02 PM
So it IS a lathe that you are building, not a ladder! The dog'll be really pissed off  :lol:


ps no problem threading using TurboCNC - converted my first Denford ORAC CNC lathe that way an awfully long time ago !
Title: Re: Electronic Leadscrew?
Post by: bertie_bassett on March 27, 2015, 02:01:29 PM
my ideas are purely in my head and have never ben tested, so bear that in mind!

with regard to reversing the lead screw with the spindle :- a spare contact on the motor contactor or switch can easily be used to tell the stepper to reverse.

or if you have a thread dial indicator thingy, just leave the spindle running, release half nuts at end of thread, manually wind back the carriage, adjust cutting depth and reengage half nuts when dial tells you to.

seems simple in my head.

other musings:

iv often wondered if a stepper were to be driven by the spindle, could the resultant voltage produced be enough to use as a speed reference? plus the stepper could also be used to drive the head for indexing or very slow speeds??
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 27, 2015, 03:05:58 PM
Eric, Something like that, yes, looks promising. :coffee:

Russell, sounds like a good principle and idea, but I need something that is working now.  :beer:

JHovel, there's a thread in this forum devoted to the problem of inconsistent threads w/single spindle point pickup-- don't have the address of the thread offhand, search if interested...  :coffee:

John S. figured you'd know.....  :dremel:

Pekka, I think I might have already touched on most of the questions you asked so far, but simple threading, acme feedscrew, and the spindle motor will be a 2.25 hp (mfr rating) DC treadmill motor and  DanFoss Cycletrol 150 controller. It does still have the big cast iron flywheel on the motor and, if it would be an advantage, I could retain that (though I hadn't planned on it). This is for my new abuilding 9"x12" heavy mini-lathe, I mean dog ladder.  :)

Bertie, some interesting ideas there. :smart:   But not a working circuit/software/firmware reality.

Andrew, lathe? What lathe? This is just a what if kinda thing......... :poke:
Title: Re: Electronic Leadscrew?
Post by: bertie_bassett on March 27, 2015, 03:28:50 PM
this any good to you?

 http://www.homemetalshopclub.org/projects/electronic_lead_screw/els.html
Title: Re: Electronic Leadscrew?
Post by: PekkaNF on March 27, 2015, 04:45:43 PM
The more I think this at my point of view the more I'm inclined to build "simplified" ELS type feed to chooce the feeds and rely gears on threading, very tempted to calculate simple norton gearbox for 90% of the three/four mostly used lead.

Normal feed is not that demanding on lead accuracy and does not need all calculation for threading start/approach stuff and no temptation to try out any automatic cycles.

There is one manufacturer that uses timing belt on threading least one Wabeco and I have seen timing belt on one Austrian lathe (it also has a "tow hich" to feed the tail stock).
http://www.lathes.co.uk/wabeco/img18.gif
But I don't see really any benefit on timing belt spagethi.

Pekka
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 27, 2015, 06:13:12 PM
Already saw it last night Bertie. Nice theory and prototype info, but is there a board or kit available?

I like the one Eric posted a video for, since it seems to use off the shelf Arduino and Arduino Shield, but much more info needed. Software available? How well does it cut threads? Does it require that Shumatch DRO in the video to work?

Pekka, if I have to mess with gears for threading, might as well go whole hog and skip the electronics just for feed.

I still do wonder about the master thread follower type (unimat style) as possibly the simplest mechanical type.

Then I start thinking take it off the lathe altogether and just make some kind of hand cranked threading machine. Seems like a lot of people just crank the spindle by hand anyway, so why even thread on a powered lathe then?

I guess a master screw and follower wouldn't be practical for making long pieces, leadscrews and such, but my lathe is going to be 12" between centers, so would I really need big threading capacity anyway?
Title: Re: Electronic Leadscrew?
Post by: bertie_bassett on March 27, 2015, 06:34:12 PM
im sure iv seen something similar that was complete and working, don't think it was a kit, but showed exactly what was srequired . unfortunalty iv no idea where I saw it, might have it saved on the old laptop, will take a look tomorrow if I get a chance
Title: Re: Electronic Leadscrew?
Post by: PekkaNF on March 28, 2015, 03:41:13 AM
Pekka, if I have to mess with gears for threading, might as well go whole hog and skip the electronics just for feed.

jea but, no but,
feeds are used pretty much all the time
threading only max. once per part
AND you want to use them in alternating order....no need to change gears (yuk) until thread pitch needs to be changed.

I could setle electric motor wth variable feed (mm/r) but rpm of it must be ofcourse controlled by spindle rpm. There is allways manual control like in manual crankking, but pretty often it would be nice to "dial in" feed, even if it is off by 5-10%.

I saw a little writeup on MEW I think few years back. Someone tried two popular ELS systems and he was able to produce thread, but they did not were really that impressive and he needed to get the parameters close to right. Least that was my impression. I desided it wasn't for me. Looked like it made easily thread looking form, but did not produce goog quality threads consistently.

I still do wonder about the master thread follower type (unimat style) as possibly the simplest mechanical type.
http://img18.photobucket.com/albums/v55/EPAIII/SetUpOnTable.jpg
http://bbs.homeshopmachinist.net/threads/5095-Thoughts-on-a-fusee/page4

If you anly need short threads I can see the attraction to that threading "formers and followers" method.


Then I start thinking take it off the lathe altogether and just make some kind of hand cranked threading machine. Seems like a lot of people just crank the spindle by hand anyway, so why even thread on a powered lathe then?

I remember seeing a picture of crude "screw lathe" that was used on mass proction around WWII. One machine more and you loose "register". But it would me interesting to see.

Pekka
Title: Re: Electronic Leadscrew?
Post by: Country Bubba on March 28, 2015, 08:30:51 AM
Somebody needs to come out with a 5 volt single board computer the size of a credit card that runs DOS natively and has a CNC compatible parallel port and a B/W LCD display capability. Doesn't even have to be more than 100 Mhz  and look like a 486.

Or better yet, we need a DOS tablet, with a parallel port!  :lol:

Hey Steve, how about this box for dos??

http://www.roboard.com/ncbox-189.html

And it can be found here:

http://www.robotshop.com/en/roboard-ncbox-189-cnc-machine-controller.html

And their located in your part of the world!

Robotshop inc.
555 VT Route 78 suite 367
Swanton, Vermont, USA, 05488



Title: Re: Electronic Leadscrew?
Post by: John Stevenson on March 28, 2015, 08:41:17 AM
Somebody needs to come out with a 5 volt single board computer the size of a credit card that runs DOS natively and has a CNC compatible parallel port and a B/W LCD display capability. Doesn't even have to be more than 100 Mhz  and look like a 486.

Or better yet, we need a DOS tablet, with a parallel port!  :lol:

Hey Steve, how about this box for dos??

http://www.roboard.com/ncbox-189.html

And it can be found here:

http://www.robotshop.com/en/roboard-ncbox-189-cnc-machine-controller.html

And their located in your part of the world!

Robotshop inc.
555 VT Route 78 suite 367
Swanton, Vermont, USA, 05488

No mouse terminal ?
Title: Re: Electronic Leadscrew?
Post by: Country Bubba on March 28, 2015, 09:04:17 AM
It has 3 usb  ports.

But I for one, don't want a mouse in the shop.
Title: Re: Electronic Leadscrew?
Post by: mattinker on March 28, 2015, 09:11:04 AM
Somebody needs to come out with a 5 volt single board computer the size of a credit card that runs DOS natively and has a CNC compatible parallel port and a B/W LCD display capability. Doesn't even have to be more than 100 Mhz  and look like a 486.

Or better yet, we need a DOS tablet, with a parallel port!  :lol:

Hey Steve, how about this box for dos?

http://www.roboard.com/ncbox-189.html

And it can be found here:

http://www.robotshop.com/en/roboard-ncbox-189-cnc-machine-controller.html

And their located in your part of the world!

Robotshop inc.
555 VT Route 78 suite 367
Swanton, Vermont, USA, 05488

No mouse terminal ?

John,

One problem, Steve doesn't want to spend more than two shillings and four p'nce on it!

Matthew
Title: Re: Electronic Leadscrew?
Post by: John Stevenson on March 28, 2015, 10:39:16 AM
It has 3 usb  ports.

But I for one, don't want a mouse in the shop.

Der, slaps head with big dirty hand.
I have an old DOS machine running AHHA and can run that without a mouse fine but it's next to impossible to run windows programs without a mouse.
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 28, 2015, 01:19:49 PM
When all is said and done and we get a small computer board and a screen and a keyboard and lets say we're going to run DOS and TurboCNC....... seems like some old funky 486 DX66 laptop with a small screen and therefore a small footprint is actually going to be more compact than all the other separate micro stuff hooked together with a power supply and cables, etc.

And I don't know why I hadn't thought of it, but I do have an old Win95 NEC 486 DX66 laptop, that will run DOS on startup, actually in quite good condition stuffed away somewhere "in case I ever found a use for it".

The only question is, John S. Is TurboCNC single pulse pickup threading no good, or probably okay for a bodger like me?



ps There's a business in Vermont???
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 28, 2015, 01:31:00 PM
Pekka re. thread follower -- I really do have a soft spot in me heart for a purely mechanical solution (other than change gears) -- and I've been hanging onto this picture, got from -- I don't remember where -- for a decade.

I'm really tempted to do something like this, or along this principal, anyway. Decisions, decisions......





Title: Re: Electronic Leadscrew?
Post by: Arbalist on March 28, 2015, 02:16:24 PM
When you think about it, it's surprising someone hasn't come up with some kind of swappable lead screw system. Not as elegant as change wheels but could be much quicker to set up?
Title: Re: Electronic Leadscrew?
Post by: sparky961 on March 28, 2015, 02:21:25 PM
... I do have an old Win95 NEC 486 DX66 laptop, that will run DOS on startup, actually in quite good condition stuffed away somewhere "in case I ever found a use for it"...

Old laptops that are too slow to use modern software find a perfect place in hobby CNC if you use old software or something of your own creation.  They are compact and more powerful than most people give them credit for.

The only issue I've come across in my own experience is that the processor speed can limit your maximum stepping rate.  There may be a way to get around this, but just another factor to keep in mind while you're exploring options.  It was definitely better when using "good old" DOS and TurboCNC rather than Mach3 and Windows 98.  The multitasking (task switching) nature of Windoze is the core of the problem when you're trying to do something that requires real time operation.

I never had much luck getting EMC running well on any computer.  Unfortunately my experience with other open source linux-based software seems to follow the same pattern.
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 28, 2015, 04:12:31 PM
Arbalist, I was thinking similar to those lines, but  a normal leadscrew with half-nut and a second parallel pushrod to the apron -- attached there with a clamping block.

Pushrod goes back through the lower front headstock area (similar to the leadscrew) to the thread pickup arm, which rides on the spindle master screw -- similar to above pics. All the connections on the pushrod are adjustable, also similar to pic above.

You can still use the conventional leadscrew, but for threading you open the half nut and clamp the pushrod to the apron. It then controls the carriage.

In other news:

The NEC lappy is a Pent 1 it turns out, but the HD seems to be missing (did I do that?) It boots to BIOS, but the floppy drive is defunct. The HD socket connector seems to be proprietary, so I can't just drop in one of my old lappy HDs. Probably a lost cause. Too bad.

Mechanical solution is looking kinda attractive at this point unless someone comes up with a cheap simple electronic leadscrew controller board. Still open to ideas there.....

Title: Re: Electronic Leadscrew?
Post by: PekkaNF on March 28, 2015, 05:11:15 PM
I was about to play with velocity-tracking AC-inverter, but lost momenum...I have few 100/200W and 400W AC drives that do all sort of tricks and I think I guestimated that chucking even unmached pair of AC motors and invertters together would produce me near perfect feeds.

But there is a guy 20km away that could not stop there but used servocontroller to drive lead screw in velovity mode. If I remmber correctly he had to use eventtualy some sort of panel for user controller, but no PC, no progam licences, no mouse, no keyboard......all the smarts were on servo drive. This might or might not fit to your budget.

I like that tread follower idea too, it's all mechanical, simple, easy to understand and there will be no cheap caps to blow up their tops. I would design it at the back of the machine and normally the threads would be made away from the spindle....at great speed.

This should give you a push:
http://www.lathes.co.uk/carstens/
http://www.lathes.co.uk/stedall/
http://www.lathes.co.uk/accuratool/

just look her curves:
http://www.lathes.co.uk/accuratool/img2.jpg
That is one interesting design, but it has the horrors. But it brings your arm out of harms way.

Pekka
Title: Re: Electronic Leadscrew?
Post by: Fergus OMore on March 28, 2015, 07:52:51 PM
Not wishing to wander too far off but others have mentioned simplified screwcutting gear boxes.  I had one!
I made it up to the design of Martin Cleeve which appeared in ME in the 1950's

Somewhere are the drawings but it is shown in his Screwcutting in the Lathe book. It covered what he needed to cut Imperial threads and whilst I have a full Myford box and a metric conversion, I recall his comments about 'tieing up' gears. I recall him saying that Prof Chaddock had calculated that 20 change gears could be arranged to cut 750 thousand pitches- if they were not locked in a box.

Not for me to try- counting the odd sheep is enough for me.

Good night

Norman

Title: Re: Electronic Leadscrew?
Post by: Country Bubba on March 28, 2015, 08:48:02 PM
When all is said and done and we get a small computer board and a screen and a keyboard and lets say we're going to run DOS and TurboCNC....... seems like some old funky 486 DX66 laptop with a small screen and therefore a small footprint is actually going to be more compact than all the other separate micro stuff hooked together with a power supply and cables, etc.

And I don't know why I hadn't thought of it, but I do have an old Win95 NEC 486 DX66 laptop, that will run DOS on startup, actually in quite good condition stuffed away somewhere "in case I ever found a use for it".

The only question is, John S. Is TurboCNC single pulse pickup threading no good, or probably okay for a bodger like me?



ps There's a business in Vermont???

Steve,
Look at the Dakeng web site and the piece that Dave K is making for a sonar part (video at http://www.dakeng.com/TurboCNC_four_tools_turning.AVI)

Yep, turbocnc ain't dead yet!

Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 28, 2015, 11:05:55 PM
Thanks Pekka, that was interesting reading.  :beer:

Norman, yes I guess a QC gearbox could be made. There was an article in May 16 1980 ME by S.H. Abigail for a really simple conversion from loose change gears that I saved and looked at for quite awhile -- thinking of doing something similar for the Craftsman 12x36. But I never did. I should still keep it in mind. But I'd have to make up a full set of gears for the new lathe, which means making up a dividing rig, etc. I suppose one way of simple dividing would be to use the set of change gears from the Craftsman to index a cutter to make the new gears with.

Bubba, I have a fondness for TurboCad, and I actually still use it on the hot wire foam cutter.  That video is cool, but it was running so fast I finally realized when I looked at the swarf that he was cutting plastic, not steel. I've used LinuxCNC on my router. Both of these are in my big shop, where there is more room for a computer and other necessary gear.

One more thought re. electronic leadscrew and a micro single board computer running the GRBL CNC program:

GRBL does not do threading -- no input for pulse or encoder

But it does do conventional axis stepping. What if you could temporarily disengage the normal spindle motor by loosening the belt, and have another sheave with a timing belt to a stepper. Then you could just treat the spindle as just another machine axis, and since thread cutting speeds are likely to be low, and reduction to the stepper can be a reasonable amount, seems like you could just sync the spindle and leadscrew that way. Then cutting and multiple passes are all doable depending on how you write your G-code.

Similar idea I've already seen where both the spindle and leadscrew are servos, but a stepper version....



Title: Re: Electronic Leadscrew?
Post by: Fergus OMore on March 29, 2015, 03:18:48 AM
Yes, but the late and much lamented Cleeve only utilised enough cogs to make the necessary threads.  I've got a heap of cogs tied up and have never been used and will never be used-- and this is a 'sight glass' Myford Super7B that Hiram Abiff made the brass pillars for Solomon's Temple( or very nearly) .Again, I've a heap of cogs for the time that I might rip it all out and fit a longer leadscrew. If I ever get everlasting life!

Seriously, apart from cutting a 1/2" BSW thread or a fine feed, that is about it. I only cut 16TPI because I'm not strong enough now  to to manually tap.

Writing as retired bean counter, having a Myford box is a better investment than having my hard earned brass in the bank.

But enough of the Ancient dis-Order of Myford Investers? What about the old Pools Major lathe? I had one- sadly worn out and past its best but it had TWO leadscrews! It simply tightened or slackened the screws for the cogs to engage or disengage. Mine had flat belts and was often archaic but these nice little touches were winners.

Electronic lathes or whatever? No, they will come for the model maker and be affordable but not in my time. Meantime, others will spend a lot of time  and money in development( and often failure).

Maybe you should make a Hozapffel with your initials cast in the legs and  a wardrobe full of homemade tools!

My kind regards

Norman
Title: Re: Electronic Leadscrew?
Post by: philf on March 29, 2015, 03:45:17 AM

But it does do conventional axis stepping. What if you could temporarily disengage the normal spindle motor by loosening the belt, and have another sheave with a timing belt to a stepper. Then you could just treat the spindle as just another machine axis, and since thread cutting speeds are likely to be low, and reduction to the stepper can be a reasonable amount, seems like you could just sync the spindle and leadscrew that way. Then cutting and multiple passes are all doable depending on how you write your G-code.

Similar idea I've already seen where both the spindle and leadscrew are servos, but a stepper version....

Good idea Steve,

You'd need a fairly powerful stepper to drive the spindle and/or a big (compound?) reduction ratio to provide enough torque for coarse threading.

Phil.
Title: Re: Electronic Leadscrew?
Post by: RussellT on March 29, 2015, 06:19:30 AM
Hi Steve

Having read all the responses it seems it's possible to do it electronically but it's not straightforward or it's expensive.

Constructing a quick change gearbox seems like a lot of work too.

I bought a gearbox for my lathe because I didn't like changing the wheels to switch from threadcutting to fine feed - which is one of the reasons you mention and I'd find myself trying to avoid threading because of it.

If you're building a lathe from scratch then perhaps the easiest solution would be to have two lead screws - or two gear trains - one for fine feed and one for threading and rely on changewheels for setting the thread.  Maybe you could even use the Craftsman change wheels.

Russell
Title: Re: Electronic Leadscrew?
Post by: PekkaNF on March 29, 2015, 07:50:38 AM
I find the two leadscrew or one leadcref for threading and one splined shaft for feeds approach a little cumbersome.

I have been thinkking one leascrew and simple gearbox (reduced set of threads) or standard change gear arragement at spindle end and athe tail stock end coupling, gear and electric motor only for feeds. Bit like Hardinge, but much simplified.
 http://www.lathes.co.uk/hardinge/index.html

I have one little French made junk that has permananetly connected leadscrew on apron. No split nut. It is a little annoying to use but most of the time not as much as you might think. It got me thinkking if I could get away with rotating nut on the apron. I.E:
* threading per changegear (it has plastic change gears)
* Manual feed at the end of the leadscrew....there is a dog coupling to disengage threading/feed.
* electric motor to rotate the nut on the apron for variable speed feed.

Only downer is that to move the saddle from one end of the machine to the other would take a lot of crankking.

Myford 10 has very interesting arragement
http://www.lathes.co.uk/myfordml10/

There is very basic changegear arragement for threading/feeds that is straight connected to leadcrew.
On apron there is no halfnut, but a helical gear meshing with leadscrew. The gear can be turned with handwheel. Downside is that handwheel turns when leadcrew turns and saddle is stationary

But here is the idea: What about having a coupling (or gear) that will alternatively mesh with handwheel or electric motor?

The big idea:
1) Leadcrew is rotated only for threading and it has whatever gear set you need or forgot there. To thread you need to mesh gears on banjo and  gear on apron is stationary (worm gear on electric motor or halfnuts).
2) Leadscrew is moved out of mesh, stays stationary and is used as a gear rack. For all other uses than threading. Myford 10 has crank at the end of the leadcrew for hand cranking (inching, halfnuts coupled), but you have to drive all selected change gear cluster.
3) Automatic feed with an electric motor, at the end of the leadcrew(=need coupling) or at the apron, needs coupling too.
4) Manual feeds with granking on apron, halfnuts disconnected and possibly.

Then again maching small gear rack and pinion is not too expensive here, but one more arragement to lined up an to be fitted.


Feeds, even spindle speed coupled is very easy to make with electric motor.

Threading looks very simple on ELS-principle, but there are very narow margins, unless 1 or 2 axis CNC approach is fully accepted. Then it is not anymore very cheap and simple.

I am electrical engineer (control systems) and my choice for threading would be between change gears and/or greatly simplified crew cutting gearbox. And electric feeds.

Sounds like VT:s choice is between CNC and thread cardride/follower. Two really different animals! I'm really intered to see which way is taken. I think that follower would be very beautiful and it screams cast parts. CNC approaches often seems to come out untidy. Not pretty.

Pekka
Title: Re: Electronic Leadscrew?
Post by: S. Heslop on March 29, 2015, 09:28:05 AM
I'm no lathe expert but looking at them it seems that it's quite common for there to be a leadscrew with a spline in it, that works as a leadscrew and an autofeed thing. You could probably do some sort of worm gear thing with that, maybe all attached to some sort of pivoting block that rotates a gear meshing with the pinion down and out of the way. I was looking at those popular youtube videos of people hobbing worm gears on the lathe with regular old taps and it seemed pretty viable to me (but probably has alot of backlash). It's something I want to try out for making guitar tuners at some point.
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 29, 2015, 09:32:33 AM
Norman, Phil, Russell, Pekka, thank you for your thoughts here -- it really makes this interesting and helps greatly in weighing the options.  :thumbup:

STEPPER:

Phil I wonder how big a threading stepper and reduction on the spindle I'd need to cut, as a practical maximum let's say an 8 tpi Acme thread on say 1" dia mild steel rod.

Would a 270 oz-in stepper motor handle it with say a 4 to 1 reduction? (The spindle is roller bearing supported, and the leadscrew would be separately driven, so, not a load in this case.)

CHASE THREADING:

I see lathes UK calls the master screw and followers "chase threading". Must have evolved from the hand chaser and Tee rest method.

I'm still kind of attracted to this one because of its wonderful simplicity. I would definitely drive the apron in front, though, and run a pushrod parallel to the leadscrew, unlike any of those I've seen so far.

I would likely put the master screw on its own idler spindle with timing pulley -- close to the pushrod bearing, on the gear side of the headstock -- and run a belt to the spindle. This would reduce the length of the pickup arm and allow a change of simple pulley ratio between spindle and master screw. That last would reduce the number of master screws and follower nuts needed for a good range of threads. Pratt and Whitney did this, I think with master screws of 5, 5.5, 6, 6.5, 7, 8, etc.

It would also utilize the carriage and ways guidance for the cutter, rather than requiring the heavy rod on the rear of the lathe as a guide. The front mounted apron pushrod would no longer need to be of heavy proportions of the old style chase threader attachment. To me, the old style needed beef because they were acting effectively as an auxiliary cylindrical ways, supporting their own toolpost. It might be argued that the rear toolpost was a benefit, but that can also be achived on the conventional carriage -- as is done for an auxiliary parting toolpost these days. I was already planning on that anyway.

CHANGEWHEELS/GEARBOX:

Still a possibility. I think the things I hate most about the Craftsman could maybe be tamed somewhat in a new lathe. The blackened oily gears, heavy floppy three slot banjo, indecipherable gear chart and awkward insert system with conventional bolts could probably be better thought out.

I guess one benefit of plastic gears is no oil needed. Maybe timing belts could replace some of the gearing. Or the gears run for threading only without oil somehow. Simple things like an internal light and custom made gearing wall chart would make sense -- and probably everyone else is smart enough to already have that. What about a quickly removable gear frame, so you could lay most of the train out on top of the workbench while changing gears around?

I could use the Craftsman gears on the new lathe, and with these changes make the operation more tolerable.

Also, feeds could be handled the same way many of us add feeds to a mill -- a DC motor and speed controller -- detach changing feeds from the need for gear changes in threading. That could be done through two leadscrews, or one with a simple dog clutch and engagement lever for the motor (as done on mill tables to allow manual use).

Okay so if I did something like an adjustable  DC motor drive for feeds, and a removavble "frame of gears" for threading. The frame could be stored out of the lathe normally, and just popped in when threading was needed. Easy to work on, easy to keep clean, and set already to the last thread cut -- no need to revert to a feed ratio. That doesn't sound too bad....
Title: Re: Electronic Leadscrew?
Post by: philf on March 29, 2015, 10:19:17 AM

STEPPER:

Phil I wonder how big a threading stepper and reduction on the spindle I'd need to cut, as a practical maximum let's say an 8 tpi Acme thread on say 1" dia mild steel rod.

Would a 270 oz-in stepper motor handle it with say a 4 to 1 reduction? (The spindle is roller bearing supported, and the leadscrew would be separately driven, so, not a load in this case.)


Steve,

As has already been pointed out 270 oz-in will be the holding torque and as soon as you try to bring speed into the equation the torque will fall off. The reduction between stepper and spindle will increase the torque proportionately but at the expense of max speed. Speed doesn't seem to be an issue for screwcutting as many users advocate hand cranking the spindle which probaly means you'd be 60 rpm maximum. If I were doing this I'd try a more powerful stepper (my CNC mill uses Nema 23 3.1 N-m (440 oz-in) motors which are cheap enough) and a higher reduction.

What's the biggest diameter and coarsest pitch you're likely to need? A 3" diameter 8 tpi  thread will obviously require much more torque than a 1/2" 32 tpi.

Something else to think about is what will happen if the spindle stepper stalls - The control probably wouldn't know and the tool would try to plough a groove along the workpiece.

There's a lot of discussion on various forums about using stepper powered spindles but not many seem to have got beyond the talking stage. There are kits available for the tiny Sherline lathes.

Phil.
Title: Re: Electronic Leadscrew?
Post by: Fergus OMore on March 29, 2015, 10:58:44 AM
Steve,
             By now you will have copies of what Martin Cleeve did to the part Myford ML7 that he purchased.

Obviously, it is all 60  year old stuff but it sort of collates a lot of original thinking.

Me, I was mulling over all this excellent information and began to realise that I had a spare Myford rack( actually 2) and wonder why no one has gone along propelling machine tool movement( model wise) with hydraulics. I was having a bit of a down with the death/funeral of an old marine engineer mate/engineering college mate/boat builder mate and lots more. I sort of think that he would have had similar thoughts .
Hope my downloads are of interest

Norman
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 29, 2015, 11:07:28 AM
Phil,  :beer:

I do have some 400+ oz in steppers already, though intended for another project.  I guess I could use one for this.

re. capacity I definitely wouldn't expect to do 3" x 8 tpi on this little lathe (mini-lathe 7x12 class). More like a max threading capacity of say1" x 8 tpi acme in mild steel.

If it seems marginal even w/a 400 oz in stepper @ 4 to 1 as a threading spindle motor, then it probably isn't what I want -- something physically large with commensurate power supplies, and support space taken.

The spindle stopping issue is something to think about.
Title: Re: Electronic Leadscrew?
Post by: awemawson on March 29, 2015, 11:09:30 AM
Well my first NC mill was all hydraulics with Moog proportional valves, but amusingly the way that they did 'rigid tapping' was to have a feedback 'quill' follow a master thread attached to the main spindle. Any error following the thread pitch resulted in follower deflection and adding a correction factor to the hydraulic equivalent of a 'summing junction'
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 29, 2015, 11:33:05 AM
Norman, thanks, much to absorb........ :coffee:
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 29, 2015, 11:34:55 AM
Simon, thanks. But I don't quite understand..., sorry!  :scratch:
Title: Re: Electronic Leadscrew?
Post by: Fergus OMore on March 29, 2015, 12:39:17 PM
Simon, thanks. But I don't quite understand..., sorry!  :scratch:

I do. This was what my Pools Major had. There was a peg in the gear- which moved the saddle etc-mine from the back. This malarkey would cut tapers. :doh:

N
Title: Re: Electronic Leadscrew?
Post by: S. Heslop on March 29, 2015, 02:16:49 PM
Image from lathes.co.uk http://www.lathes.co.uk/boxford/page2.html

(http://iforce.co.nz/i/tclk41lo.sce.gif)

The leadscrew itself has the spline in it, instead of it being a leadscrew and a separate splined shaft for the autofeed.

Can't quite see how it's all connected in this image though. But the worm reduction would probably help bring threading leadscrew speeds down to something slower for autofeed, and at least save the need of switching gears back and forth except for when you need to cut threads.

There's alot of popular videos on the topic of worm hobbing using taps, and it looks like it works fairly well (even though I've only seen one video where the guy bothered to include a scene of the thing actually meshing with a worm).
Title: Re: Electronic Leadscrew?
Post by: Fergus OMore on March 29, 2015, 02:31:25 PM
Again, might I suggest that you look at the Pools Major? OK, the first lot of pictures are pretty basic- perhaps a dog clutch but follow on until you look at the tailstock stock end and see what appears to be something different. Then you see a non- threaded leadscrew.

I'l let you enjoy the rest but with a bit of fiddling with the feed screw dials, you get some interesting developments- which I haven't seen later.

Enjoy- it's different

Norman
Title: Re: Electronic Leadscrew?
Post by: Manxmodder on March 29, 2015, 03:17:59 PM
Simon, the free hobbing process works best with a spiral flute tap,certainly when small diameter taps are being used.....OZ.
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 29, 2015, 03:53:17 PM
Simon, thanks, so you were just mentioning a way to separate functions of autofeed and threading without using two leadscrews. That's the part I didn't quite get. What the purpose was. (btw, the Craftsman also has a single, grooved leadscrew.)

Well, looking at that drawing, it may be interesting as a historical mechanism, but two leadscrews and/or making a single grooved leadscrew plus a lot of complexity in the apron isn't something I'll be doing on my own lathe. There won't be any gears in the apron, and no rack and pinion either. The only thing in the apron will be a half nut, and if I go with chase threading, a clamp for the pushrod, as outlined earlier.

To me, complex apron gearing makes sense for large lathes with very heavy carriages and long traverses, but for something like a 9x12 lathe it doesn't serve a purpose. On the Gingery, I release the half nut and slide the carriage toward the headstock instantly to position it. It's a lot faster than cranking the carriage handwheel on the craftsman.

For hand feed on the Gingery, you close the half nut and use the crank at the tailstock end of the leadscrew. It's a lot finer control than the rack and pinion on the Craftsman apron.

For autofeed on the Gingery you slip a round belt onto the leadscrew pulley at the headstock end, and the leadscrew turns. Very simple and straightforward. The Craftsman is cumbersome on all counts by comparison.
Title: Re: Electronic Leadscrew?
Post by: Will_D on March 29, 2015, 05:40:27 PM
May I suggest that first we set down some requirements:

1. Cut threads accurately and quickly

2. Use fine feeds both longitudeanly (and cross slide (if supported)) to quickly machine some parts.


Req 1:

Requirement 1 can be satisfied by simple (conventional) gear trains and the leadscrew and the TDI as implemented on most lathes
or
A pseudo cnc system as mentioned in this thread that picks off headstock rotation and converts this into a digital input to software that then ouputs control signals to leadscrew stepper motor drive.

Consider this:

Thread cutting is a slow process. To set up the gear train on a conventional lathe may take 5 minutes or less. To cut the thread can take 30 minutes. That's for imperial threads on an imperial lathe (Longer for Imp on Metric)

So on balance I would favour the traditional aproach!


Req 2:

Requirement 2 can be satisfied by simple gear trains and the leadscrew or by applying a separate digital/cnc feed to the lead screw.

On my ML7 I have just one FF available using the gears and lead screw.

Using a simple digital lead-screw drive would give infinite feed rates. Just think of a controllable rechargeable drill applied to the leadscrew hand wheel on a ML7

BTW: Guess what I am working on!
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 29, 2015, 06:32:12 PM
Will I truly appreciate your organizational bent, but the requirements were set out early on:

1.) Get away from conventional change gears  :lol:

And by golly Will, if you can cruise to a thread gear setup from a feed on my Craftsman 12 x 36 in 5 minutes time my hat is definitely off to you!

I'm no better than Martin Cleeve with my own lathe, who says changing, and then threading a half inch long part, and then changing back killed an evening of his, and why he designed his gearbox.

Maybe different lathes vary this way. Certainly people do!  :beer:
Title: Re: Electronic Leadscrew?
Post by: Manxmodder on March 29, 2015, 07:09:02 PM
Steve, the quest for a reliable electronic screw drive is,I think, very much worth the headache of figuring out a workable scheme. Maybe you'll go that route right now,or perhaps the idea needs time to evolve a bit more and you can upgrade to a full e system later.

  Earlier on I think you touched on the possibility of toothed belt and pulley drives. These are worthy of further consideration as they are relatively cheap to purchase,light to handle,clean due to no grease  and fairly straight forward to make your own pulleys from casting and milling.

I certainly like the idea of belts from the practicality viewpoint.

Agree also that not all lathe brands are as easy to change back gears on,and can understand why it makes some reluctant to get involved in the process when it takes up so much time.....OZ.
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 29, 2015, 09:39:36 PM
Is it at all possible to skip software entirely with a stepper motor?

Put an encoder disk on the spindle that directly generates the signals needed by the stepper motor driver -- step and direction?

By varying the disks, couldn't you select different "gear ratios"?

Wouldn't that also deal with the problem of a stalled spindle?

A straight stepper would have 200 steps per revolution -- a belted reduction, a multiple of that. Would it be fine enough to do it?
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 29, 2015, 10:28:34 PM
Okay so thinking about this hypothetically:

1.) Say you have a 200 line encoder on the spindle and a 200 step stepper on the lead screw.

2.) The encoder connects (through whatever buffer necessary) to  the STEP pin of the stepper driver.

3.) For the experiment, you connect the Direction pin to a Direction switch., and bring low or high as required

4.) The leadscrew is a 10 tpi pitch.

You rotate the spindle one revolution by hand.
This should rotate the stepper by one revolution.
And the carriage would move 1/10 inch.
If you were cutting a screw you'd get a 10 TPI screw thread.

Now you change out the disk in  the encoder for a 100 line disk.
One revolution of the spindle turns the stepper one half revolution.
The carriage moves 1/20 inch
If you were cutting a screw you'd get a 5 tpi screw thread

And a 400 line encoder would generate a 20 tpi screw.
etc.

But what about threads not integer divisible into 200 steps/rev for the stepper?

If the stepper was reduced 6 to 1, you could get quite a few more factors. Also the fineness of even an aproximation would increase. One step would equal 1/12,000 inch of carriage movement. For a prime pitch -- take 13 tpi, for instance, you'd need a 923 line encoder, and the thread would be accurate to about .00008" in 1"

Another possibility -- increase the encoder speed.

How about putting the encoder on the spindle motor (if DC variable drive type) and you used a timing belt from the spindle motor to the spindle, they would be in sync. The spindle motor might run 6 times the spindle speed. So the encoder would run at that speed. For our 13 TPI example we then need a 154 line encoder instead of 923. Accuracy is a little lower (154 x 6 = 924), but still good enough.

Or you could use the same belt, and spindle pulley, but add another stub spindle for an encoder pulley set to whatever ratio was convenient. You could mix and match encoder pulleys and encoder disks where necessary. This should still be a lot easier (and cleaner) than change gear trains, since it involves only one pulley and no oil.

Encoder disks could also contain multiple line grates, similar to a dividing plate, so several ratios could be on just one encoder disk. You move the sensor out to to the appropriate band to select the ratio.
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 29, 2015, 11:05:13 PM
It's possible that encoder disks could be printed out on a printer, if the number of lines was reasonably low, and the disk reasonably large.

An optimum set of pulley ratios for the motor, spindle and ledscrew, with the encoder on the motor might work out very well for homemade encoder disks.
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 29, 2015, 11:43:05 PM
Making encoders and quadrature theory:

http://www.societyofrobots.com/sensors_encoder.shtml
http://www.dgkelectronics.com/inkscape-extension-for-creating-optical-rotary-encoder-discs/
https://github.com/Hyvok/Inkscape-rotary-encoder-disk-generator
http://tutorial.cytron.com.my/2012/01/17/quadrature-encoder/
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 29, 2015, 11:53:17 PM
Going to bed. Seems like this leadscrew drive would all be easy to test out with equipment i already have -- maybe even on the Gingery as a temporary kludge, except for the sensor for the encoder.... there might even be one of those at the local Radio Shack....
Title: Re: Electronic Leadscrew?
Post by: awemawson on March 30, 2015, 04:26:02 AM
Steve, gearing up the encoder is definitely workable. On my Traub the main spindle encoder is 1024 slots, but the same encoder is used for 'C axis positioning'  geared up to 90,000 points on the circle !

Fairly obviously you need to avoid any backlash, but the Traub just uses a toothed belt under tension and seems to work !
Title: Re: Electronic Leadscrew?
Post by: RussellT on March 30, 2015, 05:43:58 AM
Steve

I think that's a brilliant idea.  :clap:  I wish I'd thought of it.

I've been thinking about it.  Direct drive to the leadscrew at 10tpi would give steps of 0.0005" which I think should be fine for most purposes.  If you need more torque I might think of using the epicyclic gears from an old cordless drill as that would give a compact drive.

A 12tpi leadscrew would give you better solutions for threads like 6,12,24 tpi as well as slightly smaller steps.

As far as your encoder goes the diameter limits the number of steps.  For convenience you will presumably be using an ordinary sized printer which would give a maximum diameter of about 8 inches and a circumference of about 25 inches.  I'd guess that using plain paper and a reflective sensor you could easily use marks about 1/16 apart giving 8 per inch, or 200 per revolution.

I've taken printers apart and they have finer resolutions than this but using a clear disc with a transmitted light sensor.  From the point of view of changing discs it makes sense to have all the hardware on 1 side.

At 200 pulses per spindle revolution the coarsest thread you could cut would be the same as your leadscrew pitch.  That's very close to working without gearing on either spindle or leadscrew.  If you could make your encoder read finer markings then you're almost there.

You could also have multiple sensors across the radius of your disc so you could use switches to select from a number of different threads and fine feeds on a single disc.  Old CDs seem an obvious candidate for discs - diameter is reduced but you could use the centre from a CD case to make changing quick.  You need to get the printed markings down to about 0.01" wide to get a thread of 6tpi from a 12 tpi leadscrew.

I also like the potential for having an electronic disengage when thread cutting.

The difficulty is as always picking up the thread. 

I don't think a single point clutch on the spindle would work because if you wobbled the encoder disc engaging the clutch you could generate a lot of pulses of unknown direction and lose position, and you couldn't disengage the half nuts for a quick return.  If you used a switch to disengage the feed you would lose position too.  I think the simplest way might be to mark a starting position on the encoder disc (if you used gearing to drive it you'd need to mark the spindle too) and return the carriage to a fixed starting point.  Starting with the lathe stationery also takes care of accelerating the leadscrew as pulses are accelerated naturally as the lathe spindle accelerates and reduces the possibility of missing steps.

Russell
Title: Re: Electronic Leadscrew?
Post by: lordedmond on March 30, 2015, 06:55:42 AM
If you go down the CD route they use to make printers that printed directly on to CD that had a coating on them , don't know if they are stil made though.

Some had a laser in them and burn the info into the disc others used the ink .

Note I do not mean the ones that you print onto a sticky backed paper and put that on the disc that would not be true enough

Stuart
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 30, 2015, 08:10:14 AM
Russell I'm going with 10 tpi leadscrew because I still think of this as a manual lathe, and there will be a leadscrew crank with a thousandths dial at the tailstock end, Just like the Gingery. On a 12" leadscrew, 1/2" x 10" acme allthread is available and just right. I'll use the same on the cross slide, etc. I don't care about handedness so it will all be RH thread. Cheap and easy.

I'm thinking a 3x reduction on the spindle motor, which is a treadmill type rated at 6000 RPM. I'll probably put the encoder on the motor. That will give a theoretical max spindle speed above 1000 RPM probably. I'll probably go with a 3 to 1 reducton on the leadscrew.

This combo should give enough resolution for threads down to 4 tpi, and yet keep the encoder disk printing relatively coarse. That could be adjusted either way on both ratios to hit whatever works out to a happy medium. I think there will be a sweet spot balancing thse for this specific lathe/moto/leadscrew -- but might take some experimentation.

BTW the motor comes with a good sized flat faced flywheel, which could serve as an encoder mount. I wasn't going to leave it on, but maybe it would also smooth out cutting as well as hold the encoder, so it's a possibility.

I could use help on choosing a suitable reflective pickup (ideally working with paper and ink, one face) and how to buffer or condition the signal (if necessary) to the step pin of a typical stepper driver.
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 30, 2015, 11:14:48 PM
I spent a lot of time today with a spreadsheet I made up to try what-if scenarios for different ratios on the leadscrew/stepper and the encoder/spindle. I used a thread range of 4 to 40 tpi.

My conclusion is, with that large a range your encoder disk needs either too many lines at the low pitches to make easily, or too few lines at the higher pitches for thread accuracy.

You could manage it by changing the reduction ratios for the leadscrew/stepper and spindle/encoder into 3 ranges with three sets of encoder disks, but this starts getting cumbersome.  It's a little better than change gears but not enough, in my opinion to justfy it on my own lathe.

I was only working with simple straight encoding, not quadrature, and that is pretty limited in range for a computer disk printable on a computer printer. That's likely the problem.

The alternative I came up with which would definitely work, and is more electronically conventional, is just use  a single encoder of reasonable resolution, and instead of swapping disks for different pitches, use a divider circuit to generate the pulses to the stepper driver.

Some dip switches to set the pitch would work -- all the thread pitches between 4 and 64 could be set in 5 bits (5 switches) for input Make it 6 switches to include direction. And no screen necessary, since the switches are indicators themselves.

This is approaching what a computer does, but you don't really need a computer, a screen, or keyboard.

 If you do use a single board computer for that, not much of one. It doesn't need a graphical OS, keyboard or even a LED dsplay driver. Basically it just needs to poll the switch state and do the dividing and output the stepper pulse. So I need 6 input lines and two output. Actually, the direction output could just be a switch -- no need to process. So okay, 5 input lines.

Because the pulse triggering is the encoder on the spindle, there is still the protection in case of spindle stall.

You could either make up the divider by discrete IC's or use something like a pic or arduino board.

The one question I have is the ability to do the input, dividing, and output fast enough. The throughput required for say 100 rpm spindle speed and a 1000 pulse per revolution encoder would be about 1.7 khz. Seems like integer math could be used for this to keep it fast.

I might try this -- I don't have the know-how to do it in discrete components, but maybe I could learn enough about Arduino programming to do it with the Uno board I've got.

Basically I'd need a dip switch and an encoder.

From my spreadsheet it looks like a 1000 line encoder run at twice spindle speed, in conjunction with a stepper with 4 to 1 reduction to the leadscrew would give reasonable threading accuracy for the full range of pitches I mentioned.

Title: Re: Electronic Leadscrew?
Post by: sparky961 on March 31, 2015, 12:21:00 AM
The one question I have is the ability to do the input, dividing, and output fast enough. The throughput required for say 100 rpm spindle speed and a 1000 pulse per revolution encoder would be about 1.7 khz. Seems like integer math could be used for this to keep it fast.

I'm running software quadrature decoding of a 4000 count servo encoder using a state machine on a "Teensy 3.0" board ( http://www.pjrc.com/teensy/teensy31.html#specs (http://www.pjrc.com/teensy/teensy31.html#specs) ).  It uses 2 pins as interrupts to trigger state changes and it's astoundingly fast for what it is.  I've implemented error checking for bad state transitions, so I'm fairly sure I'd know if I were missing pulses.

I added a quick conversion to show RPM in my code and it looks like I'm doing 1750 RPM and still maintaining an accurate count.  This is all in development and yet to be verified, so take everything here with a grain of salt.

Short answer: I think you're alright
Title: Re: Electronic Leadscrew?
Post by: awemawson on March 31, 2015, 02:26:31 AM
High count Chinese quadrature encoders are amazingly cheap on eBay
Title: Re: Electronic Leadscrew?
Post by: PekkaNF on March 31, 2015, 03:26:08 AM
You probably know this one allready:
http://www.ni.com/tutorial/7109/en/

Short discussion about creeping count...
http://www.dynapar.com/Technology/Encoder_Basics/Quadrature_Encoders/

What is important here is to note that two channel encoder (quadrature encoder) used as two channel (bidirectional information) and coupled right to counter (hardware or software) produces reliable counting. Too simple signaling could produce few (or sometimes many) erroneous counts when signals are not kept stable, even if they would work in ideal world.

To get big enough disc to lathe spindle and guarding it well (if optical encoder is used) is bit of a problem.

As mentioned before cheapest high count solution would be to use timing belt to "upgear" the encoder, it is used a whole lot in industry. Only few things to check is that encoder axial bearing loading is not exceeded, rpm is not exceeded and pulse count is not exceeded. You even could use "index" pulse for rpm-display.

Pekka
Title: Re: Electronic Leadscrew?
Post by: RussellT on March 31, 2015, 04:42:32 AM
The sensors are not expensive so you could have more than one along the radius of your encoder, and you could also have an encoder disc on motor or on flywheel which would give you a much greater range of input pulses.

I imagine something like a row of sensors from spindle to motor and a disc that would slip onto the end of the shaft of either facing the row of sensors.  Depending on dimensions the same sensors could be used for either disc position.

Going for electronic division would make it difficult to cut special threads, you never know the metric system might make it to the USA soon.

However you could take care of that if you went for microprocessor/Arduino division.  I would say that you have to stick to integer maths for accuracy.  If you use the Arduino you need to use an interrupt for the input pulses.

I wouldn't want to use dip switches like that.  I think they're fiddly and difficult to see.  I'd go for a row of toggle switch - or if you have visitors to impress some huge steam punk style knife switches.

Russell

Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 31, 2015, 09:45:46 AM
Sparky that teensy board is really neat!!

Andrew total agreement, that's what I'd use.

Pekka, commercial encoder per Andrew.

Russell special threads no problem, just depends how you implement the switch processing.

A lookup table for division count  per thread switch setting could give any results you care to set up in the table. 6 bits of input  would give 64 threads.

It also relieves the processor from doing division. it can be very fast as an algorithm.

Agorithm:

1.) Poll switch setting byte value,
2.) use that as an index to do a lookup in a table, and store the table value found
3.) Increment a count on receiving encoder pulse (interrupt or polling, whatever suits the board)
4.) Compare the count to the stored value
5.) if the count is equal to the stored value, send step pulse, reset count, loop
6.) else loop

Accuracy:

Example:

With a 3 to 1 stepper to leadscrew ratio, and a 10 tpi leadscrew and a 200 step motor, the movement fineness is 6000 steps per inch of carriage movement. That should be plenty.

With a oommon Ebay 600 line encoder at 5 to 1 spindle ratio the fineness of control is 3000 divisions per revolution. The worst rounding error would be in the higher pitches that weren't factors. Let's say 39 tpi was desired for some reason (40 is a factor). The error would be about 0.1% of pitch.  Some odball fractional pitch around this fineness of thread could be as bad as 0.7% off. That's theoretical worst case. And coarser threads are better. Oddball fractional pitches around 20 tpi would have a max error of half that. And many common thread pitches are factors.

You could use a finer encoder if this error level was a bother, or you could step up the encoder ratio further -- I don't think it will matter to me on my lathe with its overall tolerances in general. However increasing the pulses per spindle rev increases the noise and calculation speed requirements. I'm not sure that it's worth going further on my lathe.

Another possibility for dealing with rounding errors would be to round down, but accumulate errors in the algorithm, add them, and increment the encoder pulse count when they exceed 1.

I did think about toggle switches for input, and maybe I'd do that later after first going with a dip switch to get things moving. Plus I like the idea I could hide a dip switch more easily.

Ideally a rotary switch with a big metal knob would be a great "old school" solution to fit a traditional looking lathe, I think. You'd have to make one with a PC board and wipers, but it could be done as a later project in itself!

Thank you all for your replies! :beer: :beer: :beer: :beer: :beer:
Title: Re: Electronic Leadscrew?
Post by: DMIOM on March 31, 2015, 10:21:15 AM
Steve,

Even if you don't buy any of their products, I'd recommend having a look at the US Digital (http://www.usdigital.com/) website - they're one of the leading manufacturers, and I've used their products for quite a few applications over the year.

I can't see it on their website at present, but they even used to make a tiny device called an "eDivide" which had a bank of DIP-switches to set the ratio. I've used those for prototyping and then produced small-runs using PIC controllers.

You mentioned using the likes of an Arduino - I'm not sure if one would keep up reliably, but a PIC programmed in C should certainly cope. I've made a couple of slip-detectors using encoders & PICs - one had sensors either side of a clutch on a shaft running at just over 5,000 rpm; the other was similar but across a whole transmission, so as well as the two encoders, there were also a number of pins used to signal the gear in use to the PIC, so the dividing ratio could be set appropriately. One of the tricks was to use the hardware counters built into the micro, minimising the arithmetic overhead.

Dave

Edit: here's a very simple diagram (http://www.usdigital.com/assets/images/fulls/encoderconn2.gif), using their own stepper driver (http://www.usdigital.com/products/motor-drivers/MD2S) - just add the variable divider betwixt the encoder & driver....
Title: Re: Electronic Leadscrew?
Post by: RussellT on March 31, 2015, 10:43:59 AM
It sounds as though you're going to end up doing the programming you were trying to avoid.

I suggest amending your outline as follows.

5.) if the count is equal or greater than the stored value, send step pulse, deduct stored value from count
6.)loop

You might be able to improve accuracy by multiplying the count by 10 or 100 - that way you could get a couple more significant digits on your stored value and by using the subtraction method I've just suggested the extra pulses would be added in whenever they were needed.  That still allows you to use integer maths which avoids the extra processor load and any possible inaccuracy from rounding errors.  It wouldn't be as good as increasing the input count.

Russell

Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 31, 2015, 12:30:37 PM
Thanks Dave, that's a very useful site!  :beer: And that diagram with divider you mention is what I was thinking of. I do have a different stepper driver, but similar.

re. PIC: I don't know C.  :(  Too bad there isn't a board for FORTH, I know that!  :lol:

Russell, yes to getting away from programming, but seems necessary -- the error from the disc encoder bands method seems too great. I don't think the programming is too big an issue. As long as I avoid feature creep!

Yes, sounds like a good suggestion re. reducing error. :beer:

Here's my spreadsheet for others to play around with. You can see the effects of changing reduction ratios, leadscrew TPI, encoder gratings, etc. and it will give error rates, disk band size, thread TPI etc.

edit:

I've removed the spreadsheet attachment here because it needed revision -- the latest version (v1.2) is on page 4 of this thread.....
Title: Re: Electronic Leadscrew?
Post by: Bigbadbugga on March 31, 2015, 08:40:32 PM
I've been researching the electronic leadscrew options for my boxford, I've found one I'd like to replicate but can't seem to get any of the details from the git hub site. It's open source, can anyone on here get the pcb schematics for the board?

http://muck-solutions.com/?page_id=186

Google translate is your friend.

Title: Re: Electronic Leadscrew?
Post by: sparky961 on March 31, 2015, 08:48:51 PM
I've been researching the electronic leadscrew options for my boxford, I've found one I'd like to replicate but can't seem to get any of the details from the git hub site. It's open source, can anyone on here get the pcb schematics for the board?

http://muck-solutions.com/?page_id=186

Google translate is your friend.

Did you try downloading the project ZIP file?  Bottom right corner of the page you referenced, there's a button.  It's a bit hard to see but it's there.

I didn't download it, so if it's just the files you're having a problem with I can't help with that.

The more I read this thread, the more I get interested in doing this to my machine instead of full CNC.  I've had 3 axes under computer control (it's a combo mill/lathe) but found it to be very limiting when you just want to whip off a part.  Not to mention the lack of ballscrews and lots of backlash adds another dimension to the hurdles.

Going semi-automatic seems like a nice compromise, as I too hate changing gears and my machine isn't set up well for threading in the first place.
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 31, 2015, 08:49:15 PM
https://github.com/themuck/ZyklenAutomatik/archive/master.zip
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 31, 2015, 08:53:10 PM
Sparky seems like since you are familiar with the Teensy and programming it, you could try it out pretty easily.

I have to learn arduino coding to do it (if an arduino is fast enough re. Dave's comment). Probably trying out some of the programming tutorials tonight.
Title: Re: Electronic Leadscrew?
Post by: Bigbadbugga on March 31, 2015, 08:57:06 PM
I've already downloaded the zip.

The problem is, there are loads of files containing all the code for the arduino and the display, but there are no schematics for the pcb as far as I can see. There are a few files I can't seem to open though, they seem to be database files and I just can't find a program to open them on my Mac, it just displays a text box foll of gibberish.

:(
Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 31, 2015, 10:48:14 PM
I can open all of the files. Which files can't you open, BB, and I'll tell you what they are, and how to open them. (The ODG file is an Open Office/Libre Office spreadsheet). Most others are code files, and stock images of the display and ATMega board.

The connections are between existing Arduino board, some switches, encoders, and stepper driver, so it's just given as a pin list referencing the Arduino's numbered pins. There is no schematic or circuit board info. You'd have to hard wire it. Maybe write to him -- he seems to speak English on the video.

Here is the Pin List:

Code: [Select]
Pins - Funktion RJ45 (Encoder A,A' / B, B' / Z,Z')
8- GND BR
7- 5V BR/W
6- B+ GR
5- Z- BL/w
4- Z+ BL
3- B- GR/W
2- A- OR
1- A+ OR/W
---------------
Pins - Funktion RJ45 (Encoder A/B/Z und Eingänge (Endschalter) )
8- GND
7- 5V
6- B+
5- Arduino 41
4- Z+
3- Arduino 39
2- Arduino 38
1- A+
--------------
Pins - Funktion RJ45 (Endstufe)
8- GND
7- Arduino 11 (Status Eingang)
6- 5V
5- Arduino 8 Dir Pin
4- 5V
3- Arduino 9 Step Pin
2- GND
1- Arduino 10 Enable

----------------
S1- Arduino 42
S2- Arduino 43
S3- Arduino 44
S4- Arduino 45
S5- Arduino 46
S6- Arduino 47
S7- Arduino 48
S8- Arduino 49
S9- Arduino 50
S10- Adruino 51
S11- Arduino 40 (Encoder Taster)
S12 - Reset

Encoder A- Arduino 19 Int4
Encoder B- Arduino 20 Int3

Externer Encoder A- Arduino 2 Int0
Externer Encoder B- Arduino 3 Int1

Endschalter - 38
Endschalter - 39
Endschalter - 41

LED Status 1- Arduino 53
LED Status 2- Arduino 52
LED Status 3- Arduino 30
LED Status 4- Arduino 31
Summer- Arduino 32

Edit:

On his website there is this in the Downloads section:

Quote
ZyklenAutomatik b2.02 comming soon

In his video he shows an older version (probably the pin list above) and a newer version of his board. The newer version is probably what he's working on.

Title: Re: Electronic Leadscrew?
Post by: vtsteam on March 31, 2015, 11:27:34 PM
That project is for automatic thread cutting, I believe, and so it's kind of a subset of a CNC program, requiring a couple axes, and acceleration deceleration, a display and lots of button functions.

What I'm thinking of doing is MUCH simpler (or more primitive, depending on your point of view) --- simply replacing the change gears. 

Cutting threads exactly as you would on a manual lathe, otherwise. No second axis, no acelertion deceleration factors, etc. You engage the half nut with the spindle and leadscrew already turning, just as you would with change gears. You feed the slide in as multiple passes, in the manual way.

Title: Re: Electronic Leadscrew?
Post by: PekkaNF on April 01, 2015, 02:44:31 AM
I like the direction you are heading. Keep it clean and simple.

Very long time ago I used EPROM as a look uptable - without using a uP. Really simple. Incremental encoder to address lines (all extras pulled), data lines were output. Eprom was mostly wasted but small partion of was this lookup table. You need reset and clock, but they could be generated from index and quadrature count pulses?

Few posts back:
.....Ideally a rotary switch with a big metal knob would be a great "old school" solution to fit a traditional looking lathe, I think. You'd have to make one with a PC board and wipers, but it could be done as a later project in itself!

Thank you all for your replies! :beer: :beer: :beer: :beer: :beer:

Are you thinking of binary code rotary switch? Make the disc/code GRAY-code. You probably know this, but unsuspected person could find very unstable readings with ordinary binary code. Reason being that two (nearly) simultaneous bit changes are often required to happen. In real world on transition you get whatever code.

http://en.wikipedia.org/wiki/Gray_code

In this application software filtering is possible to see that the input is stable.

CNC Hand Wheel MPG uses similar type encoder than you are planning to use on spindle. It is handy feeding in all sort of numbers. I had camera that had that sort of handwheel, only circumfere sticking out and number or menu item was scrolled by rotating that hand wheel on thumb and then the hand wheel was pressed to lock/choose value. This will ofcourse require rather coarse resolution and definate detent, but for most of the people this is desirable on menu selection. On feed you want fine resolution.

Bit of OT sometimes goes far. :lol:

Pekka
Title: Re: Electronic Leadscrew?
Post by: RussellT on April 01, 2015, 05:12:20 AM
I'm not familiar with commercial rotary encoders so I've had a quick look on ebay.  It seems that for not much more you can get 2000 pulses/rev.  Presumably whichever encoder you choose for your purpose you could double the number of pulses by using two inputs and counting both sets of pulses - or possibly all three, A B and Z.  I'm not sure whether they've already done that to claim 2000p/r.

Here's an example http://www.ia.omron.com/product/item/e6b27090f/index.html (http://www.ia.omron.com/product/item/e6b27090f/index.html)

Looking at the output diagram you might be able to count 5000 p/r which ought to improve accuracy.  I've tried playing with your spreadsheet but adding to the encoder disc sectors doesn't affect the accuracy.  I must be missing something there  I think doubling the pulse output ought to halve the error.

You can program PICs in basic.  I use mikrobasic which has a free version.

Russell
Title: Re: Electronic Leadscrew?
Post by: PekkaNF on April 01, 2015, 05:43:39 AM
I'm not familiar with commercial rotary encoders so I've had a quick look on ebay.  It seems that for not much more you can get 2000 pulses/rev.  Presumably whichever encoder you choose for your purpose you could double the number of pulses by using two inputs and counting both sets of pulses - or possibly all three, A B and Z.  I'm not sure whether they've already done that to claim 2000p/r.....

Russell

I used work some time with rotary encoders (incremental and absolute) and my experience is that at some point in the system more P/R does not produce any gain. Specially when you start counting leadin/trailin edeges as a pulses you are stepping on thin ice. A little interface mismatch, threshold, not that crisp edges, not to mention little mechanical vibration when pulse is setting between 0/1 states and sometimes the count drifts even when nothing moves. Same goes to single channel encoders. They can't detect directional change. Some might think that in this case it does not matter. But it does. Even when you think that you rotate spindle on one direction only, but funny stuff happens when you start/stop at pulse transition.

I tried to shed some light on this issue few posts back.

Pekka
Title: Re: Electronic Leadscrew?
Post by: Bigbadbugga on April 01, 2015, 05:45:30 AM
I can open all of the files. Which files can't you open, BB, and I'll tell you what they are, and how to open them. (The ODG file is an Open Office/Libre Office spreadsheet). Most others are code files, and stock images of the display and ATMega board.

The connections are between existing Arduino board, some switches, encoders, and stepper driver, so it's just given as a pin list referencing the Arduino's numbered pins. There is no schematic or circuit board info. You'd have to hard wire it. Maybe write to him -- he seems to speak English on the video.

Here is the Pin List:

Code: [Select]
Pins - Funktion RJ45 (Encoder A,A' / B, B' / Z,Z')
8- GND BR
7- 5V BR/W
6- B+ GR
5- Z- BL/w
4- Z+ BL
3- B- GR/W
2- A- OR
1- A+ OR/W
---------------
Pins - Funktion RJ45 (Encoder A/B/Z und Eingänge (Endschalter) )
8- GND
7- 5V
6- B+
5- Arduino 41
4- Z+
3- Arduino 39
2- Arduino 38
1- A+
--------------
Pins - Funktion RJ45 (Endstufe)
8- GND
7- Arduino 11 (Status Eingang)
6- 5V
5- Arduino 8 Dir Pin
4- 5V
3- Arduino 9 Step Pin
2- GND
1- Arduino 10 Enable

----------------
S1- Arduino 42
S2- Arduino 43
S3- Arduino 44
S4- Arduino 45
S5- Arduino 46
S6- Arduino 47
S7- Arduino 48
S8- Arduino 49
S9- Arduino 50
S10- Adruino 51
S11- Arduino 40 (Encoder Taster)
S12 - Reset

Encoder A- Arduino 19 Int4
Encoder B- Arduino 20 Int3

Externer Encoder A- Arduino 2 Int0
Externer Encoder B- Arduino 3 Int1

Endschalter - 38
Endschalter - 39
Endschalter - 41

LED Status 1- Arduino 53
LED Status 2- Arduino 52
LED Status 3- Arduino 30
LED Status 4- Arduino 31
Summer- Arduino 32

Edit:

On his website there is this in the Downloads section:

Quote
ZyklenAutomatik b2.02 comming soon

In his video he shows an older version (probably the pin list above) and a newer version of his board. The newer version is probably what he's working on.

Thanks Vsteam, it was the odg files I couldn't see. The pinout is very helpful, thanks. I should be able to design a board from that. It's been a while since I dabbled, but I'll have fun having a go.
Title: Re: Electronic Leadscrew?
Post by: RussellT on April 01, 2015, 06:07:22 AM
Hi Pekka

I wasn't thinking of counting leading and trailing edges but just using both trains of pulses - the fact that they are slightly out of phase won't make much difference.

I can see how spurious pulses could come as you stop, start, and change direction which means that you would struggle to use this to reset each cut on the thread.  However once it is running then the more input pulses you have the more accurate it should become - I've been trying to work out the errors and I think that with 1200 pulses per rev of the spindle it should be possible to do all the inch threads that Steve suggests with no error.

Pekka, is it feasible to use the 600 p/r encoder on two channels to get 1200 p/r?

Russell







Title: Re: Electronic Leadscrew?
Post by: PekkaNF on April 01, 2015, 06:51:04 AM
Hi Pekka

I wasn't thinking of counting leading and trailing edges but just using both trains of pulses - the fact that they are slightly out of phase won't make much difference.

I can see how spurious pulses could come as you stop, start, and change direction which means that you would struggle to use this to reset each cut on the thread.  However once it is running then the more input pulses you have the more accurate it should become - I've been trying to work out the errors and I think that with 1200 pulses per rev of the spindle it should be possible to do all the inch threads that Steve suggests with no error.

Pekka, is it feasible to use the 600 p/r encoder on two channels to get 1200 p/r?

Russell

Hi, I linked this before, hote it answers your guestion better than my limited englis would do:
http://www.dynapar.com/Technology/Encoder_Basics/Quadrature_Encoders/

Latest question, Yes and it is often done. Just have a eye on mechanical system and don't let that errors accumulate too long. "index pulse" or other reference is routinely used.

Pekka
Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 01, 2015, 08:26:33 AM
Russell, my spreadsheet will show you the errors for any inch size thread at any encoder resolution, any stepper to leadscrew ratio, any encoderr to spindle ratio and any leadscrew pitch (phew!)

And it will do it for both the encoder disk method of dividing, and the digital method of dividing.


It will also show you the data throughput rate needed (all computational time). Right now I'm at 5khz w/ a 600 line encoder running at 5 times spindle speed ( running at spindle motor speed, in other words).

Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 01, 2015, 08:50:50 AM
I was thinking about something like this:

http://www.ebay.com/itm/Encoder-600P-R-Incremental-Rotary-Encoder-AB-2-phase-6mm-Shaft-5V-24V-coupling-/321160456974
Title: Re: Electronic Leadscrew?
Post by: RussellT on April 01, 2015, 10:42:17 AM
Steve

I think I understand the spreadsheet, but if in your spreadsheet I increase the spindle pulses per revolution, then I think that should reduce the error.  For example if I was trying to take a step every 1.7 pulses and I increased the pulse count by a factor of 10 then I would need to take a step every 17 pulses - doing away with the error.  I think the  error will be much smaller than your calculations suggest.

For example for a 36tpi thread there will be 3000 pulses per spindle rev and you need 166.67 steps to advance the leadscrew 1/36".  That works out you need to advance the stepper one step every 18 pulses exactly.  No error apart from the stepping nature of the advance.

In a worse scenario (27tpi) you need to advance the stepper once for every 13.5 pulses.  As long as your software takes care of the half pulses then the maximum error at any point on the tread will be one step or 0.0001666 inches.

Russell

Edited to remove my percentage error calculation which was wrong.
Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 01, 2015, 11:15:33 AM
Oops....almost killed your last post, Russell -- I hit edit insted of reply -- luckily the cache had a copy......phew!


Checking the spreadsheet Russell -- i'll post a corrected version......
Title: Re: Electronic Leadscrew?
Post by: RussellT on April 01, 2015, 12:10:58 PM
Steve

I realised that my percentage error calculation was wrong so I removed it.  The difficulty with the error calculation is that if the software keeps track of the accumulated errors then over a long thread the error will be eliminated.  However it will correct by adding a step when the error accumulates and it should do that when it has fallen one step behind.  That means that the line of the thread will show waviness a maximum of one step from peak to trough or oscillate by a maximum of half a step either side of a mean line.

Where I am having trouble is working out over what length the maximum deviation from the mean line will occur to get a percentage error. 

To take the 27tpi example the stepper should step at 14, 27, 41, 54, 68, 81, 95, 108 etc pulses.  The error is zero over two steps but the error in the middle is only by mistiming the step by half a pulse.

I need to think about how to calculate the error some more.

Russell
Title: Re: Electronic Leadscrew?
Post by: awemawson on April 01, 2015, 12:38:27 PM
I was thinking about something like this:

http://www.ebay.com/itm/Encoder-600P-R-Incremental-Rotary-Encoder-AB-2-phase-6mm-Shaft-5V-24V-coupling-/321160456974

Amazing encoder that Steve, according to the description it has an 'output triode' - now valves, that's my vintage of electronics  :lol:
Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 01, 2015, 01:58:37 PM
I think I've got it-- please check!

If correct, one thing that looks doable in it is dropping the stepper/leadscrew reduction to 1.5 to 1, and running the 600 line encoder at 5 to 1 reduction. What this does with my particular leadscrew, is match the encoder pulses per revolution with the steps per inch. That's 3000 each.

It looks like that means that the number of pulses per encoder revolution equals the thread pitch. That means no errors percentage. And the reduction on leadscrew is easy to do (small gear ratio) and the encoder can run at spindle motor speed (also easy).

Unless I'm wrong in any (or all of the above) -- which is a distinct possibility......



Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 01, 2015, 02:16:49 PM
I was thinking about something like this:

http://www.ebay.com/itm/Encoder-600P-R-Incremental-Rotary-Encoder-AB-2-phase-6mm-Shaft-5V-24V-coupling-/321160456974

Amazing encoder that Steve, according to the description it has an 'output triode' - now valves, that's my vintage of electronics  :lol:

Andrew, which wire is the grid?  :lol:
Title: Re: Electronic Leadscrew?
Post by: awemawson on April 01, 2015, 02:55:40 PM
Joking apart - that is an amazing price for what looks to be a good encoder.
Title: Re: Electronic Leadscrew?
Post by: RussellT on April 01, 2015, 03:48:53 PM
Hi Steve

I agree with your revised spreadsheet.  The error isn't zero but the cumulative error is zero and the periodic errors are similar to the errors produced by the saw tooth profile of the stepper controlled cut.

My inclination would be to retain the 3:1 leadscrew gearing for smaller steps and more torque, and to increase the number of pulses, either with a different encoder or using the rising and falling edge method of frequency doubling as mentioned by Pekka and the ebay description you linked to.

I would do that because it would give more flexibility for cutting other threads - such as metric.

It would make the software more complicated, but if you built the hardware with more pulses then you could always upgrade the software and user interface when you needed an odd thread.

Russell
Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 01, 2015, 04:26:11 PM
Hi Steve

I agree with your revised spreadsheet.  The error isn't zero but the cumulative error is zero and the periodic errors are similar to the errors produced by the saw tooth profile of the stepper controlled cut.

For Integer inch pitch threads, there is no error in the ability to send steps on time in relation to the spindle position. which is what counts as far as the thread is concerned. There is no periodic error in those threads.

It has nothing to do with the stepper's steps per inch. Only the spindle and step timing matters.

re.  increasing encoder fineness -- I don't want to do rising and falling edges for the reason Pekka mentioned, and for practical purposes a 1.5 to 1 reduction to the leadscrew will fit the lathe better. This is a small lathe, and I think a 400 oz.In stepper will handle it.

If for any reason that doesn't work well, it would be easy to change, so I think that's the way I'll go.



Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 01, 2015, 04:35:48 PM
Joking apart - that is an amazing price for what looks to be a good encoder.

Sent for one. :beer:
Title: Re: Electronic Leadscrew?
Post by: RussellT on April 01, 2015, 04:57:49 PM
For Integer inch pitch threads, there is no error in the ability to send steps on time in relation to the spindle position. which is what counts as far as the thread is concerned. There is no periodic error in those threads.

Yes - I wasn't clear but I'd also looked at other threads.

Russell
Title: Re: Electronic Leadscrew?
Post by: DMIOM on April 04, 2015, 08:15:31 AM
I like the direction you are heading. Keep it clean and simple.

Very long time ago I used EPROM as a look uptable - without using a uP. Really simple. Incremental encoder to address lines (all extras pulled), data lines were output. Eprom was mostly wasted but small partion of was this lookup table. You need reset and clock, but they could be generated from index and quadrature count pulses?
.........

OT(ish):

This reminded me of a project where I did something similar, only using volatile storage instead of EPROM.

Many years ago, I was involved in designing what was thought to be the first =digital= scanning electron microscope (SEM) in Britain, if not in Europe.

I was asked if I could use any digital techniques to improve the control and discrimination of the display; as previously the totally analog display channel typically only had the possibility of adjusting the gain and upper/lower thresholds (albeit often with multi-turn pots).

Computers at that time were far far too slow to process the image on-the-fly, so what I came up with was a hardware solution where each scan spot, instead of going through analog shaping, was digitised, modified and then converted back to analog for display. The essential central converter was a "register file" (what we would now recognise as a small block of memory) with 256 locations and stacked to 8 bits deep. The values from the ADC (Analog to Digital Converter) were used as the addresses into the register file, and the contents of that location were used to drive the DAC (Digital to Analog Converter) thence to the display. The register file was dual-ported, so you could load any pattern into the file - initially from thumbwheels and an 8048 micro, then later from a Commodore PET. Preparation of what we called "the profile", which is now more widely described as a lookup table (LUT) on the PET meant that you could add as as many knees, stretches etc. as you wanted; and the profiles could be stored and shared - between runs, between researchers and even between sites.

Although the input from the SEM was monochrome, by fanning-out from the DAC to a stack of three register files, we added false-colour ability; modification of the colour lookup tables on the PET allowed various features to be highlighted, and we added a facility similar to the zebra-stripes in professional video camera viewfinders that if the video settings meant that detail was being lost at either end, we would highlight that area on-screen - at the bottom, crushed blacks would be highlighted in blue and over-exposed/burnt-out areas would be highlighted in red.

Dave
Title: Re: Electronic Leadscrew?
Post by: PekkaNF on April 06, 2015, 04:46:06 AM
I hope that VT will post here something, othervise we are running amok with OT :D

I remember using hardware FIFO and LIFO registers with hardware multiplier or something. The best thing with these assyncrous lookuptables and regfisters was that you could syncronize them with the "process". Eliminitating a whole lot of quanisizing error and timing problems. You could actually have PLL to lock the "clock" and inhibit "data" when the loop was not locked, that saved whole lot of housekeepping if you were logging data. Now I'm probably good just for blowing up electrolytes.

Pekka

Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 06, 2015, 10:43:15 AM
Pekka, thanks! I'm working on this in the evenings but not ready to write anything here yet because I have several options I want to explore, and I am waiting for parts I ordered to arrive by mail so I can build and test.  I should have everything here within the week.  :beer:
Title: Re: Electronic Leadscrew?
Post by: PekkaNF on April 06, 2015, 02:13:12 PM
I love OT almost as much as pictures!

Two of my friends are working on one polar cordinate measurement system. They need several thousand pulpes per revolution and they choose to use quadrature pulse sensor on X4 mode. They found one chip that is normaly sold in 1000s, but ebay rescues. There is a Eage file, they are going to test it, probably even next week. They are pretty confident that they are going to all that 4x and +/- 1 non accumulating pulse error.

Pekka
Title: Re: Electronic Leadscrew?
Post by: PekkaNF on April 09, 2015, 06:15:18 AM
I asked my friends about the quadrature encoder chips and they are using this one:
http://www.lsicsi.com/pdfs/Data_Sheets/LS7183_LS7184.pdf

There is one that is a bit more involved, but it looks like it could offload some processor load (maybe...some pros have pretty nifty counters today.
http://www.lsicsi.com/pdfs/Data_Sheets/LS7166.pdf

There are quite a few different versions:
http://www.lsicsi.com/encoders.htm

At glance max. freg. was not clear, but I think most of them are good for 1Mhz least. Also it was hard to determine how much error they generate at most infavorable case.

I started thinking.... Maybe this error is not that bad here...because you can use index-pulse to reset/initialize the situation AFTER you have both axes rotating but prior engaging the feed. Therefore spurious pulses on start/stationary/stop modes does not matter.

LS7184 has Clk-output and when spindle is at steady speed and "feed" is inching you know the direction.

Bigger issue I see on stepper drive, under load at very slow speed they are close to nominal step error and that is at their best. Microsteping gives smoothness, but does not give that much linear resolution.

I'm pretty confident that VT will pull this off. He has plenty of experience.

I have plenty of experience over/under dimensioning and hit the goldilocks zone after many iterations.  :lol: No matter how hard I calculate and plan at first!

Pekka
Title: Re: Electronic Leadscrew?
Post by: spuddevans on April 09, 2015, 12:07:56 PM
The PIC 18F2331 (or 4331) has a Quadrature Encoder peripheral module built in. http://ww1.microchip.com/downloads/en/devicedoc/39616b.pdf

There are also a number of more powerful PIC microcontrollers that have the Q.E. modules built in, some have 2 of them. But for me the one linked above is sufficient.

I have ordered a couple of those pic's and also a Quad encoder off ebay, and a few other bits and bobs as well. This thread has sparked off a little  :proj:  :D


I plan on using 3 BCD thumbwheel switches as both the means of setting the required Pitch/TPI, and the means of displaying the set Pitch/TPI.

I have a PIC development board I bought ages ago, so I will prototype on that, I've already cobbled together a program, just waiting for the hardware to arrive in order to test it out.

I reckon the total cost should be £30-40 max, especially as I plan on using the 4th axis stepper driver of my CNC mill along with the stepper motor on my RoTab (perhaps with a little modding, without even removing it from the RoTab!!)

Should be fun

Tim
Title: Re: Electronic Leadscrew?
Post by: spuddevans on April 09, 2015, 12:25:14 PM
Bigger issue I see on stepper drive, under load at very slow speed they are close to nominal step error and that is at their best. Microsteping gives smoothness, but does not give that much linear resolution.

I was worried about this too, and perhaps with a non-leadscrew equiped lathe it would be an issue, but if the lathe has a leadscrew already, it will also have an arrangement of gearing attached to the leadscrew. You could use a geared reduction from the stepper to the leadscrew. In the case of my mini lathe with a metric leadscrew of 1.5mm pitch and a 2:1 geared reduction, that would result in a resolution of 0.00375mm.

Tim
Title: Re: Electronic Leadscrew?
Post by: awemawson on April 09, 2015, 12:41:59 PM
I'd be tempted to replace the gear train with tensioned toothed belts and toothed pulleys to minimise backlash.
Title: Re: Electronic Leadscrew?
Post by: John Stevenson on April 09, 2015, 01:41:13 PM
I'd be tempted to replace the gear train with tensioned toothed belts and toothed pulleys to minimise backlash.

Yup, gears are so yesterday.

I have replaced the 'standard' ratio on all my lathes with a toothed belt drive to the gearbox.

(http://www.stevenson-engineers.co.uk/files/geartrain2.jpg)

The gears stacked on the holders are just for specials that are out of reach of the normal ratio's in the gearbox. Means I can run at higher speeds with less noise.
Title: Re: Electronic Leadscrew?
Post by: spuddevans on April 09, 2015, 06:03:34 PM
I'd be tempted to replace the gear train with tensioned toothed belts and toothed pulleys to minimise backlash.

Yup, gears are so yesterday.

I have replaced the 'standard' ratio on all my lathes with a toothed belt drive to the gearbox.


Sounds good, do you think that would fit on my lathe (Seig C2)  :scratch:

Tim
Title: Re: Electronic Leadscrew?
Post by: awemawson on April 10, 2015, 02:57:19 AM
Toothed belts are available in an amazing array of pitches and sizes:


http://www.hpcgears.com/n/products/1.pulleys_belts/pulleys_belts.php
Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 10, 2015, 08:23:18 AM
Taken me two days but I've finally got FORTH assembled and burned onto an Arduino. Guess it's not an Arduino anymore since the bootloader and everything else is changed in flash. It now has a real OS and language onboard. It is its own computer. And a cool retro one at that. I'm back in the early 80's with it and enjoying it!
Title: Re: Electronic Leadscrew?
Post by: awemawson on April 10, 2015, 08:41:47 AM
Now Steve my first male menopausal event was celebrated re-building a motor cycle from my youth, and my second was to buy an Austin Healey 3000 ....

.... but you, oh no, it has to be a retro computer  :lol:
Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 10, 2015, 11:15:05 AM
From what you say about the Healy costs these days, that's out for me. I'd prefer a Morgan +4 with a TR3 engine, anyway. Any availble in my price range of say $50 over there?

Guess I'll have to settle for a $10 Arduino, then.  :lol:
Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 12, 2015, 09:09:02 PM
I've got a running experimental system with a toy encoder/gearhead motor w/IR detector combo feeding an Arduino, doing the dividing function, with step and direction output to a stepper drver and a stepper motor running at the divided rate.  :ddb:

It all works at the relatively low data rate that the toy encoder is putting out. The real encoder hasn't arrived yet, but it's really great to see it all running together as imagined now!

I used Arduino's Wiring language just to work out the connections and timing,  but I'm in the process of writing FORTH code for it, which will make future extensibility easier -- at least for me.
Title: Re: Electronic Leadscrew?
Post by: spuddevans on April 13, 2015, 08:49:02 AM
I've got a running experimental system with a toy encoder/gearhead motor w/IR detector combo feeding an Arduino, doing the dividing function, with step and direction output to a stepper drver and a stepper motor running at the divided rate.  :ddb:

It's always a good feeling to get a test system up and going, well done  :clap: :clap:

Are you going to have a LCD readout of the pitch/TPI?

I was wanting to have one on mine, but then realised the PIC that I've ordered haven't enough ROM (or I haven't pruned my code down enough) for the menu structure that I was thinking of, hence I changed plan to use BCD thumbwheels as setting/display means.

Tim
Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 13, 2015, 10:21:18 AM
Tim, I don't know yet. It makes sense to do that, but the retro part of me wants to have a knob selector or lever selector and no display, or a hidden set of switches or something on the new lathe. Just an aesthetics thing. I'd like it to look like a manual lathe -- and function like one, actually.

On the other hand a display would allow me to do lots more in the future re. expansion of capabilities without adding too many knobs and levers! I keep thinking of writing my own simple CNC manual control stuff for a lathe instead of using the heavy CNC hitters and mega computing setups. After saying I just wanted to replace change gears, it gets tempting to go further.  :palm: But I noticed I've stopped building my lathe, and that's no good. I think I'll put off getting too ambitious electronically at this stage, get the electronic change gears working, and finish the lathe. I can always come back to the fancier programming stuff after.

I might play with a display, maybe just to learn how it works. But I don't know if updating a display will hurt the gear routine throughput -- another consideration. I'm not using interrupts yet, just a simple input polling loop -- I'll have to see what is needed for speed when the "real" encoder gets here.

I'll have a very short video of the toy encoder setup shortly -- as soon as Vimeo gets done re-encoding it.
Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 13, 2015, 10:36:57 AM
Just a quick test.

First button runs the DC toy motor turning the encoder. The arduino translates that to step pulses at any preset ratio and sends to the stepper controller.

Second button reverses the stepper (leadscrew) direction.

Third button is an emergency stop/limit switch input.


https://vimeo.com/124824069 (https://vimeo.com/124824069)
Title: Re: Electronic Leadscrew?
Post by: spuddevans on April 13, 2015, 11:01:59 AM
I'm impressed with the video, that looks a good rate of RPM on the encoder.


But I don't know if updating a display will hurt the gear routine throughput -- another consideration.

When I was looking at having a LCD for mine I was worried about that too, so I came up with the thought of using a toggle switch for "Set" or "Run". then the program would regularly poll the switch and only update the display or change parameters when set to "Set".

Another thought was to use the Quad Encoder instead of buttons to change parameters (obviously without the lathe running!!) saves having a plethora of buttons, just one "Set"/"Run" switch and the display.


Tim
Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 13, 2015, 11:25:08 AM
Along with your approach, Tim, there should be a "leadscrew" switch, anyway, so setting a thread pitch could occur before running the LS, and lock the display and pitch while running the leadscrew in threading mode.

I imagine autofeed ought to be variable with a pot, though, but that's easy enough to swtch into a separate non-encoder simple variable timing routine. Then display refresh timing isn't a problem.

There's a million ways to skin this cat for UI, and that will all end up to personal taste.  :beer:
Title: Re: Electronic Leadscrew?
Post by: sparky961 on April 13, 2015, 04:40:28 PM
Some thoughts regarding display update and general latency when switching tasks... just off the top of my head, and just in the door from work.... so maybe not well thought out.

Maybe you already know this, but you're better off updating the display and such in the main loop.  You're not going to care if there's a few millisecond delay where it's unresponsive, if that.  Miss an encoder pulse though and it might mean a scrapped part or worse.

Run the encoder off interrupts (as I think you're planning eventually) and then it will always have priority.  Don't disable interrupts once you're in the main loop.  Keep your interrupt(s) as simple as humanly possible.  That said, I've been surprised how quickly my state machine code runs and counts correctly.  If its been a while since you've played with uC's, you will be pleasantly surprised at how far they've come.  I've been away from the mainstream for a while, and I sure am.

I'd be happy to send you a copy of my encoder state machine interrupt handler function... in C - the only FORTH I know is "May the FORTH be with you" ;)

Now stop (lead) screwing around and get the rest of that lathe built!
Title: Re: Electronic Leadscrew?
Post by: RobWilson on April 13, 2015, 05:29:27 PM
 :clap: :clap: :clap: Looking very canny there  Steve  :thumbup:



Were did you purchase  the smaller circuit board  ?   the opto thing



Rob
Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 13, 2015, 09:45:57 PM
Sparky, thanks for replying.  :beer: We'll work out the timing to whatever is needed. FORTH is pretty fast on old and limited procs with tiny memory and also has a built in assembler if we really need to get down and dirty for something. And there are two interrupt input pins on the board, etc.

Like I said a display isn't top priority for me -- a rotary switch and knob can select pitches very conveniently, a dip switch also, though less conveniently. I even have a plan B.

I don't know C so it wouldn't help any to see your code. I do thank you, though!

Nobody uses FORTH these days. Or even knows what it is. Just guys from the early eighties era of computing. And even then, not many.

FORTH is a language that you write your own language in. It suits the way I think. I never felt anything else fit as well. People make a big deal nowadays over various unusual characteristics like the reverse polish notation for math, the use of the stack and untyped variables, 1024 byte blocks for storage, etc. But they never seem to make much mention of the fact that it is a language designed to create your own language in. That's the critical point of interest to me!

A FORTH program works by defining words in your own invented program language at a low level, and combining those into definitions for higher level words until you get to the top of what you want to do -- the last word in your dictionary that does it all.

Utter that word and boom your program runs. I think that's cool! Just a quirk of mine. The rest of the stuff is just mechanical details. I learned them a long time ago, and don't even think about them. But it's easier for people to talk about and give little demos online of using the stack and RP notation. So you don't see much about why you'd ever want to learn a language that requires that.

FORTH isn't useful because of unusual arithmetic operations -- they're a pain in the neck for most experienced programmers. It's the way you create a program that's wonderful, to me. And how compact and fast it is. And that's possible because of the stack and RPN -- they're the primitive base words and functions very close to how the proc works and sees things.

Your program builds up from this low level of words to a level so high, one word does it all. Everything you want, in a single command. That's the highest level of the language. There aren't subroutines and calls. rather every FORTH word is a subroutine, and there is no distinction between the words you define and the base words that come with the system. They are all part of the grand dictionary, and can be used to make up new words.

Okay apologies for going on and on about this. Using FORTH again brings back the interest and excitement I had when I first started using computers, so I start chattering!

Yes, back to building the lathe as soon as the shop dries out. 1/4" of water on the floor because of ice out here. Early crocuses just beginning to show. Daffs not up yet. Still some white stuff out there in patches and the streams are roaring....
Title: Re: Electronic Leadscrew?
Post by: vtsteam on April 13, 2015, 09:58:19 PM
Rob, I found this little gem on ebay and grabbed the whole kit and kaboodle:

http://www.ebay.com/itm/321719649728?

Price is ridiculously low. The Arduino Uno clone isn't the best quality PC board work, but it runs fine so far.

Title: Re: Electronic Leadscrew?
Post by: PekkaNF on April 14, 2015, 02:37:28 AM
Aah Forth...When I was a school this was cutting edge. Every processor of it:
http://www.cpushack.com/2013/02/21/charles-moore-forth-stack-processors/

I remember one (least some part of) Norvegian team that was trying to make FORTH-processor for graphics application, bit slices were driven out of everything else than esoteric radar and such signal cruching. And finally out of that too with when signal processors started to appear. With PC:s I lost all interest on computers. Just too many layers of junk.

One more word: Harris. Never used one of those, but some later processors were very much influenced on those designs and ideas.
http://en.wikipedia.org/wiki/RTX2010

Pekka

Title: Re: Electronic Leadscrew?
Post by: vtsteam on June 28, 2018, 04:58:44 PM
Guess I better resurrect this ancient thread and try to refresh my memory on what I'd done, if I'm going to use this. 3 years, sheesh!
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on June 29, 2018, 09:39:27 PM
Okay looking back at he old spreadsheet I see I kind of lucked out on the new lathe. I just this week made a set of pulleys for it and I coincidentally gave them an exact 5 to 1 ratio. I did that at the time mainly because 18T and 90T were good do-able numbers for indexing on my old spin collet, and I lack a dividing head. And because 5 to 1 was in the range of a good reduction ratio for the specs of the treadmill motor I had. To have both of those things work out to exactly 5 to 1 was true dumb luck for me.

Why? Because I hadn't looked at this old electronic lead screw thread. And looking at it now I'm reminded that 5 to 1 is THE absolutely ideal ratio to make this work. Because what it means is that I can attach the 600 line encoder I already have directly to the DC motor and that gives me 3000 lines per rotation at the spindle. The DC motor has an extension shaft on the back end, for very easy attachment.

Looking at the lead screw, the ratio of the stepper motor and lead screw will be 1.5 to 1, that means (with a 200 step motor) the 300 steps per lead screw rotation on a 10 TPI screw yields 3000 steps per inch, super-convenient for the 3000 pulse per turn signal from the spindle.

And that means that simple integer division by the intended TPI will yield the proper pulse rate for the stepper to produce that TPI. Divide encoder pulses by 4, you get  a 4 TPI screw. Divide by 28, you get a 28 TPI screw. etc.

This doesn't even require an Arduino to accomplish. It can be done with perhaps two discreet IC's. Maybe something in the 74LS161 series chained ( I have some). I think that's going to be my approach. If that doesn't work I can always fall back on the programmed Arduino I had already developed 3 years ago in  this thread. But even an SBC is overkill, oversized, and slow and complicated by comparison.

Actually even one modern IC might work -- I don't know what's available these days. Basically I need a divide by N circuit with a max divisor of say 56 (for 56 TPI, or fine feed).
Title: Re: Electronic Leadscrew for the New Lathe
Post by: awemawson on June 30, 2018, 02:37:16 AM
Sometimes the toast falls butter side up  :thumbup:
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on June 30, 2018, 07:44:32 AM
Glad I didn't own a dividing head! 

I do need to read my own plan A before embarking on B sometimes.
Title: Re: Electronic Leadscrew for the New Lathe
Post by: rowbare on July 03, 2018, 03:16:43 PM
And that means that simple integer division by the intended TPI will yield the proper pulse rate for the stepper to produce that TPI. Divide encoder pulses by 4, you get  a 4 TPI screw. Divide by 28, you get a 28 TPI screw. etc.

So what happens to the left over pulses?  3000/28 = 107 r 4

bob
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on July 03, 2018, 03:27:01 PM
Well, rowbare, I know it's a little difficult to visualize at first, but think about it, and I think you'll get it...they just carry, as long as the thread continues. If you were doing only one turn, yes you'd have a remainder at the end of that turn, but this is a continuous process. In other words, the pulses don't have to line up with the end of each turn. It's just two different frequencies superimposed -- the spindle rotations, and the stepper pulses. Does that make sense?
Title: Re: Electronic Leadscrew for the New Lathe
Post by: rowbare on July 04, 2018, 03:36:08 PM
If you look at it as superimposed frequencies, there has to be a harmonic relationship between them.

Given a 32 tpi thread (32 shows a bigger error than 28) and 3000 ppr, if the cutter has not moved exactly 1/32 of an inch after 3000 pulses, the thread pitch is off.

3000/32 = 93.75, so a divide by n will provide 93 pulses to the stepper per revolution. After 32 revolutions, the stepper will have gotten 32 * 93 = 2976 pulses and will have moved 0.992 inches cutting a 32.25 tpi thread. It isn't a huge error but an error just the same. It is certainly more significant in theory than in practice though...

bob
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on July 04, 2018, 07:23:20 PM

3000/32 = 93.75, so a divide by n will provide 93 pulses to the stepper per revolution. .

Nope, it will provide 93 pulses, plus the .75 remainder as a "virtual" timing interval, because the spindle won't have to travel more that 1/4 of its normal inter-pulse distance before sending the next pulse, #94 to the stepper. The encoder has already moved that .75 amount.

See, the encoder doesn't reset once it gets to 93 which is what you're imagining. It's moved past that point just short of the next pulse position. The stepper just sees a continuous regular stream of pulses from the encoder. And those are timed exactly right.

Get it?

The only error is the fineness of resolution of the stepper. But there is no cumulative error from remaindering.

With a perfect leadscrew and a 3000 ppi stepper ratio the tolerance is a flat .00033" at any point along the full travel of the lathe.

Title: Re: Electronic Leadscrew for the New Lathe
Post by: beeshed on July 10, 2018, 06:07:59 PM
How do you do metric? Since a Norton box is so easy the big value from an ELS is mixing imperial and metric. I think this is where a programmable device is an advantage.
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on July 10, 2018, 10:59:20 PM
I'm not doing metric.

If you want metric it could be done the same way, but naturally you'd probably want a metric leadscrew anyway, and then you'd work the pulley and encoder ratios the same way but favoring your measurement flavor.

If you want both yeah you could go the microprocessor route. Been there done that earlier in the thread.

If I thought about it hard, I bet I could do it simply with IC's as well. 8 bits (two ls161s) gets you divisors up to 255. And 254 is an interesting number for system conversions. But I don't want to think hard about it right now.
Title: Re: Electronic Leadscrew for the New Lathe
Post by: assink on July 11, 2018, 06:25:13 AM
There is actually a german version that works, and seems popular in germany.
https://www.rocketronics.de/els/?v=796834e7a283
Just use google translate  :D
It's also able to do tapers and radius,

Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on July 11, 2018, 06:32:57 AM
Yup, I know, mentioned earlier This thread has long since evolved into making one, though.

Ysee, if  project fora like this one just carried links to manufacturer's web pages, there wouldn't be any interesting projects in them, yes?

 :proj:

 :dremel:  :dremel: :dremel: :dremel: :dremel: :dremel: :dremel: :dremel: :dremel: :dremel:



 
Title: Re: Electronic Leadscrew for the New Lathe
Post by: assink on July 11, 2018, 07:59:16 AM
I meant it just for inspiration, have also a link to the full forum page talking about it's working and development. It's rather interesting, but you have to know german or use translate.
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on July 11, 2018, 09:52:51 AM
 Fair enough assink. But I should explain what I love - I guess you'd call it elegance in conservation of resources. So I'm real happy with ditching the microprocessor-display-multifunction approach and thinking through a pennies on the dollar four component control solution that will cut any integer thread up to 255 tpi with no cumulative error. I think of that as my kind of fun. And that's what drives me to make my kinds of things and post them on this very unique forum. :dremel:   :beer:
Title: Re: Electronic Leadscrew for the New Lathe
Post by: Holt on February 16, 2020, 05:11:01 AM
I just re read this tread, it got me thinking of a youtube series about the same subject.



Holt
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on December 09, 2020, 12:23:08 PM
Well, I'm back at this again, now that my "new" lathe work has resumed and headed toward the finish line.... and I've finally got a big stepper mounted on it. :dremel:

I've had to reverse engineer what I had done before (5 years ago!) -- I have no notes, other than the FORTH program listing, and the surviving breadboard with some connections missing.   :wack: Nevertheless, it's beginning to come back.  :coffee:

I already have a working routine and circuit to do the carriage movement while cutting threads. But what I hadn't yet sussed was how to do multiple passes when cutting a thread. Since this lathe gear is strictly intended as an electronic leadscrew, or more accurately, digital change gear, there are some differences to what is possible with a full two axis CNC lathe.

In the case of CNC where a single pulse on the spindle gear gives spindle positional and timing information, and the program sets the leadscrew rotational speed based on the rotational speed of the spindle, the program can automatically retract the carriage, move it to a starting position, and advance the tool and begin carriage movement at the right time to begin a repeat cut. The single pulse gives a reference point. This method of essentially proportioning rotational speeds is especially accurate where the spindle RPM is controlled by servo, VFD, etc. A DC motor like mine would be less accurate for thread cutting if the load changed with a setup like this, though probably accurate enough for home workshop use.

I chose a different route in this project, which is running an encoder on the spindle yielding, after gearing, 3000 pulses per revolution. This is matched by the stepper gearing (plus the leadscrew pitch) to yield 3000 steps per inch. Any non-fractional TPI can therefore be generated by the simplest integer math:
40 encoder pulses per step pulse yields 40 TPI.
27 encoder pulses per step pulse yields 27 TPI, etc.

This is the most basic programming I can imagine for generating the motion needed. But without positional cue, a single pass is all this routine will do. There is no physical connection between the spindle and the carriage. As I imagine it, the only way to do multiple passes in this system is to use the early lathe spindle reversing method. In this case:

1.) manually stop the spindle motor (which will also stop the leadscrew stepper tracking it)
2.) manually retract the tool from the work
3.) reverse the spindle direction
4.) reverse the stepper direction
5.) power the spindle back to the start position manually (jog)
6.) stop the spindle motor
7.) set new tool depth
8.) change spindle direction to forward
9.) change stepper direction to forward
10.) start spindle to cut next pass

Now there are some sophistications possible. Encoder quadrature could be sensed by the Arduino to do its own switching from forward to reverse stepper rotation. Is this worth the trouble ......eh, maybe not. The little board is doing a lot already, at fairly high computational speed, and I've also heard (Pekka?) somewhere that fast quadrature sensing on the fly can be problematic especially if there's electrical interference.

Seems to me that I can reverse stepper direction and spindle direction simultaneously more simply than by asking a computer to figure out when to do that. A DPDT, center OFF switch on the DC motor could stop and reverse its direction. and if I add a diode and link it to the stepper driver's direction input, that would reverse the stepper rotation when needed.

I guess I'd need another switch for doing reverse threads. So that's two switches and a diode.

Other possible sophistications could be to employ the Hall sensor also present on my lathe (for the tach) to give actual spindle position, but I'm not sure just what this would enhance. I'd still have to jog the carriage with the stepper -- I couldn't release the halfnut to move it, or I'd lose carriage position. This is assuming I was somehow trying to sync up the Hall sensor and the carriage. I actually don't see any advantage in complicating things this way.

The other need is for user input of thread sizes. Six bits of information would give me 64 choices. Something like an 8 pin DIP switch would be overkill. I want to keep things as simple as possible -- no display for the board to have to refresh, no keypad to poll, minimal footprint -- just the Arduino and some switches. Besides, a DIP switch looks almost like an miniature automatic change gear lever set on a traditional mechanical lathe. The only problem for me is I wish they were bigger. Of course you couldn't call it a DIP switch properly then!

I guess I could make a bank out of larger single switches. Better still if the looked like levers instead of plain toggle switches!  :loco:


Title: Re: Electronic Leadscrew for the New Lathe
Post by: awemawson on December 09, 2020, 12:31:52 PM
I've had to reverse engineer what I had done before (5 years ago!) -- I have no notes, other than the FORTH

Now you know why I bore you to death with masses of details and photographs in my various rebuild threads, many is the time I've had to re-read them to clarify something that I did years ago. It's also a good reason to pop the photos on the forum server so they live as long as the forum does (though I keep higher resolution copies on my machine at home that gets a full back up every seven days)
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on December 09, 2020, 02:06:16 PM
Hey, I not only knew, but also wasn't bored.  :beer:

Onwards and upwards:

Small fly in the ointment re. my outline above. I shouldn't just reverse the stepper driver with a switch, jog back to start position and expect the stepper to stay in registration. True, I've reversed the stepper's direction, but I also need to notify the Arduino to start decrementing from its last encoder count, rather than continuing to increment from it. Natch. There's a difference.

Example: We're 23 encoder pulses towards the step point of 40 while cutting a 40 TPI thread. We stop here and reverse the spindle motor and stepper driver in order to jog back to start. If we don't tell the program to start decrementing it will wait 17 more encoder pulses before sending a stepper pulse. On the other hand, if we tell it to decrement, it will go 23 pulses before sending a stepper pulse, which is proper.
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on December 09, 2020, 11:18:32 PM
Additonal thought. I'll want coarse and fine feeds for the leadscrew as well as thread cutting. I guess .005"/revolution feed for fine feed, and .010" for coarse seem to be in the range for commonly preferred speeds. That would be the equivalent TPI if we imagined it as threading for programming purposes, of 200 TPI and 100 TPI, respectively. Or 200 and 100 encoder pulses per stepper pulse.  :smart:
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on December 11, 2020, 11:23:32 AM
Just thinking about the possibility of doing metric threads with this thing, too.

Assuming my 3000 steps per inch, that's 118.11 steps/mm. Close enough approximation would probably be 118

If 118 was used, the cumulative error over my lathe's normal bed capacity (~ a 12" or 30 cm thread) would be ~0.25 mm).
Frankly, I wonder whether most home shop lathe leadscrews will drive their carriages to .25mm precision after 12" travel.

But for even closer precision, I could just increment one step every cm (a step is only .0085 mm).

Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on December 11, 2020, 11:35:03 AM
Well, that's just imagining a metric 1mm pitch thread. Actually the way to program this for all metric threads is to generalize the increment correction method I mentioned at the end, above.

Basically increment (carry) a step, as you are threading, whenever you've accumulated a remainder (error) greater than half a step. Just like rounding numbers.
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on December 28, 2020, 02:18:55 PM
I've been quiet on this subject for awhile, but actually the ELS project has progressed to near completion (I hope!). The last week or two I have been trying to understand how to program interrupts in the Arduino UNO using FORTH.

Interrupts have been a real Babel of online tech jargon for me to try to weed through to eventually get to a relatively simple set of requirements. I've read through examples for different control chips, read the Atmel datasheet, etc. tested and tested and tested trying to get them working, and finally, yesterday, did finally have success.

While programming for interrupts is a well documented and straight forward process in the official Arduino programming language, that language is too slow for what I want to do, even using interrupts. FORTH is far more compact, and considerably faster. It's also a language I enjoy using again. But the version I'm using: FlashForth has little documentation for using interrupts on an Arduino UNO. What there is is aimed at PCI interrupts on a different board, not EI interrupts, which was what I needed.

Anyway, I'm now at a full understanding of EI's, and the applicable Atmel registers on the UNO, and successful at using the UNO's pins #2 and #3 for A and B signals from the ELS encoder. Actually, I only need one interrupt for the A line. The B status can just be read during the A interrupt routine to determine spindle direction.

I've got a workng FORTH program now as far as reading the encoder goes, but a new fly in the ointment is that my 600 line encoder doesn't seem to work. I don't know whether its open collector outputs got damaged or not -- something the supplier warns about. I'm going to try another test before calling it dead, but that's a big disappointment. I've sent for another, since this one is way too old to inquire about a return. And maybe it got damaged in several years storage -- maybe it was a static problem.

While I'm waiting for the new encoder to arrive, I may open this one up and see if anything can be done to replace the output transistors. I'd need some advice about that from you guys if I do. Not sure what would be suitable in the box of spares.
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on December 28, 2020, 08:09:16 PM
 :doh: :doh: :doh: :doh:
Problem wasn't the encoder but the breadboard. I have two of them. Apparently not quite the same, though they look the same.

The one I've used before has two sets of power busses running down the sides. The newer one interrupts both busses half way down the sides. I was using that one, thinking the busses ran all the way.

Turns out that an encoder just won't work if not connected to power! Took me an entire day to figure that out...  :wack:

Reminds me of the old IT troubleshooting litany: "Did you check to see if it's plugged in?"
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on December 29, 2020, 10:41:22 PM
By this evening I have code working to sense direction and then step an old junkbox stepper motor in response to the 600 line encoder via interrupts.

I also have the routine working to divide by a pitch value.  I can twiddle the encoder back and forth as fast as I can manage and whatever pitch rate I set the motor follows proportionately. It still remains to be seen if the whole will be fast enough when running on a lathe. It's going to be a pretty high data rate for the encoder/Arduino program -- 3000 lines per single spindle rotation. At 100 rpm that's 30,000lines /min, or 500 hz, But, fingers crossed....

The remaining stuff to do is:
1.)Add a code routine to subtract the current pulse count from the pitch setting whenever the direction changes.
2.) Add 6 switches ( a dip switch to start with) to set the pitch rate, and add the routine to read that.
3.) Decide whether the pitch value will be calculated from the switch byte, or looked up in a table. I think the latter would be more flexible, and allow future expansion to odd and metric pitches. But the calc method would probably be faster.
4.) try it on the lathe probably with a sharpie in the toolholder.
Title: Re: Electronic Leadscrew for the New Lathe
Post by: awemawson on December 30, 2020, 02:30:12 AM
Are you incorporating backlash compensation Steve?
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on December 30, 2020, 10:15:50 AM
I've thought about backlash as a topic,Andrew, but concluded in this hybrid system (an electronic leadscrew) vs full CNC automation, it is not a concern. The reason is the same as it is with a dial on a screw handle. I will manually be backing to a start position that is past the point that backlash will be taken up when the stepper starts to drive the leadscrew in the cut direction again.

Similarly in an ordinary screw cutting change gear lathe, there will be backlash in gears, leadscrew and halfnut, and even the threading dial drive. But because you start the cut in a position prior to contact, backlash is taken up by the time the cut begins.

I've taken an incremental rather than an absolute positional approach to the software, so far at least. When you are dealing with positional coordinate system, backlash becomes important. Conventional CNC is positional.
Title: Re: Electronic Leadscrew for the New Lathe
Post by: awemawson on December 30, 2020, 10:39:09 AM
My CNC mill, wire eroder and lathe have pitch error correction tables that map the ball screws along their length. I can't believe there's much error, certainly not enough to bother with for my sorts of projects.

My first CNC conversion (literally more than two decades ago !) to a Taiwanese Mill /Drill was practically unusable for profiling until I embodied backlash compensation. My first motivation to CNC it was the pain of filing out the D shaped 25 way connector mounting holes for various projects ! Programmed in assembler  :thumbup:
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on December 30, 2020, 10:58:59 AM
Andrew, cool!  :beer:

I was just thinkin, people must be getting tired here of just talk and no pics, but so far it's kind of uninspiring to look at. Nevertheless, somethin is usually better'n  nothin so ........here's my current mess:

(http://www.sredmond.com/vtsteam/Lathe/TestLayout.jpg)

Clockwise from upper left, encoder, stepper motor, step driver, power supply, breadboard, Arduino.



Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on December 30, 2020, 03:55:48 PM
Setting up an array for the various likely pitches so I can choose them with switches. Since there are 6 switches, that gives me 64 possible pitches.

I've been looking at what the common ones are, to populate the array and have come up with:
Inch: 80 72 64 56 48 40 36 32 28 27 24 20 18 16 14 13 12 11 11.5 10 9 8 7 6 5 4 tpi
Metric: .3 .4 .45 .5 .6 .7 .8 1.0 1.25 1.5 1.75 2.0 2.5 3.0 3.5 4.0
Feed Speeds (tpi equiv): 100 150 200

This is 45 total entries, so will fit in the array size available, with room for additions.

I should say that the Metric pitches and the 11.5 Inch pitch are for future work, as everything else will program now with integer math throughout. I have a good idea how to do the others also with integer math, using something like the DDA algorithm but it's more involved.

Integer math keeps the speed of processing up in FORTH and on the Arduino.
Title: Re: Electronic Leadscrew for the New Lathe
Post by: vtsteam on January 01, 2021, 04:32:08 PM
I connected an 8 pin DIP switch to the Arduino. The switches now correctly select any of the programmed inch pitches above, and the encoder turns the stepper motor at the selected pitch ratio. Encoder direction is mirrored by the stepper. It's basically ready to test on the lathe.