Giter Site home page Giter Site logo

reflow-oven-controller's Introduction

Readme
******
1. Please use the Diptrace version 2.2 and above to open/edit the schematic & layout file. 
Newer files are not backward compatible with older version of Diptrace.
2. For hardware version 1.40 and below:
- Please use the MAX6675 Library from Adafruit available from GitHub.
3. For hardware version 1.50 and above:
- Please use the MAX31855 Library from Rocket Scream available from GitHub.
4. For all hardware revision, please use the latest Arduino PID Library written
by Brett Beauregard available for down load GitHub too.
5. Uncomment necessary compiler flag in the sketch for use with different 
hardware revision.

reflow-oven-controller's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reflow-oven-controller's Issues

SSR pin goes high on cooldown.

I haven't done much testing yet but right around 100c on the cool down phase I can hear my elements click on for a split second.

issues , maby human error (most are )

hello
i recently purshased this board, and love to possabilitys
im haveing a compileing error when i load the code is, it states the bellow error

im using a udoo development board that had the same mcu and footprint as the arduino due,
i have the library loaded in, maby i am missing a step, but the file it states is missing is in the library folder , under the same name as shown,

i have a few other things i was to accomplish first , but to have a re-flow "guide at least "

stemming from this i would like to use it with my heat bed and rework station as opposed to a toaster oven, but would like to make this device control the reflow


Arduino: 0154 (Linux), Board: "Arduino Due (Programming Port)"

Using library LiquidCrystal in folder: /opt/arduino-1.5.4/libraries/LiquidCrystal

/opt/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/arm-none-eabi-g++ -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=154 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Due" -I/opt/arduino-1.5.4/hardware/arduino/sam/system/libsam -I/opt/arduino-1.5.4/hardware/arduino/sam/system/CMSIS/CMSIS/Include/ -I/opt/arduino-1.5.4/hardware/arduino/sam/system/CMSIS/Device/ATMEL/ -I/opt/arduino-1.5.4/hardware/arduino/sam/cores/arduino -I/opt/arduino-1.5.4/hardware/arduino/sam/variants/arduino_due_x -I/opt/arduino-1.5.4/libraries/LiquidCrystal/src /tmp/build4279395355937805494.tmp/reflowOvenController.cpp -o /tmp/build4279395355937805494.tmp/reflowOvenController.cpp.o
reflowOvenController.ino:103:23: fatal error: MAX31855.h: No such file or directory
compilation terminated.

udoo compatible? or maby noob issue lol

i have a UDOO board that has the same mcu an footprint as the arduino due
and has a built in arduino ide
every thing should function as the same , (www.udoo.org)

i recently bought a reflow control sheild from rocket scream ,
http://www.rocketscream.com/shop/reflow-oven-controller-shield-arduino-compatible
came in fast for malaisa,

https://github.com/rocketscream/Reflow-Oven-Controller

i have a preheater and a solder rework station with heat gun , i make a glass enclousuer , do i dont need the toser ovem , im focousing more on direct bga chip reflow, other rework components a plus, but over all that is the main objective , i was planning on useing this as a reflow or profile giude with a thermal coupple,
so basicly i can watch it and adjust the heat according to the profile , and eventually hook up the ssr to be able to contol the entire prossess or at least the heat gun directly , but i got it as a visual representation of the profile and prossess,

when i got it , i notice as far as the foot print , there are 2 pins that are un used , the scl and sda and can find them on the provided schmattic but theres no clue as to what they are or there function , on the top two pins on the upper right of the sheild
im not sure if i need to jump these to another port? or if not needed,

http://www.rocketscream.com/datasheet/rocketscream/arduino/shield/rsReflowControllerShield/RS-REFLOW-CONTROLLER-SHIELD-1R80.pdf

any way , my issue is , with the provided code and the librarry files included that they say are required i still get a compileing error and it wont load

error
the MAX31855.h file is present and is in the direct root of the library folder? im not shure where im goin wron , please and thank you for any and all help and advice

CODE: SELECT ALL
Arduino: 0154 (Linux), Board: "Arduino Due (Programming Port)"

Using library LiquidCrystal in folder: /opt/arduino-1.5.4/libraries/LiquidCrystal

