MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.28k stars 19.23k forks source link

Dual-Z-Axis Homing: Only perfect if hitting Z2_MIN_ENDSTOP first #12020

Closed MarphXL closed 5 years ago

MarphXL commented 6 years ago

I Have MKS Gen V1.4 with TMC2208 on all stepper. I Use Z-Dual-Axis with two Endstops (Z-MIN and Z2-Min). If I do a Z-homing both Z-axis going down. If it hits the Z2_MIN_ENDSTOP first, the Z2-AXIS stops and the Z-AXIS going down till it hits the Z_MIN_ENDSTOP. Perfect! Both sides are leveled.

But if the Printer hits the Z-Min-Endstop first than he stops homing. The Z2-Min-Endstop wasn't hit.

It's reproducable. Everytime! (config-files in Marlin.zip at end of this text)

Could you help and give me a tip what I have misconfigured or missunderstanded?

configuration_adv.h

#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
  #define Z_DUAL_ENDSTOPS
  #if ENABLED(Z_DUAL_ENDSTOPS)
    #define Z2_USE_ENDSTOP _YMAX_
    #define Z_DUAL_ENDSTOPS_ADJUSTMENT  0
  #endif
#endif

configuration.h

// @section homing

// Specify here all the endstop connectors that are connected to any endstop or probe.
// Almost all printers will be using one per axis. Probes will use one or more of the
// extra connectors. Leave undefined any used for non-endstop and non-probe purposes.
#define USE_XMIN_PLUG
#define USE_YMIN_PLUG
#define USE_ZMIN_PLUG
#define USE_Z2MIN_PLUG // 20181006
//#define USE_XMAX_PLUG
#define USE_YMAX_PLUG  // ***
//#define USE_ZMAX_PLUG

// Enable pullup for all endstops to prevent a floating state
#define ENDSTOPPULLUPS // ***
#if DISABLED(ENDSTOPPULLUPS)
  // Disable ENDSTOPPULLUPS to set pullups individually
  //#define ENDSTOPPULLUP_XMAX
  //#define ENDSTOPPULLUP_YMAX
  //#define ENDSTOPPULLUP_ZMAX
  //#define ENDSTOPPULLUP_XMIN
  //#define ENDSTOPPULLUP_YMIN  // ***
  //#define ENDSTOPPULLUP_ZMIN
  //#define ENDSTOPPULLUP_ZMIN_PROBE
#endif

// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the probe.

pins_RAMPS.h

//
// Limit Switches
//
#define X_MIN_PIN           3
#ifndef X_MAX_PIN
  #define X_MAX_PIN         -1   // D2 ist für serial /USB-Serial
#endif
#define Y_MIN_PIN          14
#define Y_MAX_PIN          15
//#define Z2_MIN_PIN         15   // wird in configuration_adv.h mit Y_Max definiert
#define Z_MIN_PIN          18
#define Z_MAX_PIN          19

Marlin.zip

MarphXL commented 5 years ago

I didn't get it to work. Bought another board but I have the same bug. Frustrating. I wait for a new Marlin-Version with the fixed bug.

thinkyhead commented 5 years ago

Let's try using M43 E without doing any homing.

Do you see anything unusual going on in this scenario?

joergles commented 5 years ago

Did you try switching the endstop connectors of the two Z-endstops on the board ? It worked for me with the endstop for Z stepper on E1 using ZMIN and the stepper on Z using ZMAX (the additional one). Whyever ... I use Marlin 1.1.9

MarphXL commented 5 years ago

20181215_test_issue12020

@thinkyhead I tested it, but everything looks quite good

@joergles thanks for the tipp, but I tried this before with zmax and with ymax and I tried another board, but with no effects

boelle commented 5 years ago

@MarphXL

This Issue Queue is for Marlin bug reports and development-related issues, and we prefer not to handle user-support questions here. (As noted on this page.) For best results getting help with configuration and troubleshooting, please use the following resources:

After seeking help from the community, if the consensus points to to a bug in Marlin, then you should post a bug report. Before posting a bug report please test with bugfix-2.0.x to check if problem is gone

MarphXL commented 5 years ago

it is a bug in the handling of interrupts. Not every interrupt-pin works and in source code you coulg chamge the endstop-passage

boelle commented 5 years ago

and you are using bugfix 2.0?

MarphXL commented 5 years ago

of course two printers with 2.0. and ¹.1.9 on another printer.

boelle commented 5 years ago

funny, i also use dual z drivers and dual z endstop, no problems

how old is the 2.0 copy you have?

MarphXL commented 5 years ago

funny? it is frustrating. i guess that you did not use tmc2208 with serial connection? the rx for every tmc2208 needs an interrupt. dual z-endstop interrupts and the tmc-interrupts... this combination is buggy

boelle commented 5 years ago

how old is the 2.0 copy you have?

MarphXL commented 5 years ago

5 weeks. I installed every month a new bugfix since September 2018

GMagician commented 5 years ago

I don't think it's a buggy combination (even if it's possible) but a congestion combination. You are using a 2560 board that has to handle a lot of things and maybe your real issue is that board has not enough computation power to handle all of these things.

boelle commented 5 years ago

5 weeks is also very old... 2.0 is updated every 2nd day

and 2560 is a very SLOW board, try re-arm

AnHardt commented 5 years ago

'Endstop Interrupts' and 'software serial' exclude each other. Both do handle the Pin_Change_Interrupts as if they where alone on the world. Using a good common PCI-library could be a solution but is probably to slow to be useful.

AnHardt commented 5 years ago

I don't see a solution for this until we get boards with enough 'external interrupt' pins. Up to now only the STM32 processors with lots of pins have potential for this. For the existing boards with AVR, SAM, LPC i don't have any hope.

MarphXL commented 5 years ago

Chinaboards and Arduino Uno uses only 70 Pins from Mega2560. If I connect all pins (own-designed board) I could use 86 pins with 8 more Interrupts. I assumed that there was an incorrect interrupt handling in marlin. Speedproblems would not ignore the triggered interrupt, right? I tested with MKS Gen v1.4, Trigorilla-Board and my own board

MarphXL commented 5 years ago

5 weeks is also very old... 2.0 is updated every 2nd day

@boelle However, the end-routines are not changed every 2 days

boelle commented 5 years ago

China stuff is the root to all evil

boelle commented 5 years ago

I use stuff from the western world, better quality and better service and in most cases it just works

MarphXL commented 5 years ago

@boelle Which board did you use ?

boelle commented 5 years ago

re-arm: https://www.panucatt.com/Re_ARM_for_RAMPS_p/ra1768.htm ramps: https://www.staticboards.com/products/arduino-shield-ramps-1-4-sb-premium/

boelle commented 5 years ago

drivers: https://www.watterott.com/de/SilentStepStick but also used these: https://3dnielsen.dk/controller-boards/447-drv8825-stepper-1-stk.html?search_query=drv8825&results=8

boelle commented 5 years ago

also i have used this with success: https://store.arduino.cc/arduino-mega-2560-rev3

boelle commented 5 years ago

@thinkyhead Another one that needs to be closed. Sorry, I got bored.

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.