YOUYUE 858D+ hotair station — reverse engineering #4

Possibly (and hopefully) the last post in this little hot-air station series. I’ve opened and closed that device far too often – and popped out the chip multiple times in each instance. You see the designer failed to add a programming header!

TO THE PILLORY WITH HIM (or her)!

So I finally decided to add my own programming header – lots of cables involved. Enjoy the images. I also took the opportunity to fix some other issues.

The main change in the firmware is that it now fully supports PD / PID control. PD is used if the error is large, PID is used once the temperature is somewhat close to the target value. This avoids issues with the integral part growing out of bounds.

I’ve also changed how some of the vital parameters are handled, i.e. I’ve made them user-configurable. The most important parameters (p_gain, i_gain, d_gain, i_thresh, temp_offset_corr) are available for the user to tweak. And just in case something goes wrong, the default values can be restored as well :-)

I’ve also made sure that values saved to eeprom and restored from eeprom are checked if they are within a predefined range. Hopefully nothing should go wrong, even if the eeprom data is messed up.

These parameters are stored in a struct:

typedef struct CPARAM {
        int16_t value_min;
        int16_t value_max;
        int16_t value;
        uint8_t eep_addr_high;
        uint8_t eep_addr_low;
} CPARAM;

CPARAM p_gain = { 0, 999, 0, 2, 3 };    // min, max, value, eep_addr_high, eep_addr_low
CPARAM i_gain = { 0, 999, 0, 4, 5 };
CPARAM d_gain = { 0, 999, 0, 6, 7 };
CPARAM i_thresh = { 0, 100, 0, 8, 9 };
CPARAM temp_offset_corr = { -100, 100, 0, 10, 11 };
CPARAM temp_setpoint = { 50, 500, 0, 12, 13 };

Continue reading: Part V

This entry was posted in Arduino., Soldering & PCBs. and tagged , , . Bookmark the permalink.

3 Responses to YOUYUE 858D+ hotair station — reverse engineering #4

  1. tx8 says:

    Thank you very much for sharing this! Looks very good. My station should arrive tomorrow. Will mod it right away. Which settings for PID do you generally use? the default ones or do you make settings every time depending on the job?

  2. Anton says:

    Hey robert,
    first of all: thanks for your work and for sharing the code. I must confess, that I bought the device after I stumbled across your blog.
    I just got my device today and the temperature setting button alone is worth the mod. But with the PD/PID controller and your improvement with the menu, this is just awesome. Thanks again.
    About the Fan control, I also wonder, why the did that fancy current control stuff, since a WDT and external pull-up for PWM fan control would just be fine. I think that is really unfortunate, because the mcu can’t run the fan at full speed for cooldown. bummer.

Leave a Reply

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

CAPTCHA Image

*