-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
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
Support for a filament diameter sensor #1037
Conversation
Original code is using WRITE from fastio, but original used pinMode to set pin direction and did not use the fastio SET_INPUT or SET_OUTPUT. This caused an issue with the rotary encoder interface to boards based on teensyduino, since for teensyduino pin numbers for fastio and the usual Arduino IO are different.
This feature allows the printer to read the filament diameter automatically and adjust the printer in real time. Added code to read an analog voltage that represents a filament diameter measurement. This measurement is delayed in a ring buffer to compensate for sensors that are a distance away from the extruder. The measurement is used to adjust the volumetric_multiplier for the extruder. Some additional g codes (M404, M405, M406, M407) are used to set parameters and turn on/off the control. g code M221 is updated. Pins for RAMPS1.4, RAMBO, and Printrboard are identified for analog input. The configuration file is updated with relevant user parameters.
… code Improvement to avoid reinitializing delay buffer with every print. Fixed issues in buffer indexing and memory out of bounds due to floating point imprecision. Simplified the code by avoiding conversion to standard diameter and 1cu mm extrusion, which caused complications in determining mm extruded.
Update the config file for improvements and clarifying what diameter to use in the slicer software.
This reverts commit 1d0fe03.
It’s very interesting ! Do you know if there are any youtube video on how to set this up? De : filipmu [mailto:notifications@github.com] This pull request supports the feature request in issue #1010 For examples of these sensors, see: http://www.thingiverse.com/thing:89044, 4 new Mcodes are defined to set relevant parameters. Majority of this code (except for some code in the ISR) can be bypassed by Pins defined for Rambo, Ramps 1.4, Printrboard. I reverted a commit (1d0fe03 but this is still an issue for printrboards and probably anything Teensylu.You can merge this Pull Request by running git pull https://github.com/filipmu/Marlin Filament-Sensor Or view, comment on, or merge it at: https://github.com/ErikZalm/Marlin/pull/1037
File Changes
Patch Links:
— |
As far as I know there is no youtube video on how to set this up, but it would be a good idea. I'll try to put something together. |
Can you also correct the PID_dT in configuration.h? |
Adjusted the #define PID_dT to reflect 10 A to D sample steps, vs original 8.
I made the change to the PID-dT definition. |
Added the new m-codes to this document.
So has this been merged in the code yet? |
or will that never happen? a shame as i have to add the code for it every time there is an update here... |
Support for a filament diameter sensor
This pull request supports the feature request in issue #1010 to provide an input for a real time filament diameter sensor that controls the volume of extrusion for one selected extruder. Implements a delay buffer to handle the transit delay between where the filament is measured and when it gets to the extruder. Gcode can be created once, and can be made independent of the filament diameter. See discussion for that issue.
For examples of these sensors, see: http://www.thingiverse.com/thing:89044, https://www.youmagine.com/designs/filament-diameter-sensor, http://diy3dprinting.blogspot.com/2014/01/diy-filament-diameter-sensor.html. Any sensor which produces a voltage equivalent to the diameter in mm (i.e. 1v = 1mm) can be used. This provides a very simple interface and may encourage more innovation in this area.
4 new Mcodes are defined to set relevant parameters.
Majority of this code (except for some code in the ISR) can be bypassed by undeclaring a #define. So it behaves nicely for the majority of users who don't have a sensor.
Pins defined for Rambo, Ramps 1.4, Printrboard.
I reverted a commit (1d0fe03 Change pinMode to SET_INPUT or SET_OUTPUT) since it was not really germane, but this is still an issue for printrboards and probably anything Teensylu.
One to-do is to display the filament diameter and relevant control info.