Orbiter Filament Sensor Summary
This is my filament sensor add-on for the Orbiter extruders.
The main features are:
Firmware fully supporting this sensor: Klipper, RRF and MARLIN - thanks to David
Before I reached this solution, I had tried many sensor types and
sensing methods, and in the end, this is the final solution I considered most
suitable for this purpose.
Basically, as you can see in the pictures, it uses a sensor button (v1.0 and v2.2) or a miniature end stop switch.
When filament is inserted, the 6mm steel ball pushes the button, triggering a
filament presence sensing, triggering the launch of the filament auto load macro.
filament load macro.
The unload button is connected to an input on the control board
which is configured to trigger the unload macro.
The filament entry ring is machined out of a transparent material which is lit by a bicolor LED to show status as follows:
Please note that the filament sensing button used here is not a standard TACT
switch. It has a different internal construction. The button movement range is
about 0.7mm, the output contact is engaged @ about 0.3 mm and released @ about
0.2mm.
Demo
*Note: In this video, a beta version was used in which the LED colors were mixed up.
1 Design
1.1 Orbiter sensor v3.1
Orbiter sensor v3.1 design changes:
The main changes are a new sensor switch
with longer lever travel. This allows the sensor to be even less prone to
housing print tolerances. The sensor switch height is smaller compared to the
previous detection switch versions; therefore, the sensor housing has been
adjusted to move the PCB a little closer to the filament.
The new detection switch type is XKB TM-8764-1
1.2 Orbiter sensor v2.2
Orbiter sensor v2.2 design changes:
Electronic design changes
· Unload
signal blocked when there is no filament detected.
· Output
logic of the sensor inverted (compared to v1) detection leads to a high signal level. This improves compatibility to other sensors.
· Solder
jumper to select 3.3V or 5V supply for the input illumination LEDs (JP1 and
JP2). This ensures that, with 3.3V supply voltage, the LEDs are also the brightest
possible. By default, the sensors are shipped with jumper open. For 3.3V
operation it is recommended to be closed (a soldering iron is needed). However,
the only difference will be brighter input illumination; it does not affect the
sensor operation.
· Bicolor
LED changed to two separate LEDs with much higher brightness.
Housing design changes
· PCB
guide path enlarged to better keep the PCB in place.
· Sensor
PCB moved closer to filament by 0.3 mm to avoid fake filament runout detection
due to printing tolerances of the MJF-printed housing.
· “Unload”
inscription changed to bigger characters for easier printability.
· Housing
inside has a version marking for easier version traceability
The sensor is perfectly compatible with the
first version. PCB size is the same. The main functional difference is the
inverted logic of the output signals. Housing updates are only applicable for
the MJF printed housing LDO provides for Orbiter v2.0. The new PCB design v2.2
shall perfectly fit into the v1 version printable housings for Orbiter v1.0 and
v1.5.
1.3 Orbiter sensor FDM printable Housing
This printable housing is compatible with the first two versions of the switch sensor: v1.0, v2.2 and v2.3.
This section is for those who want to print the sensor housing by their own. I redesigned the internal PCB retainer arm to screw mounting for easier printing and better PCB fixing.
This design can be used by those having fake runout detection issues due to the MJF-printed housing tolerance.
Two versions
are available, first using plastic flat head screw, then using standard M3 flat head
screw with heat insert nut.
Plastic flat
head screw
M3 insert
Screw and Nut
Print recommendations:
· Material
ABS or ASA
· 0.15 - 0.2mm
layer height
· 0.4mm
layer width
· 3 perimeter
lines
· 100%
infill
· Supports
from print-bed enabled
1.4 Orbiter sensor v1.0
This is the
first released version of the sensor design.
Make sure you use a reverse bowden tube,
this allows the filament to enter the sensor in the correct path. If you do not
use a reverse bowden tube please add a short PTFE tube (2-3 cm length) inside
the filament input light guide.
Some users reported fake filament runout
detections with the sensor leading to pause of the print.
The main root cause for this is the tolerance of the MJF printed housing. Honestly, I had the impression that MJF printing has a much better tolerance, but in fact I learned is much worse compared to FDM printing. As end effect the PCB is to lose inside the MJF printed housing allowing it to move too far away from the filament leading to fake detections. Check next section how to troubleshoot and fix it.
1) Press some shims behind the sensor PCB
to force it towards the front.
You may use some plastic material less than
1mm thick to stick it between the PCB and the highlighted guide surface.
2) Using a soldering iron lift the position
of the sensor switch by about 0.3-0.5mm
This gets the sensor switch closer to the
filament ensuring proper triggering of the switch when filament is inserted.
3) One user
successfully fixed it by adding a piece of plain paper between the sensor
switch and the metal ball. The paper shall be thick enough to get the sensor
triggered to a lower distance. Maybe you need to fold paper in two or three to
get the right thickness.
4) Since the
issue is the MJF print tolerance, you may print the housing using your printer,
a well calibrated printer will print it with much better tolerance and fixing
this issue - check section 1.2 for updated printable files.
2. Assembly instructions
Wiring configuration of the sensor
- Blue - GND
- Red -> +3.3V*
- Green -> Filament Sensor
- Yellow -> Filament Unload
* 5V supply voltage is also accepted, but make sure the microcontroller input pins are also tied up to 5V otherwise, the indicator LED will not work. The recommended supply voltage is 3.3V.
Make sure you
use a reverse bowden tube; this allows the filament to enter the sensor in the
correct path. If you do not use a reverse bowden tube, please add a short (2-3cm
length) PTFE tube inside the filament input light guide.
Assembly video
3. Firmware Configuration
When the filament is inserted, the firmware is configured to
launch a macro which automatically loads the filament into the extruder. The filament must be pushed in firmly until reaches the gears so when the macro
starts, the extruder gears will grab the filament and pull it in.
Pushing the unload button, the firmware starts a macro for automatic filament
unload.
This preheats the hotend before extraction to ~235°C (user configurable), which is fine for most
filament types.
After filament extraction, the hotend heater is switched off.
Both macros shall be configured to be active only when not printing.
Note: I have not defined a macro or configuration to detect filament runout yet.
3.1 Configuration for RRF firmware - Duet boards
Configuration Step 1:
You must connect the FS pin or Filament Sensor signal to an input of your board, which is able to trigger an event. I have connected this pin to the duet board ENCB pin on the alphanumeric LCD connector.
M950 J1 C"^connlcd.encb"; define logical input for filament auto load
M581 P1 T2 S0 R0 ;define trigger for filament auto load triggers
trigger2.g
Configuration Step 2
Define the firmware trigger for filament load trigger2.g macro with the following content:
;Autoload filament macro
T0 ; select tool 0
M300 S2000 P100 ; play beep sound
M291 P"Filament autoloading!" S0 T3 ; display message
M302 P1 ; enable cold extrusion
G4 S1 ; wait for one second
G1 E15 F500 ; load filament inside the gears
M109 S235 T0 ; set hotend temperature and wait
G1 E200 F500 ; extrude 200mm, you may need to reduce speed for very soft TPU
M104 S0 T0 ; set hotend temperature to 0
M302 P0 ; disable cold extrusion
M291 P"Filament autoload complete!" S0 T3 ; display message
Configuration Step 3
You must connect the FU pin or Filament Sensor signal to an input of your board which is able to trigger an event. I have connected this pin to the duet board ENCA pin on the alphanumeric LCD connector.
M950 J2 C"^connlcd.enca"; define logical input for filament unload
M581 P2 T3 S0 R0 ; define trigger for filament auto load triggers
trigger3.g
Configuration Step 3
Define the firmware trigger for filament load trigger3.g macro with the following content:
;Auto unload filament macro
T0 ; select tool 0
M300 S4000 P100 ; play beep sound
M291 P"Filament unloading!" S0 T3 ; display message
M109 S235 T0 ; set hotend temperature to 235 and wait
G0 E-5 F3600 ; extract filament to cold end
G4 S3 ; wait for 3 seconds
G0 E5 F3600 ; push back the filament to strive stringing
G0 E-15 F3600 ; Extract fast in the cold zone
G0 E-70 F300 ; continue extraction slow allow filament to be cooled enough
before reaches the gears
M104 S0 T0 ; set hotend temperature to 0
M291 P"Filament unload complete!" S0 T3 ; display message
Note: Do not assign macros to trigger0.g or trigger1.g as they are already reserved for other function in RRF!!!
Make sure the macro's cannot be triggered during printing, this will avoid the unwanted start of the loading / unloading filament macros by accidental triggering of the sensor. See M581 description for details.
Download the alternative configuration file made by Dániel Bulyovcsity here. This version includes the filament runout function as well.
3.2 Configuration for Klipper
Connect the FS (flament sensor signal) pin and the FU (filament unload signal) to spare digital inputs on your main board. The best is to use pins from spare pin headers or unused expander board connections. Supply the sensor board with +3.3V or +5V and GND.
It is not recommended to use inputs with a pull-up resistor to 5V like end stop inputs. If these are the only spare inputs you have, you may use them, but in this case, supply the sensor board with 5V!
Upload the orbiter sensor configuration file, OrbiterSensorV2.2.03.cfg to your configuration files as shown in the next picture:
Edit the pin configuration for the gcode button ([gcode_button sensor_fs]) and type in the pin name to which the filament sensor signal is connected.
Edit the pin configuration for the gcode button ([gcode_button sensor_fu]) and type in the pin name to which the filament unload signal is connected. Note for the v2.2 sensor the signals shall be inverted to place "!" before the port name.
Include the orbiter sensor configuration file into the printer.cfg as follows:
In the [extruder] section, the minimum extruding temperature must be configured! The macro is not working with cold extrusion enabled (extruder min temp set to 0). Klipper sets this parameter by default to 170°C. My recommendation is to change that to 180°C.
min_extrude_temp: 180
Sensor macro parameters can be configured by changing the variables in _SENSOR_VARIABLES macro at the beginning of the file. You may enable or disable some functions by setting them to true or false. The last important thing to configure is the printhead parking position. By default, it parks it in the left-front corner, but you may edit and park it where you want.
The config file includes PAUSE and RESUME macros. If you use your own macros please delete the ones at the end of the sensor config file.
Restart Klipper & enjoy!
Config example when using RatOS:
3.3 Configuration for Marlin
I have to admit I'm not very good with Marlin, and I was never able to make the sensor working properly with Marlin. One of our users took the challenge and made it. Special thanks to David, great job!
The story of the Orbiter sensor
Before I reached this solution, I have tried many filament sensing
methods. My main goal was a very compact design (maximum 7mm height) and
working with all kind of filaments. In addition, should work in my future
projects as well, where space is extremely limited. For those interested here is a summary of my investigations.
1 Panasonic detector switch ESE24MV
First version of this sensor used a panasonic detector switch ESE24MV like the one used in the mosaic palette design.
It has very good detection performance and is very compact but during testing, I have found a potential issue.
If the filament forms a kind of blob or ball shape at the end of the
filament during extraction, this causes the filament to be stuck inside
the sensor. It happened to me several times, not easy to get the filament out and
there is a potential risk of breaking the sensor lever if the filament is forced. This is because the tip of the lever is to sharp; if it would be rounder
shape would work perfectly.
2 TOF (Time of Flight) based sensor
The idea is to sense
presence of filament based on time taken for light to be reflected back in the
sensor. I've made a cavity in which, when no filament was present, the light
travel distance was about double. The sensor gives a different distance reading
when filament was present or not.
I have written Arduino software with a filtering solution to detect
all kinds of filaments. I have tested with over 30 filaments I had in my stock. The solution looked excitingly promising. It was working even with transparent filament. The weakest signal I got was from Black filament, nevertheless, it was still detectable. Below, you can see the distance reading of the sensor. Peaks: no filament; dips: detected filament.
After deeper investigations, I discovered that the sensor changes its distance reading a lot
with temperature. There is internal temperature compensation but is not a
continuous type it’s stepwise compensation (the compensation is done for
temperature intervals of about 30 degrees), which made impossible to make a
difference between 6 and 12 mm reading over temperature with the same threshold setting . It would need a threshold compensation over temperature, this means a need for calibration of each produced device, which means, of course, high effort in manufacturing, therefore, this is not a very practical solution for filament presence detection. But I have to admit, its a cool concept, but too bad it does not work perfectly. In addition, the sensor has low accuracy below 10 mm.
3 Snap Action Switch
This is a widely used, simple
filament sensing method. It is pretty reliable, but it does not fit into the space
I intended. Filament sensor based on this kind of switch is to big for my purpose. The one in the picture is also a very bad design; they shall use a snap action switch with a bent round metal end, not a plastic sleeve. We print kilometers of plastic (one kg spool is around 300 meters), and that sleeve simply cannot resist rolling that long.
4 IR filament sensor
Similar solutions were used
in many Prusa printers. Uses an indirect sensing method. A mechanical lever is displaced by the
filament, which interrupts the IR signal emitted from the IR led to the IR
sensor. It’s a very reliable solution but it occupies more space than I planned for
my Orbiter sensor.
5 Hall based sensor
The idea is to detect movement of a steel or neodymium ball magnet displaced
by the filament.
To detect steel, we
need a sensor which includes a tiny magnet. The detection is based on closing the
sensor magnetic circuit by an external magnetic material like a steel ball. One of the disadvantages of such method is the difficulty of reliably detecting
movement of ~1mm.
Hall sensors have a
huge parameter drift over temperature. Its easy to make it work in a narrow
temperature range as room temperature, but using it with enclosed chamber,
temperature compensation is a must. I abandoned the idea due to high concerns
if such method can offer a reliable solution of detecting ~1 mm displacement in
a wide operating temperature range.
6 REED switch + ball magnet
The switching
mechanism is comprised of two ferromagnetic blades, separated by only a
few microns. When a magnet approaches, these blades are pulled toward one
another. Once touching, the blades close the normally open (NO) contacts,
allowing currents to flow.
The delta distance between engagement and disengagement is too big. Higher than 1mm plus distance depends on the magnet orientation so a ball
shaped magnet cannot be used
7 Inductive proximity Sensor
They are successfully used
as bed-level sensor. The operation principle is based on inductance change of an
energized coil in presence of a metal (steel ball displaced by the filament).
Here, we can have two
effects. Inductance change due to ferromagnetic material placed closer to the
coil. Like a steel ball. Or interaction with eddy current induced into a metal effect used to detect aluminum heated bed.
These sensor types are
capable to detect ~1mm distance change but do not fit into the space I planed.
8 Capacitive proximity sensor
They look similar to
inductive sensors but the operating principle is completely different. They detect
changes of a self-generated electrical field due to an object moving in front of the
sensor. One main advantage over inductive sensors is that capacitive proximity sensors can detect also nonmetallic materials. On the downside, they are less
accurate and affected a lot by temperature change, not suitable to detect displacement
of ~1mm.
9 LASER filament sensor
Similar to the filament monitor developed by Duet 3D.. Uses surface movement tracking like LASER
computer mouse's. The sensor itself would fit but direct reading of all filament
types is not possible. Indirect reading would work perfectly, I've been using such solution for long time, but its not fitting in my
target space.
I’ve made a remix to
use indirect reading of a CF rod rotated by passing filament. The result is
very consistent; however, support of this kind of sensor has been dropped by
developers. You can find the sensor design here:
10 Magnetic position encoder
It’s very widely used
and very reliable position sensing method used in many applications, like: closed-loop stepper drivers or rotor position sensing of BLDC motors. Its indirect
filament movement detection mechanism based on a small magnet rotated by the filament.
Unfortunately, it’s not fitting into the space I proposed. I prefer such
monitoring systems to be used remotely attached to the printer frame.
11 Optical Endstop and Encode Wheel
Simple cheap and well
working solution but is not fitting into my purpose. The idea is similar to movement trackers of computer mice used before LASER technology. The filament rotates an encoder wheel (a disc full of slots). Every time a slot passes through the IR sensor, it generates a pulse.
Here, you can find
very nice, well-working design done by Yves from Fractal Engineering: