Close



Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1. #11
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,183
    Quote Originally Posted by DarkAlchemist View Post
    Sure. Eventually I will get those other pins wired up with the header pins as I had to do for ABL but frankly I had it all installed and did a Homer Simpson DOH! when I noticed I had forgotten those digital and analog pins. With those added adding another switch would be easy.
    Which limit switch is easy to get at when you are standing over your printer?

  2. #12
    Y would be.

    Here is the video I mentioned before as I just found it again:


    Basically he is doing something like this and I am unsure how M600 compares ->
    Code:
    M83 ; turn on relative movement for extruder  
    G1 E-5.000000 F6000 ; retract filament 5mm  
    G1 X0.000000 Y0.000000 Z4.000000 F9000 ; home X and Y axis leave Z at current height  
    M84 E ; release extruder stepper motor from 'holding' position  
    @pause ; pause print!
    G1 X0.000000 Y0.000000 F9000 ; upon resume, rehome X/Y in case position was bumped out  
    G1 X69.080000 Y58.560000 F9000 ; move back to next layer starting position  
    G1 E0 F6000 ; reset extruder, ready to push out plastic again  
    G1 F9000  
    M82 ; set extruder movement back to absolute ready for next layer

  3. #13
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,183
    One bad thing about what he is doing is he is turning all the motors off. It is very difficult not to move the X & Y when you do this as you are feeding new filament into the extruder. The M600 selectively turns off only the Extruder's motor.

    We can leverage the M119 code to look for the Y Limit switch being pressed. It looks like:

    #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1
    SERIAL_PROTOCOLPGM(MSG_Y_MIN);
    SERIAL_PROTOCOLLN(((READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_ INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN))
    #endif

    I think if you replace this section of code in your Marlin_main.cpp it will probably work. Probably, you should just add a M600 command to something small you can print and see if it does the right thing. My concern is if your print homes to the max position of the bed we might have to swap the Y_MIN_PIN label with Y_MAX_PIN.

    Code:
    #ifdef FILAMENTCHANGEENABLE
    #ifndef ULTIPANEL
    
    bool lcd_clicked()
     {
            int pin_being_examined;
            int ii, iii, jj;
            
            pin_being_examined=Y_MIN_PIN;                     
            
            pinMode(pin_being_examined, INPUT_PULLUP);  // Set it to Input with a pull up if it hasnt
            delay(50);                                  // been used since RESET.
            
            iii = digitalRead(pin_being_examined);      // Get the current state of pin.  
    
            return !iii;
    }
    
    void lcd_pressed()
     {
    
        while( lcd_clicked() != 0 )            // Wait for the switch to be released
            ;
        delay(50);
        while( lcd_clicked() != 1 )            // Wait for the switch to be pressed
            ;
        delay(50);
    }
    #endif 
    #endif
    Once you get that change folded into your code and tested, please report back. If everything works as expected, I'm going to change the directions on the M600 Filament Change thread to allow using limit switches as an option.
    Last edited by Roxy; 11-06-2014 at 12:28 PM.

  4. #14
    Hi Roxy,

    I was thinking of doing something along these lines, but using Y_MIN on a switch to detect filament being out, i.e., TRIGGERED if filament present, if OPEN filament is out. Then, when you run out of filament, it executes an M600.

    To do this, would you place a check for Y_MIN at the top of the marlin_main.cpp loop, and if OPEN try to jump to the M600 code somehow? Would it be best to remove the M600 code to a routine that could be called by both the trigger and the main case code?

  5. #15
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,183
    Quote Originally Posted by revwarguy View Post
    Hi Roxy,
    Hi! I got your posts approved!

    Quote Originally Posted by revwarguy View Post
    I was thinking of doing something along these lines, but using Y_MIN on a switch to detect filament being out, i.e., TRIGGERED if filament present, if OPEN filament is out. Then, when you run out of filament, it executes an M600.

    To do this, would you place a check for Y_MIN at the top of the marlin_main.cpp loop, and if OPEN try to jump to the M600 code somehow? Would it be best to remove the M600 code to a routine that could be called by both the trigger and the main case code?
    I believe the main line Marlin code at GitHub has the logic to handle a filament check now. But it might be tied to having an LCD Panel. I don't know. I haven't looked at that. But to your question, Yes, the check would have to be in the main loop somewhere. That is the only higher level piece of code that is always running.

    This is a bit of hack... But it is how the LCD Panels do their work. When you see the filament run out, you could use the function:

    bool enquecommand(const char *cmd)

    in Marlin_main.cpp to put a M600 into the buffer and then just return back to the main loop. The main loop would think the M600 command was part of the .GCODE file that it was processing. It would blindly do as told and do a filament change.

  6. #16
    thanks for approving my posts!

    I will look into the enquecommand call, and if you don't mind, I'll report back here on what happens.

    Thanks again!

  7. #17
    We've been using the "Ziggy" modification (https://docs.google.com/viewer?a=v&p...MzQzNTQyNjJmMA) to enqueue the M600 command when a filament fault is detected with our Tunell Filament Monitor (http://www.toybuilderlabs.com/produc...lament-monitor).

    Here's a demo of it working with the Fusion3 F306: https://www.youtube.com/watch?v=6IJ5EZDe62Q

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •