Hello Guest it is March 29, 2024, 06:29:32 AM

Author Topic: [GCode] Newbie question, Thanks  (Read 14084 times)

0 Members and 1 Guest are viewing this topic.

[GCode] Newbie question, Thanks
« on: April 01, 2008, 05:15:33 AM »
Hello, back again

Learning how to do welding in school and keeping those grades 90+ takes a lot of time
But i been interested in this Mach3 cnc once again

I was playing around with coding (programming) the other day, and i seen how the object (model) display will get bigger to accomidate the size of the code that was added (didnt realize this before)


I was curious about 2 things.

1. when i was coding, id put in my next destination to the X or Y axis( ex: X -1.850) and the line would go in a totally opposite direct in comparision to my last plot. 
for instance .. if i went down 2 , right 2, up 1 and i wanted to go Left 1 (id input half of the distance (1) to go half way, but A) it wouldnt be near half way or it would go in a totaly opposite direct)

1a) i was wondering, is there a visual guide, a graph or something to kind of help indicate the plotting numbers for beginners, similar to a multiplication chart or something, with numbers along the bottom, up the side, so you could estimate your next position, put it in, trial and error to get it perfect?

or are these plotted using measurements on the blueprint? or is this something that is developed over time?

2) i was wondering if there was an easier way to Code using the program itself

I have been editing a TxT file, saving it as Test1 .. loading it, checking my plot, which would be wrong .. edit Test1, save as Test, load test, check plot (kind of time consuming)
Is there a way to imput a plot using the program and being able to see the next plot instantly? (saving time and making guessing/trial and error much faster)


Thanks you very much for any help or assistance. This is something that i WILL eventually learn, just need a little help along the way :)

Thanks again and very much appreciated



Offline Sam

*
  • *
  •  987 987
    • View Profile
    • hillbillyhilton.com
Re: [GCode] Newbie question, Thanks
« Reply #1 on: April 01, 2008, 07:44:32 PM »
Quote
when i was coding, id put in my next destination to the X or Y axis( ex: X -1.850) and the line would go in a totally opposite direct in comparision to my last plot. 
Well, the first question that comes to mind is...are you programming in absolute mode or incremental? I think absolute mode is pretty much what everybody uses.
Quote
for instance .. if i went down 2 , right 2, up 1 and i wanted to go Left 1
If you were at X 0.0 Y0.0 it would be
y-2.0
x2.0
y-1.0
x1.0

and you would get this in absolute mode....
 |
 |      _ _
 |          |
 |_ _ _ _|

In Incremental mode, the same program would look like this

 |
 |
 |
 |_ _ _ _
            |
            | _ _

In Incremental mode, the last position moved, becomes your new X0.0 Y0.0 point. Absolute mode is much more easy on the brain. On my brain it is, anyhow. Think of absolute like the grid on the game Battleship. The points stay where there supposed to and don't change. (unless you tell them to, but this is basic so...crawl before ya walk)

Quote
i was wondering, is there a visual guide, a graph or something to kind of help indicate the plotting numbers for beginners, similar to a multiplication chart or something, with numbers along the bottom, up the side, so you could estimate your next position, put it in, trial and error to get it perfect?
Well the first thing that comes to mind for a visual aid is this....
load up the famous roadrunner tap file that comes with mach. ( any file will do, but you hafta load something so mach can scale something to the display.)
Go to the MDI screen. Type in "x0.5" and hit the enter key.( or "x0.5 y.125" or "g90 g01 x1 y-2 f20 t1" or whatever else.) The point on the screen will move for a visual aid for what you just typed.  There are simulators out there, but none that are free have ever impressed me. Mach beats them hands down, in my opinion. There are some really nice ones too, but they cost allot of money.
Quote
2) i was wondering if there was an easier way to Code using the program itself
If your doing simple shapes and learning, nothing could beat doing it by hand just so that you get the understanding of whats going on. Once you start doing complicated stuff, you will want/need some sort of cad and cam software. When you get that far along, "easier" has gone out the window long ago.
Now a bit of a personal rant......
Quote
Learning how to do welding in school
I have welded for many years. ITS HOT!!! It's bad on your lungs. Its bad on your nervous system. ITS HOT!!! Its bad on your eyes. Its bad on your skin. Its dirty. Its smelly. ITS HOT!!! Its just plain bad. Don't get me wrong, it is a valuable asset to me. I'm very very very glad I know how. However, doing it for a living is a completely different ballgame (been there, done that). I would HIGHLY advise also learning machining, because you obviously have an interest in it, or you wouldn't be here asking questions. The two do go hand-in-hand on most jobs. I still have to do it now and again, and it is definitely a requirement. I will never forget the words a prior boss told me...Go ahead and quit, I can always find another welder on any street corner. I did quit, and he did find another welder to take my place. Nobody can tell you, "go ahead and quit, I can find another programmer at the drop of a hat" Just food for thought. There are downsides to machining.
1. Vehicle floor mats should be considered a company expense. Kind of like gloves and a pair of greens are for welders.
2. I can be walking from the Kitchen to the living room, and like magic, I can get a steel sliver in my foot.

