Welcome! Log In Create A New Profile

Advanced

Prusa MK2S Ramps Firmware - Thermistor question

Posted by Foxen 
Prusa MK2S Ramps Firmware - Thermistor question
February 13, 2018 03:47AM
Hello guys,

I am using a Prusa I3 Single Nozzle Printer with an Ramps 1.4 (Prusa MK 2S clone).
The firmware I am using is the Prusa I3 Mk 2S Ver 3.1.0 optimized from Slippyr4:

Slippyr4 Github

I added a thermistor on my board on Pin 15 -> Temp_1_PIN.
The thermistor is connected to the internals of my power supply. I want to read the power supply temperature, if the temp is higher than a treshold it should shutoff.

The problem is, I dont know how to add the thermisor in the firmware. I already set the extruders to 2:

// This defines the number of extruders
#define EXTRUDERS 2

to activate the second thermistor. Then I modified the:
ultralcd_implementation_hitachi_HD44780.h

and added
    int tHotend=int(degHotend(0) + 0.5);
    int tTarget=int(degTargetHotend(0) + 0.5);

    //Print the hotend temperature 1
    lcd.setCursor(0, 0);
    lcd.print(LCD_STR_THERMOMETER[0]);
    lcd.print(itostr3(tHotend));
    lcd.print('/');
    lcd.print(itostr3left(tTarget));
    lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
    lcd_printPGM(PSTR("  "));

################## here begins the addeded content #################

    tHotend=int(degHotend(1) + 0.5);
    tTarget=int(degTargetHotend(1) + 0.5);
    
    //Print the hotend temperature 2
    lcd.setCursor(0, 1);
    lcd.print(LCD_STR_THERMOMETER[0]);
    lcd.print(itostr3(tHotend));
    lcd.print('/');
    lcd.print(itostr3left(tTarget));
    lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
    lcd_printPGM(PSTR("  "));

############### end of my added content #####################

    //Print the Z coordinates
    lcd.setCursor(LCD_WIDTH - 8-2, 1);
#if 1
    lcd_printPGM(PSTR("  Z"));
    if (custom_message_type == 1) {
        // In a bed calibration mode.
        lcd_printPGM(PSTR("   --- "));
    } else {
        lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
        lcd.print(' ');
    }
#else
    lcd_printPGM(PSTR(" Queue:"));
    lcd.print(int(moves_planned()));
    lcd.print(' ');
#endif

    //Print the Bedtemperature
    lcd.setCursor(LCD_WIDTH - 8-2, 0);
    tHotend=int(degBed() + 0.5);
    tTarget=int(degTargetBed() + 0.5);
    lcd.print(LCD_STR_BEDTEMP[0]);
    lcd.print(itostr3(tHotend));
    lcd.print('/');
    lcd.print(itostr3left(tTarget));
    lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
    lcd_printPGM(PSTR("  "));

I also double chekd that the pins in pins.h are mapped the right way to Pin 15.

If I compile the firmware like this it will be shown on my printer like this (See attached picture):
(LCD Layout was modified from me)

It will show the 2 thermistors in the display but the 2 thermistor is somehow mapped to the Bed thermistor .... (Hotend 1 thermistor is not defined as redundant! in the setting). So something is wrong with the definitions I think.

tHotend=int(degHotend(1) + 0.5);
tTarget=int(degTargetHotend(1) + 0.5);

should activate the 2 Thermistor .... but it is the Bed thermistor so the Bed thermistor is shown twice in my display.

Anyone an idea what I am missing ?

Edited 5 time(s). Last edit at 02/13/2018 04:04AM by Foxen.
Attachments:
open | download - Display_Thermnistor.GIF (156.5 KB)
Sorry, only registered users may post in this forum.

Click here to login