My experience programming the Tiny Reflow Controller V2

Things you should know: This is not a tutorial but it does have an optimal happy ending. Despite that, the information here may be useful, and resources on the Tiny Reflow Controller V2 are somewhat sparse. This page should save some hunting.

TLDR:
Make sure you have the V1.1 PID library and make sure it is being used instead of the V1.2 PID library. The preferences in the Arduino IDE allow you to make compiling and uploading more verbose and will tell you what libraries are being used. Uploading using programmer does not appear to be necessary.

Problem: My oven is smaller than most builds and I’ve gone through the trouble on putting additional elements and sealing as many cracks with RTV sealant as possible. This makes a quickly heated area that doesn’t loose heat very easily. Out of box, the PID settings overshoot the target temperature by 40 degrees in the preheat phase, and about 20 degrees in the reflow stage. Toast for everyone!

Using the settings specified in https://www.heavidesign.com/2020/03/11/how-to-program-the-tiny-reflow-controller-v2/ (without using the programmer, see bottom of the page) I was able to open the code, add the appropriate libraries (most found in the links in the .ino), and then upload a new piece of code onto the board using the Arduino IDE. Unfortunately nothing happened. Without the screen turning on there was no indication that I hadn’t bricked the controller.

Of course I loaded the original code back as a test, but there was no change to the OLED. Looking through the issues on the github page, I found several had issues with the OLED not starting up for different reasons. It looks for all intents and purposes that there is simply not enough ram on the chip. One user solved the issue by reverting the PID library from V1.2 to V1.1. This is something I tried without success. Another stated the the millis() function was at fault, but testing indicated it wasn’t an issue for me.

Another issue, “please help!” by user VILL088 stated he deleted a large portion of his code to get the oled working. I decided to comment out this section and tried it. Low and behold: the oled turned on! I then started a process of elimination, finally coming to an instruction in two classes that was causing the issues.

The instruction “timerSoak = millis() + soakMicroPeriod;” inside the “REFLOW_STATE_PREHEAT” and “REFLOW_STATE_SOAK” cases. Commenting them out allowed the OLED to work. My first suspicion was that there was a data type mismatch, but found that everything was set up properly. The variable soakMicroPeroid is created but not set initially. It is set during the set up phase when the variables for the run are created.

The variable would be set to 9000 for lead-free solder paste and so I replaced the variable with the actual number. I also tested if the #define the variable referenced might be at fault, but this also worked properly. The OLED worked and I ran a test run. Same heating issues as my first test run, but at least it ran.

I then played with the PID settings until I came up with these values for the PID settings. Also added are the original settings for comparison.

VariableOriginal ValueModified Value
PID_KD_PREHEAT 202500
PID_KD_SOAK 2501000
PID_KD_REFLOW 2357000

Additional notes:
I am verifying and uploading without using the programmer in the Arduino IDE as suggested in heavidesign.com’s tutorial. Attempting to use the programmer results in an error that the ‘usb’ cannot be found. This issue seem to have been solved by others by switching from the avrisp mkII programmer to another and then back again, but I could not get that solution to work and gave up on trying to upload through the programmer.

Additional update:
Despite changing the PID library version in the manage libraries menu, the compiler indicated it was still selecting the newer library because 2 libraries were available. I deleted the newer library leaving the compiler only one choice and re-uploaded the original code. It works properly now. I am still not using upload through programmer however.

Useful Links:
https://www.rocketscream.com/blog/product/tiny-reflow-controller-v2/
https://github.com/rocketscream/TinyReflowController
https://github.com/rocketscream/TinyReflowController/issues
https://www.heavidesign.com/2020/03/11/how-to-program-the-tiny-reflow-controller-v2/