Hello Guest it is April 25, 2019, 12:34:03 PM

Author Topic: Newbie questions about circle pocket cutting  (Read 6516 times)

0 Members and 1 Guest are viewing this topic.

Newbie questions about circle pocket cutting
« on: October 15, 2008, 04:38:15 PM »
Hello all.  I recently bought a Zenbot from ebay, and a Xylotec control board, and of course Mach3!  I'm trying to learn gcode well enough to create some small circular parts in Plexiglas, so I'm posting here to hopefully learn from the collective wisdom of others. :)

I found the circular pocket wizard, and after some messing around with it I managed to cut a part that's very close to what I need.  But, I don't understand what it's doing, just that "it works" -- which is a problem when I want to tweak something.

For example, I generated the meat of the gcode below with the wizard, then added some stuff at the end to finish up the part.  But now I want to try cutting the main circular pocket 1/64" smaller in diameter, to see if that provides a snugger fit.  Seems like that should be a simple change, but I'm at a loss.  I could start the wizard over again and make all new code but that's kind of buying a fish instead of learning to fish, if you know what I mean. :)  Is there a wizard tutorial somewhere that explains how these arcs work?  I found several general gcode tutorials on the wider internet, but it seems many programs use different gcode syntax, and I want something Mach3 specific.

Secondly, once this is perfect I want to stick it in a subroutine.  I'm going to want to cut many of these parts out of a single sheet of Plexiglas, so I figure I can have a main program that's just "move to location, call routine to cut part, move to next location, call routine, etc."  But the wizard spits out absolute coordinates, how can I convert them to relative coordinates so they can go in a subroutine?   Or is there a better way to accomplish what I'm trying to do?

I appreciate any suggestions.  Thanks! :)

Code: [Select]
(=== Initialization stuff  ===)
G0 G49 G40  G17 G80 G50 G90
M6 T1(TOOL DIA.0.125)
G64
G20 (Inch)
M04 S0
G00 G43 H1  Z0.1
X0 Y0

(=== Magic voodoo arcs generated by the wizard, to cut main recess ===)
G01 Z-0.0625 F3
G3 Y0 X0.1187 R0.0594 F5
Y0 X-0.1187 R0.1187
Y0 X0.2374 R0.1781
Y0 X-0.2374 R0.2374
Y0 X0.3561 R0.2968
Y0 X-0.3561 R0.3561
Y0 X0.4375 R0.3968
Y0 X-0.4375 R0.4375
X0.4375 Y0 R0.4375
Y0.0625 X0.375 R0.0625
G00 Z0.1
X0 Y0
G01 Z-0.125 F3
G3 Y0 X0.1187 R0.0594 F5
Y0 X-0.1187 R0.1187
Y0 X0.2374 R0.1781
Y0 X-0.2374 R0.2374
Y0 X0.3561 R0.2968
Y0 X-0.3561 R0.3561
Y0 X0.4375 R0.3968
Y0 X-0.4375 R0.4375
X0.4375 Y0 R0.4375
Y0.0625 X0.375 R0.0625
G00 Z0.1
X0 Y0

(=== Smaller recess-within-recess, written by hand ===)
G01 Z-0.15625 F3
X0.09375
G3 I-0.09375 F5
G00 Z0.1
X0 Y0

(=== Outer cut to remove part from material, written by hand ===)
X0.625
G01 Z-0.0625 F3
G3 I-0.625 F5
G01 Z-0.125 F3
G3 I-0.625 F5
G01 Z-0.1875 F3
G3 I-0.625 F5
G01 Z-0.210 F3
G3 I-0.625 F5

(=== wrap up ===)
G00 Z0.1
X0 Y0

M5 M9
M30

Offline Graham Waterworth

*
  • *
  •  1,851 1,851
  • West Yorkshire, England
    • View Profile
Re: Newbie questions about circle pocket cutting
« Reply #1 on: October 15, 2008, 06:51:55 PM »
Hi Jinca,

the idea of the the wizzards is to make it easy to produce code without any g-code knowledge.  The idea is you recreate the code as needed.

If you want to write your own code then the easy way to produce a circle is like this

If we want to cut a 1.000" dia hole with a 1/8" dia cutter.

G00 G90 X0 Y0 Z1. (move to centre of circle)
Z.1 (safe start point in Z)
G01 Z-.0625 F3. (feed to depth in Z axis)
G91 X.4375 (change to incremental moves and feed out to hole rad-cutter rad)
G03 I-.4375(move CCW to form circle)
G00 G90 X0 (back to absolute and centre of hole)
Z.1 (up in Z to safe height)

To change this into a sub :-

O0001
(main program)
G20 G40 G80
G00 G90
T1 M6
M98 P0002
M30

O0002
(this is a sub)
G00 G90 X0 Y0 Z1. (move to centre of circle)
Z.1 (safe start point in Z)
G01 Z-.0625 F3. (feed to depth in Z axis)
G91 X.4375 (change to incremental moves and feed out to hole rad-cutter rad)
G03 I-.4375(move CCW to form circle)
G00 G90 X0 (back to absolute and centre of hole)
Z.1 (up in Z to safe height)
M99

The magic of putting holes any where is done with G52

O0001
(main program)
G20 G40 G80
G00 G90
T1 M6
G52 X0 Y0 (clear any existing G52)
M98 P0002 (jump into sub)
G52 X2. Y2. (datum shift 2" in X&Y )
M98 P0002 (jump into sub)
G52 X0 Y0(cancel datum shift ** very important **)
M30

O0002
(this is a sub)
G00 G90 X0 Y0 Z1. (move to centre of circle)
Z.1 (safe start point in Z)
G01 Z-.0625 F3. (feed to depth in Z axis)
G91 X.4375 (change to incremental moves and feed out to hole rad-cutter rad)
G03 I-.4375(move CCW to form circle)
G00 G90 X0 (back to absolute and centre of hole)
Z.1 (up in Z to safe height)
M99

Graham
America gave us powered flight, England the steam train and Germany the car.  Who invented the first boat?

Offline Sam

*
  • *
  •  987 987
    • View Profile
    • hillbillyhilton.com
Re: Newbie questions about circle pocket cutting
« Reply #2 on: October 15, 2008, 07:10:10 PM »
The wizards are a quick way to machine common tasks. When you specify a tool in the wizard, it calculates the diameter of the tool into the code. Notice there is no tool offset commands in the code (G42-G43,G40). There may be some wizards that work differently, I haven't looked at them all. If you need a smaller hole, you will haft to re-enter the wizard and change your numbers. That's the way I understand it, anyways. If you have a CAM package, most likely you will have the option to change your hole diameter by changing the tool number or diameter in Mach3. You could also do a wizard for roughing out the pocket, then write a simple circle path manually with tool comp, for the finish pass. This would allow you to make changes to the diameter.

Quote
Secondly, once this is perfect I want to stick it in a subroutine.  I'm going to want to cut many of these parts out of a single sheet of Plexiglas, so I figure I can have a main program that's just "move to location, call routine to cut part, move to next location, call routine, etc."  But the wizard spits out absolute coordinates, how can I convert them to relative coordinates so they can go in a subroutine?   Or is there a better way to accomplish what I'm trying to do?

There are many ways to accomplish this, and it basically boils down to personal preference on the methods you choose. Chapter 7.7, and Chapter 10 of the manual may deserve a good reading. I'm not the village expert on subs and G-code, so I will not go into detail.
"CONFIDENCE: it's the feeling you experience before you fully understand the situation."

Offline Sam

*
  • *
  •  987 987
    • View Profile
    • hillbillyhilton.com
Re: Newbie questions about circle pocket cutting
« Reply #3 on: October 15, 2008, 07:13:04 PM »
Ahhh, I see the village expert helped out as I was replying. Graham is as good as gold on this sort of stuff! I still recommend downloading the manual and keeping it for reference. It is very informative and well written.
"CONFIDENCE: it's the feeling you experience before you fully understand the situation."
Re: Newbie questions about circle pocket cutting
« Reply #4 on: October 16, 2008, 05:25:05 PM »
Thank you for the assistance!  I'll try out that code, Graham.  And I'll read through those sections of the manual that you recommended, Sam.  Very much appreciated!

Offline RICH

*
  • *
  •  7,313 7,313
    • View Profile
Re: Newbie questions about circle pocket cutting
« Reply #5 on: October 16, 2008, 09:18:52 PM »
Hey Graham,
Always appreaciate your code posts and the little extras thrown in as I pick up a lot from them.
Hat off to you.
Rich
Re: Newbie questions about circle pocket cutting
« Reply #6 on: October 21, 2008, 01:40:23 PM »
Ok, so, I ran a test, and I've got a couple follow-up questions. I took Graham's gcode and tweaked it a bit to fit the measurements I need, and used the wizard to generate a spiral pocket to stick in the sub. 

The first part cut perfectly, all measurements exact.  The offset move to the second part was right.  But the second part was somehow different from the first, even though it used the same gcode from the sub!  So something has to be wrong with the table, yes?  There's no way the same code could make two parts that aren't exactly the same, right?

Two things were wrong with the second part.  First, the main circular pocket was just a tiny bit smaller -- slightly less than 1" in diameter.  These parts fit like a cap on something 1" in diameter, and the first part fits perfectly, the 2nd part you really have to work to jam it on.  So, probably less than 1/64" difference, but noticeable for my application.  I need to buy some calipers to measure exactly how far off it is.

Second, the Z depth is too deep on the 2nd part.  There's supposed to be a circular pocket inside a circular pocket, and on the 2nd part, the inner pocket goes clear through the part, making a hole instead of a pocket.  Again the difference is probably only 1/32 or less, but that's too much for my application.

Some thoughts I had about possible causes:

-- Is my steps per inch off?  I'm using the settings given to me by the manufacturer of the machine -- Zenbot comes pre-assembled with motors and everything attached, so it should be right, but... what can I do to see if this is the problem?  I don't have one of those gauge blocks & dial test indicators the manual recommends for testing, do I need to buy one?

-- Maybe the heat from cutting the first part causes the bit to expand?  but that should make the pocket wider, not narrower, yes?  I'm using this 1/8" bit, is it too cheap to be reliable?
http://www.widgetsupply.com/page/WS/PROD/dremel-router-bit/D-AD06

-- Maybe the bit is moving in the "chuck" ?  It's only a dremel after all, and there isn't a proper chuck.  I've got it tightened down as much as I dare without risking breakage.  This might explain the depth problem, but why is the pocket smaller? 

I recognize that I'm using a low-end machine, and a certain lack of precision is to be expected.  But if anything can be done to fix this, I want to try it.  Does anyone have suggestions?

Oh, and here's the gcode I'm using:
Code: [Select]
(====================================================================================)
(START main program)
(====================================================================================)
O9999
(=== Initialization stuff ===)
G0 G49 G40  G17 G80 G50 G90
M6 T1(TOOL DIA.0.125)
G20 G64 (Inch, constant velocity)

G52 X0 Y0 (clear any existing G52)
G00 G90 X0 Y0 Z0.1  (move to origin, safe Z)

(=== Start cutting ===)
G52 X0 Y0 (clear any existing G52)
M98 P1000  (call sub to cut 1st part)

G52 X0.0 Y1.50 (datum shift coordinates)
M98 P1000  (call sub to cut 2nd part)


G52 X0 Y0(cancel datum shift ** very important **)
G00 Z0.10 (rapid to safe Z)
M30 (end and rewind)
(====================================================================================)
(END main program )
(====================================================================================)



(====================================================================================)
(START subroutine )
(====================================================================================)
O1000
G00 G90 X0 Y0 Z0.1 (move to centre of circle, which is 0,0 as defined by datum shift in main)

(=== spiral arcs generated by the wizard, to cut main circular pocket ===)

G01 Z-0.078125 F3
G2 Y0 X0.0938 R0.0469 F6
Y0 X-0.0938 R0.0938
Y0 X0.1875 R0.1407
Y0 X-0.1875 R0.1875
Y0 X0.2813 R0.2344
Y0 X-0.2813 R0.2813
Y0 X0.375 R0.3282
Y0 X-0.375 R0.375
Y0 X0.4375 R0.4063
Y0 X-0.4375 R0.4375
X0.4375 Y0 R0.4375
G00 Z0.1
X0 Y0
G01 Z-0.140625 F3
G2 Y0 X0.0938 R0.0469 F6
Y0 X-0.0938 R0.0938
Y0 X0.1875 R0.1407
Y0 X-0.1875 R0.1875
Y0 X0.2813 R0.2344
Y0 X-0.2813 R0.2813
Y0 X0.375 R0.3282
Y0 X-0.375 R0.375
Y0 X0.4375 R0.4063
Y0 X-0.4375 R0.4375
X0.4375 Y0 R0.4375

G3 I-0.4375 F5 (=== around again ===)

G00 Z0.1
X0 Y0


(=== Smaller circular pocket within main circular pocket ===)
G01 Z-0.1875 F3
X0.09375
G3 I-0.09375 F5
G3 I-0.09375 F5  (=== around again ===)
G00 Z0.1
X0 Y0

(=== Outer cut to remove part from material ===)
X0.609375
G01 Z-0.0625 F3
G3 I-0.609375 F5
G01 Z-0.125 F3
G3 I-0.609375 F5
G01 Z-0.1875 F3
G3 I-0.609375 F5
G01 Z-0.210 F3
G3 I-0.609375 F5

(=== wrap up, move back to center hole and safe Z ===)
G00 Z0.1
X0 Y0

M99 (return from sub)
(====================================================================================)
(END subroutine)
(====================================================================================)

Offline Graham Waterworth

*
  • *
  •  1,851 1,851
  • West Yorkshire, England
    • View Profile
Re: Newbie questions about circle pocket cutting
« Reply #7 on: October 21, 2008, 02:26:11 PM »
how is the work fastened down on the machine, is it possible the tool is lifting the job, this would cause the parts to be the wrong size and the wrong depth.

Graham
America gave us powered flight, England the steam train and Germany the car.  Who invented the first boat?
Re: Newbie questions about circle pocket cutting
« Reply #8 on: October 21, 2008, 02:42:17 PM »
Hmm.  I guess that could be.  The table has threaded holes, so I bought large fender-washers to put around bolts at the corners of the plastic. The bolts don't go through the material, the washers just "hang over" the material to hold it down.  We're talking about only a 6 x 8 inch piece of Plexiglas here, so I thought that'd be enough. 

But if that's the most likely cause, I'll attempt to mess around with alternate clamping solutions and try a few more cuts.  Thanks!

Offline Graham Waterworth

*
  • *
  •  1,851 1,851
  • West Yorkshire, England
    • View Profile
Re: Newbie questions about circle pocket cutting
« Reply #9 on: October 21, 2008, 04:12:12 PM »
It is enough to hold the edges down but it can also force the middle up.  See picture.

Graham

America gave us powered flight, England the steam train and Germany the car.  Who invented the first boat?