"CONFIDENCE: it's the feeling you experience before you fully understand the situation."

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: [GCode] Newbie question, Thanks
« Reply #2 on: April 01, 2008, 07:51:54 PM »
Hi,

Machines work from a datum point, this can be set anywhere within its working envelope, you can then work in absolute movements or incremental moves.

Absolute (G90) commands work from the datum point to the commanded position.

Incremental (G91) commands work from the current point and move the commanded amount.

E.G. to move in a 2" square using absolute the code would look like this :-

G20 G40
G00 G90 X0 Y0
G01 X2. F10.
Y-2.
X0
Y0
M30

And the same in incremental :-

G20 G40
G00 G90 X0 Y0
G91
G01 X-2. F10.
Y-2.
X2.
Y2.
M30

I hope this helps.

Graham.
Without engineers the world stops
Re: [GCode] Newbie question, Thanks
« Reply #3 on: April 02, 2008, 08:39:44 PM »
Thanks very much for both the posts, very helpful and much appreciated

Gonna practice making some simple shapes and stuff just to get it figured out, its gonna be pretty neat once i get it all figured out
i'll get it, just need some time :) i taught myself how to model with 3d programs and animate them, this seems kinda similar but much more percise

I was wondering if you could tell me what these plots do

G20 G40           ----- what would these plots do?
G00 G90 X0 Y0  ----- guessing these set the start point, determine incremential or absolute and position x/y at 0
G01 X2. F10.     ----- what would these plots do?
Y-2.
X0
Y0
M30                 ----- guessing this plot ends the code?

Thanks very much for the help, it really is much appreciated


2 months away from finishing my first year welding, just finished fluxcore today and tomorrow starting Tig, been interested in doing tig for a while, wanna learn how to get those nice clean beads, should be interesting

and yes welding is pretty dirty, although i dont mind getting dirty myself, i have been using a resperator ever since i started, cuts down on the smoke and fume inhalation a lot. People in my class dont wear any resparator with SMAW, GMAW or FCAW, with flux, as im sure you know, theres A lot of smoke. They just breath it on in, not to safe

been burned a few times already, all part of the game i soppose.
Re: [GCode] Newbie question, Thanks
« Reply #4 on: April 03, 2008, 12:02:06 AM »
Been practicing some words. one thing im not sure of, would be how to code ,, when the drill would life upwards along the Z axis and move to a new letter or a new start point, then go down on Z axis and continue on course

getting there tho, as you can see, it kinda goes back on itself (wrong way to do it i know)

G20 G40
G00 G90 X0 Y0
G01 X0.25 Y-2 F10.
X0.5 Y-0.5
Y-2 X0.75
X1 Y0
X1.5 Y0
Y-1.75
Y-1 X1.5
Y-1 X2
X2 Y-1.75
X2 Y0
X2.5
Y-1.75
Y-1.75 X3.5
Y-1.75 X2.5
Y-1 X2.5
Y-1 X3
Y-1 X2.5
Y-0.25 X2.5
Y-0.25 X3.5
Y-0.25 X2.5
X2.5 Y0
X4
Y-1.75
Y-1.75 X5
Y-1.75 X4
Y-1 X4
Y-1 X4.5
Y-1 X4
Y-0.25 X4
Y-0.25 X5
Y-0.25 X4
X4 Y0
M30

Thanks for help so far

Offline Sam

*
  • *
  •  987 987
    • View Profile
    • hillbillyhilton.com
Re: [GCode] Newbie question, Thanks
« Reply #5 on: April 03, 2008, 12:25:24 AM »
The code list that are within mach can be helpful. The manual in the downloads section goes into pretty good detail of any questions you can dream up. They really did a good job with the manual. I certainly did not mean to down you on going to school for welding. I hope I didn't come across that way. If you feel comfortable with 3dsMax, Maya, Rhino, or whatever, you can use those to make designs, and export them to a cam program for g-code creation when you get that far along. Rhino even has a plugin to do the cam portion. Congrats on your first year of school!!
"CONFIDENCE: it's the feeling you experience before you fully understand the situation."
Re: [GCode] Newbie question, Thanks
« Reply #6 on: April 04, 2008, 06:33:20 AM »
Thanks

its interesting that something can be modeled and imported into Mach3, that could be very usedful

for now, i got the rapid positioning G00 and linear interpolation G01 kinda figured out, making a code with a 6x 5 box that gets machined out by Z-0.25 depth each time, but the whole box gets smaller by X/Y0.25 each time

I made the mistake of doing the perimeter only and then dropping down to the next level, instead of doing the perimeter and cutting away the whole top, Then moving to next level and repeat, getting the hang of it

Next i need to learn how to use the G02 and G03 circular interpolation (counter/clockwise radius cuts)

i'll post my practice code after and anyone who feels like it could give me some constructive criticism, id appreciate it

Thanks in advance
Re: [GCode] Newbie question, Thanks
« Reply #7 on: April 05, 2008, 07:18:58 AM »
finished my first practice code, just trying to wrap my mind around how to use x/y/z axis, here is the code

Next i wanna learn some circular coding and learn how to make code to perfect measurement/scale

Feel free to add some constructive criticism



G20 G40
G00 G90 X0 Y0
G00 Z 0.075 X1 Y-1
G01 Z-0.25 F10.
 X6
 Y-5
 X1
 Y-1
 X6
 Y-1.50
 X1
 Y-2
 X6
 Y-2.50
 X1
 Y-3
 X6
 Y-3.50
 X1
 Y-4
 X6
 Y-4.50
 X1
 Y-5
 X6
G00 Z0.075
 X1.25 Y-1.25
G01 Z-0.50
 X5.75
 Y-4.75
 X1.25
 Y-1.25   
 X5.75
 Y-1.75
 X1.25
 Y-2.25
 X5.75
 Y-2.75
 X1.25
 Y-3.25
 X5.75
 Y-3.75
 X1.25
 Y-4.25
 X5.75
 Y-4.75
G00 Z0.075
 X1.50 Y-1.50
G01 Z-0.75
 X5.50
 Y-4.50
 X1.50
 Y-1.50
 X5.50
 Y-2
 X1.50
 Y-2.50
 X5.50
 Y-3
 X1.50
 Y-3.50
 X5.50
 Y-4
 X1.50
 Y-4.50
 X5.50
G00 Z0.075
 X1.75 Y-1.75
G01 Z-1
 X5.25
 y-4.25
 X1.75
 Y-1.75
 X5.25
 Y-2.25
 X1.75
 Y-2.75
 X5.25
 Y-3.25
 X1.75
 Y-3.75
 X5.25
 Y-4.25
G00 Z0.075
 X2 Y-2
G01 Z-1.25
 X5
 Y-4
 X2
 Y-2
 X5
 Y-2.50
 X2
 Y-3
 X5
 Y-3.50
 X2
 Y-4
 X5
G00 Z0.075
 X2.25 Y-2.25
