smart-filament-detection-module icon indicating copy to clipboard operation
smart-filament-detection-module copied to clipboard

Detection Sensor not working on SKR mini e3 Board

Open zuverck opened this issue 5 years ago • 55 comments

Utilized the Marlin build in the SKR mini e3 v1.2 repository to enable the smart filament sensor. I wired up the sensor to the DET0 (PC12) pin on the board, made the changes to enable the feature in the firmware including printing out the debug info to the terminal. The firmware never senses a change on the input line of DET0 to reset the runout counter so after 7mm the printer will halt. I have connected the sensor to a logic analyzer and verified that the sensor is working and toggling the output as filament passes through the rollers. However their is something wrong between the pin input and the getting into the processor as the PC12 pin never changes state in the software.

Can you provide guidance on your test setup utilized for the skr mini e3 v1.2 and which port was the sensor connected to?

zuverck avatar Nov 21 '19 03:11 zuverck

Following!

kirelam avatar Nov 27 '19 19:11 kirelam

Me too

bobkinloch avatar Nov 28 '19 16:11 bobkinloch

I have run into the same issue. The default settings in the source recommends PC15, however I'm guessing that's just for on/off switches and not motion.

I created a new Issue on the E3 Mini repo since its likely something with the board and linked back here.

I also saw that Marlin moved from Bugfix-2.0.x to just 2.0.X so I guess that means its released now? I was going to try compiling straight from there tomorrow and see if that has an effect.

TerawattX avatar Dec 05 '19 02:12 TerawattX

So I just got a response on the other SKR Mini thread stating that PT-DET is not use for filament detection. I've asked if the module will work on 2 pins vs 3 since technically it comes with a 4 pin to 3 pin cable.

https://github.com/bigtreetech/BIGTREETECH-SKR-mini-E3/issues/144#issuecomment-562742596

TerawattX avatar Dec 06 '19 21:12 TerawattX

same here - wondering which pin to use on this board

MartinFuersatz avatar Dec 14 '19 17:12 MartinFuersatz

\marlin-2.0.x\marlin-2.0.x\marlin\src\pins\stm\pins_BTT_SKR_MINI_E3.h  Change #define FIL_RUNOUT_PIN  PC12   //   PT-DET

#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR)   #define NUM_RUNOUT_SENSORS   1     // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.   #define FIL_RUNOUT_INVERTING true // Set to true to invert the logic of the sensor.                   //***  // #define FIL_RUNOUT_PULLUP   

M119 to test if the sensor is working This setup works on my CR10S with the SKR Mini board and a 3 wire sensor

Hope this helps!!

bobkinloch avatar Dec 16 '19 16:12 bobkinloch

Interesting. I had the pins set correctly, but I didn't change the FIL_RUNOUT_INVERTING value. When my current print ends (in a couple of days), I'll update the firmware and see what happens.

Thanks!

TerawattX avatar Dec 16 '19 20:12 TerawattX

@bobkinloch,

Do you have FIL_RUNOUT_PULLDOWN commented out same as PULLUP?

I flashed the firmware 2x now to test. First time I set Inverting to true but missed that you commented out the FIL_RUNOUT_PULLUP as well. In this state it let me print, but when I removed filament it never seemed to trigger.

I recompiled and left inverting set to true, but commented out the pullup line and now its triggered at all times. Kind of wish I could change these values in the menu to make testing easier :\

TerawattX avatar Dec 18 '19 05:12 TerawattX

Anyone solved? I'm facing the same problem. I have also an SKR 1.3 not tried yet. There is a way to check if sensor is faulty?

Thanks

masgar avatar Dec 30 '19 10:12 masgar

I just placed the order for one. I will use it with an SKR 1.3 Mini E3 I'm already using. I do have an oscilloscope, so I'll likely give it a quick try first. Connect ground and 5V, then check the signal pin between (common ground used for the scope). That way I will see what is expected there. i.e. a high or low signal when there is wire vs. no wire, and also wire moving vs. not moving.

I'm using 2.0.1 Marlin I configured to use BL Touch. My next step will be to figure out if I want to connect this through Marlin or to a GPIO pin on my Raspberry Pi running Octoprint. If I go the GPIO pin way, I will use some 3v - 5V adapter chip I have running around to not put 5V on the Pi's pins directly. Whatever works best... I will post my results here.

TerryFrench avatar Jan 01 '20 08:01 TerryFrench

Anyone get this to work with the BIGTREETECH TFT35 V3.0 touchscreen display? They have a Fil-Det pin for this purpose.

phtp avatar Jan 02 '20 06:01 phtp

Had a similar Problem on my Cr10 with MKS SGEN L using Z+ endstop pin. the pin has the same pullup, capacitor wiring as the skr 1.3.

My problem was that Marlin does not set the runout distance after flashing the firmware.

M412 echo:Filament runout ON Filament runout distance (mm): 0.00

M412 D7 echo:Filament runout ON Filament runout distance (mm): 7.00

After that the sensor works fine for me

CaptainRoot avatar Jan 04 '20 11:01 CaptainRoot

I have a Ender 3 Pro - I gave up on trying to get it to work with the TFT 35 v3.0 and ended up using the PT-DET on the skr mini e3 v1.2 board. So far it seems like it does work, but I'll need to do more test around it.

Not sure if you have a BLTouch as well, but I found the combination of BLTouch and trying to enable the filament runout settings to be over the 256k memory cap. Did a bit of research and turns out the v1.2 can go above that.

The modifications I made were on the configs I grabbed are from the bigtreetech github for the skr mini e3 - https://github.com/bigtreetech/BIGTREETECH-SKR-mini-E3/tree/master/firmware/V1.2/Marlin-2.0.x-SKR-Mini-E3-V1.2

platformio.ini - change from 256k to 512k

[platformio] src_dir = Marlin boards_dir = buildroot/share/PlatformIO/boards default_envs = STM32F103RC_bigtree_512K

My filament runout sensor settings. I trimmed a bunch of stuff and left what's enabled to reduce clutter.

configuration.h

#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // Set to true to invert the logic of the sensor. #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.

#define FILAMENT_RUNOUT_SCRIPT "M600" #define FILAMENT_RUNOUT_DISTANCE_MM 7 #define FILAMENT_MOTION_SENSOR

#define NOZZLE_PARK_FEATURE

Configuration_adv.h

#define M114_DETAIL

#define ADVANCED_PAUSE_FEATURE

pins_BBT_SKR_MINI_E3.h

#ifndef FIL_RUNOUT_PIN //#define FIL_RUNOUT_PIN PC15 // "E0-STOP" #define FIL_RUNOUT_PIN PC12 // "PT-DET" #endif

phtp avatar Jan 05 '20 00:01 phtp

@phtp - How is your testing going with the BTT Smart Filament Sensor + SKR Mini E3? I have the SKR Mini E3 and BLTouch, and am wondering if it's safe to buy the BTT sensor, or if I should look down another path?

gritstub avatar Jan 13 '20 09:01 gritstub

@phtp - How is your testing going with the BTT Smart Filament Sensor + SKR Mini E3? I have the SKR Mini E3 and BLTouch, and am wondering if it's safe to buy the BTT sensor, or if I should look down another path?

It's pretty much plug and play as long as you adjust the configs right. I just can't get it to work with the touchscreen mode on the tft35.

phtp avatar Jan 13 '20 09:01 phtp

@phtp i tried that set up and when i put that in all the sensor does is set off the alarm and the ender 3 doesnt leave boot screen.

bakaneko718 avatar Jan 14 '20 07:01 bakaneko718

@phtp i tried that set up and when i put that in all the sensor does is set off the alarm and the ender 3 doesnt leave boot screen.

What does the boot screen say, something along the lines of filament change?

phtp avatar Jan 14 '20 09:01 phtp

It just stayed on the marlin splash screen. I went back and took off the 512K. It did the filament change thing with

#define FIL_RUNOUT_INVERTING true

Gave me the full treatment. Maybe about 4 hours into the print it stopped. The filament didn't break and there was no pause screen. It had an ETA message that I hadn't seen before.

bakaneko718 avatar Jan 14 '20 16:01 bakaneko718

It just stayed on the marlin splash screen. I went back and took off the 512K. It did the filament change thing with

#define FIL_RUNOUT_INVERTING true

Gave me the full treatment. Maybe about 4 hours into the print it stopped. The filament didn't break and there was no pause screen. It had an ETA message that I hadn't seen before.

Do you have v1.0 or v1.2 of the mini board? My settings are for v1.2. Not sure about inverting as mine is set to false. The smart sensor handles run out and jams. Maybe it detected a jam?

phtp avatar Jan 14 '20 16:01 phtp

i have v1.2. and it appears that it was jammed. guess its working. now i have to find out why it jams at the extruder.

bakaneko718 avatar Jan 14 '20 16:01 bakaneko718

i have v1.2. and it appears that it was jammed. guess its working. now i have to find out why it jams at the extruder.

I had it once where it paused mid-print and I think it was because the filament being too tight. Was a very old PLA roll and near the end of it. I'm not 100% on this, but it hasn't happened with my new roll.

phtp avatar Jan 15 '20 07:01 phtp

Seems like the tension on the extruder was too tight. Everything is working now.

bakaneko718 avatar Jan 15 '20 07:01 bakaneko718

I've been tinkering with mine over on Reddit with the help of (I assume) @phtp.

@zuverck One thing that was pointed out is that when you call M119, if the sensor is connected it will show "open", but if its unplugged it shows "triggered". In my case it shows open regardless of whether or not the sensor is attached. I even ran a jumper between the Signal and Ground wires just to confirm and no change. Curious if anyone else running into this issue is seeing the same thing.

TerawattX avatar Jan 16 '20 15:01 TerawattX

My problem was that Marlin does not set the runout distance after flashing the firmware.

M412 echo:Filament runout ON Filament runout distance (mm): 0.00

M412 D7 echo:Filament runout ON Filament runout distance (mm): 7.00

After that the sensor works fine for me

This solved the same problem on my skr v1.3 too. If you would "initialise eprom" after flashing, I'm sure the values will be taken in settings. But I don't do it every time myself...

Robbel2005 avatar Jan 22 '20 17:01 Robbel2005

Is there a light anywhere on this runout sensor? I am having issues as well. It always shows open. SKR E3 Mini 1.2,even have the TFT35 E3 v3 (pins dont work on this for sure, so went with PT-DET PC12). I am just wondering what is special on the folks who got it to work. I tried invert to true and back to false as well.

btsubjectdata avatar Jan 23 '20 05:01 btsubjectdata

M119 (not matter if filament or not): Recv: Reporting endstop status Recv: x_min: open Recv: y_min: open Recv: z_min: TRIGGERED Recv: filament: TRIGGERED Recv: ok

btsubjectdata avatar Jan 23 '20 05:01 btsubjectdata

Also same behavior after this as well: M412 D7 echo:Filament runout ON Filament runout distance (mm): 7.00

btsubjectdata avatar Jan 23 '20 05:01 btsubjectdata

ok. so i thought it was working, but i was wrong. sometimes when i start a print it will go to the pause menu and move out of the way as if it was paused. i would resume the print it would be fine. i just did a quick test and cut the filament and let it run, but the sensor didnt kick on.

#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING true // Set to true to invert the logic of the sensor. #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. #define FILAMENT_RUNOUT_SCRIPT "M600" #define FILAMENT_RUNOUT_DISTANCE_MM 7 #ifdef FILAMENT_RUNOUT_DISTANCE_MM #define FILAMENT_MOTION_SENSOR #endif #endif

bakaneko718 avatar Jan 23 '20 06:01 bakaneko718

Is there a light anywhere on this runout sensor? I am having issues as well. It always shows open. SKR E3 Mini 1.2,even have the TFT35 E3 v3 (pins dont work on this for sure, so went with PT-DET PC12). I am just wondering what is special on the folks who got it to work. I tried invert to true and back to false as well.

I wish that there is one. But you can easily add one. I used a cheap red led an a 1k resistor. just solder them together an plug it into the connector of the runout sensor (between V and S pin). or to have it more permanent just solder it to the connector on the sensor pcb. This works just fine for me.

M119 (not matter if filament or not): Recv: Reporting endstop status Recv: x_min: open Recv: y_min: open Recv: z_min: TRIGGERED Recv: filament: TRIGGERED Recv: ok

this is a motion sensor. so it not just detects is filament is present or not, it toggles between open and triggered when the filament is moving. Try to move the filament 1mm then check with M119. do this multiple times (10 times). if filament is always triggered something is wrong.

An other possibility to check the wiring ist to unplug the sensor an check M119 then shortcut S and V or S and gnd with a 1k resistor and check M119 again, this should definetly toggle the state

CaptainRoot avatar Jan 23 '20 06:01 CaptainRoot

Thanks all. Tested power and it appears to be getting 5v to the sensor. I ordered a replacement and tried new cable and new smart sensor, same results.

This is what I have:

pins_BTT_SKR_MINI_E3.h // Filament Runout Sensor // #ifndef FIL_RUNOUT_PIN //#define FIL_RUNOUT_PIN PC15 // "E0-STOP" #define FIL_RUNOUT_PIN PC12 // "PT-DET" #endif

Configuration.h #define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // Set to true to invert the logic of the sensor. #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.

// Set one or more commands to execute on filament runout. // (After 'M412 H' Marlin will ask the host to handle the process.) #define FILAMENT_RUNOUT_SCRIPT "M600"

// After a runout is detected, continue printing this length of filament // before executing the runout script. Useful for a sensor at the end of // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. #define FILAMENT_RUNOUT_DISTANCE_MM 7

#ifdef FILAMENT_RUNOUT_DISTANCE_MM
// Enable this option to use an encoder disc that toggles the runout pin
// as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM
// large enough to avoid false positives.)
  #define FILAMENT_MOTION_SENSOR

#endif #endif

Configuration_adv.h // Show extra position information with 'M114 D' #define M114_DETAIL

#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. // This short retract is done immediately, before parking the nozzle. #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. // For Bowden, the full length of the tube and nozzle. // For direct drive, the full length of the nozzle. // Set to 0 for manual unloading. #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. // 0 to disable start loading and skip to fast load only #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. // For Bowden, the full length of the tube and nozzle. // For direct drive, the full length of the nozzle. //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. // Set to 0 for manual extrusion. // Filament can be extruded repeatedly from the Filament Change menu // until extrusion is consistent, and to purge old filament. #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused.

                                              // Filament Unload does a Retract, Delay, and Purge first:

#define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged.

#define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change.

//#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change

//#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) #endif

btsubjectdata avatar Jan 24 '20 23:01 btsubjectdata