Author Topic: Youyue 858D+ some reverse engineering + custom firmware  (Read 399514 times)

0 Members and 1 Guest are viewing this topic.

Offline madwormTopic starter

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #100 on: July 23, 2014, 06:56:34 pm »
Dude! Chill out a bit, will ya?

You might not have noticed yourself, but you appear to be a bit on the edge. Have a beer or whatever people drink these days and wind down a couple of orders of magnitude.

Have a nice day.
 

Offline Carrington

  • Super Contributor
  • ***
  • Posts: 1202
  • Country: es
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #101 on: July 23, 2014, 07:06:02 pm »
Dude! Chill out a bit, will ya?

You might not have noticed yourself, but you appear to be a bit on the edge. Have a beer or whatever people drink these days and wind down a couple of orders of magnitude.

Have a nice day.
  :-//

You have a PM...
My English can be pretty bad, so suggestions are welcome. ;)
Space Weather.
Lightning & Thunderstorms in Real Time.
 

Offline Carrington

  • Super Contributor
  • ***
  • Posts: 1202
  • Country: es
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #102 on: July 23, 2014, 10:24:22 pm »
I just want add this:

If anyone has any suggestions about the PID (fuzzy PID, tuning, discrete implementation, etc) and also about the triac control method (power regulation for example), please feel free to share.

http://en.wikipedia.org/wiki/PID_controller
http://en.wikipedia.org/wiki/Integral_windup
http://bestune.50megs.com/typeABC.htm
http://www.yokogawa.com/ns/support/onepoint/utadv/ns-onepoint-utadv14.htm

Notes: The heated behaves as an integrator and have a large thermal inertia.
Also should be noted that the HW (this HW sucks) don't have a zero crossing detector, but make one is easy and cheap.
A a zero crossing detector is essential for phase control, I think that is the best way to control this thing.
The sensor (thermocuople) is deep inside the hot air gun, so obviously, the temperature at the output is different.
Also exist thermal gradients inside the hot air gun (only a few degrees).



I don't plan to continue with all this stuff, if anyone is interested in continuing (probably nobody), go ahead.
« Last Edit: July 23, 2014, 10:30:22 pm by Carrington »
My English can be pretty bad, so suggestions are welcome. ;)
Space Weather.
Lightning & Thunderstorms in Real Time.
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1407
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #103 on: November 29, 2014, 12:05:46 am »
Just had a few minutes to reverse engineer the chip connections on my 898D clone (meta-clone?).

It's a 20 pin chip, no known data on it but it's at least a micro, not just a 7 seg display driver/digital voltmeter.
Vss is on pin 1, Vdd on pin 20, that's similar to the Microchip layout, I don't know about the AVR chips.
Pin 11 is ADC goes through a 10k to pin 6 of OP07 clone which would be the opamp output.
Pins 2, 3, 5, 7, 13-19 drive the 7seg display (SM310401k)
Pin 6 goes to the opto driver.
Pin 10 goes through SD8050 + S8050 -> TIP122 to fan.
Pin 8 goes to button up AND to SCL line of the EEPROM
Pin 9 goes to button down AND to SDA line of the EEPROM
Pin 4 goes to the hall sensor in the handpiece.

The eeprom is a 2k one, I assume it only holds the last set temperature but I have not read it yet.

If anyone has any idea what kind of microcontroller this would be please give me a shout: MK(?)1841D3 C1Y21319, 20 pin PDIP, VDD pin 20, Vss pin 1, 5V, ADC pin 11, possibly I2C on pins 8,9.
Drop-in replacements from Microchip, MSP430 or AVR would also be nice.

I traced out the circuit of my Yihua 858D.  It also uses the 20 pin Samsung processor.  The pinouts are different from the Atten unit:

1 - GND
2 - SCL
3 - SDA
4 - Reed switch
5 - LED 5
6 - LED 3 (decimal point)
7 - LED 2
8 - LED 1
9 - LED digit 2
10 - LED digi 3
11 - LED digit 1
12 - Fan
13 - Heater
14 - temperature
15 - LED 4
16 - LED 10
17 - LED 6/button 2
18 - LED 9/button 1
19 - button common
20 - Vcc

LED segments:
10 - top
9 - top left
6 - top right
5 - middle
1 - bottom left
4 - bottom right
2 - bottom
3 - decimal point
 

