Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: DaveDoesIT on July 12, 2008, 06:46:56 PM

Title: I could use a GCode file for Lathe
Post by: DaveDoesIT on July 12, 2008, 06:46:56 PM
Hi People,

Still trying to get my Emco 5-PC to do more than just jog.

Could someone point me at a GCode file (or paste on in a reply) for a simple part so I can test this thing.

I am not sure if the problem is in my GCode file or the machine at this point.

I have not done lathe stuff before so I am flying a little blind.

I checked the "Shard GCode" group but nothing there.

Thanks in advance.

Dave
Title: Re: I could use a GCode file for Lathe
Post by: Hood on July 12, 2008, 06:52:51 PM
Easiest thing would be to open one of the wizards and just enter the dimension in it to get some code for testing.
 I can post some code for you but my lathe has custom Mcodes for spindle so possibly it wouldnt be the best for testing.
 What exactly are you having a problem with?
Hood
Title: Re: I could use a GCode file for Lathe
Post by: DaveDoesIT on July 12, 2008, 07:26:01 PM
What exactly are you having a problem with?

Hi Hood,

<grin> I am on a steep learning curve here, never done lathe stuff before (lotsa serious mill stuff professionally), I have never used Mach3 before and I have never used anything Enco before so flying blind may be a bit of an understatement.

I have not tried using the wizards but will scoot out to the garage and give them a shot.

Basically I would like a small Gcode file that is known to work with the 5PC and Mach3. That removes me and the XP computer from the loop. I am sure I will pick up the lathe stuff quickly but for now I would just like to see  it make correct moves and cut a simple part.

Once I have done that I can evaluate whether to keep the Emco electronics or jump up to Geckos and 150 oz-in motors with 1:1 gearing as Ron described.

Thanks for the reply.

Dave
Title: Re: I could use a GCode file for Lathe
Post by: Hood on July 12, 2008, 07:41:34 PM
I am new to CNC Lathes as well, have been using the mill with Mach for 4 yrs or more but its just really the last 3 months or so that the lathe has been functioning. I thought the lathe would be much easier than the mill as it only has two axis as opposed to 3 of the mill, I was wrong :D There are just so many more things you have to think about with the lathe especially when you have a rear turret with 6 tools sticking out of it and you have to think about clearance issues with the chuck jaws, tailstock etc. Add to that a Front tool post that has drills and boring bars in it and things can soon lead to crashing,scraping and banging sounds if not carefull :D

The wizard should let you do some simple code which should do for your lathe, might even just be good enough to hand code a few lines to get into the way of it.

Hood
Title: Re: I could use a GCode file for Lathe
Post by: DaveDoesIT on July 12, 2008, 08:16:41 PM
and things can soon lead to crashing,scraping and banging sounds if not carefull :D

The wizard should let you do some simple code which should do for your lathe, might even just be good enough to hand code a few lines to get into the way of it.

Hi Hood,

Thanks again for the reply. I tried two wizards and managed to make one work for turning a taper. The only thing was it cut the taper in reverse! :)

It also moves in to the material rather than away from on it on the clearance returns. The Z axis is correct but the X is reversed. Not being familiar with Mach3, I have not yet found how to change that. Maybe it is all in the Plus and Minus signs in the wizard.

I think I might just scrap the whole idea of using this lathe and dump it at the local thrift store for a tax deduction.

Mach3 seems quite difficult to learn compared to mainstream CNC stuff for mills and I am not sure I can be bothered. I don't have any projects in mind for the lathe, I just bought it as it seemed like a good deal for 300-bucks, in barely used condition.

I can now see why it was priced so. LOL

Dave
Title: Re: I could use a GCode file for Lathe
Post by: RICH on July 12, 2008, 08:29:58 PM
Dave,
I started with MACH Turn. Using a little barebones Sherline with no limit swithes etc and have the gcode for a number of parts for a model kit I'm making. So if you want some tested files that worked I can post. The stuff is on the small side of things, like 1/8" to 1" stock will be required but at least you can play around for pennies. I would also recomend starting with the wizards, just take a few seconds to look at how the cutting is done as it may define what kind of tool you need to use.
Do you use a CAD program?
I made a post some time ago about using Lazycam for the lathe. For that I can give you a pesky little file that works
but some reason was a challenge when I first started using Lazycam. So it may help in the learning curve.
Your nickle,
RICH
Title: Re: I could use a GCode file for Lathe
Post by: RICH on July 12, 2008, 08:51:17 PM
Dear Dave,
After reading your post, I just must say this, you will think you died and went to heaven when you get a lathe working in MACH.
It takes some learning but it's worth the effort. I am sure you can drive a car but i would bet money you couldn't just place yourself into my 66 mustang and drive it 20 feet! As a convert weening myself off another program, there are some things, manny things, that in the big picture MACH gives you. But then it's your decision.

