Skip to content

Commit

Permalink
fix UltiGCode heatup function for dual extruders
Browse files Browse the repository at this point in the history
  • Loading branch information
TinkerGnome committed Nov 17, 2018
1 parent 980c3dc commit 344220a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// build by the user have been successfully uploaded into firmware.
#define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
#ifndef STRING_CONFIG_H_AUTHOR
#define STRING_CONFIG_H_AUTHOR "Tinker_18.08-DEV" // Who made the changes.
#define STRING_CONFIG_H_AUTHOR "Tinker_18.11-DEV" // Who made the changes.
#endif

// SERIAL_PORT selects which serial port should be used for communication with the host.
Expand Down Expand Up @@ -275,9 +275,9 @@
// #define DEFAULT_bedKd 1675.16

//Ultimaker2
#define DEFAULT_bedKp 124.55
#define DEFAULT_bedKi 23.46
#define DEFAULT_bedKd 165.29
#define DEFAULT_bedKp 120.0
#define DEFAULT_bedKi 23.5
#define DEFAULT_bedKd 165.0
#endif // PIDTEMPBED


Expand Down
2 changes: 1 addition & 1 deletion Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1767,7 +1767,7 @@ void process_command(const char *strCmd, bool sendAck)
}
#endif // EXTRUDERS

while(current_temperature_bed < target_temperature_bed - TEMP_WINDOW)
while(current_temperature_bed < degTargetBed() - TEMP_WINDOW)
{
m = millis();
if((m - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
Expand Down
14 changes: 7 additions & 7 deletions Marlin/UltiLCD2_menu_print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ void lcd_menu_print_heatup()
lcd_question_screen(lcd_menu_print_tune, NULL, PSTR("TUNE"), lcd_menu_print_abort, NULL, PSTR("ABORT"));

#if TEMP_SENSOR_BED != 0
if (current_temperature_bed > target_temperature_bed - TEMP_WINDOW*2)
if (current_temperature_bed > degTargetBed() - TEMP_WINDOW*2)
{
#endif
for(uint8_t e=0; e<EXTRUDERS; ++e)
Expand All @@ -678,14 +678,14 @@ void lcd_menu_print_heatup()
}

#if TEMP_SENSOR_BED != 0
if (current_temperature_bed >= target_temperature_bed - TEMP_WINDOW * 2 && !commands_queued() && !blocks_queued())
if (current_temperature_bed >= degTargetBed() - TEMP_WINDOW * 2 && !commands_queued() && !blocks_queued())
#else
if (!commands_queued() && !blocks_queued())
#endif // TEMP_SENSOR_BED
{
bool ready = true;
for(uint8_t e=0; e<EXTRUDERS; e++)
if (current_temperature[e] < target_temperature[e] - TEMP_WINDOW)
if (current_temperature[e] < degTargetHotend(e) - TEMP_WINDOW)
ready = false;

if (ready)
Expand All @@ -704,7 +704,7 @@ void lcd_menu_print_heatup()
#endif // TEMP_SENSOR_BED

uint8_t progress = 125;
for(uint8_t e=0; e<EXTRUDERS; e++)
for(uint8_t e=0; e<EXTRUDERS; ++e)
{
#if EXTRUDERS == 2
uint8_t index = (swapExtruders() ? e ^ 0x01 : e);
Expand All @@ -715,14 +715,14 @@ void lcd_menu_print_heatup()
continue;
#endif
if (current_temperature[e] > 20)
progress = min(progress, (current_temperature[e] - 20) * 125 / (target_temperature[e] - 20 - TEMP_WINDOW));
progress = min(progress, (current_temperature[e] - 20) * 125 / (degTargetHotend(e) - 20 - TEMP_WINDOW));
else
progress = 0;
}
#if TEMP_SENSOR_BED != 0
if (current_temperature_bed > 20)
progress = min(progress, (current_temperature_bed - 20) * 125 / (target_temperature_bed - 20 - TEMP_WINDOW));
else if (target_temperature_bed > current_temperature_bed - 20)
progress = min(progress, (current_temperature_bed - 20) * 125 / (degTargetBed() - 20 - TEMP_WINDOW));
else if (degTargetBed() > current_temperature_bed - 20)
progress = 0;
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#############################

##Which version name are we appending to the final archive
export BUILD_NAME=18.08.1
export BUILD_NAME=18.11.1

#############################
# Actual build script
Expand Down
14 changes: 7 additions & 7 deletions Marlin/tinkergnome.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ void lcd_menu_print_heatup_tg()

char buffer[32] = {0};
#if TEMP_SENSOR_BED != 0
if (current_temperature_bed >= target_temperature_bed - TEMP_WINDOW * 2)
if (current_temperature_bed >= degTargetBed() - TEMP_WINDOW * 2)
{
#endif
for(uint8_t e=0; e<EXTRUDERS; ++e)
Expand All @@ -1255,15 +1255,15 @@ void lcd_menu_print_heatup_tg()
}

#if TEMP_SENSOR_BED != 0
if (current_temperature_bed >= target_temperature_bed - TEMP_WINDOW * 2 && !commands_queued() && !blocks_queued())
if (current_temperature_bed >= degTargetBed() - TEMP_WINDOW * 2 && !commands_queued() && !blocks_queued())
#else
if (!commands_queued() && !blocks_queued())
#endif // TEMP_SENSOR_BED
{
bool ready = true;
for(uint8_t e=0; (e<EXTRUDERS) && ready; ++e)
{
if (current_temperature[e] < target_temperature[e] - TEMP_WINDOW)
if (current_temperature[e] < degTargetHotend(e) - TEMP_WINDOW)
{
ready = false;
}
Expand All @@ -1287,14 +1287,14 @@ void lcd_menu_print_heatup_tg()
if (target_temperature[e] < 1)
continue;
if (current_temperature[e] > 20)
progress = min(progress, (current_temperature[e] - 20) * 125 / (target_temperature[e] - 20 - TEMP_WINDOW));
progress = min(progress, (current_temperature[e] - 20) * 125 / (degTargetHotend(e) - 20 - TEMP_WINDOW));
else
progress = 0;
}
#if TEMP_SENSOR_BED != 0
if ((current_temperature_bed > 20) && (target_temperature_bed > 20+TEMP_WINDOW))
progress = min(progress, (current_temperature_bed - 20) * 125 / (target_temperature_bed - 20 - TEMP_WINDOW));
else if (target_temperature_bed > current_temperature_bed - 20)
if ((current_temperature_bed > 20) && (degTargetBed() > 20+TEMP_WINDOW))
progress = min(progress, (current_temperature_bed - 20) * 125 / (degTargetBed() - 20 - TEMP_WINDOW));
else if (degTargetBed() > current_temperature_bed - 20)
progress = 0;
#endif

Expand Down
4 changes: 2 additions & 2 deletions MarlinSimulator/UltiLCD2_Sim.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<Add option="-D__AVR_ATmega2560__=1" />
<Add option="-DARDUINO=165" />
<Add option="-DF_CPU=16000000" />
<Add option="-DEXTRUDERS=1" />
<Add option="-DTEMP_SENSOR_1=0" />
<Add option="-DEXTRUDERS=2" />
<Add option="-DTEMP_SENSOR_1=20" />
<Add option="-DFILAMENT_SENSOR_PIN=-1" />
<Add option="-DBABYSTEPPING" />
<Add option="-DTEMP_SENSOR_BED=20" />
Expand Down

0 comments on commit 344220a

Please sign in to comment.