Configuring SKR2 for CoreXY with Z-Probe in Version 2

edited November 2021 in Questions & Answers
I need some advice migrating my 1.04 settings to version 2.

How/where should I define that my printer doesn't have X-Min and Y-Min endstops but has X-Max and Y-Max stops?
Also, how to configure Z-probe as Z-Min while also having Z-Max endstop?

I tried to change few settings but that did not help. Here is what I currently have in Configuration.h
#undef X_MIN_PIN
#define X_MIN_PIN -1
#undef X_MAX_PIN
#define X_MAX_PIN ORIG_X_MAX_PIN

#undef Y_MIN_PIN
#define Y_MIN_PIN -1
#undef Y_MAX_PIN
#define Y_MAX_PIN ORIG_Y_MAX_PIN

#undef Z_MIN_PIN
#define Z_MIN_PIN ORIG_ZPROBE
#undef Z_MAX_PIN
#define Z_MAX_PIN ORIG_Z_MAX_PIN

Z-probe is configured as this

// Define ZProbe by referencing an endstop defined
CONFIG_VARIABLE_EQ(EndstopDriver, *ZProbe, &endstopZMin)
For whatever reason, when sending M119, I see x-min instead of x_max, y_max appears correctly, z_max is missing, z_min is present while it should not be there and z_min and Z-probe always show the same values.

SENDING:M119
ok 0
endstops hit: x_min:H  y_max:L  z_min:H  Z-probe state:H

In version 1.04 M119 was showing the line below. That's what I'd expect from version 2 as well

endstops hit: x_max:H  y_max:H  z_max:L  Z-probe state:H

Thanks












Comments

  • Homing direction is independent form end stops
    #define X_HOME_DIR 1
    #define Y_HOME_DIR 1
    #define Z_HOME_DIR 1

    This would e.g. make all axis max homing.

    Z Probe is independent from normal endstops. For cartesian you define end stops like this:

    ENDSTOP_SWITCH_HW(endstopXMin, IOEndstopXMin, X_AXIS, false)
    ENDSTOP_NONE(endstopXMax)
    ENDSTOP_NONE(endstopYMin)
    ENDSTOP_SWITCH_HW(endstopYMax, IOEndstopYMax, Y_AXIS, true)
    ENDSTOP_SWITCH_HW(endstopZMin, IOEndstopZMin, Z_AXIS, false)
    ENDSTOP_NONE(endstopZMax)

    If you home z min you don't need endstopZMin so assign it ENDSTOP_NONE - firmware will use z probe in stead automatically. Last parameter is min (false) or max(true) end stop. So changing pin names is not relevant, relevant is what pin you in the end assign to endstopXXX
  • I had homing directions set correctly. After updating Configuration_io.h as shown below
    // Define your endstops inputs

    IO_INPUT(IOEndstopXMax, ORIG_X_MAX_PIN)
    IO_INPUT(IOEndstopYMax, ORIG_Y_MAX_PIN)
    IO_INPUT(IOEndstopZMin, ORIG_ZPROBE)
    IO_INPUT(IOEndstopZMax, ORIG_Z_MAX_PIN)
    // Define our endstops solutions
    // You need to define all min and max endstops for all
    // axes except E even if you have none!

    ENDSTOP_NONE(endstopXMin)
    ENDSTOP_SWITCH_HW(endstopXMax, IOEndstopXMax, X_AXIS, true)
    ENDSTOP_NONE(endstopYMin)
    ENDSTOP_SWITCH_HW(endstopYMax, IOEndstopYMax, Y_AXIS, true)
    ENDSTOP_SWITCH_HW(endstopZMin, IOEndstopZMin, Z_AXIS, false)
    ENDSTOP_SWITCH_HW(endstopZMax, IOEndstopZMax, Z_AXIS, true)
    I can now read all end stops correctly:
    SENDING:M119
    ok 0
    endstops hit: x_max:H  y_max:L  z_min:H  z_max:H  Z-probe state:H
    The only difference from version 1.04 is now that I still see in M119 printout z_min showing the same as Z-Probe state. Not sure if this affects anything internally, or whether there is a way to hide z_min.

    My printer is CoreXY (H-bot).

    Many thanks

  • And another question: My printer has only one extruder and I have the following settings:
    #define NUM_TOOLS 1
    #define NUM_EXTRUDER 1
    #define TOOLS \
        { &ToolExtruder1 }
    #define NUM_HEATERS 2
    #define HEATERS \
        { &HeaterExtruder1, &HeatedBed1 }
    Every time I connect Pronterface to SKR2 right after powering up SKR2, I get the following messages:
    Printer is now online.
    Error:Heater E1 may be defective. Sensor reported unusual values. This could mean a broken wire or a shorted contact on the sensor.
    [ERROR] Error:Heater E1 may be defective. Sensor reported unusual values. This could mean a broken wire or a shorted contact on the sensor.

    setError:1
    RequestStop:
    Error:Heater sensor defect - Printer stopped and heaters disabled due to this error. Fix error and restart with M999.
    [ERROR] Error:Heater sensor defect - Printer stopped and heaters disabled due to this error. Fix error and restart with M999.
    If I am reading the following code correctly "Heater E1" in the error message actually refers to HeaterExtruder2, which I don't have.
    HEAT_MANAGER_PID(HeaterExtruder2, 'E', 1, TempExt2, PWMExtruder2, 260, 255, 1000, 10, 20000, 20.0, 0.6, 65.0, 40, 220, false)
    So the question is - where else should I remove the 2nd tool/extruder?

    Thanks.
  • Looks like I fixed the issue with the error by commenting out the following 3 lines in Configuration_io.h

    HEAT_MANAGER_PID(HeaterExtruder2, 'E', 1, TempExt2, PWMExtruder2, 260, 255, 1000, 10, 20000, 20.0, 0.6, 65.0, 40, 220, false)

    TOOL_EXTRUDER(ToolExtruder2, 16.775, 0.615, -0.97, HeaterExtruder2, /*AL2Motor */ E2Motor, 1.75, 147.0, 5, 30, 5000, 40, "M117 Extruder 2\nM400\nM340 P0 S1500 R600\nG4 P300", "M340 P0 S800 R600\nG4 P300", &Fan1PWM)

    JAM_DETECTOR_HW(JamExtruder2, E2Motor, IOJam2, ToolExtruder2, 220, 10, 500)
    The question about z_min in M119 printout remains.

    Thanks





  • It might be that you need
    ENDSTOP_NONE(endstopZMin)
    so you only have z probe for z m in measuring. That is what you physically have anyway.

    Removing the 3 lines is correct. As soon as you define something with macros it gets initialized. You just did not add it to all loops, so it did not get used in reports but was working and as you can see can also create errors. Therefor only define pins and devices that you really have. 
  • I have tried that. It takes out both - Zmin and Z-probe from M119 printout
    SENDING:M119
    ok 0
    endstops hit: x_max:L  y_max:L  z_max:H
    I think that happens because of the following line, which points to endstopZMin
    CONFIG_VARIABLE_EQ(EndstopDriver, *ZProbe, &endstopZMin)
    Then I decided to "improvise" and made the following changes and it gave me correct printout, however I don't know if this will break anything else.
    // IO_INPUT(IOEndstopZMin, ORIG_Y_MIN_PIN)
    IO_INPUT(IOEndstopZprobe, ORIG_ZPROBE)
    ENDSTOP_NONE(endstopZMin)
    // ENDSTOP_SWITCH_HW(endstopZMin, IOEndstopZMin, Z_AXIS, false)
    ENDSTOP_SWITCH_HW(endstopZprobe, IOEndstopZprobe, Z_AXIS, false)
    // CONFIG_VARIABLE_EQ(EndstopDriver, *ZProbe, &endstopZMin)CONFIG_VARIABLE_EQ(EndstopDriver, *ZProbe, &endstopZprobe)
    Here is my latest
    >>>M119
    SENDING:M119
    ok 0
    endstops hit: x_max:L  y_max:L  z_max:H  Z-probe state:H
    Thanks

  • edited November 2021
    After (hopefully) finishing with endstop setup I started testing fans and heaters and found out that only heat bed is working. Neither of fans or extruder heaters would turn on. I checked the voltage and discovered that + pins of fan and heater connectors had no power. Meanwhile heat bed was getting +24V as expected. I was using M104, M140 and M106/M107 GCodes for testing.

    After several hours of troubleshooting I was ready to conclude that my board is defective, but then, just because I was out of other ideas, I tried to load Marlin firmware and all the sudden it worked.

    Long story short, and I am purely speculating here, looks like +24V to all fans and extruders on SKR2 is supplied via common mosfet or some kind of other component controlled by CPU, because when I run Marlin, couple of seconds after powering on the board the green LED comes up next to power connector and fans and extruders get +24V. When running Repetier, this LED remains off and there is no power.
    I wanted to upload the picture to show the exact location of the LED, but unfortunately these forums do not have such option.

    Thanks

  • I found the MOSFET that kills power of extruders, fans and steppers. It is controlled by CPU pin PC13. This pin is defined as SAFE_POWER_PIN but not used anywhere in the code. It needs to be set into UP state after booting up the board.

  • edited December 2021
    Found the code switching power on in MarlinCore.cpp file

    #if PIN_EXISTS(SAFE_POWER)
        #if HAS_DRIVER_SAFE_POWER_PROTECT
          SETUP_RUN(stepper_driver_backward_check());
        #else
          SETUP_LOG("SAFE_POWER");
          OUT_WRITE(SAFE_POWER_PIN, HIGH);
        #endif
      #endif 

    I think the following code would solve the issue but I am unsure where would be the right place to add it. Should be somewhere in the startup sequence

    #if defined(STM32F4) || defined(INI_SKR2)
        #ifdef SAFE_POWER_PIN
            pinMode(SAFE_POWER_PIN, OUTPUT);
            digitalWrite(SAFE_POWER_PIN, HIGH)
        #endif
    #endif

  • Yes, that was it. I added below lines to Printer.cpp right before
    #if defined(ENABLE_POWER_ON_STARTUP) && ENABLE_POWER_ON_STARTUP && (PS_ON_PIN > -1)
    and the board got power.

    #ifdef SAFE_POWER_PIN
        pinMode(SAFE_POWER_PIN, OUTPUT);
        digitalWrite(SAFE_POWER_PIN, HIGH);
    #endif

    @Repetier I will wait for you to update the code "the proper way" and then will retest.

    Thanks


  • Thanks. I have added a variation of your solution that should work. Just a bit earlier, also I do not think it is that important how early it gets enabled. Have committed the fix.
  • @Repetier Tested your fix. It is working!

    Many Thanks!!
  • lmcbmai said:
    Looks like I fixed the issue with the error by commenting out the following 3 lines in Configuration_io.h

    HEAT_MANAGER_PID(HeaterExtruder2, 'E', 1, TempExt2, PWMExtruder2, 260, 255, 1000, 10, 20000, 20.0, 0.6, 65.0, 40, 220, false)

    TOOL_EXTRUDER(ToolExtruder2, 16.775, 0.615, -0.97, HeaterExtruder2, /*AL2Motor */ E2Motor, 1.75, 147.0, 5, 30, 5000, 40, "M117 Extruder 2\nM400\nM340 P0 S1500 R600\nG4 P300", "M340 P0 S800 R600\nG4 P300", &Fan1PWM)

    JAM_DETECTOR_HW(JamExtruder2, E2Motor, IOJam2, ToolExtruder2, 220, 10, 500)
    The question about z_min in M119 printout remains.

    Thanks





    Can someone please explain what version of Marlin has Configuration_io.h or what provides or generates it?
  • @Poikilos
    This is repetier-firmware thread! configuration_io.h is a config file in repetier-firmware V2.x!
Sign In or Register to comment.