1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Klipper

Discussion in 'Off Topic' started by sgomes, Jan 9, 2018.

  1. sgomes

    sgomes Active Member

    Joined:
    Dec 29, 2016
    Messages:
    136
    Likes Received:
    57
    This is an interesting project, which splits up 3D printer control between the micro-controller and a separate computer (such as a Raspberry Pi), but not in the way OctoPrint does. The computer is used to calculate and schedule all the movement, whereas the micro-controller simply executes the work at the appropriate time. It can even handle multiple micro-controllers and keep them in sync, in case e.g. you want one controller per axis!

    Keeping the micro-controller codebase small supposedly helps maintain higher precision movement and a larger step throughput, and makes it much easier to tweak things, because now you're just changing a configuration file on a Linux machine, rather than recompiling and flashing new micro-controller code. Here's the feature list, where the author explains the advantages a lot better than I do.

    Definitely one to watch!
     
    OutsourcedGuru likes this.
  2. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,960
    Likes Received:
    7,344
    Interesting approach ... could work with more commodity hardware. Most of the more advanced boards (RAMBO, etc) do something similar in hardware design, but they are more expensive than the default Arduino/RAMPS/Pi sort of arrangement. Even in the case of the Pi it is not really getting leveraged to handle much of the printer work... just the slicer and host control parts.
     
  3. Grim

    Grim New Member

    Joined:
    Nov 9, 2017
    Messages:
    11
    Likes Received:
    2
    Here is a config file for a C2 if you want to try it out

    Code:
    [stepper_x]
    step_pin: PF0
    dir_pin: PF1
    enable_pin: !PD7
    step_distance: .0125
    endstop_pin: ^PE5
    position_endstop: 0
    position_max: 125
    homing_speed: 50
    
    [stepper_y]
    step_pin: PF6
    dir_pin: !PF7
    enable_pin: !PF2
    step_distance: .0125
    endstop_pin: ^PJ1
    position_endstop: 0
    position_min: 0
    position_max: 125
    homing_speed: 50
    
    [stepper_z]
    step_pin: PL3
    dir_pin: PL1
    enable_pin: !PK0
    step_distance: 0.00125
    endstop_pin: ^PD3
    homing_positive_dir: True
    homing_speed: 5.0
    position_endstop: 151.1
    position_max: 151.1
    homing_speed: 15.0
    
    [extruder]
    step_pin: PA4
    dir_pin: PA6
    enable_pin: !PA2
    step_distance: 0.006872852
    nozzle_diameter: 0.400
    filament_diameter: 1.750
    heater_pin: PB4
    sensor_type: EPCOS 100K B57560G104F
    sensor_pin: PK5
    control: pid
    pid_Kp: 23.75
    pid_Ki: 1.7
    pid_Kd: 85.0
    min_temp: 0
    max_temp: 290
    
    [probe]
    pin: ^PD2
    speed: 3.00
    z_position: 0
    activate_gcode:
        G1 Z20
    
    [bed_tilt]
    #    A newline separated list of X,Y points that should be probed
    #    during a BED_TILT_CALIBRATE command. The default is to not enable
    #    the command.
    points:
        8,30
        65.2, 30
        115, 30
    
        8, 65.2
        65.2, 65.2
        115, 65.2
    
        8,115
        65.2, 115
        115,115
    
    #probe_z_offset: -10.211017
    probe_z_offset:0
    x_adjust: 0.006699 
    y_adjust: 0.017128
    
    
    
    [fan]
    pin: PH4
    
    [mcu]
    serial: /dev/ttyACM0
    #pin_map: arduino
    
    [printer]
    kinematics: cartesian
    max_velocity: 300
    max_accel: 3000
    max_z_velocity: 20
    max_z_accel: 1000
    
    
     
    #3 Grim, Feb 24, 2018
    Last edited: Feb 25, 2018
  4. RoboticsRob

    RoboticsRob Member

    Joined:
    Oct 11, 2018
    Messages:
    60
    Likes Received:
    19
    Did anyone ever give this a try? Thinking of converting one of my R2's, so if someone had a config file for the R2 they'd be willing to share, that'd be great.
     
  5. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,960
    Likes Received:
    7,344
    Except for the MAX positions and bed heater it would be much the same as the one for the C2.
     
  6. justins

    justins New Member

    Joined:
    Sep 15, 2018
    Messages:
    3
    Likes Received:
    3
    I landed config/printer-robo3d-r2-2017.cfg in Klipper, so the R2 is now available as a standard Klipper config.
     
  7. Roberto Torres

    Roberto Torres New Member

    Joined:
    Apr 27, 2018
    Messages:
    6
    Likes Received:
    1
    I'm trying your R2 configuration in Klipper, but I'm having a hard time seeing the initial offset with the optical sendto as a depth stop. Keep diving on the bed all the time, no matter how I do the Z calibration!

    Have you tried using the offset with the mechanical Z endstop?

    Regards
     
  8. justins

    justins New Member

    Joined:
    Sep 15, 2018
    Messages:
    3
    Likes Received:
    3
    I never had a problem with the getting the IR sensor to work as an endstop. Or are you saying it works as an endstop, but you're having trouble figuring out the offset distance for your printer? If so, the Klipper documentation has a fairly complete section on figuring out the Z offset (sorry, the forum software won't let me post a link). If you want to be extra safe you should set z_offset in the [probe] section to something very small, to something very small like 1 to start with.

    Alternatively, you can uncomment the endstop switch (I left it in the file) and comment out the ABL, but you'll still have to figure out the distance to endstop switch. It may be possible to make the endstop switch and ABL work properly together, but I didn't need to, so I didn't bother.
     
  9. Roberto Torres

    Roberto Torres New Member

    Joined:
    Apr 27, 2018
    Messages:
    6
    Likes Received:
    1
    Hi Justins,

    Finally got the R2 running on Klipper, the optical sensor was bit of headache, finally solved by blocking the side of the printer by the window, IR from sunlight made it fail.

    Also got the filament sensor working, but I had to change from your config:
    switch_pin: ^!host:gpio21
    So it's high and activates when it switch to 0v.

    After tuning the rotation_distance, pressure advance and input shaper I'm just getting prints that I would never expect from this printer. Excellent!

    Are you using KlipperScreen?
     
  10. justins

    justins New Member

    Joined:
    Sep 15, 2018
    Messages:
    3
    Likes Received:
    3
    Glad Klipper is working out for you. It's my prefered firmware, and made the R2 work like a whole new printer for me. Good to know that you worked out the issue with the IR sensor. It's always been flaky for me if the room is too bright, which is probably why no printers use them anymore.

    Sorry about the filament sensor. I never actually used it for printing. I just verified that it signalled and then commented it out. I'll circle back and make a PR to fix the config.

    I did set up KlipperScreen, and prefer its UX to the original Robo3D version. Here's my HDMI section from /boot/config.txt:

    hdmi_group=2
    hdmi_mode=1
    hdmi_mode=87
    hdmi_cvt 800 480 60 6 0 0 0
    dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=390$
    display_rotate=2

    Depending on how the LCD is set in the bezel, you may have to add some padding via overscan_left, overscan_right, overscan_top, or overscan_bottom.

    You may also be in for a bit of pain if you have to calibrate the touchscreen. I ended up having to download and build a calibration tool from source to get one that worked. Although that was a few months ago now, and maybe it's been fixed in the repo.
     
  11. Michael Hauser

    Michael Hauser New Member

    Joined:
    May 21, 2017
    Messages:
    1
    Likes Received:
    0
    Does anyone have a Klipper config for an R1+? Thanks.
     
  12. Joseph Stevens

    Joseph Stevens New Member

    Joined:
    Aug 25, 2017
    Messages:
    20
    Likes Received:
    1
    Did you ever find one?
     
  13. Patrick1919

    Patrick1919 New Member

    Joined:
    Aug 28, 2021
    Messages:
    5
    Likes Received:
    0
    I'm trying to get Klipper running on the Robo R1+ in our lab, I started with the generic ramps and made some modifications according to the previous marlin firmware on our machine (the Marlin 2.0 firmware from this forum). The following is a very basic configuration, I haven't included any additional settings yet, the accuracy of the rotation distance and pid parameters require further tune.

    [stepper_x]
    step_pin: PF0
    dir_pin: !PF1
    enable_pin: !PD7
    microsteps: 16
    rotation_distance: 40
    endstop_pin: ^PE5
    position_endstop: 0
    position_max: 220
    homing_speed: 50

    [stepper_y]
    step_pin: PF6
    dir_pin: PF7
    enable_pin: !PF2
    microsteps: 16
    rotation_distance: 40
    endstop_pin: ^PJ1
    position_endstop: 0
    position_max: 236
    homing_speed: 50

    [stepper_z]
    step_pin: PL3
    dir_pin: !PL1
    enable_pin: !PK0
    microsteps: 16
    rotation_distance: 4
    endstop_pin: ^!PD3
    position_endstop: -0.5
    position_max: 230

    [extruder]
    step_pin: PA4
    dir_pin: PA6
    enable_pin: !PA2
    microsteps: 16
    rotation_distance: 4
    nozzle_diameter: 0.400
    filament_diameter: 1.750
    heater_pin: PB4
    sensor_type: EPCOS 100K B57560G104F
    sensor_pin: PK5
    control: pid
    pid_Kp: 21.83
    pid_Ki: 1.93
    pid_Kd: 61.67
    min_temp: 5
    max_temp: 290

    [heater_bed]
    heater_pin: PH5
    sensor_type: EPCOS 100K B57560G104F
    sensor_pin: PK6
    control: pid
    pid_Kp: 180.09
    pid_Ki: 8.11
    pid_Kd: 1000.24
    min_temp: 5
    max_temp: 110

    [fan]
    pin: PH6

    [mcu]
    serial: /dev/ttyACM0

    [printer]
    kinematics: cartesian
    max_velocity: 300
    max_accel: 3000
    max_z_velocity: 5
    max_z_accel: 100
     
  14. Joseph Stevens

    Joseph Stevens New Member

    Joined:
    Aug 25, 2017
    Messages:
    20
    Likes Received:
    1
    I finally gave up, and retired our R1+ to the top of some cabinets.
    I'd still be interested to know how yours is working. My thinking was that to take full advantage of Klipper's input shaper feature, the mass of the extruder should be minimized, so I converted ours to a Bowden tube setup.

    I got to a point where, I think, to really push the machine's speed, it would need to be converted to 24 v, and I just didn't feel like going through that expense in time and money.
     
  15. Patrick1919

    Patrick1919 New Member

    Joined:
    Aug 28, 2021
    Messages:
    5
    Likes Received:
    0
    We need to print TPU from time to time, so I prefer direct drive and I actually replaced both the extruder and the hotend (We are using Orbiter v1.5 & E3D v6). I slightly tested the input shaper, but I don't see any magical changes in the print quality, it did help a bit though, at higher accelerations. Maybe I didn't get the resonance frequency close enough, but I find it difficult to determine the value through the ring tower test suggested by the Klipper document. But overall the Klipper works fine and it is definitely much easier to tune the firmware settings compared to any other firmware. The following is the updated config file. I'm using Fluidd web interface, so there is a section for Fluidd. A 100mm/s print speed and 3500mm/sec2 acceleration works OK for me (PLA of course). I suspect the two Z-axis stepper motors are connected to the same set of control pins, and there will be no additional separate controls like Z-tilt in that case.

    # Klipper Printer.cfg for Robo R1+, by Patrick Ma
    # RAMPS v1.4EFB + atmega2560
    # with Mallow Orbiter v1.5 extruder and E3D V6 Hotend
    # Revised based on config file for common pin mappings for RAMPS (v1.3 and later)
    # Parameters from RoboR1PlusV2 firmware

    [stepper_x]
    step_pin: PF0
    dir_pin: !PF1
    enable_pin: !PD7
    microsteps: 16
    rotation_distance: 40
    endstop_pin: ^PE5 #xmin
    #endstop_pin: ^PE4 #xmax
    position_endstop: 0
    position_max: 220 #measured
    homing_speed: 50

    [stepper_y]
    step_pin: PF6
    dir_pin: PF7
    enable_pin: !PF2
    microsteps: 16
    rotation_distance: 40
    endstop_pin: ^PJ1 #ymin
    #endstop_pin: ^PJ0 #ymax
    position_endstop: 0
    position_max: 245 #measured
    homing_speed: 50

    [stepper_z]
    step_pin: PL3
    dir_pin: !PL1
    enable_pin: !PK0
    microsteps: 16
    rotation_distance: 4
    endstop_pin: ^!PD3 #zmin
    #endstop_pin: ^PD2 #zmax
    position_endstop: -1.045 #measured
    position_min: -1.25 #measured
    position_max: 180 #measured

    [safe_z_home]
    home_xy_position: 110, 120
    speed: 100
    z_hop: 10
    z_hop_speed: 5

    [extruder]
    step_pin: PA4
    dir_pin: !PA6
    enable_pin: !PA2
    microsteps: 16
    rotation_distance: 4.638 # Try 4.424 for the stock machine
    nozzle_diameter: 0.400
    filament_diameter: 1.750
    heater_pin: PB4
    sensor_type: ATC Semitec 104GT-2 # Likely EPCOS 100K B57560G104F for the stock machine
    sensor_pin: PK5
    control = pid
    pid_Kp = 32.621 #measured
    pid_Ki = 1.783 #measured
    pid_Kd = 149.239 #measured
    min_temp: 5
    max_temp: 290
    pressure_advance: 0.0435 #measured

    #[extruder1]
    #step_pin: PC1
    #dir_pin: PC3
    #enable_pin: !PC7
    #heater_pin: PH6
    #sensor_pin: PK7
    #...

    [heater_bed]
    heater_pin: PH5
    sensor_type: EPCOS 100K B57560G104F
    sensor_pin: PK6
    control: pid
    pid_Kp: 71.563 #measured
    pid_Ki: 1.947 #measured
    pid_Kd: 657.485 #measured
    min_temp: 5
    max_temp: 110

    [fan]
    pin: PH6

    [mcu]
    #serial: /dev/ttyACM0 # Revise to match your own machine if needed
    serial: /dev/serial/by-id/usb-Arduino__www.arduino.cc__Arduino_Mega_2560_8543036303935161C0C1-if00

    [printer]
    kinematics: cartesian
    max_velocity: 300
    max_accel: 4000
    #max_accel_to_decel: 7000
    square_corner_velocity: 5.0
    max_z_velocity: 5
    max_z_accel: 100

    [input_shaper]
    shaper_freq_x: 40 # frequency for the X mark of the test model
    shaper_freq_y: 48 # frequency for the Y mark of the test model
    shaper_type_x: ei
    shaper_type_y: mzv

    [bed_mesh]
    speed: 50
    mesh_min: 30,30
    mesh_max: 190,215
    probe_count: 3,3
    fade_start: 1
    fade_end: 10
    fade_target: 0

    [firmware_retraction]
    retract_length: 1.2
    retract_speed: 30
    unretract_extra_length: 0
    unretract_speed: 10

    [gcode_arcs]
    resolution: 0.5
    # An arc will be split into segments. Each segment's length will
    # equal the resolution in mm set above. Lower values will produce a
    # finer arc, but also more work for your machine. Arcs smaller than
    # the configured value will become straight lines. The default is
    # 1mm.

    [temperature_sensor raspberry_pi]
    sensor_type: temperature_host

    #Fluiddpi config
    [virtual_sdcard]
    path: /home/pi/gcode_files

    [pause_resume]

    [display_status]

    [gcode_macro CANCEL_PRINT]
    description: Cancel the actual running print
    rename_existing: CANCEL_PRINT_BASE
    gcode:
    TURN_OFF_HEATERS
    CANCEL_PRINT_BASE

    [gcode_macro PAUSE]
    description: Pause the actual running print
    rename_existing: PAUSE_BASE
    gcode:
    ##### set defaults #####
    {% set x = params.X|default(5) %} #edit to your park position
    {% set y = params.Y|default(5) %} #edit to your park position
    {% set z = params.Z|default(170)|float %} #edit to your park position
    {% set e = params.E|default(1.2) %} #edit to your retract length
    ##### calculate save lift position #####
    {% set max_z = printer.toolhead.axis_maximum.z|float %}
    {% set act_z = printer.toolhead.position.z|float %}
    {% set lift_z = z|abs %}
    {% if act_z < (max_z - lift_z) %}
    {% set z_safe = lift_z %}
    {% else %}
    {% set z_safe = max_z - act_z %}
    {% endif %}
    ##### end of definitions #####
    PAUSE_BASE
    G91
    {% if printer.extruder.can_extrude|lower == 'true' %}
    G1 E-{e} F2100
    {% else %}
    {action_respond_info("Extruder not hot enough")}
    {% endif %}
    {% if "xyz" in printer.toolhead.homed_axes %}
    G1 Z{z_safe}
    G90
    G1 X{x} Y{y} F6000
    {% else %}
    {action_respond_info("Printer not homed")}
    {% endif %}

    [gcode_macro RESUME]
    description: Resume the actual running print
    rename_existing: RESUME_BASE
    gcode:
    ##### set defaults #####
    {% set e = params.E|default(1.2) %} #edit to your retract length
    #### get VELOCITY parameter if specified ####
    {% if 'VELOCITY' in params|upper %}
    {% set get_params = ('VELOCITY=' + params.VELOCITY) %}
    {%else %}
    {% set get_params = "" %}
    {% endif %}
    ##### end of definitions #####
    G91
    {% if printer.extruder.can_extrude|lower == 'true' %}
    G1 E{e} F2100
    {% else %}
    {action_respond_info("Extruder not hot enough")}
    {% endif %}
    RESUME_BASE {get_params}
     
  16. rasputin

    rasputin New Member

    Joined:
    May 26, 2021
    Messages:
    4
    Likes Received:
    0
    How did you mount the Orbiter v1.5 to your printer? I've been thinking about adding one to my R1/R1+.
     
  17. Patrick1919

    Patrick1919 New Member

    Joined:
    Aug 28, 2021
    Messages:
    5
    Likes Received:
    0
    upload_2021-9-8_11-44-4.png
    I printed 3 parts to mount the Orbiter v1.5& E3D v6 (the block between x carriage and extruder)
     
  18. rasputin

    rasputin New Member

    Joined:
    May 26, 2021
    Messages:
    4
    Likes Received:
    0
    Would you mind posting a link to the stls for those parts?
     
  19. rasputin

    rasputin New Member

    Joined:
    May 26, 2021
    Messages:
    4
    Likes Received:
    0
    Have you since been able go get bed autoleveling to work?
     
  20. Patrick1919

    Patrick1919 New Member

    Joined:
    Aug 28, 2021
    Messages:
    5
    Likes Received:
    0
    No, I didn't try to set the auto-leveling because I'm not confident with the probing accuracy from my past experience with the bed-leveling mechanism of Robo R1+. Instead, I set up a 9-point manual mesh bed leveling, as long as I don't move the print bed around, the mesh should be persistent. However, if you have a probe, it wouldn't be hard to add that into the configuration.

    I haven't posted the CAD files for the mount parts anywhere and it's a total mess in my workspace right now. But I surely can upload them to Thingiverse later, once I get them organized properly.
     

Share This Page