Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: menardmfg on September 09, 2018, 11:42:31 AM

Title: Old turret lathe
Post by: menardmfg on September 09, 2018, 11:42:31 AM
I’ve been playing with an old turret lathe. The x and z axis are working ok. I know I can connect another axis motor to the turret, but can this be programmed via g-code to operate completely separate from the x and z? I’m currently still running a 1 7/8 drill through the part with the old power feed that was on the machine while the x and z are facing and turning. Can someone explain how to do it?
Thanks
Art
Title: Re: Old turret lathe
Post by: Steve Stallings on September 09, 2018, 01:29:42 PM
I assume you are talking about a turrent that does not ride on the saddle.

Seems like you could set up some limit switches for the turret travel and
use an M code to trigger some PMC code to cycle the turret using the
existing power feed. Take care that you can prevent collisions.
Title: Re: Old turret lathe
Post by: menardmfg on September 09, 2018, 04:31:50 PM
Steve,
Yes this turret is totally separate. My idea is to install another servo motor to drive the turret. I’m just not sure how you would g- code that. Can Mach 4 operate the turret servo, and the x and z at the same time?
Thanks
Art
Title: Re: Old turret lathe
Post by: joeaverage on September 09, 2018, 04:50:04 PM
Hi,
you can operate a turret in the manner that you describe.

Two ways;
1) Call the turret the Z axis
          To move the turret alone code G0 Znnn
          To move the other axes without the turret code G0 Xnnn Ymmm
2) Use an Out-of-Band axis.

A search of the Mach4 page should give you some ideas. The OB (Out-of-Band) axes have no motion (Gcode)
but are moved by jogging for which there are a number of useful API calls.

Craig
Title: Re: Old turret lathe
Post by: Steve Stallings on September 09, 2018, 04:53:40 PM
Note that the Hobby version of Mach4 allows only one OB axis. If your
configuration uses OB to implement the spindle, you cannot also use
it for your turret. OB spindles are ones that use step and direction to
run a stepper or servo as the spindle motor.
Title: Re: Old turret lathe
Post by: joeaverage on September 09, 2018, 05:32:25 PM
Hi Steve,
I was of the same opinion until smurph told me that Mach4Hobby has all six OB axes.

I'll try to run the post down and link you too it.

Mach4Lite is restricted to one OB axis, and that axis is always the spindle.

Craig
Title: Re: Old turret lathe
Post by: Steve Stallings on September 09, 2018, 05:38:42 PM
Yes, please try to find the link.

Mach4Lite? I was under the impression that this product was never offered for sale,
only Mach4Hobby and Mach4Industrial.
Title: Re: Old turret lathe
Post by: joeaverage on September 09, 2018, 06:05:52 PM
Hi Steve,

http://www.machsupport.com/forum/index.php/topic,37304.msg255366.html#msg255366 (http://www.machsupport.com/forum/index.php/topic,37304.msg255366.html#msg255366)

Craig
Title: Re: Old turret lathe
Post by: menardmfg on September 10, 2018, 09:48:25 AM
I’ve come up with an idea, let me know what you think. Running Mach 4 on the lathe after I cycle start I use an m code to activate an output which triggers a cycle start to run Mach 3 on a different computer that could operate the turret servo. Sounds to me like it should work. I’m running hundreds of these parts so it may be worth automating.
Thanks
Art
Title: Re: Old turret lathe
Post by: Cbyrdtopper on September 10, 2018, 10:00:56 AM
Personally, I would not run 2 computers on one machine.  I would just have the turret either an OBO Axis or make it the Y or A Axis in your Mach4 profile.

Art,
I'm guessing you want the turret to drill or whatever while at the same time your X and Z are machining?
Title: Re: Old turret lathe
Post by: menardmfg on September 10, 2018, 10:30:20 AM
Chad,
That is exactly what I’m trying to do. The turret needs to rapid approx 4.5 inches then feed for approx 2 inches then rapid out. What would be “a nice to have” is something that I can enter numbers in that would plug into the axis movement. That way it isn’t locked into one particular job. I was thinking the two computers would give me that option. I could also monitor the turret via the dro on the second screen. I do understand your concerns but I’m not lua smart enough to make it work.
Title: Re: Old turret lathe
Post by: Stuart on September 10, 2018, 10:38:08 AM
Why no look into using a arduino to generat the movement , the code could be triggered from an output from mach4

Have a look at nyccnc YT Chanel he as some examples of usining a arduino to drive a clear path servo

Just a rambling of a old git
Title: Re: Old turret lathe
Post by: Cbyrdtopper on September 10, 2018, 01:45:03 PM
Art,
Like Stuart said, you could use an arduino.  Personally I never liked the idea of adding an arduino to a cnc machine, it never seemed like it would be robust to me, I add PLCs to our machines instead.  But that is my opinion.

I'm not sure about drilling while it is machining a profile, doesn't sound like a good idea to me.  But I also don't know your setup and it may be working just fine for you. 

If you use a servo in Mach4 you can write a macro to drill what you want using DROs on the screen to set start, end, and rest positions.   

Have DROs for:
Drill Start Position  (DSP)
Drill End Position   (DEP)
Drill Rest Position  (DRS)
Drill Feed Rate      (DFR)

