Hello Guest it is March 28, 2024, 03:26:37 PM

Author Topic: Lathe Electronic Leadscrew / Gearbox  (Read 2514 times)

0 Members and 1 Guest are viewing this topic.

Lathe Electronic Leadscrew / Gearbox
« on: June 17, 2019, 02:40:08 PM »
I am trying to use Mach 4 as an electronic lead screw for my old atlas lathe.
Hardware: PMDX SmartBOB 416, Generic Quadrature Encoder (1024 SPR) with index, Leadshine Hybrid Stepper Moor.
Sofware: Latest PMDX Drivers and Firmware and Mach 4 Build 3804.

I have managed to get the RPMs to display on a DRO in Mach 4. I have also connected the motor and run it in jog mode. But i have not been able to figure out how to link the 2 together and apply a ratio for feed rate or TPI.  I anyone can provide any guidance on how to do this or a link to a thread where this was discussed that would be great.
Thanks in advance.
Jason
Re: Lathe Electronic Leadscrew / Gearbox
« Reply #1 on: June 17, 2019, 03:06:13 PM »
Hi,
this post should be on the Mach4 Discussion Board, I imagine Tweakie will shift it.

If I understand correctly you are trying to control the leadscrew of your lathe? If that is the case it is the Z axis
in CNC lathe parlance.

You hook your stepper driver to the Step/Direction pins of the Z axis in your PMDX-416. There is no need for an external
encoder. Mach4 nor the PMDX-416 is not a feedback controller, thus while you could use a couple of spare inputs on the
PMDX-416 to 'read' the encoder and Mach could display that if you wish. What Mach or your controller cannot do is
use that information to 'adjust' your stepper motor drive. That is a 'closed loop' and is not possible with your combination.

Instead you have an 'open loop' situation where Mach/PMDX-416 will send a precisely timed stream of pulses to your
stepper driver to move your Z axis (leadscrew) inexact lockstep with the X axis (cross slide).

The only place where an encoder will be useful, and even then only the index channel of the encoder, is when it monitors
the spindle. An index pulse is required to synchronize the spindle and Z axis ( leadscrew) when threading.

You say you are using a 'hybrid stepper motor'. Would you post some more information about it, in particular is it a closed
loop drive or not?

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Lathe Electronic Leadscrew / Gearbox
« Reply #2 on: June 17, 2019, 04:53:01 PM »
Craig,
The Driver is HBS86H "Hybrid Servo Drive".  The motor Model Number number is 86HSE8N-B32.  My understanding when i bought them was that they were not a true servo but a stepper motor with encoder feedback into the driver.

I'm ok with the system functioning as a you describe it.  My goal is to get to a point where I can choose a feed rate or a TPI and enter that in to the software so that i can use the threading dial on my lathe.  I already owned Mach 4, so it made sense for me to try to do this way.

Thanks
Jason
Re: Lathe Electronic Leadscrew / Gearbox
« Reply #3 on: June 18, 2019, 03:18:43 AM »
Hi,

Quote
My understanding when i bought them was that they were not a true servo but a stepper motor with encoder feedback into the driver.

That is essentially correct. You don't need, or indeed want, any other encoder. The PMDX-416 only has five inputs. You do not
have spare inputs for things like encoders, in fact you don't really have enough for home and limit switches as is. You will also
need an Estop and a probe, so there is two of the five available gone.

You may want to consider the PMDX-416's bigger brother like the PMDX-424 as it has a few more inputs or if you want
more still inputs an ESS, or UC300, or 57CNC.

The important point is that Mach and the PMDX-416 will issue pulses to the stepper drive to travel 1 inch say, and
the stepper drive will ensure, barring overload or other fault, that the axis gets there. You can program the drive such that
should the stepper fail to stay in sync with Machs planned trajectory the drive will issue a 'following error' fault.

To do lathe threading you will need an index signal on the spindle..

Craig
« Last Edit: June 18, 2019, 03:24:16 AM by joeaverage »
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Lathe Electronic Leadscrew / Gearbox
« Reply #4 on: June 18, 2019, 06:41:46 AM »
Craig,
Upon Re-reading your posts and advice, I may have misinterpreted what you said about the encoder or may not have been clear in my previous posts.

The quadrature encode with an index connected to the spindle to measure rpm. How do i get Mach4/PMDX to provide a continuous string of pulses to match the spindle speed
* ratio.

Z axis rpm (feed rate) = spindle rpm * ratio

The ratio takes into account the feed per revolution of the spindle and the lead screw pitch.

