Skip to content
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

Smart Filament Sensor dosen't work #312

Closed
Capricornus73 opened this issue Jan 25, 2020 · 124 comments
Closed

Smart Filament Sensor dosen't work #312

Capricornus73 opened this issue Jan 25, 2020 · 124 comments

Comments

@Capricornus73
Copy link

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

@arut16
Copy link

arut16 commented Jan 25, 2020

Same issue here.

I succed to make it work properly to connect it directely to SRK 1.3 (+X socket) board AND only trough Marlin mode AND under condition to send command "M412 D7" with PrinRun when M500 to insert the 7mm offset who is not working if coded in Marlin code on SKR directely.

Any suggestions ?

My config :
Ender 3 Pro
SKR 1.3 with Marlin 2.0.x bugfix
TFT35 v3 with 3.0.25.1

@Capricornus73
Copy link
Author

My board is skr pro v1.1 with tft 35v3.0 and my printer is JGAurora A5.
Directly connected to the Board is the original filament sensor and it works fine in Marlin Mode.
I want to use the smart filament sensor with the tft 35 in touchscreen mode, but it dosen't work!

@guruathwal
Copy link
Contributor

did you tried changing the Filament runout option in feature setting in the TFT menu to Smart?

@Capricornus73
Copy link
Author

Yes i did, but it won't work

@phtp
Copy link

phtp commented Jan 30, 2020

It doesn't work for me either. I ended up just directly connecting to the SKR Mini E3 v1.2 board. And having to use Marlin Mode.

@arut16
Copy link

arut16 commented Jan 30, 2020

Is anyone succed to connect the smart filament sensor to a must be compatible TFT screen from BTT AND make it work ??

@Scope666
Copy link

Scope666 commented Jan 31, 2020

I just tested a non-smart sensor connected in the FIL-DET port of the TFT35 V3 and it doesn't work either. I have it set to "on" in the menu... and I was printing from USB plugged into TFT when I tested.

@guruathwal
Copy link
Contributor

Did you guys tried setting this line to false?

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

@Scope666
Copy link

I haven't yet (will try tomorrow) but I did repeatedly insert and remove a piece of filament during a print. I would think even with it reversed, the port would have detected a change on either the insertion or removal ... no?

@guruathwal
Copy link
Contributor

I can't confirm it.
but if assumed that the sensor only send a HIGH signal when break is detected and send no signal (neither high or low) at all when no breakage then input pin on TFT if set to high will always read it as high? need testing to confirm this.

@guruathwal
Copy link
Contributor

Also the manual for the smart filament sensor states it support the TFT24 & TFT35V3 in 12864 mode.

Only @bigtreetech can comfirm this :

https://github.com/bigtreetech/smart-filament-detection-module/blob/master/manual/smart%20filament%20sensor%20module%20manual191205.pdf
Annotation 2020-01-31 143454

@guruathwal
Copy link
Contributor

confirm this also if this was enabled in your firmware..
according to Bigtreetech manual following line also needs to be un-commented this line in marlin firmware:
#define M114_DETAIL

https://github.com/MarlinFirmware/Marlin/blob/8eb6603e2aa948f54f1e6faec264f7309b214a89/Marlin/Configuration_adv.h#L280

image

@arut16
Copy link

arut16 commented Jan 31, 2020

confirm this also if this was enabled in your firmware..
according to Bigtreetech manual following line also needs to be un-commented this line in marlin firmware:
#define M114_DETAIL

https://github.com/MarlinFirmware/Marlin/blob/8eb6603e2aa948f54f1e6faec264f7309b214a89/Marlin/Configuration_adv.h#L280

image

Thanks for your help. Will check again all tonight, flash firmewares and try again to trigger this feature...

@Scope666
Copy link

Scope666 commented Jan 31, 2020

I can't confirm it.
but if assumed that the sensor only send a HIGH signal when break is detected and send no signal (neither high or low) at all when no breakage then input pin on TFT if set to high will always read it as high? need testing to confirm this.

So I did some extensive testing. With FIL_RUNOUT_INVERTING set to true, no change when printing when inserting or removing filament from sensor. LED on sensor is dim when no filament, bright when filament present.

With FIL_RUNOUT_INVERTING set to false, there IS a change depending on if filament is present or not, BUT it is inverted. If filament is in sensor, printing pauses and "filament runout" pops up on screen. Can only resume by removing filament from sensor. LED on sensor is OFF when no filament and bright when present.

I believe I'm going to have to solder the sensor itself to change it's state from normally open to normally closed. Before I do I wanted to see if you agree @guruathwal ?

image

@guruathwal
Copy link
Contributor

@Scope666 try this:
change the line number 40 in extend.c from:
GPIO_InitSet(FIL_RUNOUT_PIN, FIL_RUNOUT_INVERTING ? MGPIO_MODE_IPD : MGPIO_MODE_IPU, 0);
to
GPIO_InitSet(FIL_RUNOUT_PIN, MGPIO_MODE_IPU, 0);

then try with FIL_RUNOUT_INVERTING set to both true and false.

@Scope666
Copy link

Scope666 commented Jan 31, 2020

@Scope666 try this:
change the line number 40 in extend.c from:
GPIO_InitSet(FIL_RUNOUT_PIN, FIL_RUNOUT_INVERTING ? MGPIO_MODE_IPD : MGPIO_MODE_IPU, 0);
to
GPIO_InitSet(FIL_RUNOUT_PIN, MGPIO_MODE_IPU, 0);

then try with FIL_RUNOUT_INVERTING set to both true and false.

Thanks for this, I will try this shortly and report back. I'm glad I waited to solder. :)

EDIT: So I changed line 40 as you specified, and it works with FIL_RUNOUT_INVERTING true

Maybe we can save this info somewhere, this sensor is probably pretty popular. It's a Kingroon.

https://www.aliexpress.com/item/32917462715.html

@arut16
Copy link

arut16 commented Jan 31, 2020

@Scope666 try this:
change the line number 40 in extend.c from:
GPIO_InitSet(FIL_RUNOUT_PIN, FIL_RUNOUT_INVERTING ? MGPIO_MODE_IPD : MGPIO_MODE_IPU, 0);
to
GPIO_InitSet(FIL_RUNOUT_PIN, MGPIO_MODE_IPU, 0);

then try with FIL_RUNOUT_INVERTING set to both true and false.

Will try that when my actual printing will finish with my Smart Filament Sensor and report back here.

@guruathwal
Copy link
Contributor

@Scope666 good to know that it works.. it still needs confirmation for the smart sensor also

@arut16
Copy link

arut16 commented Feb 1, 2020

@Scope666 good to know that it works.. it still needs confirmation for the smart sensor also

I'm back ! Sorry for feedback time... kids...
I tested with the modification in extend.c (line 40) with FIL_RUNOUT_INVERTING on "true" and "false".

In all cases "smart" is selected in touch screen menu. I made tests in touch mode and marlin simulation mode.

Unfortanately, in none cases I'm not getting any reaction from printer when I'm cutting the filament.

Well, not really none any reaction in marlin simulation mode : in both situation ("true" or "false") with filament intact, when I'm starting a print, after the first 7 mm, fil runout/pause appears on black/green screen : "hotend warming" when filament is get out when an alarm is triggered and a message saye to me to change the filament. When I'm push rotary knob, filament is purged. When purging is done I have two possibilities "purge more" or "filament runout detection : on". I'm selecting the second one. Hotend warms again and when printing continue. BUT after that if I cut the filament, nothing append... printer continue to "print"...

@Scope666
Copy link

Scope666 commented Feb 1, 2020

Before I put guruathwal's code edit in, I had some strange behavior also, a few times it would completely skip my starting gcode (in the file itself, not the TFT's). (auto home, draw the purge line)

Seems better now with the code change.

@guruathwal
Copy link
Contributor

@arut16 the smart sensor also requires M114_DETAIL enabled in marlin firmware.
did you enabled that ?

@arut16
Copy link

arut16 commented Feb 2, 2020

@guruathwal Yes M114_DETAIL is uncommented.
Capture

I made a little video also :https://youtu.be/DYPvalHALLA

@guruathwal If need to see anything else, just ask.

@guruathwal
Copy link
Contributor

@arut16 its hard to diagnose the issue without the actual devices. BTT was sending me a smart sensor but they are still on holidays due to the coronavirus outbreak in china.

can you share the finding without changing line number 40 in extend.c from:
GPIO_InitSet(FIL_RUNOUT_PIN, FIL_RUNOUT_INVERTING ? MGPIO_MODE_IPD : MGPIO_MODE_IPU, 0);

and just with the FIL_RUNOUT_INVERTING set to both true and false.

@arut16
Copy link

arut16 commented Feb 4, 2020

@guruathwal I understand. I have same problem with an BMG Extruder order : still not sending.

Will restore line 40 in extend.c and make tests with "true" or "false" value. I will share findings here.

Thanks !

@arut16
Copy link

arut16 commented Feb 4, 2020

@guruathwal Unfortunately no configuration works ... I tried with the "true" and "false" parameter, in touch mode and Marlin mode. But nothing to do ...
Below the settings activated according to the manual of the smart filament sensor:
image
image
image
image
image
image

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.

The TFT35 v3 firmware is your last release (3.0.25.2) apart from the following change which corrects an error in the BTT source code for BTT 1.2 Relay (PA12=>PC12). It's working, you can add this fix in your next update of your own release. ;-)
image
image

@guruathwal
Copy link
Contributor

@arut16 ... 🧐 So changing the Power Supply pin number from PA12 to PC12 makes the filament runout sensor work which is on PA15. Am I right?

@arut16
Copy link

arut16 commented Feb 5, 2020

@guruathwal No. It's a little comment about BTT 1.2 Relay https://a.aliexpress.com/_U37BR
The problem with smart filament sensor is still actual

@guruathwal
Copy link
Contributor

@arut16 ok... For a moment I thought the PIN numbers are really messed up 😂.
Try this - change line number 40 in extend.c to:
GPIO_InitSet(FIL_RUNOUT_PIN, MGPIO_MODE_IPD, 0);
this just means to set the pin to Input Pull Down earlier suggestion was to set to Input Pull Up which worked for @Scope666

Then try with FIL_RUNOUT_INVERTING set to both true and false.

@arut16
Copy link

arut16 commented Feb 5, 2020

@guruathwal Unfortunately i have already tried and the tests are inconclusive. See above. #312 (comment)

@guruathwal
Copy link
Contributor

@arut16 there are two possible changes to line No 40:
The first suggestion was:
GPIO_InitSet(FIL_RUNOUT_PIN, MGPIO_MODE_IPU, 0);

The second suggestion now is
GPIO_InitSet(FIL_RUNOUT_PIN, MGPIO_MODE_IPD, 0);

The 2nd variable name is different in both of these _IPU & _IPD
did you already tried these? In combination with FIL_RUNOUT_INVERTING?

@bigtreetech
Copy link
Owner

@arut16 Thank you, I'll start testing now

@Msq001
Copy link
Contributor

Msq001 commented Apr 9, 2020

@arut16 hello, I have tested your firmware, There seems to be a problem with your Marlin. "M114 E" always responds with "Count E: 0". Normally, it should feedback the total steps number of E-axis. The touch screen judges the distance of extruder by this value, but it‘s always 0, so the touch screen thinks that filament have not been extruded, so "filament runout" will never pop up. Please download the latest Marlin firmware and configure it to test again.
test

@carl1961
Copy link

carl1961 commented Apr 9, 2020

@Msq001 do you have a working copy of marlin? whats funny is it works in marlin mode, I use the smart sensor every day, works wonderful in marlin mode. also some how it needs to be able to work with both, a bit of a pain to open the control box to switch from skr board to tft display

@Msq001
Copy link
Contributor

Msq001 commented Apr 9, 2020

