Reflow Controller V2 Stuck In Preheat Stage

A plot of the reflow oven temperature vs. time.  This is a failed attempt where the Reflow Controller V2 is stuck in the preheat stage.
Our first attempt using the controller. It got stuck in the preheat stage and did not continue!

So your Rocket Scream Reflow Controller V2 is stuck in preheat stage. We had the same issue (previously detailed here)! So, we decided to go into detail on how to fix this issue.

Digging Into the Code

With your Reflow Controller V2 stuck in preheat stage, you will need to modify the .ino file that you can find on the Rocket Scream github. We went into detail on how to do this in this post. Once you have the file open, you will need to navigate down to the “PID Parameters”, as shown in the code snippet below.

A portion of code showing the adjustment of the PID controller coefficients.
Lines in the .ino file that define the PID settings used for the reflow controller.

For the “reflow controller V2 stuck in preheat stage” issue, you will need to adjust the “Pre-heat Stage” settings shown above (lines 204-206). There are 3 options to adjust: “PID_KP_PREHEAT”, “PID_KI_PREHEAT”, and “PID_KD_PREHEAT”. These all control a PID controller. To fix the problem in achieving our desired temperature, we needed to increase “PID_KI_PREHEAT”. We increased the value to 0.05, as shown in the image below.

A portion of code showing the adjustment of the PID controller coefficients - PID_KI_PREHEAT was increased from 0.025 to 0.05.
Updated settings for the “PRE-HEAT STAGE”. “PID_KI_PREHEAT” was increased from 0.025 to 0.05.

Running another reflow, the oven successfully reached the needed preheat temperature, as shown below.

A plot of the reflow oven temperature vs. time.  This is a successful attempt after fixing the Reflow Controller V2 stuck in the preheat stage issue.
A second attempt, after we had increased the “PID_KI_PREHEAT” value.

PID Controllers and Their Implementation

As we mentioned previously, the Reflow Controller V2 uses a PID controller to operate the oven heater to reach the desired temperature. A PID controller is an acronym standing for Proportional, Integrator and Differentiator. You can read more about them here. The controller is made up of the three previously mentioned parts. The first, or “Proportional” is the response of the controller to error at this current time. By “error” we mean the difference between the desired condition (set point temperature in this case) and the current condition (the current temperature of the oven). The “PID_KP_PREHEAT” variable in the code above is applying a scalar to that error. The resultant then changes the duty cycle of the heater.

The second part of the controller is the “Integrator”. The integrator is a long-term effect to the PID controller. We will describe this with a simple example: if there is a certain amount of error, at first the integrator does not provide much adjustment. As the error persists however, the adjustment (duty cycle of the heater in this instance) progressively becomes larger until the error is decreased. This was the issue with the Reflow Controller V2 stuck in preheat stage – the integrator coefficient was too small to overcome the residual error between the set point temperature and the actual temperature of the oven. The snippet of code below shows why this is an issue. The reflow controller uses a state machine to control when to transition to a new stage. The code below is for the preheat stage. Line 636 shows the condition needed to progress onto the next stage: unless the temperature of the oven (“input” in this case) exceeds the minimum soak temperature (“TEMPERATURE_SOAK_MIN”), the oven will remain stuck in the preheat stage.

A portion of the controller code showing the preheat stage state machine.
The code snippet showing the issue where the Reflow Controller V2 gets stuck in the preheat stage. If the temperature of the preheat stage does not exceed the minimum soak temperature (line 636), the oven remains stuck in preheat perpetually.

The final part of a PID controller is the differentiator. It is good to think of the differentiator as the complement of the integrator. While the integrator seeks to reduce long-term error, the differentiator seeks to reduce error related to the rate of change of the set point. For instance, if the desire is to increase the temperature of the oven gradually, the differentiator will not influence the function of the heater greatly. However, if it is desired to rapidly change the temperature of the oven, the differentiator will have a large effect, attempting to minimize error in the short-term. Usually this results in the heater having 100% duty cycle immediately following a temperature transition.

Final Thoughts

We hope that the above has helped solve your Reflow Controller V2 stuck in preheat stage issue, as well as provide a bit of learning about PID controllers. If the changes outlined above have not helped, your reflow oven may need more insulation and/or a larger heater. If the oven is not able to provide enough thermal energy or else retain it, it will not work well as a reflow oven.

For some expansion on the Reflow Controller V2 firmware, it would be nice to see an automatic PID tuning routine implemented. There are some routines out there currently that would enable this but would require integration into the firmware and testing. If anyone is willing to help out, please go ahead and fork the original or our github repo and do a push once implemented.

Leave a Reply

Your email address will not be published. Required fields are marked *