G01 Z-1.50
 X4.75
 Y-3.75
 X2.25
 Y-2.25
 X4.75
 Y-2.75
 X2.25
 Y-3.25
 X4.75
 Y-3.75
G00 Z0.075
 X0 Y0
M30
« Last Edit: April 05, 2008, 07:20:56 AM by WH33LS »
Re: [GCode] Newbie question, Thanks
« Reply #8 on: April 08, 2008, 06:45:28 AM »
Hi this is my 1st post on this site and i am only a newbie myself (1st year fitter machinest) so make sure you double check what i say with somebody else as i may be wrong. But as i have lernt  in a hurry is safty margins in programs they are especially handy when running a program for the first time as when your using a mill your playing with big $$$$.

So having said that if i was to write the program you have written it would be somthing like this.

GO G91 G40 G49 G80 G17 G28 ZO ( THIS LINE IS THE FIRST LINE I USE FOR EVERY PROGRAM IT CANCELLS ALL OFF SETS AND MAKES SURE THE SPINDLE ITS AT Z 0 )
T1 M6 H1 ( THIS LINE WILL SELECT YOUR TOOL GIVE THAT TOOL A HEIGHT AND MAKE SURE YOUR USING TOOL 1 (M6 = TOOL CHANGE)
S8000 M3 M8 ( THIS WILL GIVE YOUR TOOL A SPEED, A DIRECTON OF ROTATION AND TURN COOLANT ON)
G20 G40 (YOU SHOULDNT NEED THIS LINE ANYMORE AS IT IS COVERED IN MY FIRST LINE)
G00 G90 X0 Y0 (RAPID IN ABSOLUTE TO THE DATUM POINT)
G00 Z 0.075 X1 Y-1( IN THIS LINE I WOULD STOP AT Z 5.0 AND FEED FROM 5 MM ABOVE THE JOB I WOULD ALSO ADD M1 (WHICH IS OPTIONAL STOP) WHEN PROVING A PROGRAM THIS IS MAY SAVE A TOOL A JOB OR A MACHINE. BY STOPING 5MM ABOVE THE JOB YOUR ALLOWING FOR INCORRECT TOOL HEIGHT)
G01 Z-0.25 F10 (THIS LINE IS GOOD)

AT THE END IT WOULD BE SOMTHING LIKE


G0 Z5.0 (RAPID OUT OF THE JOB TO 5MM ABOVE THE JOB)
M5 M9 (SPINDLE STOP, COOLANT OFF)
G91 G28 YO Z0 (CAHNGE TO INCREMENTAL, REFERANCE POINT RETURN ON Z AND Y AXIS) (ALWAYS RETURN Z FIRST)
G49 (TOOL LENGTH OFFSET CANCEL , PROBERLY NOT NEEDED HERE BUT GOOD PRACTISE)
M 30 ( END PROGRAM PROGRAM RESET)
M30

Everyone has there own programing style and theres no reason why something else wouldnt work just as well as this.  I also realize a lot of people dont have tool changers etc but if your trying to learn programing its proberly good practise to put it in. Hope this is helps.
Re: [GCode] Newbie question, Thanks
« Reply #9 on: April 08, 2008, 05:16:03 PM »
Excellent , thanks very much for the post, very informative and im sure more then just myself will find it useful

was curious about a few things

"S8000 M3 M8 ( THIS WILL GIVE YOUR TOOL A SPEED, A DIRECTON OF ROTATION AND TURN COOLANT ON) "
how would you set the direction .. M3 ? would be counter / clockwise? (assuming 8000 is the speed and M8 would be coolant on (M9 coolant off))


"G00 Z 0.075 X1 Y-1( IN THIS LINE I WOULD STOP AT Z 5.0"
im guessing that instead of 0.075 i would used 5.0? or does it depend what type of measurement method i use (mm, cm, etc) or is mach3 specifically done using mm measurement?


"G01 Z-0.25 F10 (THIS LINE IS GOOD)"
what would F10 mean?



Again thanks very much for your time for explaining and posting, greatly appreciated and im sure more then just myself is benefitting from it

also curious if you noticed anything wrong with my practice code itself? Thanks again