RICH
Title: Re: I could use a GCode file for Lathe
Post by: Chip on July 12, 2008, 09:53:59 PM
Hi, Dave

It's not bad, To reverse your X axis, Config, Homes and Limits page, X "reverse" collum, change state.

Z- moves to spindle, X- moves to center (front tool pos.).

Lathe G-code can be created in many ways, Hears just a couple of moves.

g90 ; ABS mode
g20 ; Inch mode
G00 x0 z0; start end of stock center tool x Z and zero axies
G01 x.5 F5; X moves out .5 at f5 speed
G01 Z-1.0 ; Z moves tordes spindle 1.0 f5
G01 X.45  ; X moves in .05 f5
G01 Z0    ; Z moves
G01 X.45 Z-0.050 ;X Z move
G01 x.40 Z0 ;X Z move
G01 Z0    ; Z moves away from spindle to start point
G01 x0    ; X moves to start point

M30 ; Prog return to top
%

Don't Give UP, Chip
Title: Re: I could use a GCode file for Lathe
Post by: jimpinder on July 13, 2008, 04:10:39 AM
We are firing code at Dave - but I think he needs to know how to get started - perhaps.

The most important thing is - where is your 0.0 position in your code.
The X0 position is usually down the centreline of the lathe. The Z0 position is normally on the end of the workpiece. So -

Put a piece of barstock in the machine, and jog up to it and take a facing cut across. (You can do this with the jog buttons, if you run the speed down to about 10%) Zero your Z axis.
Move your tool out, and down the barstock a little, and then, with the jog, touch the tool on the stock. This is you X position, but you need to measure the diameter (or radius) of the barstock and enter it into the X DRO. You can run the lathe in either diameter mode, or radius mode, which ever you feel more confident with. In diameter mode, you enter all X axis workings to the finished diameter you want, in radius mode, you have to half these (obviously) .

Z minus is towards the chuck, Z plus is away from it. X minus is towards the centreline, X plus is away from it. If you enter in the MDI line (not jogging becasue the jog buttons are changable) a plus move and check if the axis goes the right way. If it does not, then on your Config/Ports and Pins/Motor Outputs, change the DIR pin to "Active Low" or vica versa. This will reverse the movement of the axis. You will then need to check your jogging buttons and make sure they move the axis the same way - Config/Hotkeys

A lot of lathe work is repetative, as Hood said, and, therefore, a lot of us make use of macros for say thinning down barstock, where you might make 10 cuts to get down to where you need - all the cuts are the same, just 20 thou or so deeper.

On page one of my lathe, I have several User DROs which I can fill in with lengths, cut, feed and radius etc, and I have written several macro's to take this information, and then write the GCode - rather like the wizards - but it writes the code on the fly, whilst the machine is running. You are welcome to my lset, and macros if you would like them. They do simple work, like facing, thinning down, cutting axle ends (two different diameters), boring, and rounding off bar ends. I work in steel.

Keep at it, when the machine starts running as you want it, it gives you a nice buzz - but then you have to run round getting rid of all the shavings it makes - and it makes them faster than you can get rid of them.





Title: Re: I could use a GCode file for Lathe
Post by: DaveDoesIT on July 13, 2008, 05:12:38 PM
We are firing code at Dave - but I think he needs to know how to get started - perhaps.

Hi guys,

Thanks for all the encouragement, I will stick at it for a while longer then.

Jim you have hit the nail on the head. Just reading your posting has made a lot of stuff clear. I had been trying to figure it out by trial and error. As you and Hood have alluded to,  I have no idea what I am doing with this lathe stuff. Thanks for taking the time to outline the basics to get me started.

Thanks to all for the offer of code and macros etc, and I may take up all offers, but I will give the current suggestions some work before I get to the tricky stuff.

I will give it all a shot tomorrow as today I have sworn myself to getting my Tax stuff to the Accountant tomorrow as August extension time fast approaches and I am still procrastinating. <grin>

Dave
Title: Re: I could use a GCode file for Lathe
Post by: RICH on July 13, 2008, 07:55:37 PM
jimpinder,
Sounds like your lset and macros would be handy to use. Can you post them?
 
RICH
Title: Re: I could use a GCode file for Lathe
Post by: jimpinder on July 14, 2008, 05:45:28 AM
Rich -

Here is a taste of some I have put together in a single file. You will have to split them up and number then seperately m200 upwards, or something like that. Most of them designed to run metric or imperial, (despite what Hood says). There is no "preamble" to them so it is assumed that the user fill in G20 or G21, M3 in some cases, and anything else. They will run in either Gcode programs or stand alone MDI calls.

The are based on X0 being the centreline, and Z0 being the end of the workpiece.

