Hello Guest it is March 28, 2024, 08:59:55 PM

Author Topic: Peck drilling in the X axis  (Read 9297 times)

0 Members and 1 Guest are viewing this topic.

Offline lew

*
  •  74 74
    • View Profile
Peck drilling in the X axis
« on: November 06, 2010, 09:00:37 AM »
I've got a right angle head on my mill and I'm trying to drill a very long hole in the x axis. Is there a way to program this move with X going in the positive direction? I've used G17 to select the yz plane and programmed G83 to drill but the table moves in the negative direction. I'm trying to move the table in the positive direction while peck drilling.
Thanks in advance.

Offline lew

*
  •  74 74
    • View Profile
Re: Peck drilling in the X axis
« Reply #1 on: November 06, 2010, 09:22:00 AM »
OOPS, I meant G19 to select the yz plane
Here's the code that doesn't work - get an error that says R value less than X.
g90
g19
g83 x10.5 r0.05 p0.0 q0.50 f5.0
g80
g0 x0.0
m30

If I put a negative sign in front of the 10.5 then it works but goes the wrong way.
« Last Edit: November 06, 2010, 09:24:31 AM by lew »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Peck drilling in the X axis
« Reply #2 on: November 06, 2010, 10:53:47 AM »
I think you will find that all the canned cycles "assume" you are drilling in the neg direction.  So it will not except the R.05. and would not drill in the positve direction.

So in your case you cannot use the g83 to drill in the positive direction.



(;-) TP
« Last Edit: November 06, 2010, 10:57:51 AM by BR549 »

Offline lew

*
  •  74 74
    • View Profile
Re: Peck drilling in the X axis
« Reply #3 on: November 06, 2010, 11:05:12 AM »
Thanks for the reply. I believe you to be correct. Of course, I can set the job up so that the drill points in the negative direction. But, I was wondering if you have any simple code that would let the x axis act in the manner that I want. I tried working up a math expression with the "if" statement but it will take some additional learning on my part to get the syntax right.
Thanks again.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Peck drilling in the X axis
« Reply #4 on: November 06, 2010, 11:21:53 AM »
You can create the same motion using an Mcode(macro) or a subroutine. I'll look in the bag of tricks and see if I can dig up what you need.

(;-) TP

Offline lew

*
  •  74 74
    • View Profile
Re: Peck drilling in the X axis
« Reply #5 on: November 06, 2010, 11:32:53 AM »
Here's what I started doing and then got busy with something else.

#n=0.3
#p=0.3
#1=3.0


10 g90
g0 x0.49
g1 x[.49+#n] f#1
g0 x0.49
#p=[#p+#n]
if#p<13.0 then 10
g0 x0.0
m30

Offline lew

*
  •  74 74
    • View Profile
Re: Peck drilling in the X axis
« Reply #6 on: November 06, 2010, 12:09:11 PM »
Just played around with some other code and this is what I've got:
This code shows an error in the "if" line. this where my syntax must be wrong.


#1=3.0
#2=0.3
#3=0.3

n100
g90
g0 x0.49
g1 x[.49+#3] f#1
g0 x0.49
m98 p1

o1:
#3=[#3+#2]
if #3<13.0 then n100
m99
g0 x0.0
m30

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Peck drilling in the X axis
« Reply #7 on: November 06, 2010, 01:14:05 PM »
First, Mach does NOT do conditional gcode so the IF is not an option(;-(

I whipped up a quicky Subroutine for you. It is programable. First copy the SUB to the Mach subroutine directory

The variables are:

#100= Total depth
#101= Peck depth
#105= Pullback value
#106= Feedrate

To Use First position your tool where it needs to be to start and then Call it with        M98 (Xpeck.txt) L1 #100=1.000 #101=.040 #105=0.050 #6=10

The Sub will then load and apply the variables and begin the cycle .It will dril the peck depth and then retract the pullback value then return then drill the peck depth ,etc,etc At the end it will retract to the start point.

I am sure you will be able to modify it as you need(;-)

(;-) TP



« Last Edit: November 06, 2010, 01:33:22 PM by BR549 »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Peck drilling in the X axis
« Reply #8 on: November 06, 2010, 01:34:32 PM »
FOr those that want to see the code.

M98P1 L1
o1
(#100 = Drill Depth)
(#101 = Peck depth)
#102 = Fup[#100/#101]
#103 = [#100/#102]
#104= #103
(#105 = Pullback Value)
(#106 = Feedrate)
G91
M98 P2 L#102
G0 X[-1*#100]
G90
M30
o02
G1 X#104 F#106
G0 X[-1*#105]
G1 X#105
M99
%




« Last Edit: November 06, 2010, 01:36:19 PM by BR549 »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Peck drilling in the X axis
« Reply #9 on: November 06, 2010, 01:50:10 PM »
Here is a slightly better version that improves the pull back cycle.

M98P1 L1
o1
(#100 = Drill Depth)
(#101 = Peck depth)
#102 = Fup[#100/#101]
#103 = [#100/#102]
#104= #103
(#105 = Pullback Value)
(#106 = Feedrate)
G91
M98 P2 L#102
G0 X[-1*#100]
G90
M30
o02
G1 X#104 F#106
G0X[-1*#105]
X[#105-.010]
G1X.010

M99
%