Welcome! Log In Create A New Profile

Advanced

Marlin Filament Change

Posted by PropellerHat 
Marlin Filament Change
September 09, 2015 01:12PM
Hello

I need to get my printer to notice the end of filament, move the extruder aside from the print, allow me to exchange the filament and go back where the previous roll ended and continue from there. Isn't this the basic procedure of filamen change in Marlin? Now when I try to get the thing working I get a compiler error saying FIL_RUNOUT_INVERTING was not declared in this scope:

#if defined(FILRUNOUT_PIN) && FILRUNOUT_PIN > -1
if(card.sdprinting) {
if(!(READ(FILRUNOUT_PIN))^FIL_RUNOUT_INVERTING)
filrunout(); }
#endif

How should I change it to fix the error that I have no clue what so ever?

Thanks in advance for the ones who see the effort of helping me smiling smiley

Edited 1 time(s). Last edit at 09/09/2015 01:13PM by PropellerHat.
Re: Marlin Filament Change
September 12, 2015 08:47PM
Hi,
I am using Marlin Version 1.1 Dev

Didn't have any problems with complying, but did have an issue with not being able to restart after detecting out of filament. Wouldn't recognise pressing the LCD knob, just flashed and made a crooking sound from the LCD beeper.
I use a CoreXY with a REPRAP DISCOUNT SMART CONTROLLER

Ended up commenting out the below ... [Marlin_main.cpp sketch..... line 4884]
if (++cnt == 0) lcd_quick_feedback(); // every 256th frame till the lcd is clicked

This stopped the LCD flashing and beeping sound...



Later added to give a sound alert ....... if (!(READ(FILRUNOUT_PIN)^FIL_RUNOUT_INVERTING)) lcd_buzz(110,1000);
Copy as below of what I have.......................... Also need to set filament runout options in configuration.h and also set the I/O pin that is being used for the switch


[Marlin_main.cpp sketch..... line 4884]

//if (++cnt == 0) lcd_quick_feedback(); // every 256th frame till the lcd is clicked //--- Bak ====has edit this out -
manage_heater();
manage_inactivity(true);
lcd_update();
if (!(READ(FILRUNOUT_PIN)^FIL_RUNOUT_INVERTING)) lcd_buzz(110,1000); //-- BAK Added ===== " Warning beep if filament has run out!!!!! " =========
} // Waits for LCD knob (lcd_clicked) to be pressed and displays filament Change) Will keep beeping when filament is not present during this time - Filament needs to be loaded by hand.


Note: Filament runout only works for when printing from SD card.


Would be great if the firmware could be written that once it detects filament run out that you would get a beeping alert sound and then after pressing the LCD knob you would then have options on the LCD to _ Extrude filament, Retract filament, Resume printing.
This would allow filament changing to be done via LCD rather than a manual retract and load. Current firmware does allow setting a value for auto retract amount.

Hope this may help...
Re: Marlin Filament Change
September 25, 2015 06:42AM
This post helped me out. I had a quite a time getting my filament run out sensor to do anything in Marlin. After some time I noticed I had triggered an M600 code, but nothing happened. The solution was to go in the Configuration_adv.h file and uncomment the FILAMENTCHANGEABLE define. That then lead me to the incessant beeping problem RepRot described, and fixed.

I'd like to mention that I found it useful to replace the
if (card.sdprinting && !(READ(FILRUNOUT_PIN) ^ FIL_RUNOUT_INVERTING))
statement with
if (blocks_queued() && !(READ(FILRUNOUT_PIN) ^ FIL_RUNOUT_INVERTING))

This seems to allow the run-out sensor to work for both SD printing and serial/usb printing while not triggering during idle filament changes.
Re: Marlin Filament Change
September 25, 2015 04:51PM
I have read there is a problem that if you use filament out when printing from serial/usb that the host PC will time out after a while as your printer can't send a stop signal back to the PC. Haven't had time to test this yet.
Don't know if once you get filament out and you then pause the PC . I using ponterface whether this will not cause the PC to time out..

As far as I see it that if you run out of filament you need to stop printing regardless whether the PC times out or not.



Another thing I found to be useful to add to marlin is to include the filament sensor into the M119 status which current only reports the status of the XYZ endstops.
I also added status for my Z2 min endstop, I use 7 endstops on my CoreXY machine as I use 2 motors for my Z axis which auto sync when homing.
Also changed to code to display endstops from either " Trigged " or " Open " to Trigged " or " - - - " The term of "Open" is confusing as often if using a switch in may in fact be closed when not at Home, Using " Untrigged " is more correct but I found it looked better to use " - - - "
Better to have endstop switches closed when away from home as there is less chance of electricial noise causing a false reading when printing.

Cheers Bruce..
--------------------------------------------------------------------------------------------------------------------------------------------
M119 Gcode changes

Marlin Version: 1.1
Description: M119 is used to report status of endstop switches. It can be edited to report additional switches like the filament present switch.
Sketch: Marlin_main.cpp
Line: 3887
Code added:

#if HAS_FILRUNOUT
SERIAL_PROTOCOLPGM(MSG_FILAMENT);
SERIAL_PROTOCOLLN(((READ(FILRUNOUT_PIN)^FIL_RUNOUT_INVERTING)?MSG_FILRUNOUT:MSG_FILRUNIN));
#endif

Also
Sketch: language.h
Line: 145
Code added:

#define MSG_FILAMENT "Filament: "
#define MSG_FILRUNOUT "Out "
#define MSG_FILRUNIN "Present “

Also
Sketch: language_en.h
Line: 24
Code added:

#ifndef MSG_FILAMENT
#define MSG_FILAMENT "Filament: "
#endif
#ifndef MSG_FILRUNOUT
#define MSG_FILRUNOUT "Out "
#endif
#ifndef MSG_FILRUNIN
#define MSG_FILRUNIN "Present: "
#endif
Sorry, only registered users may post in this forum.

Click here to login