Author Topic: Electricuting the lead screw  (Read 708 times)

Offline eskoilola

  • Full Member
  • ***
  • Posts: 103
  • Country: fi
  • OH2GTK
    • Kirppuja
Electricuting the lead screw
« on: April 17, 2018, 06:30:42 PM »
First of all - I am fully capable to program a microcontroller (C/ASM) when and if that is needed. I have done several project with Atmel (AtMega-series) and PIC (16F25K-series). So if this needs one then I am not stranded with that one.

I have a 250 x 700 mm chinese lathe which is quite rigid with geared spindle and change gears for feed and threading.
See description here.

I have installed a new 1Kw 3-phase motor with VFD and a quick change toolpost. In addition to these some other gear like 4-jaw chuck etc ...

I am very satisfied with the rigidity and most of the work quality in this lathe. That being said there are a few flaws which I dislike:
- saddle feed cannot be reversed. Only right hand threads and only feeding towards the chuck (with normal spin direction)
- saddle has a half nut. Yes really, there is just the other half of the nut the other half being a hardened cylinder
- the spindle gearbox is quite noisy
- changing between feed and threading is a major PITA

My first question is: What is the minimum torque for a stepper motor assuming it is directly connected to the lead screw (3mm/rev) ? When is this torque an overkill ?
I have a heavy duty stepper motor Superior electric Slo Syn SS250B which has a maximum load inertia of 3lb/in or 8.8 kg/cm and a running torque 250Oz/in or 177n/cm. I do not have the faintest idea what those figures mean. Is that much and is that enough for my application ?

Data sheets for these motors are here and here.

I also have the big brother of that stepper. A Slo Syn SS400B which has 4.5lb/in or 13.2kg/cm max load inertia and running torque 400Oz/in or 282n/cm. It is a larege(ish) motor.

Both motors have 200 steps/rev resolution and 120V operating voltage (0.7/1.4A). There are only 3 wires coming out of these which means a quite strange drive setup with true AC feed. However - that is not a problem. This motor type can be driven with a sinusoidal drive which makes the "steps" a lot smoother.

My second question is about the accuracy of the lead screw. Is 0.015 mm/step accurate enough?
If the stepper is connected directly to the lead screw then this results to 0.015 mm/step saddle movement. To me this seems like good enough. Is there any reason why that should be more accurate? One can make this more accurate by applying some sort of a transmission (timing belt or such) but that will also impact the maximum speed of the saddle which limits the speed range I can use for threading.

The last question: What is a suitable resolution for the rotary enconder for the spindle?
I assume that the limit here is the speed of the microcontroller and the availability / easiness to make the needed slot wheel. I also understand that there should be an index so the uC knows the whereabouts of the spindle.

Hmmmm.....

Offline PK

  • Sr. Member
  • ****
  • Posts: 325
  • Country: au
Re: Electricuting the lead screw
« Reply #1 on: April 17, 2018, 08:10:35 PM »
When using ball screws, belts, or other low friction drives, you can calculate the required torque. Lead screws are a different beast because of the wide range of friction losses you may see between different lathes.

I've done a bit of work with this http://www.caswa.com/cncathome/lathe.html and http://www.caswa.com/cncathome/els.html

I recommend setting up a lump of steel in the chuck, adding a bar to one end of the lead screw and using a spring scale to get a feel for the required torque.

Your main consideration with this job will probably not be cutting torque, but rather top speed. Lead screws tend to be fairly fine pitched, so the slower top speed of the stepper means a max rapid speed of 1-2m/min. If a servomotor is out of your budget, then plan to run the stepper from > 50VDC

As per encoders on spindles. You need one pulse per revolution.

Hope that helps.

PK

Offline sparky961

  • Hero Member
  • *****
  • Posts: 836
  • Country: ca
Re: Electricuting the lead screw
« Reply #2 on: April 17, 2018, 10:19:52 PM »
If you're dreaming of rigid tapping in the future, a spindle encoder with a few thousand counts per revolution would be in order.

Offline JHovel

  • Jr. Member
  • **
  • Posts: 62
  • Country: au
Re: Electricuting the lead screw
« Reply #3 on: April 18, 2018, 11:16:30 AM »
Have a read of this page and all relevant linked pages: http://www.autoartisans.com/ELS/
I've built this ELS and it works very well. My encoder is, in fact, a small tab screwed to the main spindle inside the headstock and passes through the gap in an HP IR optical sensor. That's enough.
There is now a complete kit available and John is amazingly helpful with all questions relating to driving leadscrew and cross-feed screw on lathes and other machines.
Cheers,
Joe

