Tuesday, February 8, 2011

yay cool or should i say hot.

well today i got my latest package from maker gear, Canada post is running really behind, it should have been here last week but oh well i got it now.i got the code working the way i wanted to from renoir, thanks for all the help dude.

here is some of the data i have collected so far.
the blue line is the temp at the heater nozzle and the yellow line is the temp at the heatsink,
 at the end away from the fan. i only took the heat up to 150, i think i will take it to 180 in my next test. i also plan on slowing how fast the data was logged, to about every 4-5 seconds in my next run, i want to figure out how to average the readings in the code so there not so jittery 

the dips in the blue line are from when i knocked a wire loose. my next one will be more consistent i promise.

with the setup now it is in the middle, the space that was left on the brass rod. the 2 dips near the peak of the yellow line are where i turned the fan on,  it make the heater turn back on allot more than i was expecting. and with it off it did get allot warmer than i was expecting. so tonight i will move it to the top of the rod against the peek.  i will also do a test with no heatsink on it to see what the temp at the top of the brass rod is.

i think the 2 nuts that i used may have added a little more thermal mass than i was thinking so my next test with it at the top will just have one nut pushing it agents the peek, giving it even more space. from the heater.

this is my order from makergear, yay


i thought i would order a new tip for when i get things working, this is a .25mm one.

this is my hodgepodge for my testing, i liked having the lcd
 so that i could tell what my temps were doing 

and here you can see where i had my sensors placed, the one on the barrel read lower that the one on the arduino mega did, but that one is on the metal vs the other one being ontop of the capton tap, so that may have affected the readings some.

and here is the final code that i used on the arduino nano.

#include
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

#define THERMISTOR_PIN1 0
#define THERMISTOR_PIN2 1


// Thermistor lookup table for RepRap Temperature Sensor Boards (http://make.rrrf.org/ts)
// Made with createTemperatureLookup.py (http://svn.reprap.org/trunk/reprap/firmware/Arduino/utilities/createTemperatureLookup.py)
// ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=4066 --max-adc=1023
// r0: 100000
// t0: 25
// r1: 0
// r2: 4700
// beta: 4066
// max adc: 1023
#define NUMTEMPS 20
short temptable[NUMTEMPS][2] = {
  {1, 841},
  {54, 255},
  {107, 209},
  {160, 184},
  {213, 166},
  {266, 153},
  {319, 142},
  {372, 132},
  {425, 124},
  {478, 116},
  {531, 108},
  {584, 101},
  {637, 93},
  {690, 86},
  {743, 78},
  {796, 70},
  {849, 61},
  {902, 50},
  {955, 34},
  {1008, 3}
};


void setup()
{
  Serial.begin(9600);
  Serial.println("Starting temperature exerciser.");
  lcd.begin(8, 2);
}

void loop()
{
  int celsius1 = read_temp(THERMISTOR_PIN1);
  int celsius2 = read_temp(THERMISTOR_PIN2);


  Serial.print("Temp 1 ,");
  Serial.print(celsius1);
  Serial.print(", ");

  Serial.print(" Temp 2 ,");
  Serial.print(celsius2);
  Serial.println("");
  
  lcd.setCursor (0, 0);
  lcd.print("T1 ");
  lcd.print(celsius1);
  lcd.print((char)223);
  lcd.print("C");

  lcd.setCursor (0, 1);
  lcd.print("T2 ");
  lcd.print(celsius2);
  lcd.print((char)223);
  lcd.print("C");
  delay(4000);
}

int read_temp(int pin)
{
   int rawtemp = analogRead(pin);
   int current_celsius = 0;

   byte i;
   for (i=1; i
   {
      if (temptable[i][0] > rawtemp)
      {
         int realtemp  = temptable[i-1][1] + (rawtemp - temptable[i-1][0]) * (temptable[i][1] - temptable[i-1][1]) / (temptable[i][0] - temptable[i-1][0]);

         if (realtemp > 255)
            realtemp = 255;

         current_celsius = realtemp;

         break;
      }
   }

   // Overflow: We just clamp to 0 degrees celsius
   if (i == NUMTEMPS)
   current_celsius = 0;

   return current_celsius;
}



2 comments:

  1. Cool Mike. Are you using thermistors or thermocouples?

    ReplyDelete
  2. thermistors. i would like to go to thermocouples but there allot more money, so in time i will try them.

    ReplyDelete