The GetUserDRO codes are shown at the side of the labels for convenience.
Title: Re: I could use a GCode file for Lathe
Post by: Hood on July 14, 2008, 07:01:01 AM
Rich - (despite what Hood says).


??????? what do I say?

Hood
Title: Re: I could use a GCode file for Lathe
Post by: DaveDoesIT on July 14, 2008, 12:53:12 PM
Here is a taste of some I have put together in a single file. You will have to split them up and number then seperately m200 upwards

Hi Jim,

How do I use these? I looked at the /m1s file in notepad and it is empty. I looked at the .lset file in Notepad and it is full of control characters.

I loaded Turn but can't find an option to look at those file extensions.

Out of my depth, Dave :)
Title: Re: I could use a GCode file for Lathe
Post by: jimpinder on July 14, 2008, 03:50:09 PM
Hood - These run in Metric or Imperial (I hope) :D :D :D

Dave  - I'm sorry. For some reason the multi macro file is empty/ I have posted it again.

The lset file should be put in your Mach3 folder. You will probably see other set and lset files in there as well. Open Mach 3Turn and select View / Load screens from the top menu. This will open the Mach Folder and list - probably only the .set files. If you click "Files of type" you will see Turn Files .lset.  Click this and 1024.lset (your current set) and my Macro.lset should be shown. Select that and your screen display will change (not drastically) and on the Auto Page you will see I have juggled the Dro's around and added the User DRO set.
These User DRO's are persistant, and will remain even after switch off. So when you use them, ensure that only relevant information is in each one. If not required, enter a zero.
 
The Multi Macro file should be opened when you are in Mach3 (It should also open with Notepad - but in Mach 3 key words are different colours, which makes it easier to read)
If you open Operator/VBScript Editor you get a window. Go to File/Open and then select MultiMacro from whereever you downloaded it to.
I have just put three Macro's in this file - each one has a preamble of Rem remarks. If you either cut and paste, or better still just copy the three parts into seperate files, into the Macro folder in Mach3, each file should be M200 or similar number starting at 200 (with M prefix).
The macros have no preamble on them - they start work immediately, so you must start the spindle, coolant, etc G20 or G21 for yourself. They can either be used as stand alone macros, on the MDI line, or incorporated in GCode programs.
As I said in an earlier post, they are written with X0 on the centreline and Z0 at the end of the workpiece.

I would suggest you test them first (possibly without a cutting tool in, or without the barstock in), just to make sure they actually do what you think they will do. I offer no guarantee that they will work - they do for me (or did last time I used them - a few days ago),
and I am hoping that any last minute tweaking I did is correct - but have a go.





Title: Re: I could use a GCode file for Lathe
Post by: Hood on July 14, 2008, 03:55:50 PM
Ah ok Jim, got you, you are referring to my joke in another thread about only the Americans and Jim Pinder using Inch LOL
Hood
Title: Re: I could use a GCode file for Lathe
Post by: Chip on July 14, 2008, 03:58:56 PM
Hi, Dave

Looks like the "multimacro.m1s" didn't make it, To load the "Lathe-Macro.lset" file, Click on View, Select, File-Type "Turn Files(Lset)", Find the

"Lathe-Macro.lset", (This file Needs/Should be in the, C:\Mach3 folder).

Get your feet on the ground first with basic lathe G-code.

Thanks, Chip
Title: Re: I could use a GCode file for Lathe
Post by: RICH on July 14, 2008, 08:06:48 PM
Thanks for the post Jimpinder and what to do with the files.  Will try them out in the near future.

How are things going Dave?

RICH
Title: Re: I could use a GCode file for Lathe
Post by: DaveDoesIT on July 15, 2008, 12:49:47 PM
Thanks Jim, Chip and others.

I am working on it.

Dave
Title: Re: I could use a GCode file for Lathe
Post by: jimpinder on July 16, 2008, 01:09:55 AM
Oh - was that a joke - you dour Scot!! ;D ;D ;D
Title: Re: I could use a GCode file for Lathe
Post by: DaveDoesIT on July 17, 2008, 04:40:45 PM
How are things going Dave?

Hi Rich,

Things are going well. I have things cutting the right shapes finally. I think the stock motors on the Emco 5PC are too slow so will try upping them to 160oz-in and Keling drivers. Gotta check finances first so may stay with the old set up for a while longer. I don't have any lathe projects for them so no great rush.

Thanks again to all who helped. It was very much appreciated.

Dave
Title: Re: I could use a GCode file for Lathe
Post by: RICH on July 17, 2008, 06:40:56 PM
Dave,
Glad to hear you didn't throw in the towel. Not having any specific projects is the ideal time to just play around
with the wizards, one by one, and then when the time comes, you can work with some confidence.
As far as slow movement goes, as a hobbiest,  if it takes 10 or 15 minutes instead of five, so what!
Enjoy the moment,
RICH