Quantcast
Channel: youyue – My 2µF
Viewing all articles
Browse latest Browse all 11

YOUYUE 858D+ hotair station — reverse engineering #4

$
0
0

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.

IMGP8643 IMGP8641 IMGP8640 IMGP8639 IMGP8637 IMGP8633

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 };

//www.youtube.com/watch?v=fQZGTBUHnlk

Continue reading: Part V


Viewing all articles
Browse latest Browse all 11

Trending Articles