MarlinFirmware / MarlinFirmware/Marlin

[FR] True filament sensing

Open
#13,699 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

T: Feature Request
Dominant language
C++
Stars
17.6k
Forks
19.7k
Avg merge
3d 5h
Merged PRs (30d)
21

Description

Description

I have finished working on my true volumetric filament sensor, and I believe it requires the code in filwidth.cpp and planner.cpp to be changed (not sure about other files), as the old code assumes measurement is done in one axis.

My sensor measures the filament 360º around the periphery of the filament, and outputs an analog voltage that is a delta value. The sensor is calibrated with a precision ground 1.750mm OD pin gage, used as a standard. Whatever the voltage output is of the sensor with the pin gage in the sensor, could be set with a gcode as the 'reference/nominal', which I believe is currently in Marlin. If the voltage was hypothetically 1 volt, Marlin needs to know this, and do delta based measurements from the 1v 'reference' point. With this possibility in code, a potentiometer could be eliminated on the PCB for calibrating.

Since my sensor reports the voltage based on the cross section and not one axis like the old filament sensors, I am not sure what formula needs changed in the source files.

For sanity, it may be best to have a macro that specifies whether the sensor is a single axis (width/diameter) sensor, or a true volumetric sensor, that way the user can specify which sensor they have when I begin selling the sensors.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading filwidth.cpp and planner.cpp to understand the existing single-axis measurement and calibration flow. Clarify how a G-code-set reference voltage, delta-based volumetric measurement, and sensor-mode selection should work; done means the implementation supports both sensor types without the existing behavior regressing.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.