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.14k stars 19.2k forks source link

[FR] be able to set FIL_RUNOUT_INVERTING through gcode or UI #23578

Closed Diz-X closed 2 years ago

Diz-X commented 2 years ago

Is your feature request related to a problem? Please describe.

I want to use a filament runout sensor with inverted status, problem is I need to compile the firmware.

Are you looking for hardware support?

Ender 3 v2 board version 4.2.2

Describe the feature you want

A way to set FIL_RUNOUT_INVERTING in the UI or with gcode, without the need to compile the code yourself.

Additional context

No response

DejitaruJin commented 2 years ago

Can I ask what you're needing to accomplish with this? From the electrical standpoint, there are actually two important #defines for that, FIL_RUNOUT_STATE and either FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN (or neither). Since these values need to match the specific switch you're using, they definitely need to be hard-coded at compile time. Is there a reason you'd need to swap the value while the machine is running?

Diz-X commented 2 years ago

The reason I ask is to make it more user friendly for beginners. As there are a lot of sensors on the market, non are created equaly and a lot of people don't know how to compile the firmware from source. I understand that this is adding a extra layer to the code, but could help a lot of headache for people with reversed sensors.

DejitaruJin commented 2 years ago

I fear that might only move the headache elsewhere. A beginner who is replacing a runout sensor should replace it with one known to work with that model of printer, in which case the existing firmware for it will work already. Adding a runout sensor probably isn't something a beginner should take on - and it requires recompiling the code regardless, because #define FILAMENT_RUNOUT_SENSOR is commented out by default, and even M412 won't turn it on because the code was compiled without support entirely. And then you have to consider which pin the sensor is actually hooked up to, which varies by model...

Diz-X commented 2 years ago

I can understand, because of small group of people like me that use custom switches this could be confusing for others.

I have opened up the sensor and resoldered/rewired the switch, now the default pre-compiled firmware works correctly with my filament sensor. I am way too used writing software that is configurable in every sense of the way. Firmware is another beast on its own.

github-actions[bot] commented 2 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.