/opt/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/arm-none-eabi-g++ -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=154 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Due" -I/opt/arduino-1.5.4/hardware/arduino/sam/system/libsam -I/opt/arduino-1.5.4/hardware/arduino/sam/system/CMSIS/CMSIS/Include/ -I/opt/arduino-1.5.4/hardware/arduino/sam/system/CMSIS/Device/ATMEL/ -I/opt/arduino-1.5.4/hardware/arduino/sam/cores/arduino -I/opt/arduino-1.5.4/hardware/arduino/sam/variants/arduino_due_x -I/opt/arduino-1.5.4/libraries/LiquidCrystal/src /tmp/build3467053573229346857.tmp/reflowOvenController.cpp -o /tmp/build3467053573229346857.tmp/reflowOvenController.cpp.o
reflowOvenController.ino:103:23: fatal error: MAX31855.h: No such file or directory
compilation terminated.

Stuck in PREHEAT stage

Yes, I know there is an identical issue already created #2.

The previous issue stated that it was PID settings but I have tried setting my preheat pid to:

#define PID_KP_PREHEAT 150
#define PID_KI_PREHEAT 0.05
#define PID_KD_PREHEAT 200
--
Then I tried
--
#define PID_KP_PREHEAT 300
#define PID_KI_PREHEAT 0.05
#define PID_KD_PREHEAT 250

it works 90% of the time but especially the first time after powering on the system it seems to frequently get stuck in the preheat phase.

udoo compatable? or noob issue?

hey yall thanks for checking in to my issue, any and all comments and insite is appretiated

i recently bought a reflow control sheild from rocket scream ,
http://www.rocketscream.com/shop/reflow-oven-controller-shield-arduino-compatible
came in fast for malaisa,

code-
https://github.com/rocketscream/Reflow-Oven-Controller

i have a preheater and a solder rework station with heat gun , i make a glass enclousuer , do i dont need the toser ovem , im focousing more on direct bga chip reflow, other rework components a plus, but over all that is the main objective , i was planning on useing this as a reflow or profile giude with a thermal coupple,
so basicly i can watch it and adjust the heat according to the profile , and eventually hook up the ssr to be able to contol the entire prossess or at least the heat gun directly , but i got it as a visual representation of the profile and prossess,

any who ,
when i got it , i notice as far as the foot print , there are 2 pins that are un used , the scl and sda and can find them on the provided schmattic but theres no clue as to what they are or there function , on the top two pins on the upper right of the sheild , ,
im not sure if i need to jump these to another port? or if not needed,

http://www.rocketscream.com/datasheet/rocketscream/arduino/shield/rsReflowControllerShield/RS-REFLOW-CONTROLLER-SHIELD-1R80.pdf

any way , my issue is , with the provided code and the librarry files included that they say are required i still get a compileing error and it wont load

heres my error, im still new to the arduino language so it may be a simple human error issue , but i loaded it in directly , and expect theres may be some modification needed to run udoo or a change of components or librarrys in the code

the MAX31855.h file is present and is in the direct root of the library folder? im not shure where im goin wron , please and thank you for any and all help and advice

CODE: SELECT ALL
Arduino: 0154 (Linux), Board: "Arduino Due (Programming Port)"

Using library LiquidCrystal in folder: /opt/arduino-1.5.4/libraries/LiquidCrystal

/opt/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/arm-none-eabi-g++ -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=154 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Due" -I/opt/arduino-1.5.4/hardware/arduino/sam/system/libsam -I/opt/arduino-1.5.4/hardware/arduino/sam/system/CMSIS/CMSIS/Include/ -I/opt/arduino-1.5.4/hardware/arduino/sam/system/CMSIS/Device/ATMEL/ -I/opt/arduino-1.5.4/hardware/arduino/sam/cores/arduino -I/opt/arduino-1.5.4/hardware/arduino/sam/variants/arduino_due_x -I/opt/arduino-1.5.4/libraries/LiquidCrystal/src /tmp/build3467053573229346857.tmp/reflowOvenController.cpp -o /tmp/build3467053573229346857.tmp/reflowOvenController.cpp.o
reflowOvenController.ino:103:23: fatal error: MAX31855.h: No such file or directory
compilation terminated.

