Advanced Search

Search Results (Searched for: )

  • royka
  • royka
13 Mar 2025 23:42

Kernel 6.12 with PREEMPT_RT patches enabled - yet POSIX non-realtime (LM22.1)

Category: Installing LinuxCNC

I don't run debian 10, but Bookworm and actually use a rk3588 sbc which works very reliable. But here is the 6.12 kernel for x86 I've used before: drive.google.com/drive/folders/16Xlry00L...SlwznPLv?usp=sharing

But you can also download some from Debian, 6.13:
packages.debian.org/experimental/amd64/l...13-rt-amd64/download

And others:
packages.debian.org/search?keywords=linux-image-rt
  • tsaG
  • tsaG
13 Mar 2025 23:22
Replied by tsaG on topic ATC Tool Rack implementation gesucht

ATC Tool Rack implementation gesucht

Category: Deutsch

Thanks! That is already a great place to start! I will have a look at it. In the meantime, I came up with my own code (thanks Chatgpt). However, when executing it I get the error "Unknown word starting with f" in the GUI. However, without any hint to any line in the code. It seems I have to open linuxcnc via console and active the debug mode to see it?

This is my code for now. More work tomorrow.
%
(MSG, --- Start of toolchange.ngc ---)

o<toolchange> sub

    (MSG, --- Toolchange Subroutine Entry ---)

    ; ------------------------------------------------------------------
    ; A) Named parameters (populated by stdglue.py / M6 prolog):
    ;    #<selected_tool>, #<tool_in_spindle>,
    ;    #<selected_pocket>, #<current_pocket>,
    ;    #<atc_z_tool_change_height>, #<atc_z_tool_clearance_height>, etc.
    ; ------------------------------------------------------------------

    (MSG, Selected tool = #<selected_tool>)
    (MSG, Tool in spindle = #<tool_in_spindle>)
    (MSG, Selected pocket = #<selected_pocket>)
    (MSG, Current pocket = #<current_pocket>)

    ; ------------------------------------------------------------------
    ; B) Check if a tool change is actually needed
    ; ------------------------------------------------------------------
    IF [#<selected_tool> EQ #<tool_in_spindle>] THEN
        (MSG, Tool #<tool_in_spindle> is already loaded. No change needed.)
        M99
    END-IF

    ; ------------------------------------------------------------------
    ; C) Stop the spindle
    ; ------------------------------------------------------------------
    M5  ; no spindle orientation (M19) requested

    ; ------------------------------------------------------------------
    ; D) Rack coordinates (adjust as needed for your machine)
    ; ------------------------------------------------------------------
    #<rack_x>      = 1123
    #<rack_y_base> = 164
    #<rack_y_pitch> = 50

    ; We comment these out so they are NOT overwritten (assuming INI defines them):
    ; #<atc_z_tool_change_height>    = -80
    ; #<atc_z_tool_clearance_height> = 0

    ; Move Z to clearance
    G53 G0 Z[#<atc_z_tool_clearance_height>]

    ; ------------------------------------------------------------------
    ; E) Drop off the old tool (#<tool_in_spindle>) in #<current_pocket>
    ; ------------------------------------------------------------------
    IF [#<tool_in_spindle> GT 0] THEN

        ; 1) Y coordinate for the current pocket
        #<old_pocket_y> = [#<rack_y_base> + ([#<current_pocket>] - 1) * #<rack_y_pitch>]

        ; 2) Move to that pocket in machine coords (G53)
        G53 G0 X[#<rack_x>] Y[#<old_pocket_y>]

        ; 3) Lower Z to the tool-change height
        G53 G0 Z[#<atc_z_tool_change_height>]

        ; 4) Unclamp (M64 P2) to release old tool
        (MSG, Unclamping old tool with M64 P2)
        M64 P2
        G4 P1  ; dwell 1 second, adjust as needed

        ; 5) Move back up to clearance
        G53 G0 Z[#<atc_z_tool_clearance_height>]

        ; 6) Update the pocket table (#4001..#4024)
        #<pocket_index> = [4000 + #<current_pocket>]
        #[#<pocket_index>] = #<tool_in_spindle>
    END-IF

    ; ------------------------------------------------------------------
    ; F) Pick up the new tool (#<selected_tool>) from #<selected_pocket>
    ; ------------------------------------------------------------------
    IF [#<selected_tool> GT 0] THEN

        ; 1) Optional check: does pocket #<selected_pocket> hold #<selected_tool>?
        #<pocket_index> = [4000 + #<selected_pocket>]
        IF [#[#<pocket_index>] NE #<selected_tool>] THEN
            (MSG, *** WARNING: Pocket #<selected_pocket> does not match tool #<selected_tool>!)
        END-IF

        ; 2) Compute Y coordinate for the selected pocket
        #<new_pocket_y> = [#<rack_y_base> + ([#<selected_pocket>] - 1) * #<rack_y_pitch>]

        ; 3) Move to that pocket
        G53 G0 X[#<rack_x>] Y[#<new_pocket_y>]

        ; 4) Lower Z to the tool-change height
        G53 G0 Z[#<atc_z_tool_change_height>]

        ; 5) Clamp (M65 P2) to pick up the new tool
        (MSG, Clamping new tool with M65 P2)
        M65 P2
        G4 P1  ; dwell 1 second, adjust as needed

        ; 6) Return to clearance
        G53 G0 Z[#<atc_z_tool_clearance_height>]

        ; 7) This pocket is now empty
        #[#<pocket_index>] = 0
    END-IF

    ; ------------------------------------------------------------------
    ; G) The spindle now has the new tool
    ; ------------------------------------------------------------------
    #<tool_in_spindle> = #<selected_tool>

    ; ------------------------------------------------------------------
    ; H) Tell LinuxCNC the new tool is active & load offset
    ; ------------------------------------------------------------------
    M61 Q[#<selected_tool>]     ; set active tool to #<selected_tool>
    G43 H[#<selected_tool>]     ; load that tool's offset from table

    ; ------------------------------------------------------------------
    ; I) Return to caller
    ; ------------------------------------------------------------------
    M99

o<toolchange> endsub

M2

(MSG, --- End of toolchange.ngc ---)
%
  • tommylight
  • tommylight's Avatar
13 Mar 2025 22:55
Replied by tommylight on topic ATC Tool Rack implementation gesucht

ATC Tool Rack implementation gesucht

Category: Deutsch

LinuxCNC config picker from the main menu, then Sample configurations>sim>axis>remap>rack toolchange as shown in picture.
That will also copy the files to your LinuxCNC configs folder so you can edit and test as much as you like. :)
  • ihavenofish
  • ihavenofish
13 Mar 2025 22:55
Displaying 18211 - 18214 out of 18214 results.
Time to create page: 0.453 seconds
Powered by Kunena Forum