Offline ao2

  • Newbie
  • Posts: 1
  • Country: 00
    • Antonio Ospite - Theorist attacks
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #104 on: January 25, 2015, 12:59:58 pm »
Just had a few minutes to reverse engineer the chip connections on my 898D clone (meta-clone?).

It's a 20 pin chip, no known data on it but it's at least a micro, not just a 7 seg display driver/digital voltmeter.
...

If anyone has any idea what kind of microcontroller this would be please give me a shout: MK(?)1841D3 C1Y21319, 20 pin PDIP, VDD pin 20, Vss pin 1, 5V, ADC pin 11, possibly I2C on pins 8,9.
Drop-in replacements from Microchip, MSP430 or AVR would also be nice.

I traced out the circuit of my Yihua 858D.  It also uses the 20 pin Samsung processor.  The pinouts are different from the Atten unit:
...

I've got a Baku 858D and this unit also comes with a MK1841D3 MCU, the datasheet is here:
http://wenku.baidu.com/view/41d09779650e52ea551898f2.html
 

Offline Ardvaark

  • Contributor
  • Posts: 11
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #105 on: February 05, 2015, 05:19:08 am »
Thanks guys! I burned the new 1.33 firmware onto a 168 and popped it into my Youyue 858d+ and its a new machine. I love it now. I actually bought another machine and chip to do this mod to.
Very nice!

 

Offline madwormTopic starter

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #106 on: February 05, 2015, 02:38:18 pm »
Glad you like it!
 

Offline Ardvaark

  • Contributor
  • Posts: 11
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #107 on: February 05, 2015, 05:27:35 pm »
Glad you like it!

The stock firmware I posted below turns out to be garbage.
I first tried loading the new firmware onto the 8 and it did not work at all, black screen but the fan would turn. That's when I used the 168 and it worked perfectly.
« Last Edit: February 05, 2015, 05:57:56 pm by Ardvaark »
 

Offline madwormTopic starter

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #108 on: February 05, 2015, 05:35:25 pm »
You can download the firmware, but look at the text file!

It is way to regular and repetitive. It's garbage. Normal code looks quite random on that level (except text strings).
 

Offline Ardvaark

  • Contributor
  • Posts: 11
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #109 on: February 05, 2015, 05:55:29 pm »
I did not know. Thanks!
 

Offline bianchifan

  • Regular Contributor
  • *
  • Posts: 94
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #110 on: March 26, 2015, 12:46:44 pm »
I just wanna order a rework station from Banggood when I found the Youyue 858 at Amazon's with mostly positive reviews and the option on a custom FW... at last I fetched one  in a well known bay ;)

For I remembered eevblog from some time ago (Transistor/componen tester, chineses soldering stations..) I did a little look..well, I found this here.
Thank you!

My problem, long time ago I did something with ATTiny13, that's all.
One year ago I started with Arduino, low flame only.
No ATMegas lying around, only acouple of Tiny13 and pro minis.
Ok, the minis have a 328p on board so let's go and find some datasheets, a veroboard, some wire..
Hmm. only the last digit was showing something..what's going on??
I checked  all connections, again and again...
AT least I searched for the pins in the source...what? PB6? PB7? What's that?
Arduinos doesn't know.
So I stripped out the crystal and did the two forgotten traces..oh no!
Only lotta weired stuff, fan on, fan off, heat..on..off..display dangling around..when pressing the lower button it ran up to 992!??!??
I checked all connections, again and again.
I checked the code, changed some things, compiled again and again..nothing, the station kept spinning around.
I tried another code I found in here, at858d, wow, 150 degrees!
Today early morning I checked for the upper button 'cause it was hardly reacting.
PB2? PB5? In Arduino spraak there are no PBs, only A..s and D..s.
AT least I found it, PB5. For me it's only SCLK.
But it's also D13, and D13 is standard LED.... :palm:|O |O :-DD
After cutting the trace everything was all right.
I guess, I'll give me some beer tonight
 

Offline littlebill

  • Regular Contributor
  • *
  • Posts: 70
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #111 on: April 14, 2015, 09:06:57 pm »
based on this post I bought this unit.
http://www.amazon.com/gp/product/B00P8Z4RPG/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1

i have just started with arduino. i am very new to all of this, also did some work with a rasp pi. http://www.dslreports.com/forum/r29940332-My-little-Raspberry-Pi-Project

i am extremely noobish

that said i will check my unit once it arrives, although this is my first reflow, i love modifying everything, my question since i am new, how do i program this chip

i assume i would order this,

http://www.ebay.com/itm/1-x-ATMEL-Atmega168-20PU-AVR-8-bit-Microcontroller-FREE-SHIPPING-/321044246485?pt=LH_DefaultDomain_0&hash=item4abfba6fd5

i have a Uno but a counterfeit one, my chip is not socket ted, so what exactly are my next steps, other then to verify?

if the programmer becomes expensive, i will even pay for a chip to be flashed

 

Offline madwormTopic starter

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #112 on: April 14, 2015, 09:21:17 pm »
You can use the Arduino UNO as an AVR programmer by loading the "Arduino-ISP" program & wiring it to the new ATmega168 on a breadboard.

On the other hand, decent AVR programmers are quite cheap, e.g. the "USBasp" (supported by Arduino-IDE) is way below 10$ on ebay.

If your unit is similar to mine in terms of build quality, you may want to get a new socket for the chip. Mine was badly oxidized and wasn't too happy when I extracted the IC.

 

Offline littlebill

  • Regular Contributor
  • *
  • Posts: 70
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #113 on: April 14, 2015, 09:32:32 pm »
"You can use the Arduino UNO as an AVR programmer by loading the "Arduino-ISP" program & wiring it to the new ATmega168 on a breadboard."

like i said i am newbish, i see the isp stuff in arduino program, is there some form of wiring diagram i can follow or a basic link?

i am assuming i can use this?
http://arduino.cc/en/Tutorial/ArduinoISP

at the bottom is the diagram, which one do i use? the internal or external clock?
« Last Edit: April 14, 2015, 09:38:34 pm by littlebill »
 

Offline madwormTopic starter

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #114 on: April 14, 2015, 10:04:43 pm »
External crystal is preferred. Less chance to get stuck with an unusable chip.
 

Offline littlebill

  • Regular Contributor
  • *
  • Posts: 70
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #115 on: April 14, 2015, 10:59:36 pm »
i only need that for the programming right? i don't need to transfer that over to the actual machine right?

this comment concerns me

"(If you select the wrong item and configure the microcontroller to use an external clock, it won't work unless you connect one.) "
 

Offline bianchifan

  • Regular Contributor
  • *
  • Posts: 94
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #116 on: April 18, 2015, 05:10:50 pm »
Today I decided to give the current mod a chance, although I can't see clearly for the advantage.

But let's start... howto and ino told me something about PC2..!?? ::)
On my PCB PC2 is connected to J5 via 10k! Ok, J5 isn't wired yet..but nobody knows.
Nevertheless two analogs wre free, PC1 and PC4, last one was my chosen one.

First, it works! That's fine!

But something is weired..

Sometimes the station doesn't start, only error message is displayed, something with fan.
Sometimes it starts after turning the hadle in the cradle.
Sometimes it starts after taken it off and into again.
Sometimes I must power off and on again a few times.
I couldn't imagine what's wrong with the reed.

On full speed (Pos 9) presets above 300° C won't be reached, the fan fan speed must be reduced to Pos 5 for reaching the preset.
For ex. preset 320° C, full speed Pos 9 - temp raising stops at about 280 degs.
At preset 400° C stopping occurs at about 300 to 320 degs.
Otherwise when preset is reached with low to middle speed, it remains stable even when speed is boosted to 9.
Perhaps the fan is more powerful after this mod.
 

Offline madwormTopic starter

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #117 on: April 18, 2015, 06:31:40 pm »
Regarding the turn-on behaviour:

a) what firmware do you use

b) error codes?

There have been issues with some ATmega168 chips that for whatever reason seem to like to fire their watchdog timers for no apparent reason. This was usually fixed by replacing the chip with a known-good [genuine] one.

c) https://github.com/madworm/Youyue-858D-plus/blob/master/Docs/modes_of_operation.txt

It seems like the PID parameters are not quite optimal for your device. The issue you observe with the fan-speed and not reaching the set-point could be due to a somewhat weaker heating element. You can try to increase the capture range for the integral control, which should correct that temperature offset.

options:

a) slowly increase the "iTh" parameter [setup menu] and see if that fixes it. This may worsen temperature regulation.
b) if a) doesn't sufficiently help, reset the values to default [see manual] and try increasing the "P" parameter a bit.

If you find values that work for your device, write them on a sticker and attach it to the bottom of it.
 

Offline littlebill

  • Regular Contributor
  • *
  • Posts: 70
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #118 on: April 18, 2015, 06:32:46 pm »
i only need that for the programming right? i don't need to transfer that over to the actual machine right?

this comment concerns me

"(If you select the wrong item and configure the microcontroller to use an external clock, it won't work unless you connect one.) "

any help with this?
 

Offline madwormTopic starter

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #119 on: April 18, 2015, 06:42:41 pm »
Get a breadboard, a genuine ATmega168 (or 328), a 16MHz crystal (HC-49U package) and 2x 20pF capacitors. The chip is a few bucks, the xtal + caps less than 1 buck (combined).

https://www.adafruit.com/products/2215
https://www.adafruit.com/categories/22

 

Offline madwormTopic starter

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #120 on: April 18, 2015, 06:46:11 pm »
Setting the chip to using an external clock is ONLY a problem IF there is no external clock. Therefore the strong advice to get the crystal. Even if this step should go wrong, the chip can still be reprogrammed to correct settings. Without the crystal, it will appear dead.
 

Offline bianchifan

  • Regular Contributor
  • *
  • Posts: 94
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #121 on: April 19, 2015, 02:44:30 pm »
a) what firmware do you use

the last one, should be 1.37

b) error codes?

FAN, CUR

There have been issues with some ATmega168 ..

I'm using a modified Arduino pro mini - ATMEGA328P

I switched back today, no current hack anymore.
I do not think on the PID, should be anything else.

Without current hack preset Temps will be reached in a very short time, even with full fan speed.
But cooling down will last longer, much longer.
 

Offline madwormTopic starter

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #122 on: April 19, 2015, 05:41:23 pm »
OK...

the current-sense mod per se is not really helpful, as you've found out. The current consumption of the BLDC fan doesn't vary significantly enough to be useful (indicate stall).

A true measure of RPM would be needed. You may want to look into commutation-detection (Docs folder). I have a very crude prototype, but never got any further with it. It needs to be tuned quite a bit to work, ideally with a scope. The waveform changes quite a bit with fan-speed.



If you don't want to go any further with this, I suggest to use the standard firmware settings.
 

Offline giovannirat

  • Regular Contributor
  • *
  • Posts: 107
  • Country: at
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #123 on: April 19, 2015, 05:43:30 pm »
I have a similiar problem as bianchifan.

My hardware:
Youyue 858D+
PCB ver 6.0    20140415
ATMEGA 328P  (tried  3 different chips)

firmware 1.37

I have also a strange turn-on behaviour:
The first time i power on the station i get the following messages on the display:  005 -> 008 -> rSt
Power off the station and power on again immediately  has the following result:  005 (visible very short time, about 0,5s) -> 000 -> 1.37 ->  ---   (sometimes also 005 -> 1.37 -> 000 -> 1.37 )
Then the station works as it should .

BTW: Due to a failure of  the station I opened  the handle connector. And guess, what i found: One cable (for the reed relay) in the connector was disconnected and the heat shrink tubes in the connetor were NOT shrinked !!!  So may have a look at that.

Sometimes I must power off and on again a few times.

No idea what's wrong. :-//


« Last Edit: April 19, 2015, 06:04:54 pm by giovannirat »
 

Offline madwormTopic starter

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #124 on: April 19, 2015, 06:28:23 pm »
Code: [Select]
#ifdef DISPLAY_MCUSR
        HEATER_OFF;
        FAN_ON;
        display_number(_mcusr);
        MCUSR = 0;
        //
        // ATmega168 MCUSR (MSB to LSB): x-x-x-x-WDRF-BORF-EXTRF-PORF
        //
        delay(1000);
#endif

#ifdef USE_WATCHDOG
        if (_mcusr & _BV(WDRF)) {
                // there was a watchdog reset - should never ever happen
                HEATER_OFF;
                FAN_ON;
                while (1) {
                        display_string("RST");
                        delay(1000);
                        clear_display();
                        delay(1000);
                }
        }

005: BORF (brown-out reset flag) + PORF (power-on reset flag) bits are set. NORMAL after cold-start.
000: strange, NOT normal.
008: the WDRF (watch-dog reset flag) bit is set. This should NEVER EVER happen.

Make sure you DO NOT USE any form of bootloader when the watchdog function is used!


The next thing is speculation:

It could be that the on-board RC-oscillator is a bit wonky in your chips, meaning it runs quite a bit too slow.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf