-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
π§βπ» Clean up the endstops situation #25748
π§βπ» Clean up the endstops situation #25748
Conversation
94a41ba
to
1bf5cec
Compare
ad7c9ee
to
d78a648
Compare
dbe298e
to
d9fcb19
Compare
97cf36a
to
2a8b086
Compare
2a8b086
to
b4b4364
Compare
commit cfbd8a2 Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Thu May 4 00:20:30 2023 +0000 [cron] Bump distribution date (2023-05-04) commit 7642bfb Author: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Wed May 3 14:19:32 2023 -0700 π Fix TFT Touch Calibration overrides (MarlinFirmware#25579) β¦and other misc. display-related updates Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com> commit dbed3f1 Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Wed May 3 00:20:18 2023 +0000 [cron] Bump distribution date (2023-05-03) commit e1f6435 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Tue May 2 17:59:27 2023 -0500 β¨ Creality STM32F401RE board (e.g., Ender-5 S1) (MarlinFirmware#25773) commit 21ea9bf Author: plampix <plampix@users.noreply.github.com> Date: Tue May 2 23:50:07 2023 +0200 π Fix minimal M115, Cap:PROGRESS:0 (MarlinFirmware#25769) Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com> commit 137ea43 Author: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed May 3 09:15:10 2023 +1200 β¨ Creality Ender-2 (Melzi) (MarlinFirmware#25754) commit 9aa69cb Author: plampix <plampix@users.noreply.github.com> Date: Tue May 2 07:01:44 2023 +0200 Fix G12 Nozzle Clean (MarlinFirmware#25766) Followup to MarlinFirmware#25666 commit 61f0dd2 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Mon May 1 20:23:41 2023 -0500 π©Ή Fix _CAN_HOME for new endstop flags commit 207535a Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Mon May 1 20:33:58 2023 -0500 π¨ Fix Multi-Language Menu criteria commit 4812ed5 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Mon May 1 18:45:42 2023 -0500 π¨ Misc. code cleanup commit f89fa4c Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Tue May 2 00:24:02 2023 +0000 [cron] Bump distribution date (2023-05-02) commit b042567 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Mon May 1 18:15:31 2023 -0500 π©Ή Fix TFT sanity error commit 4bed8a8 Author: Scott Mikutsky <smikutsky@gmail.com> Date: Mon May 1 02:10:46 2023 -0400 π Fix STM32 USB disconnect behavior (MarlinFirmware#25762) commit 006a9e5 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sun Apr 30 23:10:44 2023 -0500 π©Ή NOZZLE_CLEAN_PATTERN_* Followup Followup to MarlinFirmware#25666 commit 55cbe15 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sun Apr 30 19:14:53 2023 -0500 π§ Remove config.ini obsolete options commit 35dd6a3 Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Mon May 1 00:22:20 2023 +0000 [cron] Bump distribution date (2023-05-01) commit 9773160 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sun Apr 30 18:24:05 2023 -0500 π§ Character display has boot screen commit f246e0d Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sun Apr 30 18:12:13 2023 -0500 π§ Fix X2/Y2 axis pins check commit 4937a64 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sun Apr 30 18:12:21 2023 -0500 π§βπ» Use NUM_AXIS_ARRAY commit b88ab39 Author: ellensp <530024+ellensp@users.noreply.github.com> Date: Mon May 1 09:52:29 2023 +1200 π Fix Ender-2 Stock LCD on MELZI_CREALITY (MarlinFirmware#25759) commit 3b50b6a Author: Davide RombolΓ <davide.rombola@gmail.com> Date: Sun Apr 30 23:36:47 2023 +0200 π§ Allow BLTOUCH_HS_EXTRA_CLEARANCE == 0 (MarlinFirmware#25760) commit ec6bc15 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sat Apr 29 20:10:33 2023 -0500 π Fix FT Motion reversed Z commit 5aef2c0 Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Sun Apr 30 00:22:44 2023 +0000 [cron] Bump distribution date (2023-04-30) commit 4c033c3 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sat Apr 29 12:34:56 2023 -0500 π§βπ» Tweak homing debug commit f9db5ab Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Sat Apr 29 00:20:26 2023 +0000 [cron] Bump distribution date (2023-04-29) commit c5a2e41 Author: James Pearson <jamespearson04@hotmail.co.uk> Date: Fri Apr 28 23:30:15 2023 +0100 π Probe behavior corrections (MarlinFirmware#25631) Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com> Co-authored-by: David Fries <2767875+dfries@users.noreply.github.com> commit 7d95928 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Fri Apr 28 13:38:59 2023 -0500 π Fix auto pullup/down settings Followup to MarlinFirmware#25748 commit a872232 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Fri Apr 28 11:03:38 2023 -0500 π§ Move MMU section commit 6323de3 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Fri Apr 28 11:03:20 2023 -0500 π¨ Fix LPC faux pins Followup to MarlinFirmware#25332 commit 0e2c5b4 Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Fri Apr 28 00:21:29 2023 +0000 [cron] Bump distribution date (2023-04-28) commit 959f730 Author: TheSnowfield <17957399+TheSnowfield@users.noreply.github.com> Date: Thu Apr 27 20:37:11 2023 +0800 β¨ AUTO_REPORT_REAL_POSITION option for M154 (MarlinFirmware#25738) commit 9a7d9e6 Author: Martin Turski <turningtides@outlook.de> Date: Thu Apr 27 14:05:24 2023 +0200 π§βπ» Optimize PlatformIO source filtering (MarlinFirmware#25332) Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com> commit 774861b Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Wed Apr 26 20:04:01 2023 -0500 π§ Endstops followup commit 04a25ab Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Thu Apr 27 00:22:32 2023 +0000 [cron] Bump distribution date (2023-04-27) commit 467ab74 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Wed Apr 26 14:56:23 2023 -0500 π§βπ» Simplify endstops config (MarlinFirmware#25748) commit 358a54e Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Wed Apr 26 14:39:56 2023 -0500 π¨ Servo Timer 1 with STM32F103RC_fysetc (MarlinFirmware#25741) commit 79b4555 Author: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Wed Apr 26 21:38:39 2023 +0200 π§ Thermistor 100 : SoC sensor (MarlinFirmware#25745) Followup to MarlinFirmware#25642 commit d364bab Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Wed Apr 26 14:29:21 2023 -0500 π§βπ» Change HAL_PATH macro for easier HAL relocation (MarlinFirmware#25743) commit 1771d7a Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Wed Apr 26 13:51:33 2023 -0500 β Skip change alerts in CI test commit 68f7478 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Wed Apr 26 13:50:45 2023 -0500 π¨ Misc. fixes, cleanup commit 08edb62 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Wed Apr 26 02:57:53 2023 -0500 π§ Extra axis endstop defaults commit a4cc9b6 Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Wed Apr 26 00:21:12 2023 +0000 [cron] Bump distribution date (2023-04-26) commit f5a905a Author: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Tue Apr 25 04:51:44 2023 +0200 β¨ TEMP_SENSOR_SOC (MarlinFirmware#25642) Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com> commit d1738e9 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Mon Apr 24 21:40:08 2023 -0500 π§ Fix LCD_SERIAL_PORT config commit 650e6fc Author: Anson Liu <ansonl@users.noreply.github.com> Date: Mon Apr 24 22:07:12 2023 -0400 π¨ Prevent SlowSoftWire + Wire name conflict (MarlinFirmware#25707) commit c034819 Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Tue Apr 25 00:20:57 2023 +0000 [cron] Bump distribution date (2023-04-25) commit 077a620 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Mon Apr 24 05:24:10 2023 -0500 π Developer note in boards.h commit 2954bf2 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Mon Apr 24 00:24:40 2023 -0500 π Replace '=' with '{' for substitution commit 743903b Author: Nick <nick@n-wells.co.uk> Date: Mon Apr 24 01:50:39 2023 +0100 π©Ή Fix Anycubic PlayTune (MarlinFirmware#25735) Followup to MarlinFirmware#25690 Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com> commit 02a14d3 Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Mon Apr 24 00:21:28 2023 +0000 [cron] Bump distribution date (2023-04-24) commit df4f806 Author: plampix <plampix@users.noreply.github.com> Date: Mon Apr 24 01:12:47 2023 +0200 β¨ NOZZLE_CLEAN_PATTERN_* (MarlinFirmware#25666) Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com> commit 9902097 Author: ellensp <530024+ellensp@users.noreply.github.com> Date: Mon Apr 24 11:11:02 2023 +1200 π¨ Gather GD32, suppress redundant #error (MarlinFirmware#25665) Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com> commit 10ed5ab Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sun Apr 23 03:17:55 2023 -0500 πΈ Improve PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED (MarlinFirmware#25681) commit 1669356 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sun Apr 23 03:00:56 2023 -0500 π§ Split followup commit aaf55a2 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sun Apr 23 02:07:42 2023 -0500 π©Ή Fix UBL safe measure move with extra axes Followup to 7e79fc5 commit 69f8da4 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sun Apr 23 01:58:01 2023 -0500 π§ Split Changes.h from SanityCheck.h (MarlinFirmware#25732) commit f0f7ec8 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sun Apr 23 00:47:44 2023 -0500 π§βπ» Stepper::set_directions() => apply_directions() commit 921591d Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sat Apr 22 23:15:31 2023 -0500 π§βπ» SDIO_SUPPORT => ONBOARD_SDIO commit 5664c02 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sat Apr 22 22:43:09 2023 -0500 π§βπ» Generalize SDSUPPORT as HAS_MEDIA In preparation for single- and multi-volume refactoring. commit ce85b98 Author: Jason Smith <jason.inet@gmail.com> Date: Sat Apr 22 20:27:01 2023 -0700 π©Ή Relocate Fan conditionals, sanity-checks (MarlinFirmware#25731) Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com> commit 95cfc98 Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Sun Apr 23 00:22:56 2023 +0000 [cron] Bump distribution date (2023-04-23) commit 5d8d38a Author: ellensp <530024+ellensp@users.noreply.github.com> Date: Sun Apr 23 08:59:51 2023 +1200 π©Ή Status / Host Prompt followup (MarlinFirmware#25720) Followup to MarlinFirmware#25679 Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com> commit 3117339 Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Sat Apr 22 12:06:22 2023 +0000 [cron] Bump distribution date (2023-04-22) commit c8ed795 Author: ellensp <530024+ellensp@users.noreply.github.com> Date: Sat Apr 22 21:09:17 2023 +1200 π§ Permit extrude without hotend (MarlinFirmware#25709) Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com> commit 89ccede Author: Alexey D. Filimonov <alexey@filimonic.net> Date: Sat Apr 22 12:06:19 2023 +0300 π¨ Clean up TFT Color UI display items (MarlinFirmware#25712) Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com> commit fba1f83 Author: ellensp <530024+ellensp@users.noreply.github.com> Date: Sat Apr 22 21:02:51 2023 +1200 π©Ή Fix Anycubic PlayTune (MarlinFirmware#25728) Followup to MarlinFirmware#25690 commit 726de7e Author: Nomis-97 <72187111+Nomis-97@users.noreply.github.com> Date: Sat Apr 22 10:16:19 2023 +0200 π Fix MKS Gen-L MOSFETs (MarlinFirmware#25717) commit 4233e48 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sat Apr 22 01:56:10 2023 -0500 πΈ MarlinUI Endstop Test Screen, and more (MarlinFirmware#25667) commit 98277f2 Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Fri Apr 21 00:20:12 2023 +0000 [cron] Bump distribution date (2023-04-21) commit ded9ffa Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Thu Apr 20 17:35:20 2023 -0500 π§βπ» Apply INVERT_DIR to SET_STEP_DIR commit 335ba32 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Thu Apr 20 17:21:59 2023 -0500 π©Ή Fix Core Kinematics BABYSTEP_XY
@thinkyhead: I have a question about this commit. At some point in the past, it was possible to define "USE_XMAX_PLUG" even if the printer was homing to X min (i.e. X_HOME_DIR is -1). The reason for having both X_MIN and X_MAX active simultaneously is to prevent the printer from skipping steps if it tried to exceed the end stop on a non-homing move. After this cleanup, it is not clear to me how to tell Marlin that the X_MAX end-stop exists and should be checked during non-homing moves on a printer that homes to X_MIN. This was needed by certain older LulzBot printers where the same firmware file was used on two generations of printers with slightly different travel limits. Rather than having two different firmware files with the correct X_MAX values for the printer, the soft limit was set to a value larger than the physical travel, with the consequence that during probing the head would hit the end-stop and movement would cease, thus making the same firmware work regardless of the printer model. |
I haven't entirely formalized that, but one of the points of the refactor is to get that formalized rather than relying on an unstated side-effect. So I stuck in a check for "(AXIS)_SAFETY_STOP" as a way to have more than one endstop on a single axis, but haven't added that as a configuration option yet, pending the collection of more information about use cases. |
@thinkyhead: It sounds like "(AXIS)_SAFETY_STOP" is what I need for those old LulzBot printers. Thank you! |
@thinkyhead: I tried grepping the code in bugfix-2.1.x for "SAFETY" and I see nothing. Has this been implemented yet? |
Check out #25758 which should be merged soon. I just have to work out a couple more details. |
Sorry, I'm slow on the uptake here. I have a Prusa that's modified to have a dual x carriage and it was working when I took the latest if February. Since then, you've done a lot of work on end stops. You used to be able to specify the X_MAX end stop for use in homing the second X carriage. Now there is no way to do it. Is it automatically done, now, just by specifying that there is an X2 motor? The problem I see is in line "if HAS_X2_STEPPER && DISABLED(DUAL_X_CARRIAGE)" which will always evaluate false if I define DUAL_X_CARRIAGE and X_DUAL_ENDSTOPS never gets defined. |
in https://marlinfw.org/docs/configuration/configuration.html#endstops
continues to be suggested. If I try to compile using these options in config.h. I get an error.
Should the documentation be updated by eliminating the plugs? If so, what else should be added to that part of the documentation? I would be glad to help with the documentation text if I know where to look to understand what is the current state of endstops configurations. |
Yes, the entire page needs to be wiped & redone using the current configs. Your best bet is to read the inline documentation in |
OK, I've compared the documentation site and the config.h. file. I made two simple changes that should bring a bit of clarity to this section. Thanks for the pointers. This is my first pull request (?) ever, I hope I did it correctly. |
The configuration and handling of end-stops have evolved over time to become a bit confusing and sometimes a little problematic. For example, bug report #25747 points out one problem with
USE_ZMIN_PLUG
.Background
The endstops code implementation was originally set up to monitor any endstop pins that exist, based on the direction that the axis is homing, and endstop pins were simply undefined if they weren't going to be used. So the
endstops.cpp
code could just look for a pin and use that as the sole criterion for processing that endstop.At some point we added the
USE_*_PLUG
options to allow unused endstop pins to remain defined so that they could be referenced for another usage, such as#define FIL_RUNOUT_PIN Z_MAX_PIN
or whenX2_USE_ENDSTOP == _XMAX_
. Most likely we did it this way because we needed to do Conditionals voodoo related to endstops before the point wherepins.h
was included.Meanwhile, this
#define X2_USE_ENDSTOP == _XMIN_
thing could also be better.This stuff was also developed before we had any boards with only 3 endstop pins, named
X_STOP_PIN
, etc., and before we had sensorless DIAG pins that may also wire to the regular endstop plugs.A Problem
Issue #25747 implies that
USE_ZMIN_PLUG
can cause problems with the probe even though the endstop is not specified for homing, likely becauseZ_MIN_PIN
is being monitored inappropriately. The machine is still homing to min, but the probe is probably not using theZ_MIN_PIN
, and yet the state ofZ_MIN_PIN
is being applied. So that needs to be sorted out.The Other Problem
Endstop pins aren't all that complicated, but we have a huge amount preprocessor junk to work around the stale implementation in `endstops.cpp'.
Solution
This PR is a work-in-progress to wrangle all these endstop issues:
USE_*_PLUG
doesn't need to be specified.M43
reports and used freely.PIN_EXISTS
as a criterion for initializing and monitoring endstop pins.HAS_X_MIN
, etc.X2_USE_ENDSTOP
, etc., with the clear define:#define X2_STOP_PIN X_MAX_PIN
.Other Things