Donate
Orbiter V2 Sensor showoff v2

  Orbiter Filament Sensor Summary

ezgif.com-gif-maker (2)

Hi! This is my filament sensor add-on for the Orbiter extruders.
The main features are:

  • Filament Runout sensing
  • Filament auto loading
  • Button for filament unload

Compatible with Orbiter v1.0, v1.5 and v2.0

Firmware fully supporting this sensor: RRF and Klipper, Marlin very limited - not recommended. 

Before I reached this solution, I have tried many sensor types and sensing methods, in the end this is the final solution I considered most suitable for this purpose.

Basically, as you can see it in the pictures it uses a special push-button (like the ones used in computer mouses, rated to over five million clicks). When filament is inserted the 6mm steel ball pushes the button triggering a filament presence sensing. This is information is used in the firmware to launch a macro to auto load the filament.
The unload button is connected to an input of the control board which is configured to trigger the unload macro.

The filament entry ring is printed out of a transparent material which is lit by a bicolor LED to show status as follows:

    • Red - no filament detected
    • Green - filament present
    • Orange - unload button is pressed (only when filament is present)

Please note 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 where mixed up.

  Building the filament sensor

  1. Bill of Materials

Electronic components:

* Due to logistic issues the sensor board version manufactured by LDO uses the sensor switch with 4.3mm height (instead of the 4mm version used in the first design). This affects the housing design, the latest design versions are designed for the 4.3mm sensor switch version.

Mechanical components:

  • 2x M3 screw L=20 button head (for Orbiter v1.5 and v1.0 L=18mm is also enough)
  • 4x M3 washers with 6mm outer diameter (only 1x for orbiter v1.5 and v1.0)
  • 2x M3 nut (only for Orbiter v2.0)
  • 1x 6mm steel ball - or airsoft BB
Sensor components showoff v2

Using gerber files the PCB layout can be purchased from any PCB manufacturer. I personally ordered them from www.jlcpcb.com, for 2$ / 5 pieces + shipping and import taxes.

  2. Sensor schematics

Next picture shows the schematics of the filament sensor.

SensorSCHPicture

Print the sensor housing out of ABS, ASA or some other filament with similar temperature deflection property.
The light guide shall be printed out of a transparent filament like HDGlass.

The sensor housing shall be printed with support, light guide does not require any support. Suggested layer height is 0.2mm.

You need to change the stock M3 screws of the Orbiter to button head M3 L=20mm (low profile screw head, max 2mm space on the Orbiter v1.5. The original M3 with 15mm length and socket head will not fit anymore). On v1.5 It's a bit tricky to drive in the screw near the latch in, but it’s not impossible (use a big Thor hammer and some brute force :) ).

Assembly steps:

   1. Push the 6mm ball inside the housing,
   2. Slide the electronics inside the housing;
   3. Assemble the sensor on top of the Extruder.

  4. 3D Design files

There are two housing design versions available defined by the sensor switch height. The first design variant uses switch with 4.0mm height. 

The production version by LDO uses 4.3mm - this is the design version supported in the future. So in case you want to build your own sensor please make sure you purchase the switch with 4.3mm height.

Below you can find link to online 3D viewer with downloadable content. You can explore, measure and download the design files in several formats. With the second link you can download the design files directly in .3mf, .step and .f3z formats (under construction - will be available soon).

Sensor housing design files for Orbiter v1.0 - Beta

Orbiter v1.1 Sensor v20

Sensor housing design files for Orbiter v1.5

Orbiter V1.5 Sensor v10 v34

Sensor housing design files for Orbiter v2.0

Orbiter v2 Sensor v10 LDO MJF v6

The first, discontinued design version using switch with 4.0 mm height can be downloaded from here:

Print Orientation

Orientation

  5. 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. Recommended supply voltage is 3.3V.

SensorWires

 Assembly video

...coming soon...

  6. 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.

  6.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.

  6.2 Configuration for Klipper

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.

Define a gcode button as follows:

[gcode_button filament_load]

pin: PC7

press_gcode:

    #g code for print pause due to missing filament

    #PAUSE

release_gcode:

  AutoloadFilament 

  M117 Filament loading   

  M82                      #set extruder to absolute mode

  G92 E0

  G4 P2000             # wait for two second

  FORCE_MOVE STEPPER=extruder DISTANCE=15 VELOCITY=5 ACCEL=1000  # load filament inside the gears force move needs to be enabled

  M109 S235 T0       # set hotend temperature and wait

  G1 E200 F300        # extrude 200mm

  M400                      # wait for current move to finish

  M104 S0 T0           # set hotend temperature to 0

  G92 E0                  # zero extruder position

Configuration Step 2

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.

Define a gcode button as follows:

[gcode_button filament_unload]

pin: PA8                    #use the input pin you have connected the sensor

release_gcode:

  UnloadFilament

  M117 Filament unloading

  M82                       #set extruder to absolute mode

  G92 E0

  M109 S235 T0

  G0 E-5 F3600       #extract filament to cold end

  G0 E-70 F300       # continue extraction slow allow filament to be cooled enough before reaches the gears

  M104 S0 T0

press_gcode:

  The story of the Orbiter sensor

Before I reached this solution, I have tried many filament sensing methods. My main goals were 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 the space is extremely limited. For those interested here is a summary of my investigations.

Read more here

  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 a very good detection performance and very compact but during testing I have found a potential issue.

DSW_ESE24MV1
20211209_100303

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. Happened to me several times, not easy to get the filament out and there is a potential risk to break the sensor lever if the filament forced. This is because the tip of the lever is to sharp, if it would be rounder shaped 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.

image.PF258302.en.feature-description-include-personalized-no-cpn-medium
vl6180x-time-of-flight-distance-sensor-carrier-wit-593348-1654-87636

I have written an Arduino software with a filtering solution to detect all kind 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 are with detected filament.

WhatsApp Image 2021-05-14 at 21.50.29
WhatsApp Image 2021-05-14 at 21.00.28
WhatsApp Image 2021-05-14 at 18.07.18

After deeper investigations I discovered that the sensor changes its distance reading a lot with temperature. There is an internal temperature compensation but is not a continuous type it’s a stepwise compensation (the compensation is done for temperature intervals of about 30 degrees) which made impossible to make a difference between 6 and 12mm 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 to bad it do not work perfectly. In addition, the sensor has low accuracy below 10mm.

  3 Snap Action Switch

This is a widely used simple filament sensing method. Pretty reliable however it does not fits 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 snap action switch with bent round metal ending not with plastic sleeve. We print kilometers of plastic (one kg spool is around 300 meters) that sleeve simply cannot resist so rolling.

filament-sensor-assembly

  4 IR filament sensor

Similar solution 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 occupy more space than I planned for my Orbiter sensor. 

prusa-research-parts-ir-filament-sensor-for-prusa-i3-mk3s-1_1400x

  5 Hall based sensor

The idea is to detect movement of a steel or a neodymium ball magnet displaced by the filament. 

To detect steel, we need a sensor which includes a tiny magnet. 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 to reliably detect a 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 it’s a must. I abandoned the idea due to high concerns if such method can offer a reliable solution of detecting ~1mm displacement in a wide operating temperature range. 

modul-cu-senzor-hall-ys-28

  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 current to flow.

38X7498-40
Reed-SW-Moulded-6 (1)

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). 

filament-sensor-finda2
proximity-sensor

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 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.

2667229-40
Cap-Prox-Sensor

  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'm using such solution for long time ago, 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 senor design here:

dutelaser

  10 Magnetic position encoder

It’s a 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.

Mag_FM_assembled_bg_1-600x3002

  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 mouses used before LASER technology. The filamenl rotates an encoder wheel (a disc full of slots) Every time a slot passes trough the IR sensor it generated a pulse.

Here you can find very nice well working design done by Yves from Fractal Engineering: 

optical runnout