REFLOW OVEN: MAX31855KASA+ & Arduino problems

Hi,

I have the MAX31855KASA+ (RocketScream v 1.6) connected to my Arduino board.

I have tried implementing this setup, without success, with code at;

and

https://github.com/br3ttb/Arduino-PID-Library/archive/master.zip

All codes give errors. I am using the Arduino IDE 1.06, which according to Beauregard is required for this setup.

Could I have some help please?
P.S. If you have a copy of the RocketScream Wiki (no longer available online) I would also appreciate a copy, if it throws light on the subject.

It would be useful if you could post the errors you are getting - on build/compile or at runtime?

Ralph_S_Bacon:
It would be useful if you could post the errors you are getting - on build/compile or at runtime?

From the below github links which files do you want my error codes for ;

rocketscream Version 1.10. Added negative temperature support.

Examples/ThermocoupleToSerial
Initial release

MAX31855.cpp
Version 1.10. Added negative temperature support.

MAX31855.h
Initial release

https://github.com/br3ttb/Arduino-PID-Library/archive/master.zip

library.json
library.properties
PID_Adaptive Tunings.ino
PID_Basic.ino
PID_RelayOutput.ino
PID_v1.cpp
PID_v1.h

Thanks for your help.

Post your code as you see it in the IDE.
1)
Place your cursor in the code window and press T (that is, control and t at the same time) to format the code.
2)
copy the code
3)
use code tags as shown below when positing the code

type
** **[code]** **

paste your code after that
type
** **[/code]** **

The result ill look like

your code here

Next, compile. The output window will show the errors. Click in the output window, scroll through it and select all 'orange' text. Using the above principle, post the errors using code tags.

sterretje:
Post your code as you see it in the IDE.
1)
Place your cursor in the code window and press T (that is, control and t at the same time) to format the code.
2)
copy the code
3)
use code tags as shown below when positing the code

type
** **[code]** **

paste your code after that
type
** **[/code]** **

The result ill look like

your code here

Next, compile. The output window will show the errors. Click in the output window, scroll through it and select all 'orange' text. Using the above principle, post the errors using code tags.

/********************************************************
 * PID Basic Example
 * Reading analog input 0 to control analog PWM output 3
 ********************************************************/

#include <PID_v1.h>

#define PIN_INPUT 0
#define PIN_OUTPUT 3

//Define Variables we'll be connecting to
double Setpoint, Input, Output;

//Specify the links and initial tuning parameters
double Kp=2, Ki=5, Kd=1;
PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);

void setup()
{
  //initialize the variables we're linked to
  Input = analogRead(PIN_INPUT);
  Setpoint = 100;

  //turn the PID on
  myPID.SetMode(AUTOMATIC);
}

void loop()
{
  Input = analogRead(PIN_INPUT);
  myPID.Compute();
  analogWrite(PIN_OUTPUT, Output);
}
/********************************************************
 * PID Adaptive Tuning Example
 * One of the benefits of the PID library is that you can
 * change the tuning parameters at any time.  this can be
 * helpful if we want the controller to be agressive at some
 * times, and conservative at others.   in the example below
 * we set the controller to use Conservative Tuning Parameters
 * when we're near setpoint and more agressive Tuning
 * Parameters when we're farther away.
 ********************************************************/

#include <PID_v1.h>

#define PIN_INPUT 0
#define PIN_OUTPUT 3

//Define Variables we'll be connecting to
double Setpoint, Input, Output;

//Define the aggressive and conservative Tuning Parameters
double aggKp=4, aggKi=0.2, aggKd=1;
double consKp=1, consKi=0.05, consKd=0.25;

//Specify the links and initial tuning parameters
PID myPID(&Input, &Output, &Setpoint, consKp, consKi, consKd, DIRECT);

void setup()
{
  //initialize the variables we're linked to
  Input = analogRead(PIN_INPUT);
  Setpoint = 100;

  //turn the PID on
  myPID.SetMode(AUTOMATIC);
}

void loop()
{
  Input = analogRead(PIN_INPUT);

  double gap = abs(Setpoint-Input); //distance away from setpoint
  if (gap < 10)
  {  //we're close to setpoint, use conservative tuning parameters
    myPID.SetTunings(consKp, consKi, consKd);
  }
  else
  {
     //we're far from setpoint, use aggressive tuning parameters
     myPID.SetTunings(aggKp, aggKi, aggKd);
  }

  myPID.Compute();
  analogWrite(PIN_OUTPUT, Output);
}
/********************************************************
 * PID RelayOutput Example
 * Same as basic example, except that this time, the output
 * is going to a digital pin which (we presume) is controlling
 * a relay.  the pid is designed to Output an analog value,
 * but the relay can only be On/Off.
 *
 *   to connect them together we use "time proportioning
 * control"  it's essentially a really slow version of PWM.
 * first we decide on a window size (5000mS say.) we then
 * set the pid to adjust its output between 0 and that window
 * size.  lastly, we add some logic that translates the PID
 * output into "Relay On Time" with the remainder of the
 * window being "Relay Off Time"
 ********************************************************/

#include <PID_v1.h>

#define PIN_INPUT 0
#define RELAY_PIN 6

//Define Variables we'll be connecting to
double Setpoint, Input, Output;

//Specify the links and initial tuning parameters
double Kp=2, Ki=5, Kd=1;
PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);

int WindowSize = 5000;
unsigned long windowStartTime;

void setup()
{
  windowStartTime = millis();

  //initialize the variables we're linked to
  Setpoint = 100;

  //tell the PID to range between 0 and the full window size
  myPID.SetOutputLimits(0, WindowSize);

  //turn the PID on
  myPID.SetMode(AUTOMATIC);
}

void loop()
{
  Input = analogRead(PIN_INPUT);
  myPID.Compute();

  /************************************************
   * turn the output pin on/off based on pid output
   ************************************************/
  if (millis() - windowStartTime > WindowSize)
  { //time to shift the Relay Window
    windowStartTime += WindowSize;
  }
  if (Output < millis() - windowStartTime) digitalWrite(RELAY_PIN, HIGH);
  else digitalWrite(RELAY_PIN, LOW);

}
/*******************************************************************************
* Thermocouple to serial for MAX31855 example 
* Version: 1.00
* Date: 26-12-2011
* Company: Rocket Scream Electronics
* Website: www.rocketscream.com
*
* This is an example of using the MAX31855 library for Arduino to read 
* temperature from a thermocouple and send the reading to serial interfacec. 
* Please check our wiki (www.rocketscream.com/wiki) for more information on 
* using this piece of library.
*
* This example code is licensed under Creative Commons Attribution-ShareAlike 
* 3.0 Unported License.
*
* Revision  Description
* ========  ===========
* 1.00      Initial public release.
*
*******************************************************************************/
// ***** INCLUDES *****
#include  <MAX31855.h>

// ***** PIN DEFINITIONS *****
const  unsigned  char thermocoupleSO = 12;
const  unsigned  char thermocoupleCS = 10;
const  unsigned  char thermocoupleCLK = 13;

MAX31855  MAX31855(thermocoupleSO, thermocoupleCS, thermocoupleCLK);

void  setup()
{
  Serial.begin(57600);
}

void  loop()
{
  double  temperature;
  
  // Retrieve thermocouple temperature in Degree Celsius
  temperature = MAX31855.readThermocouple(CELSIUS);
  Serial.print("Thermocouple temperature: ");
  Serial.print(temperature);
  Serial.println(" Degree Celsius");
  
  // Retrieve cold junction temperature in Degree Celsius
  temperature = MAX31855.readJunction(CELSIUS);
  Serial.print("Junction temperature: ");
  Serial.print(temperature);
  Serial.println(" Degree Celsius");
  
  delay(1000);
}

PID basic.PNG

PID active tuning.PNG

PID relay output.PNG

MAX21855.PNG

sterretje:
If you understand an example, use it.
If you don't understand an example, don't use it.

On the basis of the above it appears that I will not receive a response!

Could anyone please help me on this problem?

No idea (so not much help); I installed the pid library manually and the pidbasic sketch compiles without problems. Windows8, IDE 1.6.6.

PS
Don't post pictures; I did not realise that they were the errors. As I explained, you can use the same principle as the code (click in the output window, select all orange text, copy it and paste it here between code tags).

sterretje:
No idea (so not much help)

But for someone versed in code creation, do the errors tell you anything?

Thanks for your trouble.

Not really; I would think that your errors indicate that the library can't be found. But on my system that results in another error (like below).

C:\Users\sterretje\Documents\Arduino\sketch_jun27a_pid_basic\sketch_jun27a_pid_basic.ino:9:20: fatal error: PID_v1.h: No such file or directory
 #include <PID_v1.h>
                    ^
compilation terminated.

exit status 1

Maybe a stupid question but did you install the library? If not, install it.

Else, what you can try is to copy the cpp and h file of the library to the sketch directory. You need to change

 #include <PID_v1.h>

to

 #include "PID_v1.h"

in both the sketch and in the copied / moved cpp file. You need to do it in both !! The effect is that the code will look locally first for the include file before looking in the standard locations.