@carl1961

  • Marlin detect Smart Filament Sensor in a different way than touch screen. Touch screen can only judge the status by the Serial data.
  • About the two modes can be detected normally under the same hardware wiring. There's an idea: to add a gcode in Marlin to tell Marlin that it is in printing state. Then Marlin starts to detect whether the E-axis coordinate and Smart Filament Sensor(SFS) signal match. If the detection is abnormal, Marlin will tell the touch screen by the Serial port data. The touch screen will pause printing and pop up "filament runout". After printing, it will send the new gcode to tell Marlin it is idle now, then Marlin stop detected, so there will be no useless "filament runout" information when change filament. But it takes a lot of programming Marlin and testing to make sure it works.
  • MarlinFirmware/Marlin@27c281e
    I'm currently using the March 23 version of Marlin. It's normal to test it on SKR mini E3. I think the latest bugfix-2.0.x should also be normal (but I didn't test)

@arut16
Copy link

arut16 commented Apr 9, 2020

@Msq001 That's strange... It's ok. Will try to configure and complile 2.0.5.3 last version. Will back here as soon as it's done.

@arut16
Copy link

arut16 commented Apr 9, 2020

@guruathwal @Msq001 @bigtreetech

BINGO ! Thank you very much Msq001 ! Thanks to your investigations, I was able to put my finger on the parameter in Marlin Configuration which did not allow the SFS to function correctly! And more precisely : E0 counter to work.

At first, I downloaded and configured the last release version of Malin 2.0.5.3 of 31/03/2020. I made the full and exactely same configuration : SAME ISSUE !

When during reconfiguration of Configuration_adv.h, a function that I activated before atracted my attention : #define LIN_ADVANCE line 1515 in the last version of the file. I tried to comment it, and when made a test and : BINGO ! Filament RunOut alarm apered ! Finally !

I Will made a demo video tomorrow to demonstrate.

But a suddenly appears question: why LIN_ADVANCE interfere with E0 counter to arrive to TFT by serial BUS ?

@phtp
Copy link

phtp commented Apr 10, 2020

LIN_ADVANCE

So commenting out #define LIN_ADVANCE allowed the touchscreen mode to work with SFS?

@arut16
Copy link

arut16 commented Apr 10, 2020

@phtp Yes !

@steinboy
Copy link

is it working with TFT35_V3.0_E3.26?
i have Ender 3 Pro with SKR 1.3 with Marlin 2.0.x bugfix.

i have commented out LIN_ADVANCE
and activated M114_DETAIL and
comment out FILAMENT_RUNOUT_SENSOR

with smart filament sensor connected to TFT "FIL-DET" and sensor type set to on, then it detects a runout when sensor is unplugged, but when set to "SMART" it does not detect a runout, even when sensor is unplugged. M114 E is showing the E value increasing during a print.

@jyriturkia
Copy link

Those of you having constant false positives with filament runout sensor might find this helpful: Check that runout distance actually set

@robstermn
Copy link

robstermn commented Aug 15, 2020

I have Ender 3 Pro with SKR 1.3 with Marlin 2.0.x bugfix & TFT35_V3.0_E3.26.

And I have tried the following to get the smart filament sensor working with no luck?

  • SFS plugged into the SRK 1.3 into X+ port - Marlin Mode (and confirmed #define FIL_RUNOUT_PIN P1_28 in the pins_BTT_SKR_V1_3h. )

  • SFS plugged into the TFT in the PT-DET port - Touch Mode (Set to On and Smart with the same result)

Both options failed?

I have confirmed that M412
echo:Filament runout ON
Filament runout distance (mm): 7.00

Any help would be appriciated...

My configs:
https://drive.google.com/drive/folders/1fb4-fhaW2kdInT7n5T0qC1phCdU_I-Hx?usp=sharing

@robstermn
Copy link

I think I found the issue, was false I set it to true.

#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.

I will continue to test.

@fabduhameau
Copy link

As many people, my BT filament sensor always told me that there is no filament (with SKR 1.4 turbo)
After a full rebuilt of 2.6.1 bugfix marlin and the following modification, it's working fine
#define FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present.
Thanks to all previous comment wich helps me

@stale
Copy link

stale bot commented Nov 18, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@abecaw
Copy link

abecaw commented Dec 17, 2020

I have it working in touch screen mode as well as simulation mode and optioning. I have a Ender 3 pro with the BTT SKE mini E-3 V-1.2 mainboard. I have the TFT35 E3 V3.0. I have a Micro Swiss Direct Drive all metal hot end. Oh and a BlTouch. I'm using the latest version of Kay3D Cheetah and Marlin 2.0.7.2. I'm using PT-DET connector.

@ggjohnsonjr
Copy link

I have the same setup...Is there a way you could send a copy of your code

@abecaw
Copy link

abecaw commented Jan 6, 2021 via email

@ggjohnsonjr
Copy link

ggjohnsonjr commented Jan 6, 2021 via email

@abecaw
Copy link

abecaw commented Jan 7, 2021 via email

@abecaw
Copy link

abecaw commented Jan 7, 2021 via email

@McFussel
Copy link

How does it work?

@abecaw
Copy link

abecaw commented Jan 14, 2021 via email

@dryjoint
Copy link

Has the issue with the TFT touch screen and the smart runout sensor been resolved?. I have a TFT 7 v3. The sensor works great in Marlin but no matter what I do with the files TFT ini, Marlin files, distance, etc. I get a runout message as soon as I start to print. i have scoped to output from the sensor and pulses look good. I have moved the plug on the SKR 1.4 turbo to E1 just in case there was a problem with the board but the same result.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests