bigtreetech / BIGTREETECH-TouchScreenFirmware

support TFT35 V1.0/V1.1/V1.2/V2.0/V3.0, TFT28, TFT24 V1.1, TFT43, TFT50, TFT70
GNU General Public License v3.0
1.32k stars 1.65k forks source link

Smart Filament Sensor dosen't work #312

Closed Capricornus73 closed 4 years ago

Capricornus73 commented 4 years ago

The smart filament sensor won't work in touch screen mode. The sensor ist conected in according to the TFT35V3 / Filament detection module manual directly at the TFT 35v3.0. At the feature menue the filament runout! is toggled to smart. What must i do to enable the sensor in the TFT35 v3.0 Firmware?

Thank you for helping me

guruathwal commented 4 years ago

@arut16 no.. connect the TFT to the main board and print an actual test print with the sensor connected to the TFT then try to block the filament after fer minutes.

arut16 commented 4 years ago

@guruathwal with actual testing firmeware on TFT ?

guruathwal commented 4 years ago

@arut16 yes with the test firmware I uploaded https://github.com/guruathwal/BIGTREETECH-TouchScreenFirmware-test-firmware-binaries/tree/master/Filament%20sensor%20test%20binary

arut16 commented 4 years ago

@guruathwal Tests done. Well it's strange... During printing, I stopped the filament by hand but "sensor filter level: 0 or 1" never appeared in the data flow but only a single occurrence when I canceled the printing in progress (photos below) :

First video WITHOUT BBT Writer Second video with capture on Putty PS : To have something on putty, I connnected com pins directely : Rx<->Rx and Tx<->Tx between TFT and BBT Writer. If I connect BBT Writer as it must be (Rx<->Tx, Tx<->Rx), TFT is anable to connect to SKR (normal sitiation right ; com bus is already used ?)

IMG_20200209_134652 IMG_20200209_134658

guruathwal commented 4 years ago

@arut16 no. Just print normally without BTT writer (and ignore the unknown command warning).. you do not have to look at serial data.. you need to test the filament runout sensor. Just see if it detects the filament when blocked while printing.

arut16 commented 4 years ago

@guruathwal I understood you. I also tried without BTT writer: no reaction.

guruathwal commented 4 years ago

You did not print anything.. you can not test the sensor without printing.

arut16 commented 4 years ago

@guruathwal sorry. I didn't make video but I maked a test just after this first test and it not worked.

guruathwal commented 4 years ago

Ok I got it.. will take a look at it tomorrow..

arut16 commented 4 years ago

@guruathwal did you have time to take a look? if i can help anything ...

guruathwal commented 4 years ago

I will try to check later today in evening..

guruathwal commented 4 years ago

I tried to print without the smart sensor connected but turned on the smart sensor feature in TFT (this should be similar to no pulse from the sensor as I do not have the sensor) and it does show the filament runout alert, even with no change to the Extend.c file. it does take time between 3 and 10 seconds depending on the gcode buffer to clear up before the TFT receives the Extruder position from the Main board. One thing to note is that the Extruder steps per MM also need to be set up in the TFT Configuration.h.

arut16 commented 4 years ago

@guruathwal You meen this modification : from #define EXTRUDE_STEPS 100.0f to #define EXTRUDE_STEPS mm ?

guruathwal commented 4 years ago

@arut16 no... Set it to the number you set in marlin.. the steps per mm for your extruder... If for example your extruder has 200 steps per MM in marlin firmware the it should be like this: #define EXTRUDE_STEPS 200.0f

arut16 commented 4 years ago

@guruathwal ok will try that and back here after 21 February : going vacations ! 😄

arut16 commented 4 years ago

@guruathwal I'm back. Just tested right now. Still not triggering... :'-( I waited quite long the filament runout trigger... video => https://youtu.be/aZO-Q6r3Bds Here my sets on steps : IMG_20200222_115134

EDIT : I just tried to start a print without connecting smart sensor at all and with "smart" selected on TFT ; just like you did before and filament runout alert do not showed up! I really do not understand what's wrong with my config... Can anyone test ?

Maybe a problem from Marlin bugfix-2.0.x on my SKR 1.3 installed ?

Here is the link to the source code of Marlin 2.0.x bugfix currently installed on my SKR 1.3 with all my configurations.

guruathwal commented 4 years ago

@arut in your video the filament is still moving through the smart sensor, you have just removed it from the hotend .

arut16 commented 4 years ago

@guruathwal Sorry. It doesn't have to be clear enough in the video (maybe I'm not good enough for that).

I inserted a small piece of filament into the extruder and took it out of the sensor directly into the video.

At the start of the test print, the extruder pushes the piece of filament to the maximum then arrived at the end of the piece, the extruder turns in a void and the filament does not move anymore (video).

So theoretically, this is when the end of filament alarm should be triggered except that nothing is triggered ...

arut16 commented 4 years ago

@guruathwal Any ideas ?

guruathwal commented 4 years ago

@arut16 It is very difficult to debug without the actual hardware.

arut16 commented 4 years ago

@guruathwal you ordered one smart filament sensor right ? Still not arrived I suppose... 😕

guruathwal commented 4 years ago

@arut16 not even shipped

arut16 commented 4 years ago

@guruathwal ok. Let me know. 😉

carl1961 commented 4 years ago

@guruathwal you can simulate a smart sensor with a micro switch ( they wire up the same) by just pressing it on and off at a steady rate, as long as your turning it on and off it should not trigger a runout.

catlord21 commented 4 years ago

Hi there, I'm also breaking my head on filament runout detection with TFT 24. here's my configuration :

when I print from microsdcard inserted in skr mini : filament runout works, print started from marlin screen Same gcode in sd card inserted in TFT24 print started from TFT24 : no detection at all.

I don't understand one thing : if I start a print from TFT24, is it the TFT 24 that send the Gcode to the printer ? the skr mini isn't involved in sending gcode anymore ?

Best regards @guruathwal (and take care of you and your family)

guruathwal commented 4 years ago

@guruathwal you can simulate a smart sensor with a micro switch ( they wire up the same) by just pressing it on and off at a steady rate, as long as your turning it on and off it should not trigger a runout.

@carl1961 sure, I will try this on next Sunday.

guruathwal commented 4 years ago

@carl1961 @arut16 using the microswitch did not work. although @Msq001 had done some improvement for the smart sensor in PR #401. you should try with this update.

arut16 commented 4 years ago

@carl1961 @guruathwal @Msq001 Unfortunately, after recompiling and successful update, none reaction from printer with a filament run-out. I tried two times through SKR connection and TFT connection.

Something is missing again...

AVKosterin commented 4 years ago

Hi there, This is my test Smart Filametn Sensor The sensor only works when switching from pause to return https://www.youtube.com/watch?v=mIpkgMGpWK8 TFT35 V3.0 Firmvare 25.2 (non modified) Board SKR E3

arut16 commented 4 years ago

@AVKosterin I can reproduce the same thing but your test conditions are not correct ! Where your sensor is connected ? On TFT or on SKR ? Try this way instead : let your sensor connected and just cut your filament and see what happens or not... Let us know.

AVKosterin commented 4 years ago

sensor is connected to the TFT

arut16 commented 4 years ago

@AVKosterin ok. Good. Let us know with a new test by cutting the filament.

AVKosterin commented 4 years ago

New test https://www.youtube.com/watch?v=B6cXK8h0flw

arut16 commented 4 years ago

@AVKosterin Yes. I have exactly same strange issue.

The question is : what happens when print is resumed to make trigger work but only every 2 pause/resume action ?

AVKosterin commented 4 years ago

yes it seems so

carl1961 commented 4 years ago

Mine does not work either . The smart sensor works great, I use it in marlin mode and it is very accurate, has saved me many times with filament jams.

carl1961 commented 4 years ago

Ok looks like I need to learn LOL, I see settings in the C:\BIGTREETECH\BIGTREETECH-TouchScreenFirmware-master\TFT\src\User\Configuration.h

Line 185:

// Filament runout detection

define FIL_RUNOUT_INVERTING true // Set to false to invert the logic of the sensor.

define FIL_NOISE_THRESHOLD 10 // 10*10 = 100ms, Pause print when filament runout is detected for 100ms.

// Smart filament runout detection // For use with an encoder disc that toggles runout pin as filament moves

define FILAMENT_RUNOUT_DISTANCE_MM 7

In Marlin 2.0 this is set to false for smart sensor (my working setup running marlin mode)

// Filament runout detection

define FIL_RUNOUT_INVERTING false // Set to false to invert the logic of the sensor.

Also looking at the TFT code , Looks like we need the sensor on the Board and not the TFT) TFT is looking in the marlin code for stuff

File: extend.c

Located @ C:\BIGTREETECH\BIGTREETECH-TouchScreenFirmware-master\TFT\src\User\API\extend.c

// Filament runout detect

ifdef FIL_RUNOUT_PIN

switch (infoSettings.runout) { case FILAMENT_RUNOUT_ON: // Detect HIGH/LOW level, Suitable for general mechanical / photoelectric switches return (FIL_RunoutPinFilteredLevel() == FIL_RUNOUT_INVERTING);

case FILAMENT_SMART_RUNOUT_ON:
  return FIL_SmartRunoutDetect();

Looks like Smart sensor is automatically on when we toggle FILAMENT RUNOUT

File: extend.h

Located @ C:\BIGTREETECH\BIGTREETECH-TouchScreenFirmware-master\TFT\src\User\API\extend.h

FILAMENT_RUNOUT_OFF = 0, FILAMENT_RUNOUT_ON, FILAMENT_SMART_RUNOUT_ON,

carl1961 commented 4 years ago

Ok smart sensor is detected on TFT filament sensor pins, but only like a filament switch (Filament Sensor ON). By moving the wheel just until the logic changed. the Filament Run Out triggered after 7mm movement (on extruder). By moving the wheel just until the logic changed again it let you run again. Setting Filament Sensor to (Smart) I get no Filament Run Out , no matter how many times I move the wheel and wait.

fnhhnxfn commented 4 years ago

hi guys i will not say that i have fully succeeded using smart filament sensor in touch mode but now minimum its giving error messages on touch screen , i did followings:

i am using skr pro and i connected sensor to the board X-max I enabled filament motion sensor in marlin and M114 D enable smart (sensor) on tft 35 V3.0 E3

Now its displaying filament runout error message , but i always get false positives

bigtreetech commented 4 years ago

@fnhhnxfn Hello, There are two ways to use the touch screen for printing:

arut16 commented 4 years ago

@bigtreetech And then SFS will work properly? Only SKR Pro is compatible in LCD12864 mode ? Will not work with SKR 1.3 on x_max for example ?

arut16 commented 4 years ago

@bigtreetech I did all you sed in the second way of use : SFS connected to FIL-DET on TFT, FILAMENT_RUNOUT_SENSOR commented in Marlin on my SKR 1.3 with bugfix-2.0.x, only M114_DETAIL is uncommented, Smart is selected in TFT settings.

Here a little test video with a short piece of filament to simulate filament runout : STILL NOT TRIGERING !

bigtreetech commented 4 years ago

@arut16 Hello, Can you take a picture of "Settings -> Machine -> Parameter -> Steps per MM" interface for me to check?

arut16 commented 4 years ago

@bigtreetech Here you go : 15862397023583445421094249192415

bigtreetech commented 4 years ago

@arut16 Hello, Please remove SFS from TFT "FIL-DET" port, and then test whether the screen will popup "Filament runout!" menu when printing from TFT SD.

arut16 commented 4 years ago

@bigtreetech Here a demostration/test video with SFS disconnected from TFT. No reaction from TFT : Fil Runout alarm still not triggering...

bigtreetech commented 4 years ago

@arut16 Hello, can you test this firmware that I compiled. BIGTREE_TFT35_V3.0.25.3.txt You just need to change the ".txt" extension to ".bin" for update

arut16 commented 4 years ago

@bigtreetech After your compiled firmware installed, here a new test video. I started a print with SFS connected to TFT. I waited fil runout alarm when filament wasn't moving encoder anymore : no fil runout alarm triggering. When, I unplugged SFS to see what happend : no more reaction... Printing continues without filament...

bigtreetech commented 4 years ago

@arut16 Can you provide the gcode file you have printed for test? And the Marlin version number and motherboard type you used. If possible, I will restore your usage environment to test to see if it can reproduce the problem

arut16 commented 4 years ago

@bigtreetech You can find my bugfix-2.0.x Marlin sources and firmware.bin actually installed in Marlin-bugfix-2.0.x.pio\build\LPC1768 here and also gcode file that I used in lasts videos.

I'm using BTT SKR 1.3 with TMC2208 UART drivers.

PS : I'm using Atom for compiling sources.