Hello Guest it is March 28, 2024, 05:29:50 AM

Author Topic: Need to repeat two cutters, but have a popup box for new dim.  (Read 3984 times)

0 Members and 1 Guest are viewing this topic.

Need to repeat two cutters, but have a popup box for new dim.
« on: February 02, 2012, 10:51:59 AM »
Hello all. I have a program I run that uses two cutters. The program is a pattern that is repeated multi times on the same part. I have a VMC with an extra table that extends the X-axis, with a servo (I use the B-axis to control it). The pattern stays the same on all parts but the location on the part changes (B-axis). I need to figure out a way to have Mach3 bring up a popup menu that ask what the B-axis value needs to be then moves to that location and runs the pattern.

The parts are various lengths, so some have 1 pattern up to 10 patterns. Is there a way to make Mach3 ask how many locations for the pattern?

What would be nice is for Mach3 to prompt for the amount of patterns, then ask for each B value for each pattern. This might be asking for to much but this isn't going to be a one part run. I will be making these for years (hopefully).

Here is the program:

N1 G00 G40 G80 G90
T01 M06 (3/16 2 FLUTE CRB EM)
S3200 M03
G00 G54 B0 X0 Y0       (This is the B value I need to change)
G43 Z.1 H01
G01 Z-.245 F4.
G41 D01 X0 Y-.0144 F15.
X.7874 Y-.0144
G03 X.7874 Y.0144 I0 J.0144
G01 X-.7874 Y.0144
G03 X-.7874 Y-.0144 I0 J-.0144
G01 X0 Y-.0144
G40 X-.002 Y.001
G00 Z.1
X-.0547 Y-.0079
G01 Z-.245 F50.
G41 D01 X-.0441 Y-.0185 F15.
G03 X-.03 Y-.0244 I.0141 J.0141
G01 X.7874 Y-.0244
G03 X.7874 Y.0244 I0 J.0244
G01 X-.7874 Y.0244
G03 X-.7874 Y-.0244 I0 J-.0244
G01 X0 Y-.0244
X.7874 Y-.0244
G03 X.7874 Y.0244 I0 J.0244
G01 X-.7874 Y.0244
G03 X-.7874 Y-.0244 I0 J-.0244
G01 X0 Y-.0244
X.03 Y-.0244
G03 X.0441 Y-.0185 I0 J.02
G40 G01 X.0547 Y-.0079
G00 Z6.0
M01

