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

SKR MINI (MZ) Board and simple filament sensor #14

Open
pappicio opened this issue Apr 23, 2021 · 17 comments
Open

SKR MINI (MZ) Board and simple filament sensor #14

pappicio opened this issue Apr 23, 2021 · 17 comments

Comments

@pappicio
Copy link

pappicio commented Apr 23, 2021

Hi, I've found that SKR releases only uses smart filament sensor, infact, If I compile and use SKR_BTT_MINI (for mega zero 1.0 version) and enable filament_sensor, I have false positive, so when start printing, printer tell ever me that filamen is terminated, so I changed:
#if ANY(KAD_SKR_ENOUGH_FLASH, KAD_SMART_FILAMENT_SENSOR)
#define FILAMENT_MOTION_SENSOR
#endif
to:
#if ANY(KAD_SKR_ENOUGH_FLASH, KAD_SMART_FILAMENT_SENSOR)
/// #define FILAMENT_MOTION_SENSOR
#endif

and finally it worked with simple filament sensor, in fact setting simple filament sensor pin to GND, and only in this case I receive on lcd screen message that filament is terminated and need to be changed and now works well, but I have simple filament sensor wired on octoprint raspberry3 pins, and prefer use it to have also messages sent to homeassistant and then adviced by alexas diposed into my home, but, iwith mentioned modification on source code, simple filament sensor finally works on my new SKR MINI MZ Board, with no false positive about it!
thanks.

@kad
Copy link
Owner

kad commented Apr 25, 2021

Yes, BTTs smart filament sensor is better choice than simple ones, so for SKR boards it is selected as default option.
So far nobody requested other configuration, so I haven't added it as separate build option, and it is easy to comment out one line if needed. If there will be need to persistently generate such configuration, I can add build targets for that as well.

@pappicio
Copy link
Author

ok. no problem, disabling that line works well, for me is ok!

@pappicio
Copy link
Author

pappicio commented May 8, 2021

I can see yoy 're updating skr mini buils inserting also fs for filament sensor!
I' ve added also theese ones!

[env:anycubic_mega_zero_btt_mini_bl_zmin_e0fan_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_bed_bl_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_bed_bl_zmin_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_bed_bl_e0fan_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_bed_bl_zmin_e0fan_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_bfpt_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_bfpt_e0fan_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_bfpt_zmin_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_bfpt_zmin_e0fan_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_pinda_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_pinda_e0fan_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_bed_bfpt_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_bed_bfpt_zmin_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_bed_bfpt_e0fan_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_bed_bfpt_zmin_e0fan_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_bed_pinda_fs]
extends = env:anycubic_mega_zero_btt_mini
[env:anycubic_mega_zero_btt_mini_bed_pinda_e0fan_fs]
extends = env:anycubic_mega_zero_btt_mini

@kad
Copy link
Owner

kad commented May 8, 2021

@pappicio yeah, I'll need to fix script that generates all those permutations of configs and update it globally. I had in recent few days person who is trying to use simple filament sensor with BTT SKR mini board, thus adding few configs for him to test.
One feedback that I've got is that for his sensor it would be needed to invert FIL_RUNOUT_STATE=LOW to FIL_RUNOUT_STATE=HIGH. @pappicio how is it in your setup?

@pappicio
Copy link
Author

pappicio commented May 8, 2021

I use: mini_bed_bl_zmin_e0fan_fs and works well, and nothing modded respect original code, so It is (if I remeber well) pulled up and FIL_RUNOUT_STATE=LOW (If It means that filament is not present). I used homemade sensor 3d printed and a switch, so I've connected only 2 wire. Pin-in and GND, so when filament ends, the switch close and Pin goes to gnd.
so, there are 2 different way, maybe the original one is pulled down and when switch closes, the Pin-in is connected to 5v and goes in pull-up. in this case the user can invert GND and 5V on sensor Pin or invert by code as you wrote.
EDITED.
wait.... wait...
I've found a scheme
https://reprap.org/forum/file.php?219,file=98159

and seems to be on GND when filament is not present (cos is has also a led inside, led that is on only when the filament is present and according to the scheme, is all exact) so like my setup.... strange....
I' ve checked (online) the runout sensor pinout and is + / - / in and on skr mini mz relative pinout is same: + / - / in....

@kad
Copy link
Owner

kad commented May 8, 2021

reprap link is not working for me :(
ok, anyway, it seems I need to connect and re-check with sensors I have.

@pappicio
Copy link
Author

pappicio commented May 8, 2021

Screenshot_20210508-191433_Chrome

can you see it now?

@kad
Copy link
Owner

kad commented May 8, 2021

looks similar to what I bought from aliexpress, but not sure about presence of R1... anyway, I'll need to try myself it seems.

@pappicio
Copy link
Author

pappicio commented May 8, 2021

R1 is to put pin in pullup with 5v but is bypassed by led and 1k resistor that are from Pin to 5v so led in on and only when switch turns to GND, the resistor R1 became active for a while, leaving Pin to pullup, until itself is connected to GND, and in this case passes from HIGH state to LOW state (filament ended!)

@kad
Copy link
Owner

kad commented May 8, 2021

@pappicio I understand that :) I'm just not sure the ones I have have similar schematics, need to double check those.

@pappicio
Copy link
Author

pappicio commented May 8, 2021

ok, btw, thanks for all your work on marlin firmware.

@pappicio
Copy link
Author

pappicio commented May 9, 2021

just 10 minutes agoo I contacted a friend of mine, he has simple filament sensor and just for wiring, he confirm, 3 wire and the sequence is: +/-/in (he told me about the wires colors: red/black/white)...

@kad
Copy link
Owner

kad commented May 9, 2021

Well, I've re-checked with ones that I have + Lerdge endstop

IMG_5553D

Both have same jst xh2.54 connector, both have in absence of filament state low (signal to gnd connection)... However they have different schematics and pin order.

  • BTT simple filament sensor - this one has LED active when filament is inserted. pin order is like on EXT-A2 on Melzi board, so can be connected there with straight xh2.54 3pin cable. However, sold with cross-over cable suitable for BTT boards (on one of the ends it is reversed: 1/2/3 -> 3/2/1).
    IMG_5546D
    IMG_5545D

  • More common, I've bought mine from TwoTrees - this one has LED active when filament is out. Pins are in order matching BTT boards, sold with straight xh2.54 3 pin cable.
    IMG_5548D
    IMG_5547D

Both of them have same operation mode: when filament absent, signal is low, so current setting is fine:
IMG_5551D
IMG_5550D

One thing that worries me, is that TwoTrees nowadays have in description "Trigger: high level"... so might be some new types of sensors are sold and that would require people to update config/rebuild if they would want to use those.

@pappicio
Copy link
Author

pappicio commented May 9, 2021

well done, I've seen on thingiverse a model of runout sensor for ender 3, with schematic, and it had wire inverted in 3.3/5v and GND, it had: GND/5V/signal.... very strange.... maybe depend only by the sensor you bought. (if I find again that page I'll post schematic, that, repeat, is inverter from that one I've posted.....)
btw, could be easy the solution, if the wire colors are inverted: invert from LOW to HIGH by firmware...
I found that:
https://www.thingiverse.com/thing:3965021

seeing better that scheme, maybe also cut and invert 2 wires on it (5V and GND) can solve the problem.

@kad
Copy link
Owner

kad commented May 9, 2021

this one is DIY variant... my point was what to keep as defaults in my configs. Based on what I was able to buy - LOW is the setting. For more rare variants people might need to update themselves.

pinout above: this one above targeting to be used with some pin27 adapters on original Melzi boards. Those have different pinouts, e.g. easier BLTouch 3pin servo connection. so, orders of the wires on DIY variants not that matter...

Reversing 5v/gnd might work, need to re-check at least in mine, how the LEDs are wired. I think in cheaper versions from Aliexpress they are saving pennies on resistors/capacitors... so will not be surprised if that will not work :)

@pappicio
Copy link
Author

pappicio commented May 26, 2021

some news (I had 3 wire runout filament sensor on raspberry3 before) now I changed the raspberry with a minipc, really mini (an old windows based TV BOX), but powerfull respect to raspberry, so, I now mounted rounout filament sensor on SKR mini MZ (not previous homemade 2 wire filament sensor, but new one with 3 wire by aliexpress), and, yes, I can confirm that also for my 3 wire rounout filament sensor I need to change:

FIL_RUNOUT_STATE=LOW
to
FIL_RUNOUT_STATE=HIGH

so: homemade 2 wire runout filament sensor, source is ok.
3 wire filament sensor I need to change, and then all works well (I re-fixed to work property also advices by Homeassistant, telegram and alexa announces, if filamet ends during print operations!)

@kad
Copy link
Owner

kad commented May 26, 2021

@pappicio it looks like there are several designs. Mine are from older designs where state is LOW to trigger. One of the vendors nowadays changed description to state=HIGH. So, they might have newer variant.

Regarding reversing 5v/gnd: I tried that. Yes, it also inverts the signal pin, however, that disables LED on sensors (well, polarity of LED is becoming opposite, as expected).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants