Hello Guest it is April 25, 2024, 09:05:53 AM

Author Topic: Polar Mode in Mach3 Mill  (Read 11428 times)

0 Members and 1 Guest are viewing this topic.

Re: Polar Mode in Mach3 Mill
« Reply #10 on: July 30, 2009, 09:31:42 AM »
To get the arcs to drill properly I used the code from vmax as a start and modified it as below.

Note that I declared all the parameters first.  Note the one related to the G16 such as center point etc are all assigned to 4 decimal places.

This drills 4 arcs,  two arcs of two rows of holes, 5 holes per arc, 15 deg apart, skipping the 90 deg position.

Some parameter assignments are not used in this code snippet.
It appears that the G81 is not completely modal when in G16 mode.  You must define the X and Y on each line.  True modality would not require this.  
So it appears that nesting a modal command in G16 has a minor shortcoming.

F40 G20 G90 G0
#24=0            ( SETS PARAMETER FOR X AXIS TO ZERO )
#25=0            ( SETS PARAMETER FOR Y AXIS TO ZERO )
#26=0            ( SETS PARAMETER FOR Z AXIS TO ZERO )
#40=0.0000
#41=0.0000
#42=0.0000
#43=0.0000
#60=0.0000
#61=0.0000            
#30=0.2686       ( WAS 2812 THEN 2801 NOW 2790 IS GAP BETWEEN TRACK HOLES 2686 IS FINAL VALUE)
#31=0.3740       ( GAP BETWEEN GROUPS OF HOLES WAS 3750 NOW 3740 )
#40=2.2187       ( X VALUE FOR CENTER OF LARGE ARC )
#41=11.2500      ( Y VALUE FOR CENTER OF LARGE ARC )
#42=1.2626       ( SMALL RADIUS FOR LARGE ARC )
#43=1.5312       ( LARGE RADIUS FOR LARGE ARC )
#50=-4.6000      ( Z DRILL DEPTH )
#51=[#50+0.600]  (RETRACT OR CLEARANCE FOR DRILLING )
#60=165.0000     ( STARTING ANGLE FOR LARGE ARCS JUST ABOVE 9 OCLOCK POSITION )
#61=210.0000     ( STARTING ANGLE FOR SMALL ARCS JUST BELOW 9 OCLOCK POSITION )

% THE LARGE ARC  PATTERN HERE.  THIS DRILLS TWO CIRCULAR ROWS OF HOLES ONE INNER, ONE OUTER AT SAME ANGLES
%  THE 90 DEG POSITION IS SKIPPED

G0 X#40 Y#41   (sets the pivot point)
G16
G81 x#42 y#60 Z#50 R#51 F16  ( in g16 mode the x becomes the offset from center and the Y becomes the degrees of rotation from the center of

offset)
X#43 Y#60 #60=[#60-15.00]   ( WE ARE DECREMENTING THE ANGLE BY 15 DEGREES AFTER EVERY 2 HOLES )
X#42 Y#60
X#43 Y#60 #60=[#60-15.00]
X#42 Y#60  
X#43 Y#60 #60=[#60-15.00]
X#42 Y#60  
X#43 Y#60 #60=[#60-15.00]
X#42 Y#60
X#43 Y#60 #60=[#60-30.00]   (  WE SKIP THE 90 DEGREE POSITION )
X#42 Y#60
X#43 Y#60 #60=[#60-15.00]
X#42 Y#60
X#43 Y#60 #60=[#60-15.00]
X#42 Y#60
X#43 Y#60 #60=[#60-15.00]
X#42 Y#60
X#43 Y#60 #60=[#60-15.00]
X#42 Y#60
X#43 Y#60
G15             ( cancells the g16)
G80
z0
X0y0
M30  
« Last Edit: July 30, 2009, 10:21:56 AM by small_rcer »

vmax549

*
Re: Polar Mode in Mach3 Mill
« Reply #11 on: July 30, 2009, 09:05:11 PM »
THat is a lot of code for a few simple holes (;-)

With the G15 the starting point of zero is always 3 o'clock.


Yes "with" the drill cycle x&y are required for each point only because of the nature of the G15 not the g81.

Yes it should run as g90 or G91 BUT the G91 is kinda busted it will do the circle properly but it offsets from pivot point.

HOPE that helps, (;-) TP

Yes the Math works if you want to calculate the points in Gcode

AND the NFW drill circle wizard does work well.

« Last Edit: July 30, 2009, 09:37:49 PM by vmax549 »
Re: Polar Mode in Mach3 Mill
« Reply #12 on: July 31, 2009, 04:27:49 PM »
Vmax  I must thank you for your guidance.  It got me over a frustrating delay.

Yup it is a lot of code for a batch of 20 holes.  But because it is parametric driven, it can be modded in a few seconds in any simple editor.  Could not get the L or  Loop to work cleanly, so did it with line pairs of code.  In fact this is part of the code that drills a cribbage board.  The main program will drill 3 boards in one fixture with 9 or 12 lines of code.  Has 4 subroutines of which the above is most of one of them.  Another very similar and two for the groups of holes.  One heading toward +Y and the other toward -Y.  Will be changing that to use only one, with the direction defined in the parameters.   All parametrically driven.  So can change the length of board, hole spacing, number of tracks etc with only a few changes in the header or parameter file.

I am really quite lazy and only want to write this once.  Want it to be as flexible as possible with the fewest lines.

Jim H




« Last Edit: July 31, 2009, 04:33:15 PM by small_rcer »

vmax549

*
Re: Polar Mode in Mach3 Mill
« Reply #13 on: July 31, 2009, 10:56:28 PM »
Don't get me wrong I love parametric code. I have wrote MANY MANY Param Gcode programs but in Fanuc macroB  Parametric code in MACH without conditional statements is a PAIN in the rear. There is a way around it thought.

ANother note you know that there IS a VAR monitor in MACH that lets you veiw the values of VARs

Also Brian Has hinted that he CAN create in MACH a Gcode window that can display the values of the vars as it runs parameteric code. Neat HUH?

ANd by the way the G16 in G91 mode IS fixed I tested it last night.

I would also consider Sub programming for that project.

Looks GOOD from here(;-) Keep up the good work

(;-) TP
What I was trying to achieve
« Reply #14 on: August 01, 2009, 06:53:47 PM »
4 pictures say it all.  Just the final fixtures to make on this machine.  1 hour 17 minutes 29 seconds 745 holes 1/2 inch deep. 

Jim H