N1 G00 G40 G80 G90
T02 M06 (#19 STUB DRILL)
S3200 M03
G00 G54 B0 X-1.2992 Y0          (This is the B value I need to change)
G43 Z.1 H02
G81 G98 Z-.312 R.1 F10.
X1.2992 Y0
G00 Z6.0
M30
%
Re: Need to repeat two cutters, but have a popup box for new dim.
« Reply #1 on: February 02, 2012, 01:12:50 PM »
OK, say I do this:

Mcode M153:

NextPos = Question(“Enter next B position:”)

Mcode M154:

Code “G00 G54 B" & NextPos


Gcode:

N1 G00 G40 G80 G90
T01 M06 (3/16 2 FLUTE CRB EM)
S3200 M03
M153
M154
X0 Y0
G43 Z.1 H01
G01 Z-.245 F4.
G41 D01 X0 Y-.0144 F15.
X.7874 Y-.0144
G03 X.7874 Y.0144 I0 J.0144
G01 X-.7874 Y.0144
G03 X-.7874 Y-.0144 I0 J-.0144
G01 X0 Y-.0144
G40 X-.002 Y.001
G00 Z.1
X-.0547 Y-.0079
G01 Z-.245 F50.
G41 D01 X-.0441 Y-.0185 F15.
G03 X-.03 Y-.0244 I.0141 J.0141
G01 X.7874 Y-.0244
G03 X.7874 Y.0244 I0 J.0244
G01 X-.7874 Y.0244
G03 X-.7874 Y-.0244 I0 J-.0244
G01 X0 Y-.0244
X.7874 Y-.0244
G03 X.7874 Y.0244 I0 J.0244
G01 X-.7874 Y.0244
G03 X-.7874 Y-.0244 I0 J-.0244
G01 X0 Y-.0244
X.03 Y-.0244
G03 X.0441 Y-.0185 I0 J.02
G40 G01 X.0547 Y-.0079
G00 Z6.0
M01

N1 G00 G40 G80 G90
T02 M06 (#19 STUB DRILL)
S3200 M03
M154
X-1.2992 Y0
G43 Z.1 H02
G81 G98 Z-.312 R.1 F10.
X1.2992 Y0
G00 Z6.0
M30
%

Can I repeat M154 and the value will still be the same? Does the Var "NextPos" keep it's value?


Thanks,

Aero

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Need to repeat two cutters, but have a popup box for new dim.
« Reply #2 on: February 02, 2012, 01:58:50 PM »
There are many ways to do what you want here is but 1 way based on your example.



Here is the MACRO, Created and store in the macro directory:

'M153 macro to set B #variable
Bval = Question ("What is the new B variable Value?")
SetVar(1,Bval)



Here is the program:

N1 G00 G40 G80 G90
T01 M06 (3/16 2 FLUTE CRB EM)
M153
S3200 M03
G00 G54 B#1 X0 Y0       (This is the B value I need to change)
G43 Z.1 H01
G01 Z-.245 F4.
G41 D01 X0 Y-.0144 F15.
X.7874 Y-.0144
G03 X.7874 Y.0144 I0 J.0144
G01 X-.7874 Y.0144
G03 X-.7874 Y-.0144 I0 J-.0144
G01 X0 Y-.0144
G40 X-.002 Y.001
G00 Z.1
X-.0547 Y-.0079
G01 Z-.245 F50.
G41 D01 X-.0441 Y-.0185 F15.
G03 X-.03 Y-.0244 I.0141 J.0141
G01 X.7874 Y-.0244
G03 X.7874 Y.0244 I0 J.0244
G01 X-.7874 Y.0244
G03 X-.7874 Y-.0244 I0 J-.0244
G01 X0 Y-.0244
X.7874 Y-.0244
G03 X.7874 Y.0244 I0 J.0244
G01 X-.7874 Y.0244
G03 X-.7874 Y-.0244 I0 J-.0244
G01 X0 Y-.0244
X.03 Y-.0244
G03 X.0441 Y-.0185 I0 J.02
G40 G01 X.0547 Y-.0079
G00 Z6.0
M01

N2 G00 G40 G80 G90
T02 M06 (#19 STUB DRILL)
S3200 M03
G00 G54 B#1 X-1.2992 Y0          (This is the B value I need to change)
G43 Z.1 H02
G81 G98 Z-.312 R.1 F10.
X1.2992 Y0
G00 Z6.0
M30
%
Re: Need to repeat two cutters, but have a popup box for new dim.
« Reply #3 on: February 02, 2012, 02:28:39 PM »
I like that better, cleaner and easier. I will give it a try and let you guys know how it works out.



Thanks!!

Aero
Re: Need to repeat two cutters, but have a popup box for new dim.
« Reply #4 on: February 02, 2012, 02:42:51 PM »
OK, I tested it in MDI and works GREAT!! Later I need to work on the repeat the pattern in different places part. But this will make this job ALOT easier!!


Thanks so much BR549!!!!


Aero

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Need to repeat two cutters, but have a popup box for new dim.
« Reply #5 on: February 02, 2012, 07:10:37 PM »
Study up on SUB programing. For what you are doing it is the CATS meow.

Use a macro to program the variables and call whatever subs you need to run to make the part.

It makes the Gcoding pretty much a conversational TOOL



(;-) TP
« Last Edit: February 02, 2012, 07:12:40 PM by BR549 »