origonal code
CODE: SELECT ALL
/*******************************************************************************

  • Title: Reflow Oven Controller
  • Version: 1.20
  • Date: 26-11-2012
  • Company: Rocket Scream Electronics
  • Author: Lim Phang Moh
  • Website: www.rocketscream.com
  • Brief
  • =====
  • This is an example firmware for our Arduino compatible reflow oven controller.
  • The reflow curve used in this firmware is meant for lead-free profile
  • (it's even easier for leaded process!). You'll need to use the MAX31855
  • library for Arduino if you are having a shield of v1.60 & above which can be
  • downloaded from our GitHub repository. Please check our wiki
  • (www.rocketscream.com/wiki) for more information on using this piece of code
  • together with the reflow oven controller shield.
    *
  • Temperature (Degree Celcius) Magic Happens Here!
  • 245-| x x
  • |                                            x        x
    
  • |                                         x              x
    
  • |                                      x                    x
    
  • 200-| x x
  • |                              x    |                          |   x  
    
  • |                         x         |                          |       x
    
  • |                    x              |                          |
    
  • 150-| x | |
  • |             x |                   |                          |
    
  • |           x   |                   |                          | 
    
  • |         x     |                   |                          | 
    
  • |       x       |                   |                          | 
    
  • |     x         |                   |                          |
    
  • |   x           |                   |                          |
    
  • 30 -| x | | |
  • |<  60 - 90 s  >|<    90 - 120 s   >|<       90 - 120 s       >|
    
  • | Preheat Stage |   Soaking Stage   |       Reflow Stage       | Cool
    
  • 0 |_ _ _ _ _ _ _ | _ _ _ _ _ _ _ _ | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  •                                                            Time (Seconds)
    
  • This firmware owed very much on the works of other talented individuals as
  • follows:
  • ==========================================
  • Brett Beauregard (www.brettbeauregard.com)
  • ==========================================
  • Author of Arduino PID library. On top of providing industry standard PID
  • implementation, he gave a lot of help in making this reflow oven controller
  • possible using his awesome library.
    *
  • ==========================================
  • Limor Fried of Adafruit (www.adafruit.com)
  • ==========================================
  • Author of Arduino MAX6675 library. Adafruit has been the source of tonnes of
  • tutorials, examples, and libraries for everyone to learn.
    *
  • Disclaimer
  • ==========
  • Dealing with high voltage is a very dangerous act! Please make sure you know
  • what you are dealing with and have proper knowledge before hand. Your use of
  • any information or materials on this reflow oven controller is entirely at
  • your own risk, for which we shall not be liable.
    *
  • Licences
  • ========
  • This reflow oven controller hardware and firmware are released under the
  • Creative Commons Share Alike v3.0 license
  • http://creativecommons.org/licenses/by-sa/3.0/
  • You are free to take this piece of code, use it and modify it.
  • All we ask is attribution including the supporting libraries used in this
  • firmware.
    *
  • Required Libraries
  • ==================
  • - Arduino PID Library:
  • https://github.com/br3ttb/Arduino-PID-Library

  • - MAX31855 Library (for board v1.60 & above):
  • https://github.com/rocketscream/MAX31855

  • - MAX6675 Library (for board v1.50 & below):
  • https://github.com/adafruit/MAX6675-library

  • Revision Description
  • ======== ===========
  • 1.20 Adds supports for v1.60 (and above) of Reflow Oven Controller
  •       Shield:
    
  •             - Uses MAX31855KASA+ chip and pin reassign (allowing A4 & A5 (I2C)
    
  •         to be used for user application).
    
  •             - Uses analog based switch (allowing D2 & D3 to be used for user 
    
  •                application).  
    
  •              Adds waiting state when temperature too hot to start reflow process.
    
  •              Corrected thermocouple disconnect error interpretation (MAX6675).
    
  • 1.10 Arduino IDE 1.0 compatible.
  • 1.00 Initial public release.
    *******************************************************************************/
    // Comment either one the following #define to select your board revision
    // Newer board version starts from v1.60 using MAX31855KASA+ chip
    #define USE_MAX31855
    // Older board version below version v1.60 using MAX6675ISA+ chip
    //#define USE_MAX6675

// ***** INCLUDES *****

include <LiquidCrystal.h>

