Circle

More
24 Jan 2016 20:05 #69066 by BigJohnT
Circle was created by BigJohnT
This sub mills an inside or outside circle. Outside is done.
(info: Mill Circle)
o<circle>sub

#<Z_Start> = #1 (=0.100 Z Start)
#<Z_Depth> = #2 (Z Depth)
#<Z_Steps> = #3 (Z Steps)
#<Circle_Dia> = #4 (Circle Diameter)
#<X_Coord> = #5 (X Center)
#<Y_Coord> = #6 (Y Center)
#<InOut> = #7 (=0 0=Outside 1=Inside)
#<Tool> = #8 (=1 Tool Number)
#<Tool_Dia> = #9 (Tool Diameter)
#<FeedRate> = #10 (Feed IPM)
#<RPM> = #11 (=1800 Spindle RPM)
#<X_Park> = #12 (=0 X Park)
#<Y_Park> = #13 (=0 Y Park)

T#<Tool> M6
G43
F#<FeedRate>
M3 S#<RPM>
M110
o110 if [#<InOut> EQ 0]
(MSG,Outside Circle Climb Mill)
#<Path> = [#<Circle_Dia>+[#<Tool_Dia>]]
#<X_Start> = [#<X_Coord>+[#<Circle_Dia>/2]+[#<Tool_Dia>/2]]
G0 X#<X_Start> Y#<Y_Coord>
Z#<Z_Start>
G2 X#<X_Start> Y#<Y_Coord> Z#<Z_Depth> I-[#<Path>/2] P#<Z_Steps>
G2 X#<X_Start> Y#<Y_Coord> Z#<Z_Depth> I-[#<Path>/2] P1
G91
G1 X[#<Tool_Dia>/2]
G90
G0 G53 Z0
G0 X#<X_Park> Y#<Y_Park>
o110 else
(MSG,Inside Circle Climb Mill)
o110 endif

o<circle>endsub

JT

Please Log in or Create an account to join the conversation.

More
08 Mar 2018 13:26 #107115 by jensor
Replied by jensor on topic Circle
I'm trying to write a gcode routine to cut either a hole (tool inside) or circle (tool outside) with a choice of where to start cutting (either 12, 3 , 6, or 9 o'clock positions). The code also includes cutter diameter compensation. Depth of cut would be controlled manually by adjusting the mill knee.
However, In order to do this I need to nest the "if" command and have not been successful.
Do you know how to do it. I just posted this as a new topic.

Please Log in or Create an account to join the conversation.

More
08 Mar 2018 15:31 - 08 Mar 2018 15:31 #107117 by andypugh
Replied by andypugh on topic Circle
A nested IF looks like this
O111 IF [condition 1]
    ....
    O222 IF [condition 2
        ...
    O222 ENDIF
    ....
O111 ENDIF
Last edit: 08 Mar 2018 15:31 by andypugh.

Please Log in or Create an account to join the conversation.

Time to create page: 0.304 seconds
Powered by Kunena Forum