View Full Version : Macros


MachineSMM
06-20-2003, 09:52 AM
I am trying to make a macro to cut a round groove into some steel. I want it to ramp in and out of the cut. I am going to paste what I have so for below this post. The problem I am having is it always leaves a mark at the start and end point (the same spot). I think what is happening is there is a little rounding error.

If anyone has some ideas please let me know. If you have more questions either post here, email me christellers@eschelon.com or give me a call 612-823-6477.

Thanks

Macro
%
O9050(O-RING MILLING MACRO)
(#7 D = CIRCLE DIAMETER)
(#9 F = FEEDRATE)
(R CANNOT EXCEED 24 PERCENT)
(#18 R = PERCENTAGE OF CIRCUMFERENCE TO RAMP IN AT)
(#26 Z = FINAL DEPTH)
(INTERNAL VARIABLES)
(#4 CIRCLE RADIUS)
(#5 LENGTH OF RAMP MOVE BASED ON THE PERCENTAGE USER DEFINES)
(#6 ANGLE OF RAMP MOVE)
(#10 X POSITION OF IN RAMP MOVE)
(#11 Y POSITION OF IN RAMP MOVE)
(#12 #1 INC MOVE)
#3=#18*.01
#4=#7/2
#5=[3.1416*#7]*#3
#6=[57.296*#5]/#4
#10=#4*COS[#6]
#11=#4*SIN[#6]
#12=#4-#10
G91G17
G00X#10Y-#11
G90G17
G00Z.1
G01Z.005F5.0
G91G17
G03X#12Y#11I-#10J#11Z[#26+[-.005]]F#9
G03I-#4
G03X-#12Y#11I-#4Z-[#26+[-.005]]F[#9*4]
G01Z.095F50.
(DONE)
G90G00Z1.
N9M99
%

Macro Details
G65 makes the command Simple
G66 makes the command Modal, must be canceled (G67)
P9050 is the Sub-program Number of the C’Bore Macro
F = Feedrate
D = Ring Centerline Diameter
--- R CANNOT EXCEED 24. ---
R = Percentage of Circumference to Ramp In At
Z = Final Depth of Cut

Z0 is ALWAYS Top of Surface to be Cut

Example G66 Code:
G66 P9050 D.5 Z-.05 R15. F5.
X0.0 Y0.0
X3.0 Y0.0
X6.0 Y0.0
G67

Example G65 Code:
G66 P9050 D.5 Z-.05 R15. F5.
X0.0 Y0.0
G66 P9050 D.5 Z-.05 P15. F5.
X3.0 Y0.0
G66 P9050 D.5 Z-.05 P15. F5.
X6.0 Y0.0

HuFlungDung
06-20-2003, 01:36 PM
Hi MachineSSM,

Its tough wading through that!

If you suspect a rounding error, then why don't you boost the accuracy of your constants, that is Pi = 3.1415927 and 1 Radian = 57.295778.

Also, what kind of mark do you get? What direction is it in?

Is it like an end of arc position error?

MachineSMM
06-20-2003, 01:41 PM
I am sure that it is very confusing looking at it for the first time. I am not even sure I understand it!!

I did some texting at it seems that the numbers are coming out ok when it is run.

I think that I may have figured out a solution. I am trying to change the code so that I will get an overlap of the start point (3 o'clock)

I will let you know how it turns out.