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

end of filament detection #999

Closed
rr2s opened this issue Jul 9, 2014 · 21 comments
Closed

end of filament detection #999

rr2s opened this issue Jul 9, 2014 · 21 comments

Comments

@rr2s
Copy link

rr2s commented Jul 9, 2014

I would like to implement a function that would put marlin break at the detection end of the filament.
I would really contributed to this framework and understand how to do it properly.

Where and how can I create a function that triggers a pause if the pin D1 and high state (normally unused pin on the ramps 1.4).

@gerty
Copy link

gerty commented Oct 24, 2014

Has any progress been made on this feature? We're looking to repurpose an unused endstop and a roller/limit switch which would trigger an M226 "Gcode Initiated Pause" when open. D1 is a good thought but we're using an Azteeg X3. I'll have to check the mapping.

@rr2s
Copy link
Author

rr2s commented Oct 24, 2014

I wanted have advice, but I have not had any.
I fend me.
I use a optical detector fork.
Command M226 is trigger when there no more filament.
In ramps 1.4 we can use the AUX (D1 for example).
Azteeg X3 also uses a Atmel ATMEGA2560 micro controller, you should find the auxiliary fairly easily.
I also use a buzzer to warn me when there lack of filament M300.
  It's very simple to set up.

@boelle
Copy link
Contributor

boelle commented Dec 19, 2014

if you have fixed this then please fork the latest marlin, make the changes you made and submit a pull request

@JamesT42
Copy link

If you do, please make it multi-extruder compatible

@AbuMaia
Copy link

AbuMaia commented Mar 24, 2015

I see there is now an option to enable a filament runout sensor in configuration.h. Where can I find documentation on this feature? I have such a switch already in use on my printer, set to normally-open, and held closed by the filament, triggering M300 when the filament end opens the switch.

@thinkyhead
Copy link
Member

Hi @AbuMaia. All you need to do is to uncomment the define FILAMENT_SENSOR and then make sure your sensor's pin is set correctly. The default values are…

@boelle
Copy link
Contributor

boelle commented Mar 24, 2015

info here: http://www.thingiverse.com/thing:89044

and you can get one here: http://owi.storenvy.com/

@AbuMaia
Copy link

AbuMaia commented Mar 24, 2015

That's the wrong sensor, Thinkyhead. I'm not talking about a filament width sensor, but an end-of-filament sensor. Configuration.h says it uses RAMPS servo pin 2, but there are options for pullups and inverting which I do not understand.

@boelle
Copy link
Contributor

boelle commented Mar 24, 2015

you can still use that sensor... if a 3mm filament is below 1mm then you
are prob out

Den tirsdag den 24. marts 2015 skrev AbuMaia notifications@github.com:

That's the wrong sensor, Thinkyhead. I'm not talking about a filament
width sensor, but an end-of-filament sensor. Configuration.h says it uses
RAMPS servo pin 2, but there are options for pullups and inverting which I
do not understand.


Reply to this email directly or view it on GitHub
#999 (comment)
.

@AnHardt
Copy link
Member

AnHardt commented Mar 24, 2015

@boelle
Yes. But there is a little difference between 60$ and 20€ cent.

@AbuMaia
Copy link

AbuMaia commented Mar 24, 2015

As mentioned earlier, I don't have a width sensor, I have a filament runout sensor. I just need some additional info on how to set it up in Configuration.h.

@Wurstnase
Copy link
Contributor

If you have a normal mechanical switch you need a pullup, so the pin can reset. Inverting depends on your switch (normally close/normally open).

@AnHardt
Copy link
Member

AnHardt commented Mar 24, 2015

@AbuMaia
Take a switch. Connect to pin and ground. Set FILRUNOUT_PIN in your pins_???.h. Define ENDSTOPPULLUP_FIL_RUNOUT. Play with FIL_RUNOUT_INVERTING until it works.

@AbuMaia
Copy link

AbuMaia commented Mar 24, 2015

I have my switch connected to pin 57. Is there a pullup resistor associated with that pin?

@AnHardt
Copy link
Member

AnHardt commented Mar 24, 2015

@AbuMaia
As fa i remember there are pullups for all pins.

@AbuMaia
Copy link

AbuMaia commented Mar 24, 2015

Thanks for the help.

@thinkyhead
Copy link
Member

Oops, right, well, same general idea. Find the relevant pin, make sure it's set, enable the option. Etc.

@Ziggy2013
Copy link

Most of the functionality required for a filament "end" monitor and alarm are already in Marlin. The existing "filament Change" function (pause/resume) can be used if triggered by a digital pin going low to high. A simple filament end sensor can be made just using a micro switch which normally holds the pin low when filament is present.

http://community.robo3d.com/index.php?threads/filament-monitor.3335/page-2#post-42914

The mods below have been tested and work. The end of filament sense pin is 44. Obviously this pin needs to be a config parameter. The boolean FC_Flag also needs to be defined correctly (not just in line as in this mod)

The code changes required in the file marlin_main.cpp are :

  lcd_init();
  _delay_ms(1000);  // wait 1sec to display the splash screen

  #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
    SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
  #endif

  #ifdef DIGIPOT_I2C
    digipot_i2c_init();
  #endif

  // filament monitor mod - 18/03/2015
  // filament monitor pin set to input
   SET_INPUT(44);
   WRITE(44,HIGH); // enable pull up 
}

// filament monitor mod - 18/03/2015
boolean FC_Flag = false; // initialise flag to enque M600 command once per alarm

void loop()
{
  if(buflen < (BUFSIZE-1))
    get_command();

And in the marlin_main.cpp loop() code

    #else
      process_commands();
    #endif //SDSUPPORT
    buflen = (buflen-1);
    bufindr = (bufindr + 1)%BUFSIZE;

// filament monitor mod - Ziggy 
// 
// note FC_Flag variable must be global
//
 if (digitalRead(44) == HIGH) {         // check filament monitor alarm pin
    if (!FC_Flag) {              // not already triggered ?
     enquecommand_P(PSTR("M600"));       // trigger a filament change
     FC_Flag = true;                     // 
    }
  } else FC_Flag = false;               // reset for next alarm

  }
  //check heater every n milliseconds

@Ziggy2013
Copy link

I see in the latest dev version this function has been implemented along the same lines using pin 4

@thinkyhead
Copy link
Member

Sounds like you have it in hand. I can see it will help to make better documentation for this, and for Marlin features generally. Keeping that in mind…

@github-actions
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 Apr 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants