Close



Results 1 to 3 of 3
  1. #1
    Technician
    Join Date
    Nov 2014
    Location
    Kentucky, US
    Posts
    70

    A fix for COOLDOWN on the LCD

    The PREPARE / COOLDOWN menu item does not work correctly on the version of Marlin designed for my 10" i3v. Instead of turning off both the hot end heater (gcode M104 S0) and the bed heater (M140 S0), it turns off only the hot end heater and leaves the bed heater running. The second half of the command is not interpreted correctly so COOLDOWN does not reset the bed target to 0C. Examining the code, it appears as though the attempt to send 2 gcode commands in the same text string does not work.

    I have implemented a fix that works with the Marlin_RAMPS_EPCOS_i3v10 code that I downloaded from Makerfarm. I imagine it would work with other versions as well. The fix consists of adding a short function to replace the inline code that attempts to send 2 gcode commands at once. The added function sends the hot end and bed heater codes individually. It also causes a return to the main menu after selecting COOLDOWN (I prefer this behavior).

    Two changes are required in the ultralcd.cpp file (only that file is affected). First, add a new lcd_cooldown() function at a convenient location in the code:

    Code:
    #ifdef SDSUPPORT
    static void lcd_autostart_sd()
    {
        card.lastnr=0;
        card.setroot();
        card.checkautostart(true);
    }
    #endif
    
    // ------------- begin added 11/12/14 code (makes cooldown function correctly)
    void lcd_cooldown()
    {
        enquecommand_P(PSTR("M104 S0"));
        enquecommand_P(PSTR("M140 S0"));
        lcd_return_to_status();
    }
    // ----------------------- end 11/12/14 added code
    
    void lcd_preheat_pla()
    {
        setTargetHotend0(plaPreheatHotendTemp);
        setTargetHotend1(plaPreheatHotendTemp);
        setTargetHotend2(plaPreheatHotendTemp);
        setTargetBed(plaPreheatHPBTemp);
        fanSpeed = plaPreheatFanSpeed;
        lcd_return_to_status();
    }
    Next, edit the code for the COOLDOWN menu item to call the new function as follows (disable the original line with //, and add one new line of code in its place):

    Code:
    static void lcd_prepare_menu()
    {
        START_MENU();
        MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
    #ifdef SDSUPPORT
        //MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd);
    #endif
        MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
        MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
        //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
        MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla);
        MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs);
        MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown);  // added 11/14/14:  cooldown menu selection not working
        //MENU_ITEM(gcode, MSG_COOLDOWN, PSTR("M104 S0\nM140 S0"));  // disable since not working correctly, M140 is ignored
        MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
        END_MENU();
    }
    
    float move_menu_scale;
    static void lcd_move_menu_axis();
    Hope this helps someone besides me.

    Jim

  2. #2
    Staff Engineer printbus's Avatar
    Join Date
    May 2014
    Location
    Highlands Ranch, Colorado USA
    Posts
    1,437
    Add printbus on Thingiverse
    FYI - it looks like the problem with cooldown via LCD was fixed in Marlin sometime after MakerFarm grabbed the snapshot they're distributing. The MakerFarm fork dacb put together in http://3dprintboard.com/showthread.p...s-enhancements already has a similar fix.

  3. #3
    Technician
    Join Date
    Nov 2014
    Location
    Kentucky, US
    Posts
    70
    Thanks. I like dacb's fix better, and have changed my code to match. For those reading this thread, see below for an improved lcd_cooldown() function:

    Code:
    void lcd_cooldown()
    {
        setTargetHotend0(0);
        setTargetHotend1(0);
        setTargetHotend2(0);
        setTargetBed(0);
        fanSpeed = 0;
        lcd_return_to_status();
    }
    Jim

Posting Permissions

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