Skip to content

[1.1] Add 3rd preheat, smaller move distance#8214

Closed
stuartmp wants to merge 2 commits intoMarlinFirmware:bugfix-1.1.xfrom
stuartmp:bugfix-1.1.x
Closed

[1.1] Add 3rd preheat, smaller move distance#8214
stuartmp wants to merge 2 commits intoMarlinFirmware:bugfix-1.1.xfrom
stuartmp:bugfix-1.1.x

Conversation

@stuartmp
Copy link

@stuartmp stuartmp commented Nov 2, 2017

I find myself using PETG more often so I added an option to the Pre-heat menu.

I also like to move finer increments that what was there so I added move 0.01mm and 0.001mm

Thanks for your help Scott

@thinkyhead thinkyhead changed the title Added a new preheat and move distance options [1.1] Add 3rd preheat, smaller move distance Nov 3, 2017
@thinkyhead
Copy link
Member

You may need to push your changes. There are none included with this PR.

@alexxy
Copy link
Contributor

alexxy commented Nov 5, 2017

May be it will be better to define Preheat settings with M code?
So use can define needed set

MXXX P0 ABS E200 T100
MXXX P1 PLA E180 T60
MXXX P2 SMT E250 T100

or something like that...

@stuartmp
Copy link
Author

stuartmp commented Nov 5, 2017 via email

@thinkyhead thinkyhead force-pushed the bugfix-1.1.x branch 2 times, most recently from 50cc55d to 38900ea Compare April 24, 2018 12:24
@marcio-ao
Copy link
Contributor

marcio-ao commented Aug 3, 2018

@stuartmp: I had a similar issue, but with our customers expecting support for dozens of filament types, three options aren't enough. Rather than keep adding preheat options, which will never be sufficient for everyone, a better option is to have the third option be a numerical temperature selection field for custom preheat temperature. This is the changes I made in "ultralcd.cpp":

...
void _change_filament_temp(const uint16_t temperature) {
    char cmd[11];
    sprintf_P(cmd, _change_filament_temp_command(), _change_filament_temp_extruder);
    thermalManager.setTargetHotend(temperature, _change_filament_temp_extruder);
    lcd_enqueue_command(cmd);
}
void _lcd_change_filament_temp_1_menu()      {_change_filament_temp(PREHEAT_1_TEMP_HOTEND); }
void _lcd_change_filament_temp_2_menu()      {_change_filament_temp(PREHEAT_2_TEMP_HOTEND); }
void _lcd_change_filament_temp_custom_menu() {_change_filament_temp(thermalManager.target_temperature[_change_filament_temp_extruder]);}
...
void _lcd_temp_menu_filament_op(const AdvancedPauseMode mode, const int8_t extruder) {
    _change_filament_temp_mode = mode;
    _change_filament_temp_extruder = extruder;
    START_MENU();
    if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), true, true);
    MENU_BACK(MSG_FILAMENTCHANGE);
    MENU_ITEM(submenu, MSG_PREHEAT_1, _lcd_change_filament_temp_1_menu);
    MENU_ITEM(submenu, MSG_PREHEAT_2, _lcd_change_filament_temp_2_menu);
    MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, _UxGT("Preheat Custom"), &thermalManager.target_temperature[_change_filament_temp_extruder], EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15, _lcd_change_filament_temp_custom_menu);
    END_MENU();
}
...

Once I do more testing on this, I may roll it up into a PR.

@stuartmp
Copy link
Author

stuartmp commented Aug 5, 2018 via email

@marcio-ao
Copy link
Contributor

Nice work. Great idea.

@stuartmp: Thanks! Glad you like it!

Sent from my Android device with K-9 Mail. Please excuse my brevity.

Woof!

@rmoravcik
Copy link
Contributor

Great work @marcio-ao . I'm personally using mostly PETG, so I hard-coded a third 3rd preheat menu item in my Marlin.

Would it be possible to add an configuration option to specify initial value of temperature for "Preheat custom"?

Also maybe it would be a good idea to store last "Preheat custom" temperature value to eeprom if eeprom is enabled.

@marcio-ao
Copy link
Contributor

marcio-ao commented Aug 8, 2018

Would it be possible to add an configuration option to specify initial value of temperature for "Preheat custom"?

Yes and no. On the following line, the argument that currently has EXTRUDE_MINTEMP is the minimum value the custom temperature control can take:

MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, _UxGT("Preheat Custom"), &thermalManager.target_temperature[_change_filament_temp_extruder], EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15, _lcd_change_filament_temp_custom_menu);

If you change EXTRUDE_MINTEMP to the PETG print temperature, then the custom temperature will start at that value, which is what you want. However, there will be no way to tune the temperature below that value.

One possibility would be to add an option to Configuration_adv.h called CHANGE_FILAMENT_CUSTOM_TEMP_MIN, and use that instead of EXTRUDE_MINTEMP in the line above, but it would be a bit weird from a user's perspective, because while it would allow the setting of a third temperature preset, it also has that side-effect of preventing the temperature from being adjusted below that value.

Making it so there is a default temperature that starts at some arbitrary value, while still allowing that temperature to be adjusted below that value, or making it an EEPROM saveable value, would require a more sophisticated fix that would consume more resources in Marlin.

@marcio-ao
Copy link
Contributor

marcio-ao commented Aug 8, 2018

@thinkyhead: What are your thoughts on @rmoravcik's request?

If we can spare another two bytes in SRAM and are willing to store the data in EEPROM, then I can see the fix being implemented by adding a third element to the "lcd_preheat_hotend_temp" in "Configuration_store.cpp", then the above code becomes the following:

...
void _change_filament_temp(const uint16_t temperature) {
    char cmd[11];
    sprintf_P(cmd, _change_filament_temp_command(), _change_filament_temp_extruder);
    thermalManager.setTargetHotend(temperature, _change_filament_temp_extruder);
    lcd_enqueue_command(cmd);
}
void _lcd_change_filament_temp_1_menu()      {_change_filament_temp(PREHEAT_1_TEMP_HOTEND); }
void _lcd_change_filament_temp_2_menu()      {_change_filament_temp(PREHEAT_2_TEMP_HOTEND); }
void _lcd_change_filament_temp_custom_menu() {_change_filament_temp(lcd_preheat_hotend_temp[2]);}
...
void _lcd_temp_menu_filament_op(const AdvancedPauseMode mode, const int8_t extruder) {
    _change_filament_temp_mode = mode;
    _change_filament_temp_extruder = extruder;
    START_MENU();
    if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), true, true);
    MENU_BACK(MSG_FILAMENTCHANGE);
    MENU_ITEM(submenu, MSG_PREHEAT_1, _lcd_change_filament_temp_1_menu);
    MENU_ITEM(submenu, MSG_PREHEAT_2, _lcd_change_filament_temp_2_menu);
    MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, _UxGT("Preheat Custom"), &lcd_preheat_hotend_temp[2], EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15, _lcd_change_filament_temp_custom_menu);
    END_MENU();
}
...

This means though that there would be three elements in lcd_preheat_hotend_temp, but only two in lcd_preheat_bed_temp and lcd_preheat_fan_speed, which would be a bit peculiar.

@thinkyhead
Copy link
Member

At this point Marlin 1.1.x is end-of-life, so this PR will need to be re-done starting from bugfix-2.0.x and targeting that branch. Sorry for the inconvenience!

@thinkyhead thinkyhead closed this Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants