Hello Guest it is May 06, 2024, 12:02:00 AM

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

1141
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

1142
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

1143
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

1144
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
 

1145
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

1146
CVI MachStdMill (MSM) / Re: How to Enable RPM in MachStd Mill
« on: September 24, 2010, 05:18:15 AM »
This may be a stupid question but have you given Mach3 a speed command e.g. S1000 M3/4

Graham

1147
G-Code, CAD, and CAM discussions / Re: G code
« on: September 23, 2010, 01:51:06 PM »
Send only huge bags of cash  ;D  ;D  ;D

You are welcome

Graham

1148
G-Code, CAD, and CAM discussions / Re: G code
« on: September 23, 2010, 01:39:10 PM »
Have you got the macro saved in the correct profile?

If you are using the standard mach3mill profile it needs to be stored in C:\Mach3\macros\Mach3Mill as M1001.m1s

Graham

1149
G-Code, CAD, and CAM discussions / Re: G code
« on: September 23, 2010, 01:00:51 PM »
Sorry Larry, my fault, the macro code should read :-

Setvar(3, getuserdro(1001))

You had the M code in the right place.

I must have been having a bad day.

Graham

1150
I am sure you could twist my arm to make me attend the event, the last one was very good.

Graham