Closed vini-nu closed 3 years ago
Note: With official firmware then on main menu, long pressing A button gives info about what hotplate model is currently mounted and what resistance it has. Meaning there is some kind of detection mechanism wired into hotplate head.
@Vinigas This appears to be the plate_sensor_res
which is measuring the 100 ohm resistor on the pcb on the base of the heater head. I'm going to implement their equations for now as we dont know how they will change the heads in the future.
unfortunately i lost all the reversed stuff. saved the database along with the romdump in a temporary folder... which got deleted during a scheduled reboot... call me an idiot :D but could redo the most important part of the stuff.
for completeness, here the LUT for ADC9: 3670, 3659, 3649, 3638, 3627, 3615, 3604, 3592, 3581, 3568, 3556, 3544, 3531, 3518, 3505, 3492, 3478, 3465, 3451, 3437, 3422, 3408, 3393, 3378, 3363, 3348, 3332, 3317, 3301, 3285, 3268, 3252, 3235, 3218, 3201, 3184, 3167, 3149, 3131, 3113, 3095, 3076, 3058, 3039, 3021, 3001, 2982, 2963, 2944, 2924, 2904, 2884, 2864, 2844, 2824, 2803, 2783, 2762, 2742, 2721, 2700, 2679, 2658, 2636, 2615, 2594, 2572, 2551, 2529, 2508, 2486, 2464, 2443, 2421, 2399, 2377, 2355, 2333, 2312, 2290, 2268, 2246, 2224, 2202, 2181, 2159, 2137, 2115, 2094, 2072, 2051, 2029, 2008, 1986, 1965, 1944, 1923, 1902, 1880, 1860, 1839, 1818, 1797, 1777, 1757, 1736, 1716, 1696, 1676, 1656, 1637, 1617, 1598, 1579, 1559, 1540, 1522, 1503, 1484, 1466, 1448, 1430, 1411, 1394, 1376, 1359, 1341, 1324, 1307, 1290, 1273, 1257, 1240, 1224, 1208, 1192, 1176, 1161, 1145, 1130, 1115, 1100, 1085, 1071, 1056, 1042, 1028, 1014, 1000, 987, 973, 960, 947, 934, 921, 908, 896, 884, 871, 859, 847, 836, 824, 813, 801, 790, 779, 768, 757, 747, 736, 726, 716, 706, 696, 686, 677, 667, 658, 649, 640, 631, 622, 613, 604, 596, 587, 579, 571, 563, 555, 547, 540, 532, 525, 517, 510, 503, 496, 489, 482, 475, 469, 462, 456, 449, 443, 437, 431, 425, 419, 413, 407, 402, 396, 391, 385, 380, 375, 369, 364, 359, 354, 349, 345, 340, 335, 331, 326, 322, 317, 313, 309, 305, 300, 296, 292, 288, 284, 281, 277, 273, 269, 266, 262, 259, 255, 252, 248, 245, 242, 239, 235, 232, 229, 226, 223, 220, 217, 215, 212, 209, 206, 204, 201, 198, 196, 193, 191, 188, 186, 183, 181, 179, 176, 174, 172, 170, 168, 166, 163, 161, 159, 157, 155, 153, 151, 150, 148, 146, 144, 142, 140, 139, 137, 135, 134, 132, 130, 129, 127, 126, 124, 123, 121, 120, 118, 117, 115, 114, 113, 111, 110, 109, 107, 106, 105, 104, 102, 101,
Y axis the input value, X axis is the output value.
that dual sensor thing makes totally sense.
they seem to really take things serious and make sure the system is safe. the toggling I/O with diode and cap to keep the mosfet enabled is kind of a watchdog thingie. didnt check, but if they also use a main-loop I/O toggling func, that only toggles when all system parameters are correct, then its really designed well.
the inline-sensor is not very accurate, but if it "fails", the heating element will also fail. but the inline-sensor, so they added an more accurate one.
if they did it properly, the check the sensor values against each other. if the accurate fails and has a temperature offset of more than a few centigrades, the device should shut down. this would be a system with respect to safety measures.
@g3gg0 Now have a nice build you can test 🤟🏼 https://github.com/Ralim/IronOS/actions/runs/809565338
I have no idea how to really put the buzzer to use; but basic functionality looks to be here now I believe. Open to all critism :)
Definitely some non-optimal stuff in here I think; but steps in the right direction.
amazing. produced a working PoC within days. light speed.
tried to flash, worked flawlessly and can set the temperature. tried with 5V and is heating even with a plain USB. PID looks sane there. perfect!
will play around this evening. Ideas:
also with 20V everything looks sane. dont have a thermometer, but 300°C feels hot ;)
maybe limit the temperatures to 300°C? when checking the plot above, it clearly would be at the absolute resolution limit and for sure few degrees off.
what about a "profile" menu popping up when you press the A button a few seconds. then scroll through profiles using B and select the one you want using A again.
when somewhen USB is possible - could configuring the profiles be done using the textfile by providing a list like this? 280°C=280C 300°C=300C Reflow 280=180C 10s 280C 10s OFF Dry/Reflow 280=80C 180s 180C 10s 280C 10s OFF Dry=80C 600s OFF
can you estimate the effort how much work USB support in main firmware would require? is it even possible RAM-wise?
Depending on how much free space is left in MHP30 after USB stack support, there could be USB editable profile_scripts files. These files could be interpreted with a help of https://github.com/antlr/grammars-v4 (choose which you want as a base) language grammar, which could be simplified.
https://github.com/antlr/antlr4/tree/master/runtime/Cpp would allow to generate cpp tokenizer, lexer and interpreter stubs from the selected grammar.
This means that profiles could include for
while
loops, etc. And this custom interpreter should not weigh much. Also would be easy to add functionality in the future.
- buzz blip when target temperature reached
I'll give this a go at adding it :)
maybe limit the temperatures to 300°C?
Ah heck, so the firmware will limit you when we run out of ADC, but yes I will limit the menu options down
regarding profiles
I'm going to leave all profiles until after the current PR (aka basic support) is merged 😂 🙈 Would rather get basics out and give people option to test, before I dig in more time for profiles / setpoints / curves etc. Since there may be a bit of bug squashing to be done first, and want a stable base for building on (and also to not drag out the PR for months).
can you estimate the effort how much work USB support in main firmware would require?
Depends entirely, if you want the virtual USB drive like the miniware irons, probably a fair amount as would require emulating an entire fat filesystem and dealing with all the quirks of all the different drivers for fat.
Implementing a custom HID style protocol over usb is much easier (no filesystem to emulate) but would require some aspect of custom app to interact with.
Implementing custom file parsing is another entire mess.
If going easy route and using the premade STM32 USB stack, there would be fairly little flash left over for much else in the 96k of flash.
Adding USB will also require slowing down the processor to 48Mhz rather than the 64 we currently run at for all of the firmware. Shouldn't be a huge deal as we are not too stressed on CPU atm, but will require some fun testing to ensure we re-setup times etc correctly. Also bit-bashing the WS2812 protocol will need re-timing as well.
is it even possible RAM-wise?
Ram wise it should fit / could be made to fit.
Definitely view USB as a longer term item, thats open to anyone in the community if they want to give it a crack.
Okay buzzer and reduced max temperatuer should now be done in the PR.
thank you, also for the answers.
a few thoughts on USB... maybe start with a virtual com port? keeps the whole thing platform independent and implementation-wise simple in the firmware. configuration could be done using a simple interpreter. thats mainly printf, strncmp and atoi.
HID adds another descriptor and definitely needs custom software. without custom software you can make the iron/hotplate.. well... a 2-button joystick device, yeah... but why? :D
i don't like the filesystem approach at all. feels... weird and hackish. fully agree with all the quirks.
Thanks so much for putting this together. Did some temperature tests today. It appears that the actual surface temperature is consistently ~ 30 deg C higher than the set temperature. Probably an easy fix. Tried the temperature calibration (room temperature) but that didn't seem to help. Room temperature of my place is 22.6 deg C. For the 50 C test, it did overshoot quite a bit (went up to 100 C), then stabilized around 80 C after ~ 10 minutes.
SET: 50 C, ACTUAL: 84.4 C SET: 100 C, ACTUAL: 132.9 C SET: 150 C, ACTUAL: 180.0 C
@GoJian This is interesting as we are using the same data they are (as far as we can tell). Also I did test throwing two MHP30's on top of each other (tip to tip) and validated the two firmwares were within a few C of each other. (sensor lagged by 5C during heating but once at temp within 1 C).
Could you run the same test on the official firmware while you have the equipment around ? Ill try and run more testing here to test as well.
According to the specs (or at least the product materials) the max temp for this is 350C, but the config in the code specifies that the max is 300C. Is that intentional?
Ah, well in the firmware I first used on it, they had limited it to 300C so i copied their limit (not knowing actual hardware specs). If the stock firmware has since been uncapped to 350C more than happy to raise it :)
No need, I was just wondering if it was intentional, there's no reflow profiles that need 300C+ temps. Thanks for the response
@Ralim
MHP30 and reflow curves? That would be awesome.
How would you implement it? 5 points, where every point has a temperature and a timespan to get to from previous point? I guess a PC application would be way to complicated?
Or maybe someone could do a application where one can drag&drop points… Software then could spit out temps every x seconds via serial to Hotplate?
Very interested in your imagination
So the current version of IronOS reads thermocouple values or the tip inline circuit for temperature sensing? And, the inline temp measurement circuit is an NTC + op-amp? Is it in the top PCB with the male pins?
Hi, just for info. i had a broken hotplate and was within warranty and has been replaced by morningtools. :) Old broken hotplate i disassembled and would like to share it's inside photo.
ok here the solution to your "DEMO MODE" issue.
this is the culprit code that causes your device to lock in "Demo mode"
after some more reversing and decompiling, this is the result:
this tells us that the firmware is loading the signature bytes from 0x1FFFF7E8 (Unique device ID register), and comparing it with the content of the bytes at 0x08007FF2 - where every word gets XORed with 0x80007FF2. if the content doesnt match -> lock into DEMO MODE
didn't check if there are checksums, but you could try patching the content accordingly. or just patch the code:
replace the 0xD1 with a 0xE0, that should give an unconditional jump.
A bit off topic, i have same issue but with MDP-P906 psu, after changing microcontroller i flashed it with firmware from official site , but got in demo mode and its missing dfu bootloader. Anyone have a full dump of MDP-P906 ?
Can someone confirm that the temperature sensor connected to T- and T+ on the heating element is a thermocouple and not a thermistor? Measuring it with a multimeter, I read about 101 ohms when the heating element is at 24 degrees Celsius. I'm trying to set up an Arduino to read the temperature of this heating element. Do I need a k-type thermocouple amplifier to read in the temperature values? I wonder if it is a k-type thermocouple, since the labels on the circuit board here are red and yellow.
It is most likely a K type thermocouple indeed. You will need an amplifier and cold junction compensation or an integrated amplifier that does the cold junction offset for you
What about supporting MHP30 ? From the feature side it is very similar to ts80p. Externally it is basically the same iron (A B buttons, one OLED screen, type c pd and hotplate_vs_tip ), just in hotplate form factor.
It's menu is also very similar to default firmware for TS80P and TS100 (including menu icons).
What do you think about it ? @Ralim
I have it in hands, can send more info. Maybe pics of internals. Etc. Personally I could sit down to coding this, but that would be in mid-summer sadly.
PS. Official hardware page: http://www.miniware.com.cn/product/mhp30-mini-hot-plate-preheater/ Official MHP30 firmware: https://www.minidso.com/forum.php?mod=viewthread&tid=4385&extra=page%3D1 TypeC PD 20V/60W (Max); Meanwhile on 65W PD supply, display shows 59W on cold-start. 100'C-350'C; Through it could definitely work in wider low-temp range.