ifdef USE_MAX31855

#include <MAX31855.h>

else

#include <max6675.h>

endif

include <PID_v1.h>

// ***** TYPE DEFINITIONS *****
typedef enum REFLOW_STATE
{
REFLOW_STATE_IDLE,
REFLOW_STATE_PREHEAT,
REFLOW_STATE_SOAK,
REFLOW_STATE_REFLOW,
REFLOW_STATE_COOL,
REFLOW_STATE_COMPLETE,
REFLOW_STATE_TOO_HOT,
REFLOW_STATE_ERROR
} reflowState_t;

typedef enum REFLOW_STATUS
{
REFLOW_STATUS_OFF,
REFLOW_STATUS_ON
} reflowStatus_t;

typedef enum SWITCH
{
SWITCH_NONE,
SWITCH_1,
SWITCH_2
} switch_t;

typedef enum DEBOUNCE_STATE
{
DEBOUNCE_STATE_IDLE,
DEBOUNCE_STATE_CHECK,
DEBOUNCE_STATE_RELEASE
} debounceState_t;

// ***** CONSTANTS *****

define TEMPERATURE_ROOM 50

define TEMPERATURE_SOAK_MIN 150

define TEMPERATURE_SOAK_MAX 200

define TEMPERATURE_REFLOW_MAX 250

define TEMPERATURE_COOL_MIN 100

define SENSOR_SAMPLING_TIME 1000

define SOAK_TEMPERATURE_STEP 5

define SOAK_MICRO_PERIOD 9000

define DEBOUNCE_PERIOD_MIN 50

// ***** PID PARAMETERS *****
// ***** PRE-HEAT STAGE *****

define PID_KP_PREHEAT 100

define PID_KI_PREHEAT 0.025

define PID_KD_PREHEAT 20

// ***** SOAKING STAGE *****

define PID_KP_SOAK 300

define PID_KI_SOAK 0.05

define PID_KD_SOAK 250

// ***** REFLOW STAGE *****

define PID_KP_REFLOW 300

define PID_KI_REFLOW 0.05

define PID_KD_REFLOW 350

define PID_SAMPLE_TIME 1000

// ***** LCD MESSAGES *****
const char* lcdMessagesReflowStatus[] = {
"Ready",
"Pre-heat",
"Soak",
"Reflow",
"Cool",
"Complete",
"Wait,hot",
"Error"
};

// ***** DEGREE SYMBOL FOR LCD *****
unsigned char degree[8] = {
140,146,146,140,128,128,128,128};

// ***** PIN ASSIGNMENT *****

ifdef USE_MAX31855

int ssrPin = 5;
int thermocoupleSOPin = A3;
int thermocoupleCSPin = A2;
int thermocoupleCLKPin = A1;
int lcdRsPin = 7;
int lcdEPin = 8;
int lcdD4Pin = 9;
int lcdD5Pin = 10;
int lcdD6Pin = 11;
int lcdD7Pin = 12;
int ledRedPin = 4;
int buzzerPin = 6;
int switchPin = A0;

else

int ssrPin = 5;
int thermocoupleSOPin = A5;
int thermocoupleCSPin = A4;
int thermocoupleCLKPin = A3;
int lcdRsPin = 7;
int lcdEPin = 8;
int lcdD4Pin = 9;
int lcdD5Pin = 10;
int lcdD6Pin = 11;
int lcdD7Pin = 12;
int ledRedPin = A1;
int ledGreenPin = A0;
int buzzerPin = 6;
int switch1Pin = 2;
int switch2Pin = 3;

endif

// ***** PID CONTROL VARIABLES *****
double setpoint;
double input;
double output;
double kp = PID_KP_PREHEAT;
double ki = PID_KI_PREHEAT;
double kd = PID_KD_PREHEAT;
int windowSize;
unsigned long windowStartTime;
unsigned long nextCheck;
unsigned long nextRead;
unsigned long timerSoak;
unsigned long buzzerPeriod;
// Reflow oven controller state machine state variable
reflowState_t reflowState;
// Reflow oven controller status
reflowStatus_t reflowStatus;
// Switch debounce state machine state variable
debounceState_t debounceState;
// Switch debounce timer
long lastDebounceTime;
// Switch press status
switch_t switchStatus;
// Seconds timer
int timerSeconds;

// Specify PID control interface
PID reflowOvenPID(&input, &output, &setpoint, kp, ki, kd, DIRECT);
// Specify LCD interface
LiquidCrystal lcd(lcdRsPin, lcdEPin, lcdD4Pin, lcdD5Pin, lcdD6Pin, lcdD7Pin);
// Specify MAX6675 thermocouple interface

ifdef USE_MAX31855

MAX31855 thermocouple(thermocoupleSOPin, thermocoupleCSPin,
thermocoupleCLKPin);

else

MAX6675 thermocouple(thermocoupleCLKPin, thermocoupleCSPin,
thermocoupleSOPin);

endif

void setup()
{
// SSR pin initialization to ensure reflow oven is off
digitalWrite(ssrPin, LOW);
pinMode(ssrPin, OUTPUT);

// Buzzer pin initialization to ensure annoying buzzer is off
digitalWrite(buzzerPin, LOW);
pinMode(buzzerPin, OUTPUT);

// LED pins initialization and turn on upon start-up (active low)
digitalWrite(ledRedPin, LOW);
pinMode(ledRedPin, OUTPUT);
#ifdef USE_MAX6675
// LED pins initialization and turn on upon start-up (active low)
digitalWrite(ledGreenPin, LOW);
pinMode(ledGreenPin, OUTPUT);
// Switch pins initialization
pinMode(switch1Pin, INPUT);
pinMode(switch2Pin, INPUT);
#endif

// Start-up splash
digitalWrite(buzzerPin, HIGH);
lcd.begin(8, 2);
lcd.createChar(0, degree);
lcd.clear();
lcd.print("Reflow");
lcd.setCursor(0, 1);
lcd.print("Oven 1.2");
digitalWrite(buzzerPin, LOW);
delay(2500);
lcd.clear();

// Serial communication at 57600 bps
Serial.begin(57600);

// Turn off LED (active low)
digitalWrite(ledRedPin, HIGH);
#ifdef USE_MAX6675
digitalWrite(ledGreenPin, HIGH);
#endif
// Set window size
windowSize = 2000;
// Initialize time keeping variable
nextCheck = millis();
// Initialize thermocouple reading variable
nextRead = millis();
}