Your macro can rapid to DSP DRO value then drill to DRE DRO Value at the DFR DRO Value rapid out to DRS DRO Value. 
If you use an OBO Axis you can still monitor axis position.  I figured out how to do that a few months ago.

The only thing you would need to figure out is how to do it while the machine is running your turning operations. 
Just spitballing here.
Write a function to do the drilling ops and call it from the PLC script.  That may allow it to run in the background.  This is just a theory and I don't have time to delve into it this week, we are heading to IMTS in the morning so I won't be able to test this. 
Maybe Craig or Steve can jump in here and see if this is a feasible idea.
Title: Re: Old turret lathe
Post by: menardmfg on September 10, 2018, 02:13:01 PM
Chad,
This Warner & Swasey was built in 1940. My dad had been running these machines forever. I have to listen to him telling me that these wimpy cnc machines can’t remove material any faster than he could on this old clunker. Lol! That’s part of my motivation to drill at the same time as the turning op, I actually have been drilling using the old power feed for thr turret while the cnc is doing the turning op. The drilling op is shorter than the turning op and is out of the way when the facing in being finished. Dad would run this whole part turning handles manually, it is sometimes amazing how these types of parts were done before cnc machines were around.
Thanks
Art
Title: Re: Old turret lathe
Post by: Cbyrdtopper on September 10, 2018, 02:38:25 PM
Art,
That's true.  We have a turret lathe here at the shop.  Pretty cool machines. 
To do these at the same time... I would look into a PLC function of some kind.  It may have to be broken into parts, but doable.
Title: Re: Old turret lathe
Post by: joeaverage on September 10, 2018, 03:07:43 PM
Hi,
an Out-of-Band axis can do exactly as you require, the regular coordinated CNC axes move as normal and at the same time
turret can drill.

Craig
Title: Re: Old turret lathe
Post by: Cbyrdtopper on September 10, 2018, 03:20:33 PM
Hey Craig,
How do you think one would you move it to the desired positions while G Code is going?
I am going to have a call from the PLC to initiate movement for a tool carousel; but how would you make it move to 3 or 4 positions like Art is wanting. 
I was/am thinking having a function called from the PLC script from a macro in the G Code.  This could trigger the Turret to a rapid position, then that function could fire another function from the PLC that would be the drill cycle, then that would fire the retract function from the PLC.
Thoughts on that?
Title: Re: Old turret lathe
Post by: joeaverage on September 10, 2018, 04:42:01 PM
Hi,
when a line of  Gcode is read, interpreted and the PVT data is sent to the motion controller the
call returns to read the next line while the current line is executing.
If the next Gcode line is a jog move to an OB axis it processes that and dispatches that to the
controller. Unlike a coordinated move it can start imediately, thus you have Gcode executing
and you can still issue OB axis moves at the same time.

Craig
Title: Re: Old turret lathe
Post by: menardmfg on September 11, 2018, 08:53:27 AM
Craig,
Next question is does the motion controller store any moves in a buffer of sorts? So let’s say we tell the turret g00 t0.1, then we tell x and z to start to do their thing can we then tell axis t to g01 t-2.5? How would that be handled if the rapid isn’t done, does it have to wait until the turret rapid move is complete? Would that pause the next x and z move until the rapid is done, load the next turret feed move then continue on with the next x and z move? I’ve never done anything like this so forgive my ignorance.
Thanks
Art
Title: Re: Old turret lathe
Post by: Steve Stallings on September 11, 2018, 09:02:33 AM
The motion controller must use buffering to assure smooth uninterrupted motion.

It is up to the motion controller vendor to decide how much buffer. The motion
controller asks Mach4 for a packet of date and specifies the update rate and how
much data to provide. Mach4 does not send complete G code type motions to
the motion controller. Motion is broken down into many many small segments
typically only a few milliseconds long each. Thus it is Mach4 that determines
if two motions can proceed at the same time, and to provide that motion as
simultaneous small segments.
Title: Re: Old turret lathe
Post by: menardmfg on October 17, 2018, 12:02:47 PM
Ok guys, I have a motor set up on my turret. For test purposes I called it “c” axis and I set a DRO on my screen to monitor it. Now I’m lost as to how th write the g-code to get it to work separate from the other axis. Right now it will move the c axis and then go on to the others after it makes its move. Help needed please
Thanks
Art
Title: Re: Old turret lathe
Post by: menardmfg on October 18, 2018, 09:38:19 AM
Guys
I think I understand what Chad means by the DSP and DEP etc but I would like to do a pecking operation(to break chips). So I rapid to drill start position drill to say -.2 then back off .01 then continue to the -.4 back off .01 until it reaches drill end position. Then go to a drill clear position. So I’m not a lua guy what would that macro look like.
Thanks
Art
Title: Re: Old turret lathe
Post by: Cbyrdtopper on October 18, 2018, 10:36:33 AM
Art,
You could use a pecking drill cycle in the code. G83.1 Deep Hole Peck Drilling or G73.1 Peck Drilling. 
For reference see Page 64 and 65 of the Lathe G Code Programming Manual.