Welcome! Log In Create A New Profile

Advanced

Adding support for up to 16 added temp sensors???

Posted by kasper219 
Adding support for up to 16 added temp sensors???
May 06, 2015 09:17AM
I am looking to add an Analog Multiplexer/Demultiplexer (CD74HC4067) to my printer which currently has 6 seperate heating elements on it that most of which i use outside sources to control and keep in tune to the correct temperature... I was wondering if i could modify my printers firmware to work the Multiplexer in such a way that it could redirect each of the extra heating elements and ambient sensors to say the T0 pin for reading and possibly storing into an array to do something with it. That way I can go back to using just the RAMPS board for full control not just turning it completely on via extra pins and letting an outside preset take care of controlling the temperatures.... I am sure that there is a way to do such a thing, but I haven't found one yet....

I am currently using Marlin fimware with auto-level support on a RAMPS 1.4 board running 12V.

Any direction or helpful advice would be greatly appreciated in my ventures of modifying the firmware to my direct needs.
Re: Adding support for up to 16 added temp sensors???
May 06, 2015 09:24AM
Here what i've found.

[bildr.org]

You could take a look in the temperature.cpp at line ~1400. There starts the temp_state switch. Put the setup in the tp_init(). That should work.
For the 4 pins you can use the aux-pins.


Triffid Hunter's Calibration Guide --> X <-- Drill for new Monitor Most important Gcode.
Re: Adding support for up to 16 added temp sensors???
May 06, 2015 09:25AM
Thanks I will look at that when i get off work later!
Re: Adding support for up to 16 added temp sensors???
May 09, 2015 12:16PM
I am assuming that the bellow would be the code block you were reffering to. I am a little lost how i would add in a section that could be seen by the main routine to watch and run while each one is supposed to be on. What function/code block would refference this to see what each heater is at????

switch(temp_state) {
    case 0: // Prepare TEMP_0
      #if defined(TEMP_0_PIN) && (TEMP_0_PIN > -1)
        #if TEMP_0_PIN > 7
          ADCSRB = 1< -1)
        raw_temp_0_value += ADC;
      #endif
      #ifdef HEATER_0_USES_MAX6675 // TODO remove the blocking
        raw_temp_0_value = read_max6675();
      #endif
      temp_state = 2;
      break;
    case 2: // Prepare TEMP_BED
      #if defined(TEMP_BED_PIN) && (TEMP_BED_PIN > -1)
        #if TEMP_BED_PIN > 7
          ADCSRB = 1< -1)
        raw_temp_bed_value += ADC;
      #endif
      temp_state = 4;
      break;
    case 4: // Prepare TEMP_1
      #if defined(TEMP_1_PIN) && (TEMP_1_PIN > -1)
        #if TEMP_1_PIN > 7
          ADCSRB = 1< -1)
        raw_temp_1_value += ADC;
      #endif
      temp_state = 6;
      break;
    case 6: // Prepare TEMP_2
      #if defined(TEMP_2_PIN) && (TEMP_2_PIN > -1)
        #if TEMP_2_PIN > 7
          ADCSRB = 1< -1)
        raw_temp_2_value += ADC;
      #endif
      temp_state = 0;
      temp_count++;
      break;
    case 8: //Startup, delay initial temp reading a tiny bit so the hardware can settle.
      temp_state = 0;
      break;
//    default:
//      SERIAL_ERROR_START;
//      SERIAL_ERRORLNPGM("Temp measurement error!");
//      break;
  }
Sorry, only registered users may post in this forum.

Click here to login