void loop()
{
// Current time
unsigned long now;

// Time to read thermocouple?
if (millis() > nextRead)
{
// Read thermocouple next sampling period
nextRead += SENSOR_SAMPLING_TIME;
// Read current temperature
#ifdef USE_MAX31855
input = thermocouple.readThermocouple(CELSIUS);
#else
input = thermocouple.readCelsius();
#endif

// If thermocouple problem detected
  #ifdef   USE_MAX6675
     if (isnan(input))
  #else
     if((input == FAULT_OPEN) || (input == FAULT_SHORT_GND) || 
         (input == FAULT_SHORT_VCC))
#endif
  {
  // Illegal operation
  reflowState = REFLOW_STATE_ERROR;
  reflowStatus = REFLOW_STATUS_OFF;
}

}

if (millis() > nextCheck)
{
// Check input in the next seconds
nextCheck += 1000;
// If reflow process is on going
if (reflowStatus == REFLOW_STATUS_ON)
{
// Toggle red LED as system heart beat
digitalWrite(ledRedPin, !(digitalRead(ledRedPin)));
// Increase seconds timer for reflow curve analysis
timerSeconds++;
// Send temperature and time stamp to serial
Serial.print(timerSeconds);
Serial.print(" ");
Serial.print(setpoint);
Serial.print(" ");
Serial.print(input);
Serial.print(" ");
Serial.println(output);
}
else
{
// Turn off red LED
digitalWrite(ledRedPin, HIGH);
}

// Clear LCD
lcd.clear();
// Print current system state
lcd.print(lcdMessagesReflowStatus[reflowState]);
// Move the cursor to the 2 line
lcd.setCursor(0, 1);

// If currently in error state
if (reflowState == REFLOW_STATE_ERROR)
{
  // No thermocouple wire connected
  lcd.print("TC Error!");
}
else
{
  // Print current temperature
  lcd.print(input);

     #if ARDUINO >= 100
        // Print degree Celsius symbol
        lcd.write((uint8_t)0);
     #else
        // Print degree Celsius symbol
        lcd.print(0, BYTE);
     #endif
  lcd.print("C ");
}

}

// Reflow oven controller state machine
switch (reflowState)
{
case REFLOW_STATE_IDLE:
// If oven temperature is still above room temperature
if (input >= TEMPERATURE_ROOM)
{
reflowState = REFLOW_STATE_TOO_HOT;
}
else
{
// If switch is pressed to start reflow process
if (switchStatus == SWITCH_1)
{
// Send header for CSV file
Serial.println("Time Setpoint Input Output");
// Intialize seconds timer for serial debug information
timerSeconds = 0;
// Initialize PID control window starting time
windowStartTime = millis();
// Ramp up to minimum soaking temperature
setpoint = TEMPERATURE_SOAK_MIN;
// Tell the PID to range between 0 and the full window size
reflowOvenPID.SetOutputLimits(0, windowSize);
reflowOvenPID.SetSampleTime(PID_SAMPLE_TIME);
// Turn the PID on
reflowOvenPID.SetMode(AUTOMATIC);
// Proceed to preheat stage
reflowState = REFLOW_STATE_PREHEAT;
}
}
break;

case REFLOW_STATE_PREHEAT:
reflowStatus = REFLOW_STATUS_ON;
// If minimum soak temperature is achieve
if (input >= TEMPERATURE_SOAK_MIN)
{
// Chop soaking period into smaller sub-period
timerSoak = millis() + SOAK_MICRO_PERIOD;
// Set less agressive PID parameters for soaking ramp
reflowOvenPID.SetTunings(PID_KP_SOAK, PID_KI_SOAK, PID_KD_SOAK);
// Ramp up to first section of soaking temperature
setpoint = TEMPERATURE_SOAK_MIN + SOAK_TEMPERATURE_STEP;
// Proceed to soaking state
reflowState = REFLOW_STATE_SOAK;
}
break;

case REFLOW_STATE_SOAK:
// If micro soak temperature is achieved
if (millis() > timerSoak)
{
timerSoak = millis() + SOAK_MICRO_PERIOD;
// Increment micro setpoint
setpoint += SOAK_TEMPERATURE_STEP;
if (setpoint > TEMPERATURE_SOAK_MAX)
{
// Set agressive PID parameters for reflow ramp
reflowOvenPID.SetTunings(PID_KP_REFLOW, PID_KI_REFLOW, PID_KD_REFLOW);
// Ramp up to first section of soaking temperature
setpoint = TEMPERATURE_REFLOW_MAX;
// Proceed to reflowing state
reflowState = REFLOW_STATE_REFLOW;
}
}
break;

case REFLOW_STATE_REFLOW:
// We need to avoid hovering at peak temperature for too long
// Crude method that works like a charm and safe for the components
if (input >= (TEMPERATURE_REFLOW_MAX - 5))
{
// Set PID parameters for cooling ramp
reflowOvenPID.SetTunings(PID_KP_REFLOW, PID_KI_REFLOW, PID_KD_REFLOW);
// Ramp down to minimum cooling temperature
setpoint = TEMPERATURE_COOL_MIN;
// Proceed to cooling state
reflowState = REFLOW_STATE_COOL;
}
break;

case REFLOW_STATE_COOL:
// If minimum cool temperature is achieve
if (input <= TEMPERATURE_COOL_MIN)
{
// Retrieve current time for buzzer usage
buzzerPeriod = millis() + 1000;
// Turn on buzzer and green LED to indicate completion
#ifdef USE_MAX6675
digitalWrite(ledGreenPin, LOW);
#endif
digitalWrite(buzzerPin, HIGH);
// Turn off reflow process
reflowStatus = REFLOW_STATUS_OFF;
// Proceed to reflow Completion state
reflowState = REFLOW_STATE_COMPLETE;
}
break;

case REFLOW_STATE_COMPLETE:
if (millis() > buzzerPeriod)
{
// Turn off buzzer and green LED
digitalWrite(buzzerPin, LOW);
#ifdef USE_MAX6675
digitalWrite(ledGreenPin, HIGH);
#endif
// Reflow process ended
reflowState = REFLOW_STATE_IDLE;
}
break;

case REFLOW_STATE_TOO_HOT:
// If oven temperature drops below room temperature
if (input < TEMPERATURE_ROOM)
{
// Ready to reflow
reflowState = REFLOW_STATE_IDLE;
}
break;

case REFLOW_STATE_ERROR:
// If thermocouple problem is still present
#ifdef USE_MAX6675
if (isnan(input))
#else
if((input == FAULT_OPEN) || (input == FAULT_SHORT_GND) ||
(input == FAULT_SHORT_VCC))
#endif
{
// Wait until thermocouple wire is connected
reflowState = REFLOW_STATE_ERROR;
}
else
{
// Clear to perform reflow process
reflowState = REFLOW_STATE_IDLE;
}
break;
}

// If switch 1 is pressed
if (switchStatus == SWITCH_1)
{
// If currently reflow process is on going
if (reflowStatus == REFLOW_STATUS_ON)
{
// Button press is for cancelling
// Turn off reflow process
reflowStatus = REFLOW_STATUS_OFF;
// Reinitialize state machine
reflowState = REFLOW_STATE_IDLE;
}
}

// Simple switch debounce state machine (for switch #1 (both analog & digital
// switch supported))
switch (debounceState)
{
case DEBOUNCE_STATE_IDLE:
// No valid switch press
switchStatus = SWITCH_NONE;
// If switch #1 is pressed
#ifdef USE_MAX6675
if (digitalRead(switch1Pin) == LOW)
#else
if (analogRead(switchPin) == 0)
#endif
{
// Intialize debounce counter
lastDebounceTime = millis();
// Proceed to check validity of button press
debounceState = DEBOUNCE_STATE_CHECK;
}
break;

case DEBOUNCE_STATE_CHECK:
#ifdef USE_MAX6675
// If switch #1 is still pressed
if (digitalRead(switch1Pin) == LOW)
#else
if (analogRead(switchPin) == 0)
#endif
{
// If minimum debounce period is completed
if ((millis() - lastDebounceTime) > DEBOUNCE_PERIOD_MIN)
{
// Proceed to wait for button release
debounceState = DEBOUNCE_STATE_RELEASE;
}
}
// False trigger
else
{
// Reinitialize button debounce state machine
debounceState = DEBOUNCE_STATE_IDLE;
}
break;

case DEBOUNCE_STATE_RELEASE:
#ifdef USE_MAX6675
if (digitalRead(switch1Pin) == HIGH)
#else
if (analogRead(switchPin) > 0)
#endif
{
// Valid switch 1 press
switchStatus = SWITCH_1;
// Reinitialize button debounce state machine
debounceState = DEBOUNCE_STATE_IDLE;
}
break;
}

// PID computation and SSR control
if (reflowStatus == REFLOW_STATUS_ON)
{
now = millis();

reflowOvenPID.Compute();

if((now - windowStartTime) > windowSize)
{ 
  // Time to shift the Relay Window
  windowStartTime += windowSize;
}
if(output > (now - windowStartTime)) digitalWrite(ssrPin, HIGH);
else digitalWrite(ssrPin, LOW);   

}
// Reflow oven process is off, ensure oven is off
else
{
digitalWrite(ssrPin, LOW);
}
}

please and thank you

verry much
htsauce

License

Hi,
I am working on a research project related to the fuzzing of embedded firmware. Currently, we are generating a benchmark for evaluating the current state-of-the-art fuzzing mechanisms. The aim of this benchmark is to help researchers working on this field to evaluate their developed embedded fuzzers correctly and effectively. The Reflow Oven firmware in this Github repository is really interesting for us to be included in our benchmark.

However, unfortunately, we could not find any license regarding this firmware in the repository. I was wondering if there is any possibility for us to modify, distribute, and use this firmware in our benchmark (for sure, with a reference to your Github repository)?
Thanks.

Oven stuck in PREHEAT stage

I just recently bought a reflow shield (v1.80). Got almost exactly the same oven that the one shown in the [wiki](http://www.rocketscream.com/wiki/index.php/Reflow_Controller_Shield_(Arduino_Compatible), but it is running on 220v (EU).

Everything is working fine but it looks like the oven can't get past the initial pre-heat stage, when the thermocouple temp is getting close to 150°C, the oven starts switching ON/OFF (like its max temp target was exactly 150°C & not above). So the temp starts idling around 145°C.

Here are the extract from the logs:

Time Setpoint Input Output
130 150.00 134.50 1905.75
131 150.00 135.00 1736.14
132 150.00 135.25 1706.51
133 150.00 135.75 1686.88
134 150.00 137.25 1632.24
135 150.00 138.00 1462.56
136 150.00 138.50 1402.86
137 150.00 138.75 1358.14
138 150.00 139.00 1338.43
139 150.00 140.00 1313.70
140 150.00 140.25 1198.95
141 150.00 141.00 1189.19
142 150.00 142.50 1104.42
143 150.00 142.50 939.61
144 150.00 143.00 969.79
145 150.00 143.25 909.97
146 150.00 143.50 890.14
147 150.00 144.00 865.30
148 150.00 144.75 810.45
149 150.00 144.75 730.58
150 150.00 145.75 745.71
151 150.00 146.50 625.82
152 150.00 146.50 555.91
153 150.00 147.50 570.99
154 150.00 147.50 451.06
155 150.00 147.75 471.12
156 150.00 147.50 441.18
157 150.00 147.50 476.24
158 150.00 147.50 471.30
159 150.00 148.00 471.36
160 150.00 148.50 411.41
161 150.00 148.75 361.45
162 150.00 148.75 341.48
163 150.00 148.50 346.51
164 150.00 148.75 376.55
165 150.00 148.50 341.58
166 150.00 149.25 376.62
167 150.00 149.00 281.64
168 150.00 149.25 326.66
169 150.00 149.50 291.68
170 150.00 149.50 266.69
171 150.00 149.50 271.71
172 150.00 149.25 271.72
173 150.00 149.25 301.74
174 150.00 149.25 296.76
175 150.00 149.00 296.78
176 150.00 148.75 326.80
177 150.00 148.50 351.83
178 150.00 149.00 376.87
179 150.00 148.75 311.89
180 150.00 148.75 351.93
181 150.00 148.25 346.96
182 150.00 148.25 407.00
183 150.00 148.00 397.04
184 150.00 147.75 427.09
185 150.00 147.75 452.15
186 150.00 147.75 447.21
187 150.00 147.50 447.26
188 150.00 147.25 477.33
189 150.00 147.25 502.39
190 150.00 147.00 497.46
191 150.00 147.00 527.54
192 150.00 146.50 522.61
193 150.00 146.50 582.70
194 150.00 146.50 572.79
195 150.00 146.25 572.88
196 150.00 146.00 602.97
197 150.00 146.00 628.07
198 150.00 145.75 623.17
199 150.00 145.75 653.28
200 150.00 146.00 648.38
201 150.00 145.50 618.48
202 150.00 145.50 683.59
203 150.00 145.50 673.71
204 150.00 145.00 673.82
205 150.00 145.25 733.94
206 150.00 145.00 694.06
207 150.00 145.00 729.19
208 150.00 145.00 724.31
209 150.00 144.75 724.44
210 150.00 144.50 754.57
211 150.00 144.50 779.71
212 150.00 144.25 774.84
213 150.00 144.25 804.99
214 150.00 144.25 800.13
215 150.00 144.00 800.28
216 150.00 144.25 830.43
217 150.00 144.00 795.57
218 150.00 144.00 830.72
219 150.00 144.00 825.87
220 150.00 144.00 826.02

I can't read tempreture

Hi,
When I connect the K- Type termocouple, the screen shows preheat 0.00 c, the problem persists when I change the termocouple directions.
I use MAX31855.

My Arduino code starts as below ;

// Comment either one the following #define to select your board revision
// Newer board version starts from v1.60 using MAX31855KASA+ chip
#define USE_MAX31855
// Older board version below version v1.60 using MAX6675ISA+ chip
//#define USE_MAX6675

// ***** INCLUDES *****
#include <LiquidCrystal.h>
#ifdef USE_MAX31855
#include <MAX31855.h>
#else
#include <max6675.h>
#endif
#include <PID_v1.h>

What other line should I change other than the lines above? I am using code v.1.2 board 1R80.
Best regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.