Hello Guest it is April 25, 2024, 09:05:21 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Graham Waterworth

1131
Finished Screens / Re: Profile Shapes Wizard
« on: October 04, 2010, 05:15:48 PM »
I don't think its you, I have had a look at Scott's code and it looks faulty to me, I have sent him a message so I can discuss it with him.

Graham

1132
G-Code, CAD, and CAM discussions / Re: Subroutine confusion.
« on: October 03, 2010, 06:04:14 PM »
Its not a problem, change the feed rates to what you need.

Graham

1133
G-Code, CAD, and CAM discussions / Re: Subroutine confusion.
« on: October 03, 2010, 05:14:00 PM »
The feed rate and depth of cut are taken from your original gcode.

The sub program is stored along with the main program in the same file. The main program calls the sub at the end of the file every time it is needed.

If you want to use the same sub program in many different gcode files then is must be stored in the subroutines folder inside the Mach3 folder and called with a M98 (filename.tap) command.

%
G20 G40
T1 M6
G92 A0 (zero out a axis)
G00 G90 X0 Y0 Z.1 A0 (move to start position)
G01 Z-.0214 F360. (feed to depth)
M98 P0002 L6 (call sub)
G01 Z-.022 F360.
M98 P0002 L6
G01 Z-.03 F360.
M98 P0002 L6
G01 Z-.0375 F360.
M98 P0002 L6
G00 Z.1
M30

O0002(SUB)
G91                             (incremental mode)
G01 X3. A1080. F1080.  (feed to x3. rotating as you go)
G00 Z.1                        (jump up in z by .1)
X-3. A60.                      (rapid back to x0 and rotate 60 degs)
Z-.1                              (back down to cutting depth)
G90                              (absolute mode)
M99                              (end of sub)
%

Graham

1134
General Mach Discussion / Re: Tool offsets - newbie problems
« on: October 03, 2010, 04:52:24 PM »
For tool offsets to be used your program must have a G43

Graham

1135
G-Code, CAD, and CAM discussions / Re: Subroutine confusion.
« on: October 03, 2010, 03:26:20 PM »
This is my version assuming I have interpreted what you were trying to do.

%
G20 G40
T1 M6
G92 A0
G00 G90 X0 Y0 Z.1 A0
G01 Z-.0214 F360.
M98 P0002 L6
G01 Z-.022 F360.
M98 P0002 L6
G01 Z-.03 F360.
M98 P0002 L6
G01 Z-.0375 F360.
M98 P0002 L6
G00 Z.1
M30

O0002(SUB)
G91
G01 X3. A1080. F1080.
G00 Z.1
X-3. A60.
Z-.1
G90
M99
%

Edit : Revised code to remove excess rapids.

Graham

1136
G-Code, CAD, and CAM discussions / Re: Subroutine confusion.
« on: October 03, 2010, 12:47:58 PM »
Post your code and a sketch of what you are trying to achieve and I will take a look.

Graham

1137
G-Code, CAD, and CAM discussions / Re: Subroutine confusion.
« on: October 03, 2010, 06:11:42 AM »
A sub program can be anything from a single gcode command to a complete multi tool program.

The simplest use is to allow repetition of a series of moves, e.g. you have 10 holes to drill & tap on 10mm centres along the X axis.

%
O0001(DRILL HOLES 10MM CTS)

G21 G40 G00 G80
G91 G28 Z0

N1(CENTRE DRILL)
T1 M6
G54 G00 G90 G43 X0 Y0 Z25. H1 S1000 M3
M8 (COOLANT ON)
G82 Z-2. R2. P250 F75. (DRILL CYCLE WITH A DWELL OF .25 SECONDS)
M98 P0002 (CALL SUB O0002)
G80 (CANCEL CYCLE)
G91 G28 Z0(MOVE TO TOOL CHANGE)
M1

N2(5MM DRILL)
T2 M6
G54 G00 G90 G43 X0 Y0 Z25. H2 S1500 M3
M8
G81 Z-10. R1. F150.
M98 P0002
G80
G91 G28 Z0
M1

N3(TAP M6)
T3 M6
G54 G00 G90 G43 X0 Y0 Z25. H3 S100 M3
M8
G84 Z-12. R3. F100.
M98 P0002
G80
G91 G28 Y0 Z0
M30

O0002(SUB PROGRAM)
X10.
X20.
X30.
X40.
X50.
X60.
X70.
X80.
X90.
M99
%

We call the sub program O0002 three times, this saves writing out the gcode three times in the main program. This makes for less errors easy editing and smaller gcode files.

There are some simple rules to follow when using sub programs

1.  The first line of a program with sub programs should be a % sign only

2.  The last line of a program with sub programs should be a % sign only

3.  Sub programs should be listed after the main program

4.  Subs should start with a unique Onnnn number and finish with M99

5.  The main program must end with an M2, M30 or M47

6.  Subs calling subs can be up to 7 deep.

7.  Subs can be called from the subroutines directory within Mach3 by using its file name e.g. M98 (SUB01.TAP)

8.  A sub call with an Lnn in the line will call the sub nn times, the value of nn can be in the range of 1 to 99. E.g. M98 P0002 L10

I will add more to this on request.

Regards
Graham

1138
G-Code, CAD, and CAM discussions / Re: Denford Novamill conversion
« on: October 02, 2010, 05:53:38 AM »
I would look at the Denford forum, there are quite a few conversions on there and some are very well documented.

Graham

1139
I suspect having the G41 applied before the sub call and the rapid moves is causing the problem.  Try applying the G41 within the sub and cancelling it before it exits the sub.

Graham
 

1140
G-Code, CAD, and CAM discussions / Re: Code help needed
« on: September 25, 2010, 02:10:25 PM »
Try it like this :-

%
(tool 1)
M6 T1
G43 H1
M03 S2500
M8
G52 X0 (cancel any current datum shifts)
M98 P2
G52 X2. (do a local datum shift of 2 in the x axis)
M98 P2 (call sub program O0002)
G52 X4.
M98 P2
G52 X6.
M98 P2
G52 X8.
M98 P2
G52 X10.
M98 P2
G52 X12.
M98 P2
G52 X14.
M98 P2
G00 Z.100  (this code moves the part and)
Y-3.0         (and brings the tool down)
Z - 1.0        (for the wife)
M9
M5

(tool 2)
M6 T2
G43 H2
M03 S2500
M8
G52 X0
M98 P3 (call sub program O0003)
G52 X2.
M98 P3
G52 X4.
M98 P3
G52 X6.
M98 P3
G52 X8.
M98 P3
G52 X10.
M98 P3
G52 X12.
M98 P3
G52 X14.
M98 P3
G00 Z.100  (this code moves the part and)
Y-3.0         (and brings the tool down)
Z - 1.0        (for the wife)
M9
M5
M30

O0002  (this is a sub program called by M98 P2)
G00 Z 1.00
Y -.6875         
X 0.003
Z-.130
G01 Y.6875 F5.0
Z-.130
X-0.003
Y-.6875
G00 Z.1
G52 X0
M99

O0003(SUB PROGRAM CALLED BY M98 P3)
(PLACE YOUR CODE HERE)

G00 Z1.
G52 X0
M99
%

Graham