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.
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.
Running another reflow, the oven successfully reached the needed preheat temperature, as shown below.
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.
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