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.18k stars 19.21k forks source link

[2.0.x, Question] Keeping track of distance extruded in T0 and T1 for filament run-out sensor #11811

Closed marcio-ao closed 5 years ago

marcio-ao commented 6 years ago

We are implementing a filament run-out sensor that can detect when one or the other filament moves in a dual-extruder system. I would it to work by keeping a counter for T0 and T1 indicating the number of mm extruded from each extruder since the last time motion was detected by the sensor. When that counter exceeds the length of the feed tube from the hotend to the sensor, we want to pause the print.

I believe I can take care of most of the sensing in the idle loop, but I need to be able to increment the counters when an extrusion takes place and be able to keep separate counters for T0 and T1. Where would be a good place to hook this in?

Some ideas I have might be in the G0/G1 gcode, or possibly in the planner, but I don't know exactly. I would like this to be as unintrusive a change as possible, so perhaps I could have my idle loop routine simply poll for changes in current_position[E_AXIS] and assume that whatever move took place corresponded to the active_extruder? Maybe not 100% accurate, but possibly good enough?

Thoughts? Thank you in advance for any ideas.

marcio-ao commented 5 years ago

Closing this as a related PR has already been closed.

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.