Frix-x / klippain

Generic Klipper configuration for 3D printers
GNU General Public License v3.0
849 stars 221 forks source link

ERCF Happy Hare support #141

Closed AMFkuna closed 1 year ago

AMFkuna commented 1 year ago

Hi Frix-x Are you planning to support ERCF Happy Hare please? https://github.com/moggieuk/ERCF-Software-V3

Thanks

Frix-x commented 1 year ago

Hello! Yes I'm working with @Benoitone to switch to Happy hare as the default ERCF system in Klippain. In the meantime you can already use it like that:

  1. Use the Happy Hare installer from moggieuk (install.sh -i) and let it do its job
  2. In your printer.cfg let only
    [include ercf_hardware.cfg]

    but remove the following lines:

    [include client_macros.cfg]
    [include ercf_software.cfg]
    [include ercf_parameters.cfg]
    1. In the ercf_hardware.cfg file add to the top:
      
      [gcode_macro _USER_VARIABLES]
      variable_ercf_enabled: True
      gcode:

[include ercf_software.cfg] [include ercf_parameters.cfg]

  4. Then in your `overrides.cfg` file, add this specific macro needed for the START_PRINT:

Specific macro to raise an error during the print_start and stop in case of ERCF error

[gcode_macro _DO_ERROR_ERCF_PAUSE] gcode: {% if printer.ercf.is_paused|int == 1 %} {action_raise_error("ERROR ERCF !!! UNLOCK ERCF FIRST and restart start_print macro.")} {% else %} {% if verbose %} RESPOND MSG="ERCF not paused" {% endif %} {% endif %}


  5. Check in the `ercf_hardware.cfg` file the pins and change them according to your `mcu.cfg`

With this, everything should work correctly. Also, you can be "safe" as the files are set in the "Klippain way" and will not be deleted on update :)
AMFkuna commented 1 year ago

Many thanks for your great work !!

Surion79 commented 1 year ago

There is an issue with this description, the Happy Hare will not boot up and throw a warning. The [save_variables] section in the variables.cfg points to apparently original ERCF variables. This is "incomplete" for Happy Hare as the option ercf_calib_clog_length = 8.0 is not set. this missing line errors out booting ERCF. since the variables.cfg is included "after" the ercf_hardware.cfg of the [save_variables] section the HappyHare include is overwritten. (That took HOURS for me to find out :D )

Benoitone commented 1 year ago

Ho Yes, in ercf_software.cfg The first 2 lines must be commented like:

**#[save_variables]

filename: /home/pi/printer_data/config/ercf_vars.cfg**

So ercf use the default klippain variable file to save is variable which is defined at the end of klippain variable.cfg file(because only one save_variable file must be present.)

I don't know if it's necessary to add: ercf_calib_clog_length = 8.0 in klippain save_variables.cfg ???

Surion79 commented 1 year ago

Ho Yes, in ercf_software.cfg The first 2 lines must be commented like:

#[save_variables] #filename: /home/pi/printer_data/config/ercf_vars.cfg

So ercf use the default klippain variable file to save is variable which is defined at the end of klippain variable.cfg file(because only one save_variable file must be present.)

I don't know if it's necessary to add: ercf_calib_clog_length = 8.0 in klippain save_variables.cfg ???

yes, as i described, you need to add the clog length or Happy Hare WILL NOT boot/start.

Benoitone commented 1 year ago

I just try to remove ercf_calib_clog_length from my save_variables.cfg file and when i make the ercf calibration (ERCF_CALIBRATE_SINGLE TOOL=0 or ERCF_CALIBRATE) the ercf_calib_clog_length line has been created...

Surion79 commented 1 year ago

image This doesn't work with the macro when I have an ercf error... Not sure what the issue is yet

Benoitone commented 1 year ago

OK, i just test too and I think it's a change in ERCF Happy Hare.... image

Benoitone commented 1 year ago

I think it can work...

    {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %}
    {% set INITIAL_TOOL = printer["gcode_macro START_PRINT"].initial_tool %}
    {% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}

    {% if printer.ercf.enabled|int == 1 %}
        {% if printer.ercf.tool|int != INITIAL_TOOL or printer.ercf.filament != "Loaded" %}
            {% if status_leds_enabled %}
                STATUS_LEDS COLOR="ERROR"
            {% endif %}
            {action_raise_error("ERROR in loading filament from ERCF !!! Check and restart the print.")}
        {% else %}
            {% if verbose %}
                RESPOND MSG="T{INITIAL_TOOL} ready"
            {% endif %}
        {% endif %}
    {% endif %}
Frix-x commented 1 year ago

Closing as Klippain v4 is merged and released :)