Reflow Plot Profile

Lately I have been working on the reflow plot profile and how it could be implemented within the arduino controller.

I have consolidated the reflow profile information so I could wrap my head around what the oven needs to do. My plan right now is to have the Arduino hold a number of different profiles in EEPROM. These stored profiles will be user selectable and adjustable using the LCD screen and user input.

I have made a function that outputs a waveform of this shape.  All of the twists and turns are built with adjustable parameters.

//###############################################
int SnPbProfilePoint(unsigned long theTime) {
// each count is 1/4 degC, time count are milliSeconds
// pre-heat, flux activation, reflow, cooling
// profile for SnPb (Tin-Led)
// wetting time is duration spent above 183degC

// Pre-Heat: 0-110sec
// raise the temperature up from 25degC to 110degC over 100sec
// preheat = Time*(110-25)degC/100+25 =
// Time*(phMaxT-ambT)/phTime+ambT
unsigned long  phMaxT = 440; //4 * 110
unsigned long  ambT = 100; // = 4 * 25
unsigned long phTime = 100000; //=100*1000

// Flux Activation: 100-160sec
// raise the temperature up from 110degC to 125degC over 60sec
// =110+(125-110)*(Time-100)/60 =
// phMaxT+(faMaxT-phMaxT)*(Time-phTime)/faTime
unsigned long  faMaxT = 500; //(4*125)
unsigned long faTime = 60000;//(1000*60)

// <a class="zem_slink" title="Reflow soldering" href="http://en.wikipedia.org/wiki/Reflow_soldering" rel="wikipedia">Reflow</a>: 160-250sec
// raise the temperature up from 125degC to 240degC over 90sec
// = 125 + (250 -125)* (Time -100-60)/90
// faMaxT + (rfMaxT-faMaxT)*(Time-phTime-faTime)/rfTime
unsigned long  rfMaxT = 960;//(4*240)
unsigned long  rfTime = 90000;//(1000*90)

// Cool Down: 250sec+ 6deg/sec max rampdown
// 240-5deg/sec*(time-90-100-60)
// rfMaxT - cdSlope*(Time-rfTime-phTime-faTime)
unsigned long  cdSlope =16;//(4*4)
unsigned long sp;

 sp = 0;
  if (theTime < phTime){
    sp = ambT + (theTime*(phMaxT - ambT))/phTime;
  }
  else if (theTime < (phTime+faTime)){
      sp = phMaxT + ((faMaxT-phMaxT)*(theTime-phTime))/faTime;
  }
  else if  (theTime < (phTime+faTime+rfTime)){
      sp = faMaxT + ((rfMaxT-faMaxT)*(theTime-phTime-faTime))/rfTime;
  }
  else if (theTime < phTime+faTime+rfTime+1000*(rfMaxT-ambT)/cdSlope){
    sp = rfMaxT - (cdSlope*(theTime-rfTime-phTime-faTime))/1000;
  }
  else {
    sp=ambT ;
  }
return int(sp);
}

With a lot of head scratching and some luck I was able to alter the python code to accept both  X and  Y values (instead of just Y). This allowed me to output a plot from the arduino through the serial port.

There are some issues with the plotting code that I need to address before I get into trying to tune a PID for the oven. The software is very heavy on my laptop. I don’t think it should be but it is. I think it might have something to do with the threading going on involving the serial port. Also, sometimes I can’t get the plotting software to stop and close. It just likes to take over all of the CPU cycles. That’s not very efficient considering that I am sending one point a second. I would like to configure it to detect and accept multiple traces based on what the Arduino sends it. I have some ideas on how to do this but will take some additional python research as I am not a programmer by trade.

Advertisements

, , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: