Tool compensation question

More
13 Dec 2023 16:55 #288055 by ckuecker
Running axis on a gantry mill - get this message when I try to run my program. "Error - Length of cutter compensation entry move is not greater than the tool radius". I can't find a reference to this message in the forum.
Tool is 1/8" end mill.
The program ran without the g42 line.

%
#<count> = 1    (Number of parts)
#<width> = 0.75    (Thickness of part)
#<length> = [[#<width> * #<count>] + 1]
#<cut_depth> = -0.05 (Depth of each pass)
#<feed>    = 10 (Feed rate)
t1
g40    (comp off)
s18000 m03 (Spindle 18,000 RPM, turn on clockwise)
g20 (inch mode)
g90 (absolute mode)
g54 (fixture zero)
g42    (tool comp)
g04 p2 (pause for spindle runup)

(Loop to cut slots)
(Params: #1 = incremental cut depth)
(         #2 = ending depth >= #1)
(         #3 = length of cut)
(         #4 = feed rate)
(         #5 = current cut depth)
o100 sub
    #5 = #1 (Initial cut)
        
    o101 do
        g0 z[#5]
         g1 y[#3] f [#4] (make a cut)
        g0 y0 (return to start)
        
        o102 if [#5 EQ #2]    (end of loop)
            o100 return
        o102 endif

        #5 = [#5 + #1] (go deeper)
        
        o103 if [#5 LT #2] (went too deep!)
            #5 = #2
        o103 endif
     o101 while [#5 GE #2]
o100 endsub

(First six slots)
g1 x0 y0 z0 f100
g1 x0.45 f100 (Start of first cut)
o100 call [#<cut_depth>] [-0.1] [#<length>] [#<feed>]
g1 x0.78 f100
o100 call [#<cut_depth>] [-0.34] [#<length>] [#<feed>]
g1 x1.10 f100
o100 call [#<cut_depth>] [-0.5] [#<length>] [#<feed>]
g0 x0 y0 z0
m2
%


 

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

More
13 Dec 2023 17:43 #288059 by Aciera
Replied by Aciera on topic Tool compensation question
This may give you some insight (towards the bottom):
linuxcnc.org/docs/html/gcode/tool-compensation.html

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

More
14 Dec 2023 16:12 #288134 by ckuecker
Replied by ckuecker on topic Tool compensation question
Added
g10 l1 p1 r0.0625
g42 (tool comp)
to the program. When I run it, the spindle starts and the machine goes to the start position, then just sits there with no indication what G code line is running or next.

%
#<count> = 1 (Number of parts)
#<width> = 0.75 (Thickness of part)
#<length> = [[#<width> * #<count>] + 1]
#<cut_depth> = -0.05 (Depth of each pass)
#<feed> = 10 (Feed rate)
g40 (comp off)
s18000 m03 (Spindle 18,000 RPM, turn on clockwise)
g20 (inch mode)
g90 (absolute mode)
g54 (fixture zero)
g0 x0 y0.3 z0
t1
g10 l1 p1 r0.0625
g42 (tool comp)
g04 p2 (pause for spindle runup)

(Loop to cut slots)
(Params: #1 = incremental cut depth)
( #2 = ending depth >= #1)
( #3 = length of cut)
( #4 = feed rate)
( #5 = current cut depth)
o100 sub
#5 = #1 (Initial cut)

o101 do
g0 z[#5]
g1 y[#3] f [#4] (make a cut)
g0 y0 (return to start)

o102 if [#5 EQ #2] (end of loop)
o100 return
o102 endif

#5 = [#5 + #1] (go deeper)

o103 if [#5 LT #2] (went too deep!)
#5 = #2
o103 endif
o101 while [#5 GE #2]
o100 endsub

(First six slots)
g1 x0.45 f100 (Start of first cut)
o100 call [#<cut_depth>] [-0.1] [#<length>] [#<feed>]
g1 x0.78 f100
o100 call [#<cut_depth>] [-0.34] [#<length>] [#<feed>]
g1 x1.10 f100
o100 call [#<cut_depth>] [-0.5] [#<length>] [#<feed>]
g0 x0 y0 z0
m2
%

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

More
14 Dec 2023 16:44 #288137 by Aciera
Replied by Aciera on topic Tool compensation question

then just sits there with no indication what G code line is running or next.

This usually indicates a missing 'spindle-at-speed' signal.

The Gcode from your last post seems to run fine in a simulation:

 
Attachments:
The following user(s) said Thank You: ckuecker

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

More
14 Dec 2023 17:02 #288140 by ckuecker
Replied by ckuecker on topic Tool compensation question
The code ran fine before I put in the compensation code. I don't have an encoder on my spindle - do I have to set that parameter to 1 explicitly?

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

More
14 Dec 2023 19:48 #288151 by ckuecker
Replied by ckuecker on topic Tool compensation question
More info - the code runs up to the same point and hangs with the spindle running. If I stop the program and try to reload the file, it will not run at all. I have to end LinuxCNC and restart.

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

More
15 Dec 2023 06:40 #288186 by Aciera
Replied by Aciera on topic Tool compensation question
Without spindle feedback you would usually force the pin in your hal file with something like this:

setp spindle.0.at-speed 1


Seems odd though that it worked before.

Does it run in a simulation config ? (You may have to reduce the spindle speed to say 1600rpm as the simulation spindle may be set to a max speed lower than your 16000)

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

More
15 Dec 2023 18:06 #288248 by ckuecker
Replied by ckuecker on topic Tool compensation question
CNC1.hal has this already:
net spindle-at-speed => spindle.0.at-speed
net spindle-vel-fb-rps => spindle.0.speed-in
net spindle-index-enable <=> spindle.0.index-enable

# ---Setup spindle at speed signals---

sets spindle-at-speed true

I have not tried a simulation - I've never had this issue before, and I've run a few programs successfully, even if they were not written optimally. I'm a C and assembly programmer - slowly learning G-code.

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

More
18 Dec 2023 13:36 #288484 by ckuecker
Replied by ckuecker on topic Tool compensation question
Ran the simulation. It runs, but it appears the return path after each cut will blast through material I do not want cut.

The program before compensation had the cutter return at high speed through the slot just machined. The slots are 1/8" wide, and the cutter is 1/8" diameter.

All I want is for the left side of the cutter to follow the left edge of the slot. I still have no idea why the program hangs after starting the spindle.

Maybe I don't actually want to turn on compensation? An offset of 0.0625" might do the job, but I really need to understand how to use compensation for future jobs.

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

More
18 Dec 2023 17:40 #288498 by Aciera
Replied by Aciera on topic Tool compensation question
You have compensation active on the return path as well.

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

Time to create page: 0.099 seconds
Powered by Kunena Forum