X moving before W axis retracts

More
08 Feb 2024 05:01 #292820 by cncrcelec
Here's a puzzling one: I ran a test file that drills some holes. The X axis starts moving before the W axis has retracted. See the holes in the middle (horizontal) row - the leftmost hole and the third of four in that row - in the photo attached. Where do I look to solve this one? It only seems to happen in the X direction; not when diagonal moves are next in the sequence.

David :)

test_holes.ngc
M6 T1 (6mm dia end mill)

#<offset> = 10
#<numholes> = 2
#<feedrate> = 1500

;G52 X100 Y100 (Local Coordinate System Offset)

G0 X0 Y0 W2
o<holes_5mm> call [0] [#<numholes>] [10] [#<offset>] [#<feedrate>]
G0 X0 Y0 W2
o<holes_5mm> call [45] [#<numholes>] [10] [#<offset>] [#<feedrate>]
G0 X0 Y0 W2
o<holes_5mm> call [90] [#<numholes>] [10] [#<offset>] [#<feedrate>]
G0 X0 Y0 W2
o<holes_5mm> call [135] [#<numholes>] [10] [#<offset>] [#<feedrate>]
G0 X0 Y0 W2
o<holes_5mm> call [180] [#<numholes>] [10] [#<offset>] [#<feedrate>]
G0 X0 Y0 W2
o<holes_5mm> call [225] [#<numholes>] [10] [#<offset>] [#<feedrate>]
G0 X0 Y0 W2
o<holes_5mm> call [270] [#<numholes>] [10] [#<offset>] [#<feedrate>]
G0 X0 Y0 W2
o<holes_5mm> call [315] [#<numholes>] [10] [#<offset>] [#<feedrate>]

;G52 X0 Y0

M2

holes_5mm.ngc
(filename holes_6mm.ngc)
(Row of holes from current position going at an angle - 0 East, 90 North etc)
(Hafele 013.15.715 screws need about 8mm deep holes @ 5mm dia)
(Hafele 329.71.523 hinge dowel cam need ~11mm deep holes @ 5mm dia @ 32mm centres)
(Hafele 329.74.513 hinge mount plate 3mm steel euro screw needs ~11.3mm deep holes @ 5mm dia @ 32mm centres)
(Bunnings shelf panels - predrilled 12mm deep holes @ 32mm centres)

o<holes_5mm> sub

#<angle> = #1
#<numHoles> = #2
#<holeSpacing> = #3
#<offset> = #4
#<feedrate> = #5

#<ox> = #5420
#<oy> = #5421
#<ow> = #5428

;(DEBUG,Test debug!!)

#10=0
O1 while [#10 lt #<numHoles>]
    #<distance> = [#<offset> + #10 * #<holeSpacing>]
    #<xx> = [cos[#<angle>] * #<distance>] (adj = COS a * hyp)
    #<yy> = [sin[#<angle>] * #<distance>] (opp = SIN a * hyp)

    G0 X[#<ox> + #<xx>] Y[#<oy> + #<yy>]

    G1 W-12 F[#<feedrate>] (Drill hole)
    G00 W[#<ow>] (retract to rapid height)
    #10 = [#10 + 1]
O1 endwhile

o<holes_5mm> endsub
M2
Attachments:

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

More
08 Feb 2024 14:45 #292851 by Aciera
I can't totally explain what is going on but I tend to throw in quebusters when I use loops, try this in your 'holes_5mm,ngc' (Note the two lines with 'M66 E0 L0' at the beginning and at the end):
O1 while [#10 lt #<numHoles>]
    M66 E0 L0
    #<distance> = [#<offset> + #10 * #<holeSpacing>]
    #<xx> = [cos[#<angle>] * #<distance>] (adj = COS a * hyp)
    #<yy> = [sin[#<angle>] * #<distance>] (opp = SIN a * hyp)

    G0 X[#<ox> + #<xx>] Y[#<oy> + #<yy>]

    G1 W-12 F[#<feedrate>] (Drill hole)
    G00 W[#<ow>] (retract to rapid height)
    #10 = [#10 + 1]
    M66 E0 L0
O1 endwhile
The following user(s) said Thank You: cncrcelec

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

More
08 Feb 2024 22:48 #292888 by cncrcelec
Thanks Aciera, the M66 E0 L0 (wait on input) fixes the issue.

In testing, I also found G61 (Exact Path Mode) also fixes the issue.
 
Attachments:
The following user(s) said Thank You: tommylight, Unlogic

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

More
09 Feb 2024 08:31 #292917 by Aciera
Ah, good to know, I've tried tweaking G64 but I have not tried G61. That seems more convenient as it can just be put in the preamble.

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

Time to create page: 1.640 seconds
Powered by Kunena Forum