Offline eskoilola

  • Full Member
  • ***
  • Posts: 103
  • Country: fi
  • OH2GTK
    • Kirppuja
Re: Electricuting the lead screw
« Reply #4 on: April 18, 2018, 01:38:05 PM »
As PK in his project page describes, a lathe electronic control can be (and should be) brought that tiny step further making it a partially capable CNC lathe. This in turn involves precise control/sensing  over spindle and both axes.

I am really tempted to make this just that. A lil' bit more capable as it actually does not seem to be awfully more stuff to do.

What I am going to have fun or struggle with (which ever way one wants to put it) are the mechanical things. Electronics and uC programming are easy for me. And as it seems most of this modification is actually just that.

I have also thought about using a servo motor on this one. It is my assumption that a servo motor controller needs some sort of PID controller to work as intended. In addition it needs either a rotary encoder or better yet a linear encoder  to tell the position of the saddle. I'll check what the stepper can actually do speedwise. The stepper is actually a nominally 120 volt device dc voltage for nominal current being around 30 volts. No problem as then the currents are smaller.

Of course this would be quite a bit more than just a electronic lead screw (ELS) but on the other hand - making the lathe to understand G-code (or whatever it is named) would make it compatible with GPL software which in turn has a temptation on me. Being a programmer makes me want to do everything in a computer.

I have an old Gerber photo plotter in my posession. This unit has one meter long ball lead screw with two nuts and another 70 cm long equally with two nuts. The steppers are too weak and slow for this application but because the unit has to work very precisely (being a foto plotter) the lead screws are quite massive (about 2 cm in diameter). As my lathe has a lead screw of about 90 cm length this could quite easily be replaced with that ball thing.

Using a ball lead screw has it's implications. There is no more a half nut to disconnect. This means that the apron handwheel has to be electricuted as well. Maybe a torsion sensor for manual control making it feel exactly as sloppy as it is now. Another torsion sensor to the end of the leadscrew handwheel and that thing could be operated exactly as it is operated now in a manual mode. The current half-nut lever and the auto-feed clutch would then be simple switches to disable/enable the manual handwheels. All this would of course mostly spoil the feel and touch of the manual operations.

On the other hand the ball lead screw is very precise and the lead screw backslash is mostly eliminated by using two nuts. Backslash originating from the leadscrew ends is a bit more difficult to eliminate - not much though.

I have to sleep on this one - this may run out of hands.....

Offline eskoilola

  • Full Member
  • ***
  • Posts: 103
  • Country: fi
  • OH2GTK
    • Kirppuja
Re: Electricuting the lead screw
« Reply #5 on: April 18, 2018, 02:06:04 PM »
If you're dreaming of rigid tapping in the future, a spindle encoder with a few thousand counts per revolution would be in order.
If the spindle is running at 1500 RPM there will be around 100.000 interrupts for the uC to be served each second. I know from experience that a PIC18F runniing at 64MhZ will be capable of serving around 30.000 intererupts per second if those interrupts are fast executing, simple things like advancing a counter. I know for sure that 100.000 is way too much.

Offline awemawson

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5961
  • Country: gb
  • East Sussex, UK
Re: Electricuting the lead screw
« Reply #6 on: April 18, 2018, 02:20:27 PM »
If this lathe is to have an electrocuted lead screw, will you have to wear thick rubber gloves using it  :lol:


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


(sorry I couldn't resist, your English is infinitely better than my Finnish )
Andrew Mawson
East Sussex

Offline AdeV

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2039
  • Country: gb
Re: Electricuting the lead screw
« Reply #7 on: April 18, 2018, 02:57:04 PM »
You could maybe use a 2nd hand servomotor off a Bridgeport CNC mill, they pop up on eBay from time to time. I've no idea what the torque is, but you'd probably multiply it by running it via a drive belt anyway. And they have the encoder built in. You can avoid the need for a linear encoder on the saddle by using limit switches; at switch on, motor drives to one of the limit switches & that gives it a known physical position to start from. A decent industrial microswitch should have the repeatability you need. Re controllers - again, the Bridgeport controllers for those motors appear on eBay fairly frequently. I'm not sure what you'd need electrically & electronically to drive them though, I've not looked into it in great depth.
Cheers!
Ade.
--
Location: Wallasey, Merseyside. A long way from anywhere.
Or: Zhengzhou, China. An even longer way from anywhere...
Skype: adev73

Offline tom osselton

  • Hero Member
  • *****
  • Posts: 910
  • Country: ca
Re: Electricuting the lead screw
« Reply #8 on: April 18, 2018, 03:01:26 PM »
If this lathe is to have an electrocuted lead screw, will you have to wear thick rubber gloves using it  :lol:


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


(sorry I couldn't resist, your English is infinitely better than my Finnish )
Igor throw the switch!!

Offline PekkaNF

  • Hero Member
  • *****
  • Posts: 1960
  • Country: fi
Re: Electricuting the lead screw
« Reply #9 on: April 18, 2018, 04:38:43 PM »
Leadscrew electrocity :lol:

I have been reading some of the ELS projects and there are some. In principle it works like on any CNC lathe. Cascaded spindele servo and other servo for ballscrew. Enenough pulses per rev. and stiff servo loop = no problem.

Hobbyist tries to cope with rubberstring AC motor spindle drive, that will produce cyclic spindle speed that will slow down when punny threading tool hits the work.

And at the each start you must syncronize spindle and lead screw (ball screw) servo (stepper?) some distance from the start of threading. You need a lot of pulses and a controller when spindle speed will fluctuate during cutting.

Or much brute force the keep the system stiff.

I actually know one guy who bought servo drive for spindle and lead screw. This all is done in CNC controller and it seems to work well.

Pekka

Offline PK

  • Sr. Member
  • ****
  • Posts: 325
  • Country: au
Re: Electricuting the lead screw
« Reply #10 on: April 18, 2018, 05:12:12 PM »
If you're dreaming of rigid tapping in the future, a spindle encoder with a few thousand counts per revolution would be in order.
If the spindle is running at 1500 RPM there will be around 100.000 interrupts for the uC to be served each second. I know from experience that a PIC18F runniing at 64MhZ will be capable of serving around 30.000 intererupts per second if those interrupts are fast executing, simple things like advancing a counter. I know for sure that 100.000 is way too much.

This is the old chestnut that everyone struggles with. Rigid tapping aside (in that case you use a servo drive for a spindle motor) , You need 1 pulse per revolution to CNC thread on the lathe.
All the software and hardware based controllers are set up for it...

Re servo motors.  You buy a Stepper motor and a drive or you buy a servo motor and a drive. The interface is the same, the price is pretty close, the servo motor spins 3 times as fast as the stepper.   I spent many years building my own stepper and servo drives. Eventually I came up with some OK ones:
http://www.caswa.com/cncathome/drives.html
and
[ Invalid YouTube link ]

But there are now so many cheap options on the market that are actually pretty good that it's not making them yourself (and I say that owning an electronics company with an assembly line).

One piece of generic advice, DIY CNC is the best example I've come across of "The cheapest way to do it is properly". I can't tell you how many times I rebuilt that lathe around some new motor or drive that I got cheaply. I undoubtedly spent thousands... 

Offline JHovel

  • Jr. Member
  • **
  • Posts: 62
  • Country: au
Re: Electricuting the lead screw
« Reply #11 on: April 19, 2018, 05:38:37 AM »
@eskoilola
if you haven't read the link I provided, there is provision for and a design for an "electronic half nut" for this ELS controller. It works just as you describe: you move it a certain amount in either direction and it moves the apron at a preset cutting speed. You can move it a bit further and it accelerates progressively to a defined 'jogging' speed. Pretty much like you would use the apron handwheel. He used the analogue input of the control chip to achieve this with a simple potentiometer. I used an electric wheelchair handle with pot to do this.
Finer control is provided by the manual pulse control on the panel. The whole thing is very functional.
It also has a port to connect it to a full CNC controller, should you want to use MachIII, G-code or whatever to operate the lathe.
The ELS by itself just gives you better control over feeds and cutting depth, and includes all common threads, all common tapers and taper threading in memory. It withdraws the cutting tool at the right time and allows nice consistent cutting and threading at the correct speeds for the tools used. Cutting threads a high speeds with nice fine depth of cuts automatically is very nice - and a bit exciting when they finish against a large shoulder!
Cheers,
Joe

Offline eskoilola

  • Full Member
  • ***
  • Posts: 103
  • Country: fi
  • OH2GTK
    • Kirppuja
Re: Electricuting the lead screw
« Reply #12 on: April 19, 2018, 01:51:45 PM »
@eskoilola
if you haven't read the link I provided, <snip>
Actually I DID read the article(s) and this seems to be somewhat what I want to do.
- I want to maintain the manual controls touch and feel as much as possible
- I want to have the thing to be a "fly by wire" - probably G-code compliant
- I want to do this as far as possible with the original controls
- I want to have sex with my lathe ....

What I would really hate is a big bunch of buttons and some reverse polish notation aka Sinclair scientific calculator from the 70's - it was a really sexy gadget at it's time. Had one and hated it all the way.

For example. At the moment there is a automatic feed on/off lever. That lever would be really easy to modify to be a forward/reverse feed control. On center position (positive lock) it would allow manual control with apron handwheel or the handwheel at end of the lead screw. When away from the center the feed would be equally faster to the desired direction.

Same kind of thinking would go with the cross slide. This time the feed would be controlled with the ex-half nut lever which would now be repurposed for that function.

That Slo Syn motor can do (per spesification) 10.000 steps / second (aka 2500 Hz) - quite amazing for a large stepper like that. I am pretty sure that the torque is an overkill - which is not bad. That 10.000 steps/second amazes me as I also have done my fair part of stepper drivers. The best ones had a switching power supply with constant current output. This means that the voltage rises with the drive frequency. These could easily do 2.000 steps/second but after that most of the steppers went berzerk. That sort of speeds also require acceleration time. Assuming that the ball-nut I have has a 3 mm pitch (same as the current lead screw) the max speed would be then 150mm / second. It is enough for most purposes. I have never measured the pitch of the ball-screw but if my memory serves me correctly - it is more.

When it comes to accuracy there is one unspoken element in the lathe, the compound. You figure it out from there. Auto-feed in the compound ... Hmmmm ..... Maybe a angle sensor and whatnot.

As PK very nicely put it - all this is really cheap - one just needs 10.000 worth of equipment to do it  :beer:

Further more - all this is purely academic as long as I am on my assignment here and my home is there. That being said - well thought is halfway done.





Offline eskoilola

  • Full Member
  • ***
  • Posts: 103
  • Country: fi
  • OH2GTK
    • Kirppuja
Re: Electricuting the lead screw
« Reply #13 on: April 20, 2018, 06:41:36 PM »
Designed the schematics for the spindle controller.
This controller will take care of .... spinning the spindle  :loco:.
After a lot of thinking i ended up in the following configuration:
- there is a 60 step quadrature encoder in the spindle and an index
- there is another 60 step single phase encoder in the gearbox input shaft (this lathe has gears too). This encoder is used to detect the gear
- inputs for an emergency switch
- controls the VFD using MODBUS
- connects to the host with a proprietary protocol using RS485
- time critical signals have their own bus, for example the virtual index, sync marker and emergency stop

With this configuration a virtual Index can be moved at any location from the physical index with 3 degree steps. The virtual index is fully independent from spindle speed.

The Huanyang VFD has an inbuilt PID controller with configurable P, I and D factors. In order to make this work the controller must be aware of the gear ratio and thus the inertia of the rotating system. This will be fun to configure  :dremel:

There is a schematic of this controller HERE. In case someone is interested.

This, of course requires a program to work  :dremel:


Offline PK

  • Sr. Member
  • ****
  • Posts: 325
  • Country: au
Re: Electricuting the lead screw
« Reply #14 on: April 21, 2018, 12:41:30 AM »
One pulse per rev. It's all you need.

Offline efrench

  • Full Member
  • ***
  • Posts: 128
Re: Electricuting the lead screw
« Reply #15 on: April 21, 2018, 02:37:14 AM »
I'm using a Teensy 3.2 microprocessor (Arduino compatible) to drive the spindle on my rose engine.  The stepper is a NEMA 17 94 oz-in.  Stepper driver is a DRV8825.  The Teensy can easily do 60,000 steps per second with this stepper and driver.  The Teensy 3.5 and 3.6 can do even more.  This stepper library claims 300,000 steps per second.

Offline eskoilola

  • Full Member
  • ***
  • Posts: 103
  • Country: fi
  • OH2GTK
    • Kirppuja
Re: Electricuting the lead screw
« Reply #16 on: April 21, 2018, 07:29:26 AM »
One pulse per rev. It's all you need.
I agree ... but ... I have the rubberband motor setup which means that the spindle speed is somewhat dependent on load. Driving the spindle with stepper or maybe a servo might make things lot easier. However, I am not willing to do that. As You stated in Your page - I will not believe You - I just have to bang my head into the same tree carcasses on the rocky way ....

I'm using a Teensy 3.2 microprocessor (Arduino compatible) to drive the spindle on my rose engine. <snip>  The stepper is a NEMA 17 94 oz-in.  Stepper driver is a DRV8825.  The Teensy can easily do 60,000 steps per second <snip>
What kind of steps are these ? I suppose we are talking about microsteps and not the ordinary 200 steps/revolution steps. The final truth is actually the max. RPM of the stepper which in my case using the Slo SYn stepper would be about 600 rpm. I have a few steppers which can do at least 5.000 rpm but those have very special construction and have only 4 steps / revolution...


Offline Noitoen

  • Full Member
  • ***
  • Posts: 135
  • Country: pt
Re: Electricuting the lead screw
« Reply #17 on: April 21, 2018, 02:24:51 PM »

Offline efrench

  • Full Member
  • ***
  • Posts: 128
Re: Electricuting the lead screw
« Reply #18 on: April 21, 2018, 11:56:04 PM »
I don't think it matters if it's full steps or microsteps.  The driver sends one pulse for either.

Offline eskoilola

  • Full Member
  • ***
  • Posts: 103
  • Country: fi
  • OH2GTK
    • Kirppuja
Re: Electricuting the lead screw
« Reply #19 on: April 22, 2018, 05:07:26 AM »
I don't think it matters if it's full steps or microsteps.  The driver sends one pulse for either.
From the controller point of view this really is irrelevant. Modern electronics can easily do 10.000 steps per second with 100Vpp voltage swing. However, it is the motor itself that becomes a problem. Combining high step count with high RPM converts into high voltage and frequency.

It should also kept in mind that it is actually the current (not the voltage) that has to be stepped. Since the motor is an inductive device switching the current in any reasonable value with 10.000 Hz frequency will convert into very high voltage and also high losses in the motor due to the eddy currents.

Microsteps on the other hand divide the full step cycle into smaller ... ehhh .... microsteps. The minimum for a stepper to operate is 4 which can be divided further into 8 or even 16 microsteps.

The motor specifications (holding torque etc.) are always referencing the full steps (4 steps / full cycle). The intermediate steps have less holding torque and are also less accurate.

The Slo Syn stepper/synchronous motor is designed to be run either by stepping or by two sine waves 90 degrees apart. And again, it is the current that needs to be 90 degrees apart - not the voltage. Driving this motor with sine waves produces a very smooth movement without any resonances etc.

As I stated earlier - this can very easily run out of hands. So I should first think what I really need:
- power feed for lead screw in both directions regardless the spindle rotation direction
- accurate and adjustable stop of the feed on each of the directions

Anything else I can cope with. The power feed of my lathe is all too fast even with the slowest gear set selection.

So as long as I really cannot guarantee the spindle position with one pulse per revolution (with a 3-phase VFD one cannot) I have to forget about the electronic threading control. From this point of view PK's comments make perfect sense.

So let's assume I have an arrangement with some sort of a motor that is able to turn the lead screw and which has some sort of a speed control - what would I achieve with this:
- adjustable feed in both directions
- easy to do electronic feed stops

In this case I would be doing all threading with the existing gear swap system. This would not be that much of a problem as threading is not something one does every day. On the other hand feeding is something that is associated on almost every lathe operation.

The only thing I would really be missing are the left hand threads. How often do I come across those ... not very. Further more it would be an interesting project to install a middle gear somewhere there in between.


Offline AdeV

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2039
  • Country: gb
Re: Electricuting the lead screw
« Reply #20 on: April 22, 2018, 08:02:37 AM »
Could you hook something like this encoder up to your spindle? It's massively overkill for your needs (up to 10k pulses/rev, up to 10krpm, not sure if you can do both at the same time...), and at 5v it should hook straight into your MCU setup.
Cheers!
Ade.
--
Location: Wallasey, Merseyside. A long way from anywhere.
Or: Zhengzhou, China. An even longer way from anywhere...
Skype: adev73

Offline PK

  • Sr. Member
  • ****
  • Posts: 325
  • Country: au
Re: Electricuting the lead screw
« Reply #21 on: April 22, 2018, 08:20:48 AM »
One pulse per rev.
Here's a video of my CNC lathe conversion turning a 1/8" BSPT thread with ...... wait for it...... a one pulse per rev encoder on the spindle...

Offline eskoilola

  • Full Member
  • ***
  • Posts: 103
  • Country: fi
  • OH2GTK
    • Kirppuja
Re: Electricuting the lead screw
« Reply #22 on: April 22, 2018, 08:59:16 AM »
PK, I assume You are driving You spindle with a servo or a stepper. Not by the normal 3-phase motor.

Offline PK

  • Sr. Member
  • ****
  • Posts: 325
  • Country: au
Re: Electricuting the lead screw
« Reply #23 on: April 22, 2018, 06:28:34 PM »
That's just a normal three phase motor, or a single phase, or a large hamster in a running wheel.

One pulse per rev is all you need to cnc turn threads.

I have a party trick (which I can't find video of). 2 start tapered ACME thread. All done with......wait for it......one pulse per rev.