Firmware, mechanical and electrical design files for the Inline Filament Diameter Estimator, Lowcost (InFiDEL).

Overview

Inline Filament Diameter Estimator, Lowcost (InFiDEL)

CC0 Originally created by Thomas Sanladerer

A cheap, yet precise filament diameter sensor, intended to compensate for filament diameter deviations in real-time.

The InFiDEL is a cheap (< $5) filament diameter sensor intended for use with FDM 3d printers. The sensor can be calibrated to provide surprisingly precise filament diameter readings in real-time. The main idea is to use the sensor to correct for filament diameter deviations while printing.

Based on this proof-of-concept: https://www.youmagine.com/designs/filament-diameter-sensor

Assembly and Setup

Assembly and Setup Instructions on Youtube

Calibration

  • Flash board with calibration.ino
  • Connect a host via I2C (see provided host-example.ino)
  • Insert each calibration drill bit shafts and replace the lookup table entries in driver.ino with your own measurements
    • Measure the actual diameter of the shafts and fill second column
    • Use the host's output *1000 to fill first column
  • Finally, flash driver.ino with your values filled out
  • Hub should now output exact diameter values

Note:

Analog output is currently not enabled in driver.ino (I2C and FAULT pin only)

BOM

Printed Parts

1 Block 1 Lever

Note:

Parts should preferably be printed in PETG, ABS or ASA as PLA may creep significantly over time.

Electronics

There are two board variants included in this repository, either can be used to assemble the InFiDEL.

Choose one:

  • SMT control board (which is populated; Gerber files and component specifications are included)
  • THT control board

Also required:

  • Suitable programmer for ATTiny85 (eg USBtinyISP)
  • 1 SS495A linear hall effect sensor (or comparable)

Fasteners

  • 2 M3x8 screws (eg ISO 4762 M2x8)
  • 1 3x24mm pin (eg DIN 7 3x24mm, for mating lever to the block)
  • 1 3x16mm pin (eg DIN 7 3x16mm, for roller bearing in lever)
  • 1 3x18mm pin (eg DIN 7 3x18mm, for idler bearing in block)
  • 6 M3 threaded inserts

Pins may be replaced with screws or grubscrews, which may result in decreased precision.

Other Hardware

  • 1 6x2mm magnet (eg N35)
  • 4 623 bearings (preferably 623-2Z / 623-ZZ)
  • 1 Ballpoint pen spring (or other soft 4mm spring)
  • Short length of PTFE tube

Calibration Accessories

  • 1 1.5mm drill bit
  • 1 1.7mm or 1.8mm drill bit
  • 1 2mm drill bit
  • Calipers for verifying drill bit shaft diameter

Drill bits may be replaced with similar diameters. Measured diameter is to be written to firmware lookup table.

Issues
  • [FEATURE] Add auto-build of documentation as preview in a Pull request

    [FEATURE] Add auto-build of documentation as preview in a Pull request

    Is your feature request related to a problem? Please describe. When making a pull request aiming to improve the documentation, it is hard to test that the new changes does not break the original documentation

    Describe the solution you'd like Figure out a way to auto-build it in a check when merging a pull request

    Describe alternatives you've considered Manually building but this takes time

    Additional context Example for this feature using readthedocs can be found in the Manim Community repository

    Example pull request - https://github.com/ManimCommunity/manim/pull/1712 Example build for the pull request (may not last after merging) - https://manimce--1712.org.readthedocs.build/en/1712/

    documentation enhancement help wanted 
    opened by darigovresearch 12
  • infidel Sensor with Table in EEPROM and Programming over I2C

    infidel Sensor with Table in EEPROM and Programming over I2C

    Hi,

    I have make an Firmware for the Sensor with

    • Table in EEPROM
    • Programm the Table over I2C (Host)
    • Get Diameter
    • Get RAW Value

    so the Sensor has Programmed one time an the Calibartion kan make over I2C with Uart Console on the Host.

    Michael

    documentation enhancement 
    opened by midopple 11
  • Add Electronics BOM

    Add Electronics BOM

    Hello,

    would people be interested in electronic BOMs for both PCB versions? I made a BOM for my build and could add it here and maybe add links to electronic resellers like mouser or similar (EU and US)

    documentation 
    opened by lost-hope 9
  • [FEATURE REQUEST] Documentation

    [FEATURE REQUEST] Documentation

    Would be good to have a docs page to help improve adoption of the project such as step-by-step assembly instructions for the build and coding. This would help make the project more accessible for new joiners and help pull from a wider audience for new features etc. Would suggest having it in the same repository if possible so it could be hosted as a GitHub page

    Example docs frameworks that can be used:

    • Read the docs - https://readthedocs.org/
    • Docusaurus - https://docusaurus.io/
    • docsy - https://www.docsy.dev/docs/

    Example of open source documentation based on some of the above frameworks Open source pick and place machine - https://docs.indexmachines.io/docs/ Open source machines to recycle plastic - https://community.preciousplastic.com/academy/intro.html

    Happy to write content for it if the maintainers think this would be helpful and choose which documentation framework they have a preference for

    documentation enhancement 
    opened by darigovresearch 8
  •  The lever part has some thin walls that make it almost unprintable

    The lever part has some thin walls that make it almost unprintable

    The walls that the bearings locate to are extraordinarily thin, so thin in fact that they are basically unprintable with a normal FDM printer with a 0.4mm nozzle. Even with a 0.25mm nozzle I don't think these details are resolvable in a suitable material ASA, PETG as specified by the original designer.

    image

    Whereas the solid part should look like:

    image

    Looking in the CAD the inner and outer faces appear to be intersecting, which will absolutely make any printer sad, as it's trying to print something that is infinitely thin.

    enhancement 
    opened by darraghbr 8
  • JLCPCB makes it look like the pick and place locations are incorrect in the current CPL file

    JLCPCB makes it look like the pick and place locations are incorrect in the current CPL file

    If you go through the order process with JLCPCB the resulting pick and place locations are incorrect.

    image

    JLCPCB will still accept the files and it should work properly, they go through a checking process where they will adjust the positions by hand.

    wontfix 
    opened by darraghbr 7
  • Version 3 of the Infidel Sensor

    Version 3 of the Infidel Sensor

    New functions and updates:

    • Command "6" reads the average value of the ADC input (sensor) over 100 samples, removes the outliers and sends the AVERAGE/MIN/MAX values. Results in better accuracy when calibrating.

    • Calibration without host, if the button is pressed when switching on, the calibration starts at the sensor. The calibration procedure is described in the readme.me file.

    • Command "7" sets the analogue output to PWM 0.

    • Command "8" sets the analogue output to PWM 255 (MAX). This is necessary to calibrate the analogue output because it depends on the supply voltage. Therefore, do this only when the sensor is connected to the printer control.

    • The calibration table contains the calibration values for the DAC with index 9, the procedure is described in the readme.me. The values for the DAC can be set via OK command "4".

    opened by midopple 6
  • Capacitor grounds not connected

    Capacitor grounds not connected

    As can be seen in the screenshots below, the grounds of the two capacitors are connected to each other and a ground fill island on the bottom side. This ground fill island is then not connected to the rest of ground, but it should be. Top side: image Bottom side: image

    opened by eltobu 5
  • [FEATURE REQUEST] Add Kitspace one click pricing

    [FEATURE REQUEST] Add Kitspace one click pricing

    Kitspace is a project that really helps with building open source hardware as it allows you to (when properly implemented) have an almost one click pricing for the PCB and electronics components. If setup by the maintainers it would really decrease uncertainty if the components chosen are the ones that work reliably.

    We haven't had to implement it yet but it seems relatively straightforward to implement and lets users have self-autonomy to replicate the work, build upon it and put it in the hands of users.

    Examples of very good implementations of this are the Open book and ebook wing projects by @joeycastillo

    https://kitspace.org/1-click-bom/ https://github.com/kitspace/1clickBOM#readme

    Would also resolve issue #18 as well

    enhancement 
    opened by darigovresearch 5
  • Which TinyWireS library to use

    Which TinyWireS library to use

    calibration.ino and driver.ino both use calls to TinyWireS.write() to send data, but I haven't found a version of the TinyWireS library that includes a write() function instead of send(). Is there a particular library version needed here? Changing .write to .send looks proper and compiles, but I'm not able to test that it works properly.

    bug question 
    opened by blurfl 5
  • [FEATURE REQUEST] KiCad version of PCB

    [FEATURE REQUEST] KiCad version of PCB

    We may get more contributions/improvements to the system if it is in an open source PCB format like KiCad as it would reduce the barrier to entry for new users. Was wondering if the maintainers or someone from the community would be interested in trying this out.

    https://www.kicad.org/

    opened by darigovresearch 4
  • compensation of retractions in the calculation of the filament diameter

    compensation of retractions in the calculation of the filament diameter

    Any related problems?

    I was thinking about the operation of the sensor and as long as it comes to measuring the filament in optimal conditions the system is valid but ... when measuring the filament while printing, a few millimeters of filament will be read 3 times. these multiple reads occur when there are retractions in the gcode. How can we compensate for this error which will be directly proportional to the number and length of the retractions?

    What's your feature?

    Compensation of the error due to the multiple reading of the retraction filament

    Additional context?

    None

    bug 
    opened by TamerlanOne 0
  • [Feature] Filament stuck function

    [Feature] Filament stuck function

    Any related problems?

    No response

    What's your feature?

    Could you add a function with an high resolution encoder wheel, to know when filament is stuck? Bigtreetech has something like this with their sensor, but it's really not that reliable:

    https://www.youtube.com/watch?v=UUx2R9u6ohE

    This review of this sensor shows the problem. If you could add a version, in which one of the bearings is the encoder wheel and add that to the sensor, that would be really a gamechanger. When I look at what you did so far, that can't be that hard.

    Additional context?

    None

    bug 
    opened by LordPinhead 2
  • [FEATURE REQUEST]: Add typical changes to be made to a printer firmware

    [FEATURE REQUEST]: Add typical changes to be made to a printer firmware

    One of the main use cases of this project is for filament that is more or less experimental/home-made, and thus varies a lot in diameter, but that you want to print anyway. This filament diameter sensor could be used to allow steady extrusion with varying diameter of filament, especially during a print.

    As far as I know there's been no 'complete integration' yet. By complete integration I mean, one or several sensor that would be mounted on a classic Marlin-based printer, like a Prusa MK3S for instance. The sensors (different angles to account for ovality) would send analog readings of the filament diameter to the board, and the firmware would adjust the extrusion steps (maybe with something equivalent to M221 Set flow rate) on the fly, with a delay (i.e. taking into account the feed rate and the distance from reading to hot end).

    I think this needs a number of changes to the printer's firmware, which would be useful to include in this repository too.

    I find this feature very interesting myself so I'm ready to spend some time on it, but I would also appreciate the help of someone who's familiar with tweaking things in Marlin. If anyone is interested to collaborate/provide a little support to get this feature faster, please reach out! Thanks.

    opened by CCMCAGP 2
  • [Bug]: Unexpected behaviour of the sensor ADC to Diameter

    [Bug]: Unexpected behaviour of the sensor ADC to Diameter

    What happened?

    Sensor is flashed with infidel_release_ee.ino, board with host_ee_prog.ino. This is calibration over I2C. I have drill bits of different sizes to calibrate with: 1.4, 1.5, 1.6, 1.7, 1.8, 1.9 mm [for my sensor, 2mm doesn't fit at all, 1.9mm doesn't even go all the way in, and 1mm doesn't move the lever].

    I expect the normal behaviour of the sensor to be as coded in infidel_release_ee.ino, and indicated in the docs, as shown by orange curve on the graph -> ADC increases with decreasing diameter.

    What actually happens with my readings (Command 6) is the opposite (Blue curve). My ADC readings increase with diameter.

    unexpected_sensor_behaviour

    Of course this means bad behaviour of the interpolation function convert2dia in infidel_release_ee.ino, so I get incorrect readings when you import the calibrated values in EEPROM starting from the biggest diameter to the smallest, because it includes if (dia_table[i][0] > in) ... return (out); break.

    Another issue is that the ADC range is less wide than expected. The range of ADC values given in firmware.rst is [617,999] for drill bits from 1 to 2mm, for me they are spread out from 26 to 282 for drill bits 1.4 to 1.9mm. The resolution is about 2 (=500/256) values of ADC per micron, it's still ok but I'm wondering whether this shift towards lower ADC values, and slight reduction in range is normal. Probably not...

    Any solutions?

    To solve the incorrect readings, I simply flipped the calibration table so that ADC are sorted in ascending order with the line index of the table.
    image

    This solved the problem and my readings seem accurate. However I am wondering if I am the only one getting this deviation from the docs or if this is something that should be corrected in the documentation.

    Additional info

    I got the unpopulated PCB from Aisler, not altering anything from the SMT files there. Also got the BOM from Kitspace without deviations.

    bug 
    opened by CCMCAGP 5
  • Make the firmware documentation more explicit

    Make the firmware documentation more explicit

    I would like to make the doc>firmware.rst document [EDIT: currently at the stage of pull request from @leonhma] more complete and accessible. Can someone review it and see whether my initial steps are correct? As a beginner in electronics, I have been struggling to interprete the firmware instructions, but a research project I’m doing requires this filament sensor so I'll have to make it work, on a printer too!

    REQUIREMENTS

    • Arduino > V1.8.8
    • TinyWireS LIbary from https://github.com/nadavmatalon/TinyWireS Download the .ZIP of this library and upload in Tool>Include Library>Add .ZIP library
    • ATtiny85 Board for Arduino from https://github.com/damellis/attiny Load this in Board Manager, more info in https://www.youtube.com/watch?v=AmpHIHM41Hw&ab_channel=Adio_ -
    • ISP Programmer like Arduino over ISP --> https://www.arduino.cc/en/Tutorial/BuiltInExamples/ArduinoISP Set the Arduino Uno as an Arduino As ISP following same video as above. Upload the example sketch ArduinoISP onto the board, this board is now an ISP programmer and you may need a different board as host.

    Load the code, wire the ISP program to the ISP port on the sensor and program it.

    This sentence was very obscure to me, so here's how I interpreted and detailed it.

    How to flash firmware onto the sensor

    1. Wire the ISP programmer to the ISP port on the sensor. I think this is different from the host_to_sensor_arduino.PNG wiring drawing because the ISP port is not occupied. So I tried to find the equivalent functions of each pin on the ISP port and on the Uno ISP programmer.

    Type | Pin # on ISP  port (Sensor) | Arduino Pin (ISP programmer) -- | -- | -- MISO | 1 | 12 VCC | 2 | 5V SCK | 3 | 13 SDA | 4 | 11 RESET | 5 | 10 GND | 6 | GND

    1. In Tools, Set processor to Attiny85, Clock to Internal 16MHz (current doc says 1MHz but the sensor .ino files all say 16MHz), Programmer to Arduino as ISP
    2. Tools > Burn Bootloader
    3. Open driver.ino and Sketch>Upload with Programmer

    Current status

    At the moment, with this method, three issues arise: ISSUE 1. In the doc Firmware, the LED is said to flash twice. For me, it flashed only once. ISSUE 2. With the driver.ino flashed onto the sensor, when I approach a magnet, no matter what the magnet polarity is, the LED is triggered. I wonder if anyone has the same issue. In the video https://www.youtube.com/watch?v=RYgdLPe_T0c&t=14s&ab_channel=ThomasSanladerer (5:19), the sensor should not be triggered with one of the two magnet faces (and that's the direction you should use to stick on the lever). I have a N45 magnet instead of the N35, but I also have the same problem with a much smaller N45 magnet which should have a smaller force.

    ISSUE 3. With the current state of the documentation, I don't understand when the 5 different firmwares should be used. Could someone clarify the difference between all these firmware in the description and state exactly on which occasion they should be used?

    TLDR;

    a noob tries to clarify the documentation on the firmware. Can you review up to this stage, and clarify what firmware should be on host and sensor at every step?

    PS: I realize this might belongs more to a forum than to GitHub but since I'm not aware of one, please forgive me for posting it here. I hope that maybe my remarks and questions could help to make this project more accessible to others as well.

    documentation question 
    opened by CCMCAGP 4
  • Added 'firmware' section to docs

    Added 'firmware' section to docs

    This is again some changes to the docs. Can be seen on my forked repo leonhma/infidel-sensor. I also deleted the gh-pages workflow, in favor of hosting the docs on rtd. This is also linked in the forked repo and the pullrequest preview as in #44 can be seen in leonhma/infidel-sensor#2 (click on 'show all checks' and then 'details'). To add this feature either an existing maintainer has to link to rtd and set stuff up, or i can do it and will have to be made maintainer.

    documentation enhancement 
    opened by leonhma 7
Releases(0.0.1)
Owner
Daniel Smullen
Software engineering researcher. Interested in privacy, security, autonomous systems, software architecture, and the Internet of Things.
Daniel Smullen
This is customized version of Seagull tool to support MD5 Hash calculation for Diameter Protocol(Digest-HA1 AVP)

This is customized version of Seagull tool to support MD5 Hash calculation for Diameter Protocol(Digest-HA1 AVP)

null 1 Nov 18, 2021
control any electrical device.

let's build something together ?? You get: ?? Requirements: arduino IDE bread board NodeMcu8266 cp2102 1Chanel 5v relay Female female 20cm jumper wire

Milad Dehghan 13 Mar 5, 2022
🎮 Plants vs. Zombies multiplayer battle, developed via reverse engineering, inline hook and dynamic-link library injection. Two online players defend and attack as the plant side and zombie side respectively.

Plants vs. Zombies Online Battle This project has two original repositories: https://github.com/czs108/Plants-vs.-Zombies-Online-Battle https://github

Liugw 71 Oct 14, 2021
shadowhook is an inline hook library for Android apps.

shadowhook is an inline hook library for Android apps.

Bytedance Inc. 646 Aug 11, 2022
A fully-functional open source and open hardware mechanical USB computer keyboard with only three keys!

threeboard threeboard is a fully-functional open source and open hardware mechanical USB computer keyboard with only three keys. It supports multiple

Conor Taylor 97 May 23, 2022
C/C++ Application to solve irrigation rotation whatever two-turn rotation or three-turn rotation, longitudinal section design, hydraulic calculations, and design of hydraulic structures like weirs and tail escape.

Irrigation works C/C++ Application to solve irrigation rotation whatever two-turn rotation or three-turn rotation, longitudinal section design, hydrau

Mohamed Jamal Ghayyad 1 Jun 24, 2022
sipeed opensource mechanical keyboard make with BL706

sipeed_keyboard sipeed opensource mechanical keyboard make with BL706 矽π 开源双模机械键盘 目录结构 ./ ├── LICENSE ├── README.md ├── firmware // 存放键盘固件 ├── hardwar

Sipeed 53 Jun 6, 2022
A large mechanical 7-segment clock using cheap stepper motors.

mechanical-7-segment-clock A large mechanical 7-segment clock using cheap stepper motors. Each digit requires its own controller board. The seconds di

null 44 Aug 1, 2022
An Alice-like 35% 3d printed mechanical keyboard using ItsyBitsy dev boards

QALBLE An ergo 35% 3d printed wireless mechanical keyboard, born from the thought of "Imagine QAZ but split like an Alice ?? " The BLE is a misnomer s

null 13 Jul 9, 2022
Design and firmware for a stepper motor retrofit to the often-failed AC synchronous flip clock motors

StepperFlipClock Design and firmware for a stepper motor retrofit to the often-failed AC synchronous flip clock motors. Flip clocks, perhaps most icon

Dan Ellis 2 Jun 11, 2022
Design files and resources for building a wireless N64 controller

wireless-n64-controller This project and its documentation is a Work-In-Progress. I'm still working on writing everything down and working out kinks i

Spencer Fraint 33 Jul 10, 2022
Creates 3D lithophanes from image files, exports them to stl files, ready for slicing and 3D printing.

LithoMaker Creates 3D lithophanes from PNG image files and exports them to STL files, ready for slicing and 3D printing. Download the latest release h

Lars Muldjord 13 Jun 29, 2022
This program converts ASCII STL files to RT files for miniRT.

STL to RT This program converts ASCII STL files to RT files for miniRT. Input the ASCII STL file to the standard input and output the RT file from the

null 5 Mar 29, 2021
Use DOS object files (OMF) as patch files

omfpatch - Use Intel/Microsoft .OBJ files as binary diffs Overview This tool makes it possible to use MASM / TASM / JWasm / nasm as tool to write patc

Michael Karcher 2 Jan 30, 2022
The whole design is modular, parametric (cost and others), field repairable, and super extensible

Easy-Transceiver The whole design is modular, parametric (cost and others), field repairable, and super extensible. It is almost trivial to add suppor

Dhiru Kholia 3 Jul 5, 2022
KePOS is a 64-bit operating system. Design and implement your own operating system

KePOS is a 64-bit operating system. The purpose of this system is to combine the theoretical knowledge and practice of the operating system, and to deepen the understanding of the operating system.

null 65 Jul 27, 2022
foxBMS is a free, open and flexible development environment to design battery management systems.

foxBMS is a free, open and flexible development environment to design battery management systems. It is the first modular open source BMS development platform.

The foxBMS Team 74 Aug 8, 2022
Simplified design of an analog keypad matrix interface and demo thereof

Analog Keypad Interface In pin-restricted microcontroller designs it is common to use analog pins and sets of resistors to encode button switch inputs

null 14 Feb 6, 2022
This project design to mine Duino-Coin using an Esp8266 as a master and Arduino as a slave.

DuinoCoinI2C This project design to mine Duino-Coin using an Esp8266/Esp32 as a master and Arduino as a slave. Using the I2C communication to connect

Luiz Henrique Cassettari 143 Jul 23, 2022