Close



Results 1 to 10 of 17

Hybrid View

  1. #1
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,182
    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 11:28 AM.

Posting Permissions

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