Klipper for cnc controlled by remote software

klipper is running my LR4. This is an advanced and unsupported setup.

This question is for others running a similar setup: Did you adapt your klipper setup to work with grbl or marlin gcode?

I adapted estlcam to work with klipper. I’m experimenting with other network attached software now and I’d like to make klipper accept marlin gcode or grbl gcode (one then the other depending…). Would you share your interpreting macros?

Edit for clarity:

In estlcam, i edited the post processor so instead of outputting G01 → G1

In klipper this could be done with

[gcode_macro G01]
Gcode:
    G1 #and some info to process the rest of the line

What other commands need to be changed?
The klipper cnc repository has some things for working with the cnc, but they did not appear to me to be translation macros.

2 Likes

I personally have a pretty standard klipper setup, with the main “different addition” being this:

[gcode_arcs]
#resolution: 1.0

in my printer.cfg. I also have 3 macros set up for zeroing the workpiece. They are extremely basic, I can’t remember exactly what they are but it just sets “X” “Y” and “Z” equal to 0 so the LR4 thinks the origin is the corner of the workpiece rather than the actual machine home.
I have played around with a few macro packages people have made for klipper CNC use, however I have never given much of them enough time to learn/understand, and honestly most of them seemed to add extra steps to the workflow.
For making files, I use Fusion 360 with the fly fisher post processor, and as far as I can remember the only change I have made is to un tick the box the makes the origin the current location (G92) or something like that.
I would like to start using Estlcam, as I feel like most people here do, but for some reason my brain just works so much more intuitively with fusion 360, and I always struggled with estlcam. Also, I make all of my designs in fusion, so it would seem like an extra step to make a design in fusion, send it to Estlcam, then send it to the LR4 rather than just keep everything in fusion.

1 Like

I have

[gcode arcs]
  resolution: 1
[force_move] 
  Enable_force_move: True. #required for set kinematic position command to work below

[gcode_macro MANUAL_ZERO]
gcode:
  SET_KINEMATIC_POSITION X=0 Y=0 Z=0

to enable movement without homing or after homing and squaring when the work piece is placed. There should be a way to probe and use the z offset without changing the machine absolute endstop positions, but that is another topic.

I’m trying to learn how to customize klipper to accept gcode from other sources such as a marlin sender or grbl sender rather than change the post processor to output for klipper.

Side note: got the z probe working on klipper with the cnc so it homes high – and sets 0 → when the probe contacts.

[gcode_macro PROBE_Z]
gcode:
  PROBE
  SET_KINEMATIC_POSITION Z = 0.5

[probe]
  pin: ^! z_mini: PC2   #pin on your board that probe connects
  x_offset: 0 
  y_offset: 0
  z_offset: 0.5     #this doesnt do anything but helps me remember the offset
  speed = 5        # lowering speed default
  samples = 1
  
1 Like

Hello, can you help me to make estlcam work with klipper?

There are two approaches to do this:

  1. Edit the estlcam postprocessor
  • Open the marlin post processor in estlcam (v11) setup-> CNC programs opens the cnc program preset/ postprocessor.
  • Select Marlin (this us a starting point so pick one. I picked marlin, but you could pick grbl) and change/set the following:
    → select the basic settings at the bottom:

    → Select the commands tab and remove the preceding 0 for each command so it looks like this:

    → save the post processor and load it before you save gcode for klipper.
  • make sure your gcode arcs is set correctly in your klipper printer.cfg as shown above with a resolution small enough to allow circles to appear round and use the klipper preview to verify the arcs don’t go backwards (will look like too many extra circles).
  1. [Edit: Clarifying that this us the second option if you choose not to do #1]: Add macros to klipper by defining each of the G commands in gcode_macro statements so G00 calls G0, G01 calls G1 and passes the arguements correctly. This is part of what I was specifically asking about in this post to make GRBL and Marlin code work natively with Klipper… though I’d also like to be able to send data over a socket connection to do it.

give that first one a go and see if it works. that is what I’m currently using.

1 Like

big thank you

1 Like