Thanks,
Jason
Re: Lathe Electronic Leadscrew / Gearbox
« Reply #5 on: June 18, 2019, 02:55:23 PM »
It seems that you have movement and you have an index on the spindle since you say that the actual (not commanded ) RPM is displayed and you can jog.  Have you set your steps per unit for both axes yet?  Bryanna did a video that explains that process:

https://www.youtube.com/watch?v=d-xCWDR0Uvg

If you have the steps per unit configured correctly then in the mdi when you execute g0 w1.000 then the carriage would move inch/mm away from the headstock. 

If you have an index on the spindle and have a pmdx 416 then you use a g74 with the appropriate parameters to do threading.  Or use the Turn Cycles threading in Mach4.  The PMDX driver is responsible for coordinating the threading movement.

Hope I understood your question.

RT

Re: Lathe Electronic Leadscrew / Gearbox
« Reply #6 on: June 18, 2019, 03:14:09 PM »
Hi,
for Mach to measure an display spindle rpm it requires a signal. It can accommodate one channel of an encoder.
It measures the time between successive pulses and calculates the rpm based on the time delay. With an encoder channel
producing many, maybe hundreds of pulses per rev the time between pulses is vanishingly small and the potential inaccuracy
in measuring such small time intervals is large.

As a consequence the recommendation is, and the PMDX-416 may in fact require, an index signal, that is one pulse per rev.
Hook up your encoder but use only the index channel.

Thereafter setting the speed of the spindle is all  about Gcode.
g1 z-1 s1000    for instance would cause the Z axis to advance 1 inch (assuming z=0 currently) with the spindle at 1000 rpm.
Note that the spindle is not synchronized however, it is known as an 'out of band' axis. So with the numbers I have proposed
the average feedrate is 0.001 inch/rev, however the z axis will accelerate up to cutting speed and then at the end of the move
decelerate to zero. Thus in those accel/deccel phases the feedrate will not be 0.001/rev.

If you wish to maintain the spindle and the z axis in exact lockstep or synchronization then an ordinary 'spindle' or out of band
axis is insufficient. You would require the spindle to become a coordinated axis....the C axis.

Is that necessary? Have you had a look at Gcode for turning jobs on a lathe? The vast majority dont not have such
tight synchronism between the Z axis and the spindle.

Have a look at the properties of G93 called 'inverse time feed mode'. Have a look also at the Constant Surface Speed feature
of Mach4. Excepting threading its not strictly necessary to achieve synchronism between the Z axis and the spindle.

May I suggest do that first and  once you have explored the performance of that THEN consider what advantages that perfect
synchronism offer relative to the complexity of achieving it.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Lathe Electronic Leadscrew / Gearbox
« Reply #7 on: June 18, 2019, 07:16:43 PM »
Craig and RT,
Thanks for your help. It looks like I have a fair amount of reading to do on g code.  I don't understand the G words enough to read programs well.  I do have two more questions.  The examples I have seen for G95 seem be for mills, does G95 work for lathes?  Why wouldn't I use that?

Thanks
Jason
Re: Lathe Electronic Leadscrew / Gearbox
« Reply #8 on: June 19, 2019, 04:04:55 AM »
Hi,
g95 occurs in the Mill Gcode Manual.pdf but not in the Lathe Gcode Manual.pdf It suggests that g95 is not available
in lathe operations.

The time that you strictly require the Z axis and the spindle synchronized is when threading. The PMDX-416
handles threading and synchronization in real time and on it own board, Mach 'supervises' but because Mach is
not realtime capable it can at best supervise while the motion controller (PMDX-416) gets on with the real business.

g76 is used for threading.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Lathe Electronic Leadscrew / Gearbox
« Reply #9 on: June 20, 2019, 12:02:08 PM »
I fear there may be some confusion between the original OP's question and the responses which have been given thus far (or maybe I'm the confused one!).

I believe jasonbrame is stating that he has a MANUAL lathe without a full threading gearbox. He wishes to drive the threading leadscrew with a closed loop stepper motor rather than gearing it physically to the spindle. He hopes to use Mach 4 to read a spindle mounted encoder and allow him to select a thread pitch or feedrate with which the leadscrew will be electronically geared. I don't think he stated he is planning on using the machine as a CNC and the electronic leadscrew will be a function of the manual lathe (similar to the screw on a Hardinge HLVH).

I don't have the expertise to comment on the best way to do this. Sure you could read and match RPM in a macro, but you'd never keep the correct position. Maybe you can start a threading cycle of infinite length whenever the spindle starts? Some servos that I have used have this functionality fully built into the drive.