Coder Social home page Coder Social logo

dukeduck1984 / ureflowoven-esp32-micropython Goto Github PK

View Code? Open in Web Editor NEW
116.0 12.0 33.0 2.76 MB

μReflow Oven controller based on ESP32 with MicroPython & LVGL

Python 100.00%
reflow-oven-controller esp32 micropython littlevgl tft-display max31855 ili9341 thermocouple kitchen-oven buzzer

ureflowoven-esp32-micropython's Introduction

μReflow Oven with MicroPython & LittlevGL

中文版请见于此

WARNING: when updating from a previous version, make sure to get the latest config.json and carefully verify that it reflects your system configuration. First and foremost make sure that the heater is configured to the right polarity.

Updated! Now the μReflow Oven is PID control enabled!

For previous version which is non-PID controlled, pls see the branch Adafruit-EZ-Make-Oven-alike.

This project is an improved and heavily modified version of Adafruit EZ Make Oven. The original code of EZ Make Oven can be found here.

The purpose is to make a reflow soldering oven by modifying a kitchen oven with more affordable and widely available hardwares. Instead of an oven, a heating plate can also be used.

The GUI of this project is built with LittlevGL (lv_binding_micropython) which is a very powerful and easy to use GUI library. LittlevGL already comes with drivers for ILI9341 TFT display and XPT2046 touch controller, this project takes the advantage of both to ease the user operation.

Bill of Materials

  • 1 x regular kitchen oven with 10-12L capacity, like this, OR a heater plate, like this.
  • 1 x solid state relay rated at least 10A. Like this (the heater plate linked above already includes it).
  • 1 x passive piezo buzzer. Like this.
  • 1 x ILI9341 TFT display with on-board XPT2046 touch controller. Like this.
  • 1 x Thermocouple amplifier with K-thermocouple. So far, MAX31855 and MAX6675 are supported. MAX31855 MAX6675
  • 1 x AC-DC5v power supply to power the ESP32 dev board. Like this.
  • 1 x ESP32 dev board. Like this.

Oven Modification and Wiring

  • WARNING: The mains (220/110V) can be deadly. Make sure the oven is unplugged from the outlet before doing any modification or wiring.
  • Ovens are different one from another, but basically all you need to do is to bypass the original switch and timer, and let the solid state relay control the heating element, hence the ESP32 board can turn the heating element on and off via the solid state relay.

The Firmware for ESP32

  • Pls refer to here.

=======

Configuration

  • Configuration is done by editing the config.json file.
  • Hardware wiring: edit the value of the key names ending with '_pins' to match your actual wiring.
  • The TFT screen and the touch controller share the same Clock, Data In & Data Out pins.
  • The ACC pin is for switching power of the TFT screen. This pin is optional. If your display has an input to switch power (often labeled ACC), you may connect the designated GPIO directly to this pin. Alternatively, you could use a transistor to switch the power supply of the screen. It has been reported that the screen can even be powered directly from a GPIO pin, however note that an ESP32 GPIO pin can drive at most 50mA (according to specification) and a typical 2.8" screen will draw between 80mA and 250mA, so this method risks damaging your ESP32. Since this pin is optional, you may safely ignore it (simply wire the 3V3 pin of the screen to the 3V3 output of the ESP32).
  • The active_low properties can be used to make a pin active low.
  • sampling_hz determines the update rate of the temp sensor and the PID controller. The default setting 5 means 5HZ which is 5 times per second.
  • temp_offset & pid parameters can be set in the settings of the GUI.
  • advanced_temp_tuning can only be changed by editing the config.json.
    • preheat_until (temperature in Celsius) is used to set a temperature below which the oven will always be on - it helps to heat up the oven as quickly as possible at the early stage.
    • previsioning (time in Second) is for the PID to look for the set temp X seconds ahead, as the reflow temperature profile is not constant but a changing curve, this parameter will make the PID more reactive.
    • overshoot_comp (temperature in Celsius) it helps reduce the overshoot.

FTP access

  • The above mentioned advanced_temp_tuning may need some trial and error. To make the fine tuning process a bit easier, the ESP32 will create a WiFi access point named Reflower ftp://192.168.4.1
  • Simply connect to that SSID and you can edit the config.json by logging in 192.168.4.1:21 via an FTP client, e.g. FileZiila.

Installation

  • All files are under MAIN folder.
  • After flashing the firmware, you need to edit config.json to change the GPIO pin numbers according to how you wiring your TFT display and other components.
  • Set sensor_type to either MAX31855 or MAX6675.
  • Some solid state relays will not switch on with the little current supplied by an ESP32 GPIO pin. In this case you have to use a transistor between the GPIO pin and the SSR. You may need to configure the pin as active low then.
  • Make sure you have configured the right polarity for all pins.
  • Transfer all the files and folder under MAIN to the ESP32 dev board and you are good to go.

Usage Guide

  • Upon powering on the first time, you will be guided through touch screen calibration, once finished, the ESP32 will reboot.
  • After calibration and reboot, the GUI will load, where you can select Solder Paste type from the drop-down menu, just choose the type you'll use, and the reflow temperature profile will show down below.
  • If your solder paste isn't there in the menu, you can build your own solder profile files. Pls refer to: https://learn.adafruit.com/ez-make-oven?view=all#the-toaster-oven, under chapter "Solder Paste Profiles". The new solder profile json file should be put under folder profiles.
  • All set and click "Start" button to start the reflow soldering procress.
  • If you wish to re-calibrate the touch screen, click the 'Settings' button on the screen, and choose from the popup window. And follow the on-screen instruction.

PID tuning tips

  • Firstly, set previsioning & overshoot_comp to 0 in config.json to avoid confusing behavior.
  • Set kp to a small value, e.g. 0.1, and kd to a large value, e.g. 300. This helps to minimize overshooting during the early stage which is typically seen in 'preheat' and 'soak' stage. Keep decreasing/increasing kp/kd value until minimum overshooting is observed.
  • With a small kp & a large kd, it's very hard for the actual temp to reach the peak temp of the ideal reflow profile, this is when you need to tune the value of ki. Slowly increase ki until the actual peak temp gets really close to the ideal profile.
  • Pls note that the integration part (where ki takes effects) of the PID algorithm is only enabled when it reaches 'reflow' stage - this is hard coded and cannot be changed by settings. The intention is to prevent overshooting in the early stage while it still can reach the peak temp of the ideal profile.

ureflowoven-esp32-micropython's People

Contributors

dukeduck1984 avatar pastaclub avatar

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

ureflowoven-esp32-micropython's Issues

uReflowOven PCB

Here is a suitable board for the uReflowOven project

Download Gerber file: uReflowOven_Gerber_2020-08-25.zip

uReflowOven Schematic
uReflowOven OSHPARK Top
uReflowOven OSHPARK Bottom
uReflowOven Top
uReflowOven Bottom

Pictures of my prototype:

IMG_20200702_194728 (Large)
IMG_20200702_194751 (Large)
IMG_20200702_194840 (Large)

Need Door open servo and Open door switch

Could you

  1. add a servo to open the door for cooling.

  2. file : servo-- define pin(pwm)@ 50HZ.

  3. closed @ 5%,

  4. SLOWLY OPEN to 90% cooling

  5. Can add servo to piece of angle with servo on back of oven with rod to push door open enough to assist with cooling : FAN ON

  6. add language for a micro-switch

  7. (N.O) when closed

  8. (N.C) when not closed

  9. NOT EMERGENCY STOP while cooling.

  10. to keep the oven from heating while door is not closed completely

  11. file: switch -- define pin (in) pin low: door closed. (All is good) pin high: door open: heaters off, cycle stop, buzzer intermittent if not in cooling stage.

Stages messed up

I tested the new code (with your PID adjustments). It's not working well on my hardware.

The actual temperature lacks behind the profile and it switches stages much too late. On my first run, it was still in pre-heat stage when it should already have reached the reflow peak, then it froze and didn't react anymore (I had to turn off the power and restart). On the second test run, it stayed in pre-heat for too long and the temperature actually dropped again. Much later it started heating again and reached soak only when reflow was supposed to be over.

Obviously the PIDs need to be changed, but I am wondering whether it is correct that the machine doesn't change the stages when the time is reached. It seems that it's waiting for the specified temperature. Maybe it should switch stages when the time of the stage has elapsed?

IMG_6094

Soak stage too short

As can be seen in screenshots (e.g. this one, heaters are a bit slow and the actual temperature curve lags behind the intended profile.

In the current implementation this leads to a soak phase which is too short. In the Lead217 profile, the specified soak stage is from 90s to 180s with the temperature raising from 150C to 175C, i.e. a 25C increase over 90s. The actual (measured) temperature reaches 150C only with a delay, yet the device soon heats more to transition to the reflow phase. It's not soaking long enough, and the temperature rises too quickly, which is not good for the components.

As a simple remedy, I suggest syncing the actual curve with the profile up to a specified temperature, for example 90C. That means that during the pre-heat stage, whenever the temperature is measured, the profile is shifted on the time-axis so that the actual temperature matches the temperature specified in the profile. For example, when the heater is slower, the profile will be shifted right in the screenshot, until reaching 90C. At 90C both curves are crossing. From there on, the behavior would be just as before.

搜索不到WIFI信号

使用ESP32烧录座+ESP32-WROVER-B模块的方式烧录固件发现无法搜索到WIFI型号,ES32-WROOM-32模块也有尝试
微信图片_20200706182024
Snipaste_2020-07-06_18-21-31
Snipaste_2020-07-06_18-21-46

Machine freezes

I occasionally get the problem that the machine freezes and doesn't react anymore. This happened in the past when the machine had been on for a while, but now it happens everytime during the reflow process.

I suspect that ESP32 runs out of memory, since mine was almost full before, and now with the code improvements even more memory is used up. Needs to be examined further.

I also suspect that continuosly adding elements to the list temp_points as it's currently done, could lead to memory fragmentation. Would it be possible to replace this by an array of fixed size (and still be compatible with the chart drawing)?

Status of the project today and doubts.

First of all thanks for sharing all this (there aren't many people like that, or at least I don't know them)
I have been searching a lot on the internet and there are very cool projects but with screens of 60 euros (which used to be 25...) and others with more normal screens type controleo3 which I decided to do and after buying everything on aliexpress the samd21j18 is missing from the stores... and now I have material which I don't want to waste.... and there is good in these questions.
The project is still alive? if so, is it possible to use a 4" screen with the ILI9488 and use a max31865?
I have bought the esp (https://es.aliexpress.com/item/32855652152.html?gatewayAdapt=glo2esp) that indicates to carry out the project.
With this python thing I get lost... what versions should I have installed for it to work?
Thank you so much for everything!! All the best.

@pastaclub how are we going to do the merge?

My most recent changes to the code are reflected in beta branch, and I haven't merged them into the master

Below is your changing list.

1. Emergency off: whenever the temperature sensor reports a failure, shortcut or missing thermocouple, the heater is now automatically turned off immediately to prevent destruction of the PCB or fire.

2. Support for MAX6675 sensor (my MAX31855 is really dead, the dump above actually documents the moment it passed away.  I still had one MAX6675 lying around, so I wrote code to use that one instead. You can now configure in config.json which one you wish to use.

3. GUI now displays thermocouple errors (e.g. “NC” for “not connected”). This should be very useful for debugging while people build this project.

4. Fixed temperature caching (the concept was smart, but it didn’t work properly. oven_control never used cache values and always read new ones via SPI). Now you can also configure the max. temperature caching time seperately from the update interval of the temperature display.

5. WiFi SSID can now be configured in config.json

6. FTP can be turned on or off in config.json

7. Touch sensor is now only instantiated in one single place (instead of two if-branches).

8. More efficient parsing of the config file shrinks main.py by 40% to 109 lines

9. Application title can now be configured

My two cents:

  • I think all your improvements are relatively easy to merge, except 4. Fixed temperature caching of which care shall be taken, as I just made some changes in oven_control.py.
  • Also, I have realized low active heater by using the built-in machine.Signal class in main.py, and the option has been added accordingly in config.json.

Pls let me know how you want to do the merge.

Thanks,
Kaiyuan

Plans for next version

Just a few thoughts, no concrete timeline now. No guarantee, it may not happen at all.

  • Upgrade to LVGL v7 (or v8 if released) and the lastest stable MicroPython
  • For scheduler mechanism, replace Timer & _thread with uasyncio.
  • Adding servo & fan control options to open the door of the oven and speed up cooling.
  • Plug & play, no need to modify the internal of the oven.
  • It might worth adding an ESP8266 for the sake of safety to monitor the temperature in case the ESP32 crashes, the power can be cut.

运行遇到一点小报错

能搜索到WIFI信号但是无法连接,温度检测显示X_GND,拔掉K型热电偶显示NC,另外蜂鸣器会有微弱的“哒哒哒哒”声响。

程序是通过ampy一个个文件上传的。
启动过程中有“Emergency off”报错
Snipaste_2020-08-18_14-17-49

这是我焊接的一块板子
微信图片_20200817181623

以下是我的接线方式

TFT-3.2 ESP-32
T_IRO 35
T_DO 5
T_DIN 18
T_CS 25
T_CLK 19
MISO 5
LED 15
SCK 19
MOSI 18
DC 12
RST 4
CS 13
GND GND
VCC 14
BUZZ ESP-32
GND GND
I/O 22
VCC VCC
MAX31855 ESP-32
GND GND
VCC VCC
DO 33
CS 27
CLK 32
SSR ESP-32 AC220V
1 * 负极
2 * 负极
3 GND *
4 21 *

wifi有信号但无法链接

wifi windows 提示无法连接

1612455270947

另麦克风有哒哒哒哒声。温度用体温测正常。我用的6675。
目前还有继电器未链接。
1612455195090

搞错了

@pastaclub The touch pins are connected. The hardware buttons are optional, if you use a display without touch function.

BOM List:

Value Case
C1, C2, C3, C4, C6 100nF SMD-0805
C5 47uF 25V SMD-D 7343
D1, D2, D3, D4, D5 MBR120VLSFT1G SOD-123FL
J1 DC-005 DC Power Jack 5.5x2.1mm barrel type
R1, R2, R3, R4 1K2 Resistor SMD-0805
R5, R6, R7 10K Resistor SMD-0805 (optional)
T1, T2, T3, T4 MMBT2222A NPN SOT-23
X1 KF301-4P Terminal Red 5,08mm
X2 KF301-8P Terminal Blue 5,08mm

_Originally posted by @Bibbbi in #12 (comment)

C5 7343这个尺寸是真不好买。

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.