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

0 Members and 5 Guests are viewing this topic.

Offline stj

  • Super Contributor
  • ***
  • Posts: 2155
  • Country: gb
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #475 on: May 09, 2017, 12:13:34 pm »
have you looked closely at the fan?

a lot of 2wire fans actually have the tacho circuit, but no wire soldered to the pad.
 
The following users thanked this post: carpin

Offline Experimenter

  • Contributor
  • Posts: 12
  • Country: ru
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #476 on: May 09, 2017, 03:04:14 pm »
The fan in mine is marked CHA5024SX-15B and doesn't seem to have a tachometer pad.

Perhaps, it could be replaced with something of about the same size, coming with the tacho wire (or a pad)?


EDIT:
Is it that easy to add an RPM output to a 2-wire fan? (found somewhere on the Internet)
Quote
The tacho wire needs to be connected at one of the ends of the coil-pairs. The two pairs have a common wire (you can see this clearly)...you should see three connections coming from the coil. You need one of the other two, not the common one. Solder a wire to the coil-wire and close up the fan again. Then solder a common purpose diode like the 1N4148 or 1N914 to the third wire with it's kathode to the fan side, it's anode is your third wire connection.

(I didn't try this myself)
« Last Edit: May 09, 2017, 03:42:37 pm by Experimenter »
 
The following users thanked this post: carpin

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 6958
  • Country: ca
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #477 on: May 09, 2017, 09:28:57 pm »
The fan has no tachometer output and even then no spare wire exists in the wand cable to bring the signal back.

madworm I tried the circuit here but it was delicate. I needed a lower reference (+27mV vs +71mV) to detect at lower fan speeds, but then it extra-pulsed at certain higher speeds. Increasing threshold would stop extra-pulsing, but then it would cut out at lower fan speeds. It would be possible to simply debounce the fan speed signal in firmware, but I have not seen how the code works.

I took a try and came up a circuit that seems OK. Here is my BLDC fan-speed detect circuit that works well enough.  No trimpots and works on all BLDC fans I have lying around too. I worried about chatter from the edge-detector at zero signal, but the op-amp offset currents/voltages hold it at bay. At rest, the output is high.
From 7-24VDC I measure about 200-475Hz with 700Hz max.  My Youyue 858D+ can dish out 9-32VDC to the fan, which is crazy high.

So I could add this circuit to the PCB I'm working on. Just trying to find room for a bigger PCB. Along the top is the TRIAC heatsink, the right has the TIP122 heatsink, a bit limited and I'm not sure older 858D04.PCB could be accommodated.

Thanks stj I changed to LM4040 (TL431 also works with jumper and resistor change). Some LM4040 $8 and some $0.50 lol
 
The following users thanked this post: bwack, Experimenter

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 6958
  • Country: ca
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #478 on: May 12, 2017, 01:54:18 am »
Finished a PCB layout for the 858D06.PCB MCU adapter, including the fan speed sense and buzzer option, and LM4040 reference for the A/D.
Here is schematic, PCB etc. for any feedback.

I have to make sure the board fits. If it doesn't then maybe have to use a stacked daughter board for the fan speed sense circuit.

When I get a chance, I'll check for layout errors and get a proto made.
Not a lot of room, had to trash the silkscreen clearances and use 0.3mm traces but got a decent ground pour.
 
The following users thanked this post: carpin, bwack, electricMN, Experimenter

Offline flodo

  • Contributor
  • Posts: 41
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #479 on: May 12, 2017, 08:03:06 am »
Hey Guys!
I ordered a UVISTAR 858D, the PCB is the one labeled with 858D06 and SMD components.
The installed µc is a MK1840D3.

@all: thank you for sharing your designs!

@floobydust: Thank you for the efforts! If I can help you in any way - let me know! I would appreciate it!
« Last Edit: May 12, 2017, 08:13:20 am by flodo »
 

Offline bwack

  • Contributor
  • Posts: 15
  • Country: no
    • Bwack's YouTube
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #480 on: May 12, 2017, 02:43:39 pm »
Floobydust, check your schematics again regarding PB7, PB6 and PB0.

Using GiantGnome's schematic as reference, because I have this board, and it works for me:

MCU pinnameMK1841D3 pin no.
PB07
PB62
PB73

Offline flodo

  • Contributor
  • Posts: 41
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #481 on: May 12, 2017, 05:33:28 pm »
bwack is right I guess... I can confirm the following:

MK2 is PB0, but should be PB6 according to giantgnome
MK3 is PB6, but should be PB0                 - " -

PB7 looks right to me!

btw, if you are going make some prototypes: I am definitely interested, I would buy one  :-+

« Last Edit: May 13, 2017, 05:43:50 am by flodo »
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 6958
  • Country: ca
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #482 on: May 13, 2017, 06:31:49 am »
Thanks everyone for looking at the Rev. A sch and pcb and giving feedback. I corrected the LED digits (misread the F/W assignments) so PCB Rev. B now.
--------------------------------------------------------------------------------------------
I found another problem- two issues to resolve surrounding fan speed signal. I didn't pay enough attention to sensing fan speed, how it is presently done.

I was planning to get fan speed into the MCU as a digital signal, and measure frequency on the pin to calculate RPM.
But I see it is presently an analog voltage.

There are two possible uses for fan speed.
One is for safety, to shut heat off immediately if the fan is dead and not overheat the wand.
Two, is for better PID control.

The V1.46 firmware right now (as I understand it) has fan movement strictly a safety test feature- using the fan current sense mod:
fan_current = analogRead(A2);

OR just looking at voltage applied to the fan:
fan_speed = analogRead(A5);

with high and low limits in EEPROM.


For fan safety, the MK1840D3 firmware looks at the "D" term in the PID variables. I did tests to find this.
If the heater is on, temperature should rise at a base rate because airflow is coupling heat to the thermocouple.

If the heater is on, but no fan airflow, temperature reading rises at a much slower rate (until the wand is on fire).
So firmware can tell if the fan is working by looking at the "D" term or rate of temperature rise.


I was approaching the fan speed differently, thinking and designing to model fan airflow.

If you correlate fan speed with fan voltage or current you can tell the fan's load and model mass airflow.
Different nozzles change the 'system gain' and high-end hot air controllers ask you to input the nozzle size!
This is because the PID gains are affected, unique for each nozzle.
Do we want this kind of accuracy?
 
The following users thanked this post: carpin, bwack

Offline flodo

  • Contributor
  • Posts: 41
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #483 on: May 14, 2017, 10:10:44 am »
Quote
I found another problem- two issues to resolve surrounding fan speed signal. I didn't pay enough attention to sensing fan speed, how it is presently done. I was planning to get fan speed into the MCU as a digital signal, and measure frequency on the pin to calculate RPM.
But I see it is presently an analog voltage.

By "presently" you refer to other users which modified the 858, right?
Is it a problem if you solve it in another way? Is it more effort?

Quote
Different nozzles change the 'system gain' and high-end hot air controllers ask you to input the nozzle size!
This is because the PID gains are affected, unique for each nozzle.
Do we want this kind of accuracy?

As I understand it:
The upside would be "a better regulation" and the downside "you have to select the mounted nozzle" - is that correct?
 

Offline Experimenter

  • Contributor
  • Posts: 12
  • Country: ru
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #484 on: May 14, 2017, 09:52:25 pm »
If I understand it correctly, the new features like nozzle size selection will require corresponding support in firmware, which is currently not there. It will also add a layer of complexity (what happens if a nozzle size is incorrect? how wrong the readings will be? may it cause a damage to the wand?).

On the other hand, I prefer the hardware to offer maximum features. So that if there's a need in the future, a software support can be added without the need to modify hardware (whenever possible). So I would vote for the better accuracy option.

BTW, floobydust, if you plan to offer these boards for sale - count me in for at least one!


Oh... A comment regarding the adapter board itself: instead of having the beeper connector, I would prefer the beeper to be soldered directly onto the board. It shouldn't take much more space than the connector itself, but will look nicer (in my opinion).
« Last Edit: May 14, 2017, 09:58:03 pm by Experimenter »
 

Offline flodo

  • Contributor
  • Posts: 41
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #485 on: May 15, 2017, 12:43:42 pm »
@GiantGnome:
I ordered your pcb from OSHpark, thanks for your efforts!
The part list - according to the schematic (https://www.eevblog.com/forum/reviews/youyue-858d-some-reverse-engineering-custom-firmware/msg904576/#msg904576) - looks like:

C1   10uF electrolytic
C2   100nF
C3   100nF
C4   100nF
C5   100nF

R1   10k
R2   10k 100k
R3   100k 10k
R4   10k
R5   10k

Is there anywhere a more detailed list? I would need the dimensions to order the parts :)


UPDATE!!!! R2 and R3 are confused on the schematic/board! Install the 100k at the pads labeled R2!
« Last Edit: October 10, 2017, 03:40:22 pm by flodo »
 

Offline shotgun

  • Newbie
  • Posts: 1
  • Country: ua
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #486 on: May 25, 2017, 10:30:18 pm »
Tell me please the value of the transistor q2 on the board 858d06.pcb And if you can make a photo
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 6958
  • Country: ca
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #487 on: May 26, 2017, 01:59:04 am »
This is the stock fan-speed control schematic I have. I have to check the zener voltage measures on mine.
 
The following users thanked this post: carpin

Offline bwack

  • Contributor
  • Posts: 15
  • Country: no
    • Bwack's YouTube
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #488 on: May 27, 2017, 12:30:15 am »
I've played with the Madworm FW and added a CAL menu next to the CFG menu.
- Added a CAL menu which allows you to change five (adc,temp) pairs.
- Added a function piecewise_map() which uses those five pairs to map (convert) adc values into temp values.
- Averaging of the displayed adc value. You can use this to make pairs of your temp measurements and displayed adc values.
(if CFG's ADC parameter is set to 1 you get the adc on the display, and it used to be so fast and noisy)

I hade good results with this calibration scheme using this piecewise linear interpolation.
I made a video. I'll post the code soon. Shall I fork Madworms Github repository.. ?

« Last Edit: May 27, 2017, 12:32:31 am by bwack »
 
The following users thanked this post: carpin, LucasArg

Offline madwormTopic starter

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #489 on: May 27, 2017, 06:50:35 am »
You can create a merge request as well.
 
The following users thanked this post: carpin, bwack

Offline bwack

  • Contributor
  • Posts: 15
  • Country: no
    • Bwack's YouTube
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #490 on: May 28, 2017, 02:27:26 pm »
You can create a merge request as well.

Is it the same as using the Pull Request ? (noobie here)
I forked and added my code over here: https://github.com/bwack/Youyue-858D-plus

Hans.

Offline madwormTopic starter

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: de
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #491 on: May 28, 2017, 02:32:50 pm »
On github you can initiate a "pull request" for the repo you did a fork off.

When aporoved, your code would be integrated into my repo.

Not sure if you want that. From a user's perspective, it might be good to keep it in one place.
 
The following users thanked this post: bwack

Offline stj

  • Super Contributor
  • ***
  • Posts: 2155
  • Country: gb
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #492 on: May 28, 2017, 05:47:08 pm »
i just ordered an 858 to get in on this.  :-+

is there any type of roadmap, or is it just a matter of doing stuff that gets thought up?

my plan is to draw a complete schematic and try to dump the original firmware ( i have serious programming equipment)
then to make a sub board with an AVR or ARM cpu and extra IO headers and get it working with the basics.

after that - maybe add stuff  :-/O
 
The following users thanked this post: carpin, bwack

Offline knotlogic

  • Regular Contributor
  • *
  • Posts: 189
  • Country: sg
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #493 on: May 29, 2017, 06:19:31 am »
Does anyone have any experience with the Yihua branded versions of these systems?  I'm thinking of picking up one of these units.

Oddly, I've found a unit on aliexpress where you have to specify whether you're ordering the 110 V, 220 V, 230 V or 240 V version of the system.  As far as I can tell, they do sell spare heater elements which come either as 110 V or 220 V, but I can't imagine what difference the 230 V or 240V options would make.  Maybe their power supply for the uC has a very narrow input range?

Edit: Typo.
« Last Edit: May 31, 2017, 03:25:24 am by knotlogic »
 

Offline dorin

  • Contributor
  • Posts: 39
  • Country: ro
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #494 on: May 29, 2017, 07:00:04 am »
220 V, 230 V or 240 V are all just variations within the tolerances of the same European 50Hz system.
Some devices are more sensitive than others and might require a specific of the 3 voltages, but I doubt it is the case of this station given that the heater has active regulation.
Nevertheless, the difference between 110 and 220 V gives a power ratio of 4 and this definitely requires different heaters or transformers.
« Last Edit: May 29, 2017, 07:08:35 am by dorin »
 

Offline knotlogic

  • Regular Contributor
  • *
  • Posts: 189
  • Country: sg
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #495 on: May 29, 2017, 08:18:18 am »
Yes, and all that makes me wonder.  After all, if there are so many corners cut in the construction of the station to begin with, I can't imagine that they would go to the trouble to have different stations for 220 / 230 / 240 V.

They're cheap.  But not cheap enough that I would buy more than one for comparison... ;D

Edit: 230 V, not 2230 V.  Doh!
« Last Edit: May 31, 2017, 03:25:43 am by knotlogic »
 

Offline stj

  • Super Contributor
  • ***
  • Posts: 2155
  • Country: gb
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #496 on: May 29, 2017, 11:59:51 am »
it may just relate to the type of plug on the cable.

240v is u.k., 230v is Europe / schuko for example.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 6958
  • Country: ca
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #497 on: May 30, 2017, 03:04:37 am »
i just ordered an 858 to get in on this.  :-+

is there any type of roadmap, or is it just a matter of doing stuff that gets thought up?

my plan is to draw a complete schematic and try to dump the original firmware ( i have serious programming equipment)
then to make a sub board with an AVR or ARM cpu and extra IO headers and get it working with the basics.

after that - maybe add stuff  :-/O

The schematic has been conquered but the original MCU is largely unknown.  It's socketed (=no ICSP) but no idea what MCU core to disassemble. I think 2KB codespace and better A/D than the AVR. Even then, it's a fairly basic controller. Right now, people are doing their own thing for mods.
 

Offline Shock

  • Super Contributor
  • ***
  • Posts: 4211
  • Country: au
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #498 on: May 30, 2017, 09:45:57 pm »
i just ordered an 858 to get in on this.  :-+

is there any type of roadmap, or is it just a matter of doing stuff that gets thought up?

my plan is to draw a complete schematic and try to dump the original firmware ( i have serious programming equipment)
then to make a sub board with an AVR or ARM cpu and extra IO headers and get it working with the basics.

after that - maybe add stuff  :-/O

I'd stick to AVR because this is an easy mod and why make it harder or more confusing for others to follow you?

Dumping the original firmware for your specific hot air station may be of limited use to others, unless it offers insights. Already superior featured custom code has been written by Madworm and others that have contributed. Look at bwack's video a few posts ago for instance.

Schematics for the Baku has already been done, this could save you a bit of work if it's similar to yours. The ultimate for me would being able to whip one up on vero or perfboard.

The moment it starts to become expensive to build or I have to drill holes in the faceplate etc I lose interest, uploading new code is free.
Soldering/Rework: Pace ADS200, Pace MBT350
Multimeters: Fluke 189, 87V, 117, 112   >>> WANTED STUFF <<<
Oszilloskopen: Lecroy 9314, Phillips PM3065, Tektronix 2215a, 314
 
The following users thanked this post: carpin

Offline stj

  • Super Contributor
  • ***
  • Posts: 2155
  • Country: gb
Re: Youyue 858D+ some reverse engineering + custom firmware
« Reply #499 on: May 30, 2017, 10:11:25 pm »
the main thing i want to do is replace the led display with an LCD or OLED so i can display set temperature, current temperature, and status.
like my soldering station has.  :-+

as a bonus, it would be a serial display instead of the current 11 outputs.
so it free's some pins for future use.

maybe later add some temperature presets for different jobs.
 
The following users thanked this post: carpin, bwack, bitseeker


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf