Author Topic: CFW for KSGER/Quicko STM32 Soldering Stations  (Read 655594 times)

jesusthegoat and 5 Guests are viewing this topic.

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5892
  • Country: es
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2975 on: May 21, 2022, 09:42:02 pm »
Nope not easily, neither supported, even when compiling for size instead performance, it still uses 79KB.
Just find a STM32F101/2/3CB, not C8, so even if being a clone, it'll have 128KB.

KocsisV, I don't forget, I just need to find some time to review all the changes!

I was thinking, are project build variables passed to the Makefile?
Could this:
Code: [Select]
all : ./boards/KSGER_V1_5/src/generated       \
  ./boards/KSGER_V2/src/generated         \
  ./boards/KSGER_V3/src/generated         \
  ./boards/Quicko_STM32F103/src/generated \
  ./boards/Quicko_STM32F072/src/generated ;

Be replaced to something like this? (pseudo code):
Code: [Select]
all :
if(BOARD==KSGER_V1_5)
          ./boards/KSGER_V1_5/src/generated ;
elif(BOARD==KSGER_V2)
  ./boards/KSGER_V2/src/generated ;
elif(BOARD==KSGER_V3)
  ./boards/KSGER_V3/src/generated ;
elif(BOARD==Quicko_STM32F103)
  ./boards/Quicko_STM32F103/src/generated ;
elif(BOARD==Quicko_STM32F072)
  ./boards/Quicko_STM32F072/src/generated ;
fi

Declaring "BOARD" var in the build profile. A little hacky but would work.
Sorry, I have very little knowledge about Makefiles!
« Last Edit: May 21, 2022, 10:25:04 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline Embehu

  • Contributor
  • Posts: 30
  • Country: vn
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2976 on: May 22, 2022, 09:13:48 am »
Really sorry, this is my stupid error. I did a right click to download the.bin file. And I end up with a bin file that is 1Mb size. Therefore I can’t flash into the new mcu. Now, it works like a charm!

Work well with tx2 tip but idk why it only draw 3A which is not powerful enough and it takes quite long time to heat up

Thank you so much for taking your valuable time to clarify me!
« Last Edit: May 22, 2022, 09:15:53 am by Embehu »
 

Offline ygi

  • Regular Contributor
  • *
  • Posts: 202
  • Country: be
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2977 on: May 22, 2022, 10:38:10 am »
Have you set the correct values in iron menu? Power should be set to 260W and heater impedance to ~2.2 Ohm.
 

Offline KocsisV

  • Contributor
  • Posts: 31
  • Country: hu
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2978 on: May 22, 2022, 11:08:36 am »
I just need to find some time to review all the changes!
I know, I'm not rushing you  :)
That PR does not contain the project restructuring, that will be part of another PR later.

I was thinking, are project build variables passed to the Makefile?
It does not work. As I said in the earlier posts, I tried quite a few methods, here is why they don't work:
Method A: If there is one subproject per hardware target, it only triggers the build of the "codegen" builder if you build one target. If you try to build all configurations with the "build all" then it fails to trigger the subproject build completely. This is a known 15 year old eclipse CDT bug.
Method B: If you put the codegen step into the main project as a "pre build step" (This is different from a builder!) then eclipse will generate its own makefiles before this step runs thus the generated files won't be compiled. This partially works, but you need to compile the project twice, and refresh the project between them. And this does not work at all with "build all" because that executes a clean after build.
Method C: If you put the codegen step into a builder (like it's currently is) then it will be only triggered once, regardless if you asked it to only compile a specific configuration or compile all. And the eclipse internal variable which holds the "active configuration" does not tell you if its running for only that config or all the configurations. Even if it were executed for each target separately when "build all" the active configuration does not change because that contains the name of the config selected on the UI, not what its currently building.

To translate this to the "board variable":
Method A: works for single targets, but due to the bug build all configs does not.
Method B: does not matter, does not work.
Method C: no such variable available in eclipse in the builder stage.

Sorry, I have very little knowledge about Makefiles!
Your approach is with the "if"s is completely wrong :) You try to treat "make" as an imperative language, but it is a declarative one! It does not define steps to run, it defines rules how to obtain artifacts.

Code: [Select]
all : boardX ;This means to get the target "all" first target "boardX" need to be present (prerequisite), then do nothing.
If you wan't to introduce a variable for example, there is absolutely no need to "if" anything. Simply
Code: [Select]
all : $(BOARD);will work (well, actually it won't and this is not a good approach, will explain later). As this says resolve the BOARD variable and that becomes a target which is needed for all. And its possible to use wildchars, variables, etc in the target's name. So this is why that in my current setup you don't see specific targets for each board:
https://github.com/KocsisV/stm32_soldering_iron_controller/blob/updateProjectStructure/mcu/generate_sources.makefile#L24
This matches any target that matches this given pattern. The last "touch generated" part is only there to make an actual file exactly at the target's name. This will be used by make to determine if the rule for this target need to be executed or not. If the file is there AND its timestamp is newer than all of its prerequisite, then the rule is already satisfied. This is why the code-gen becomes incremental. It only runs it if the file named "generated" is not present or if you change the templates or the IOC file.

And to why "$(BOARD)" won't work as a prerequisite: it will not check if "BOARD" exists or not if the target (all) is already up to date. So even if you ask it to build a different board if any files in its prerequisites is older than the one you already built then it will simply skip the rule.
This is why I have one rule that matches all boards (./boards/%/src/generated). If I ask make to build target "./boards/XYZ/src/generated" it will execute the rule if the file at "./boards/XYZ/src/generated" is not present or if one of it's prerequisites is newer than it.
So by listing all boards as prerequisite in the "all" target all it says that to get the "all" target it needs those ./boards/.../src/generated files before it can be satisfied.

I recommend you to read this tutorial: https://makefiletutorial.com/. It explains the basics pretty good. Only thing I used what's not in there is the "second expansion" trick to resolve env vars with env vars.

But again, no such "BOARD" variable can be obtained in "method C", and "method A" is not executed when building all targets. So neither works. And since this whole code-gen only needs to be executed once it's not that annoying. It takes less than 2 minutes on my machine for all 5 to be done. And again don't confuse the board target to the configuration! One board target can be used by multiple configs. If you check my latest commit of the updateProjectStructure, I already added the configs for the LCD variants. 18 configs get's built if you pick build all, but "only" 5 codegen is executed (one for each hardware variant).
« Last Edit: May 22, 2022, 12:30:37 pm by KocsisV »
 

Offline Embehu

  • Contributor
  • Posts: 30
  • Country: vn
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2979 on: May 22, 2022, 11:08:50 am »
Have you set the correct values in iron menu? Power should be set to 260W and heater impedance to ~2.2 Ohm.

I changed to 300W and 3.0R, as my calculating it should be 10A. Anyway, just a little bit waiting time, it’s okay to me.
So when I change tip to T12, do I need to set back to 8R /80W?
 

Offline ygi

  • Regular Contributor
  • *
  • Posts: 202
  • Country: be
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2980 on: May 22, 2022, 04:15:03 pm »
The power setting is really a limit for when you're using a power supply that's too weak for the tip. If yours can do 300W, you can leave it at that. Now for the heater setting, I'm not quite sure how it interacts with power delivery control. I would change it back unless David says it's fine like that.
PID settings for T12 are most likely not adequate for TX2. You can get really slow response time if it's not configured properly. Also, check if the MOSFET is overheating. I know others said it's fine according to datasheet but that's only if the part is genuine.
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5892
  • Country: es
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2981 on: May 22, 2022, 04:39:11 pm »
The heater resistance is used for the power limit function, nothing else, it simply uses Ohms law:

Power supply2/resistance = Max Power.

If this value exceeds power limit value, it adjusts the relative 100% PWM duty value.

Ex. If 24V puts 200W into the tip but you set 100W limit, the "virtual" 100% PWM output value would be actually the 50%, and that's what is used for PID calculation.

At maximum output, each PWM cycle would average the power limit: 50% at 200w, 50% off, average=100W.
Since PWM cycles is 200ms, there's no time for the heater to overheat and burn.

If course if you use a very low power heater, it would blow up like a fuse, even limiting the power, like driving 1W with 200W pulses.
But not likely to happen with any soldering heater.
« Last Edit: May 22, 2022, 04:44:07 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: ygi

Offline Embehu

  • Contributor
  • Posts: 30
  • Country: vn
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2982 on: May 23, 2022, 04:34:00 am »
The heater resistance is used for the power limit function, nothing else, it simply uses Ohms law:

Power supply2/resistance = Max Power.

If this value exceeds power limit value, it adjusts the relative 100% PWM duty value.

Ex. If 24V puts 200W into the tip but you set 100W limit, the "virtual" 100% PWM output value would be actually the 50%, and that's what is used for PID calculation.

At maximum output, each PWM cycle would average the power limit: 50% at 200w, 50% off, average=100W.
Since PWM cycles is 200ms, there's no time for the heater to overheat and burn.

If course if you use a very low power heater, it would blow up like a fuse, even limiting the power, like driving 1W with 200W pulses.
But not likely to happen with any soldering heater.

Thank you so much. I got the idea. Could you please explain a little bit about Imax (now it’s 0.7) what if I increase it to 1 2....?

Moreover, please add these explaining to your github. I think it will be really useful for someone noob like me


The power setting is really a limit for when you're using a power supply that's too weak for the tip. If yours can do 300W, you can leave it at that. Now for the heater setting, I'm not quite sure how it interacts with power delivery control. I would change it back unless David says it's fine like that.
PID settings for T12 are most likely not adequate for TX2. You can get really slow response time if it's not configured properly. Also, check if the MOSFET is overheating. I know others said it's fine according to datasheet but that's only if the part is genuine.

As DavidAlfa explained, I got the main idea. I do have 24V/14A psu and a laptop ac adaptor (19V 7A). Which one should I use? Since now I’m using DC power supply for testing current and so on
« Last Edit: May 23, 2022, 04:37:43 am by Embehu »
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5892
  • Country: es
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2983 on: May 23, 2022, 08:09:08 am »
Explain what in GitHub? It does what it's supposed to do, limit the power, everything it's pretty well explained in the Operation manual.
Same for Imax, it's a PID adjustment, means Integral Max Accumulator, the limit it will grow, and the grow speed depends on Ki, all this is also explained.
I can briefly explain what each option does, but not down to ground level, I'm not a teacher!

Both power supplies are ok, 19V will give 120W and 24V 192W, with a 3 ohm load.
« Last Edit: May 23, 2022, 10:27:24 am by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline Embehu

  • Contributor
  • Posts: 30
  • Country: vn
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2984 on: May 23, 2022, 10:42:52 am »
Explain what in GitHub? It does what it's supposed to do, limit the power, everything it's pretty well explained in the Operation manual.
Same for Imax, it's a PID adjustment, means Integral Max Accumulator, the limit it will grow, and the grow speed depends on Ki, all this is also explained.
I can briefly explain what each option does, but not down to ground level, I'm not a teacher!

Both power supplies are ok, 19V will give 120W and 24V 192W, with a 3 ohm load.

Thanks again! This is really good fw for the one not really good from China :D

Actually I’m not an electrical engineering, but I learned my first lesson from our school when my professor said “what ever you do, just do things that anyone could understand what you are doing no matter who are they, professor, amateur or stupid ones”
 

Offline yelkvi

  • Regular Contributor
  • *
  • Posts: 114
  • Country: ru
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2985 on: May 23, 2022, 11:25:01 am »
Actually I’m not an electrical engineering, but I learned my first lesson from our school when my professor said “what ever you do, just do things that anyone could understand what you are doing no matter who are they, professor, amateur or stupid ones”
Are you saying that the developer of a nuclear power plant should make sure that any peasant understands?
It is important for a peasant to have electricity in the house. And if he is interested in how a nuclear power plant works, let him go to study as a nuclear physicist. :)

I don't know how to program STM controllers. But I don't need it. I'm just using what David developed. I like.
« Last Edit: May 23, 2022, 11:28:18 am by yelkvi »
 

Offline ygi

  • Regular Contributor
  • *
  • Posts: 202
  • Country: be
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2986 on: May 25, 2022, 10:25:28 am »
@David Since nobody reported it, there's a misnamed variable here: https://github.com/deividAlfa/stm32_soldering_iron_controller/blob/f142199fe73a4bf0c6f1dec9bf7ffa89af2fc334/Core/Src/main.c#L224
PWM_DETECT_TIME should be TIP_DETECT_TIME

 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5892
  • Country: es
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2987 on: May 25, 2022, 10:34:46 am »
You're right, I changed that recently... But I swear it compiled ok? Otherwise I completely missed out!
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline ygi

  • Regular Contributor
  • *
  • Posts: 202
  • Country: be
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2988 on: May 25, 2022, 01:05:46 pm »
I wouldn't catch that if it weren't for the compiler crying about it, that's for sure. Your dev computer might be out of sync with github.
 

Offline Polf

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ru
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2989 on: May 25, 2022, 01:17:20 pm »
Received LCD GMG12864-06D v.2.2, black and white, inverse. I waited for the parcel for 60 days.
The backlight current is limited using a resistor, it is 11 mA.  The update rate is noticeably lower than that of the OLED, there is a delay.  How it works can be seen in this video.
https://disk.yandex.ru/i/hf1bfeK2GO3KMA
The controller is homemade based on the scheme of the KSGER v.3. The microcontroller is STM32F101CBT6. Firmware from David STM32F101_ST7565 May 8 2022.
 

Offline Polf

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ru
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2990 on: May 25, 2022, 01:30:36 pm »
I'll add a photo.
 

Offline soldermarc

  • Newbie
  • Posts: 8
  • Country: de
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2991 on: May 25, 2022, 01:59:34 pm »
What is the preferred method to build the firmware atm?
I installed CubeIDE and followed the video instructions on github, but IDE 1.9.0 looks different and doesn't seem to load files as expected/explained.

After that I tried to use the Building_script.bat (java had to be installed first) but got an
Code: [Select]
Running CubeMX...
CubeMX error!
:-//
 

Offline KocsisV

  • Contributor
  • Posts: 31
  • Country: hu
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2992 on: May 25, 2022, 03:01:35 pm »
Quote
TIP_DETECT_TIME
Probably you left it out from the commit or something.
I noticed this too, I thought that it was because of the failure of git to correctly resolve conflicts in the merge of 40+ commits. It is already fixed in the PR.
Btw feel free to leave comments in the PR itself, even better if make the comments on the specific changed lines itself.

I installed CubeIDE and followed the video instructions on github, but IDE 1.9.0 looks different and doesn't seem to load files as expected/explained.
I also use 1.9.0, followed the guide and it worked.
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5892
  • Country: es
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2993 on: May 25, 2022, 06:54:42 pm »
Yep, I left out that commit! Fixed. I had removed the main project to try KocsisV's and forgot about it...

soldermarc, it should build now. Thanks ygi for reporting!


KocsisV, reviewing some commits it seems we did the some work twice, like the screen pixel for bicolor OLEDs and cleaning of some old, unused parts(iron debug ,etc), flash erase IWDG (I detected it because it was resetting in a debug build)...
Are you sure about making the display variables as a packed bitfield?
I mean, it's ok, but saves only 3 bytes, makes access by the cpu harder, and you might want to change it in the future to whatever?
Otherwise, there're a lot more of variables that could be modified to bitfields to save space.
« Last Edit: May 25, 2022, 07:12:50 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline soldermarc

  • Newbie
  • Posts: 8
  • Country: de
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2994 on: May 26, 2022, 04:22:36 pm »
So I've managed to get a CFW on my pcb.  :)

But I'm unsure if it is the right one...  :-// Flashed the STM32F101_SSD1306 because of the 4pin OLED connector.
Display was flipped initially, but set to the right orientation in menu. The tip is not recognized. I wonder if I have a different pinout on the 5pin iron connector or the wrong board/fw combination.

I searched for all pictures of KSGER and Quicko revisions I could find. But there was no exact match - very confusing. The station was sold as Handskit STM32 v2.1S.
https://de.aliexpress.com/item/4000183089084.html
Btw. the component under the power cable is a big 78M05.

Edit:
what does the
JBC H/T+=OFF
T12 H/T+=ON
mean?
« Last Edit: May 26, 2022, 04:25:16 pm by soldermarc »
 

Offline KocsisV

  • Contributor
  • Posts: 31
  • Country: hu
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2995 on: May 26, 2022, 04:55:19 pm »
I had removed the main project
Why don't you check out multiple instances of the same repository? Git is a distributed version control system, you can even push&pull changes between your local repositories, have branches/commits only locally in your repository, etc.
Because STM32CubeIDE is eclipse based, you can have multiple workspaces and switch between them. So in one you can have one set of projects (and even IDE settings), and a different set (and IDE settings) at the same time. (File -> Switch Workspace)

we did the some work twice
Could be the case. But all of these conflicts are resolved. Don't check it commit by commit, use the review options in github.

makes access by the cpu harder
If I recall correctly, it does not. CortexM3 has instructions for direct bit manipulation/testing.
Btw, for these flags the bool_t type should be used as that gives a hint to the compiler that it can optimize a bit. (Eg with the abstraction of the iron_t structure with the additional getter/setter functions the code size actually decreased instead of increasing.)
But for this particular case, I think that was a mistake that I left that in (I tried to arrange the layout in a way to not have to reset every setting, thus the need to shift things around a bit). That could be reverted.
A lot of space could be saved, but since that area is not even close to being full it does not matter much from the space saving perspective.

Please make these comments in github! It will be hard to track them here. Assign yourself as a reviewer to the pull request, then click on the "files changed" tab, hover over any line where you want to add a comment, a small blue + icon will appear at the line number, click that,  add your comment (and click "start review" in the first one). Once you are done with a bunch of these (you can also mark files as "viewed"), on the upper right corner click review change it to "request changes" (if needed) and submit.
 

Offline yelkvi

  • Regular Contributor
  • *
  • Posts: 114
  • Country: ru
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2996 on: May 26, 2022, 05:15:04 pm »
Edit:
what does the
JBC H/T+=OFF
T12 H/T+=ON
mean?

For T12, these contacts must be closed (this is done at the factory).
If you want to use 245, then these contacts must be disconnected.
How to connect 245 can be viewed on the Internet.

If you use 245, then solder the missing LED, as in the picture.
« Last Edit: May 26, 2022, 05:18:04 pm by yelkvi »
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5892
  • Country: es
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2997 on: May 26, 2022, 06:11:19 pm »
That makes sense, probably the reason it's not being detected.
The LED function is to clamp the voltage when the output is enabled.
Not required for C245, as 24V never reaches the amplifier input (the sensor is isolated from power), it's in T12 where it happens.
I'd put a simple 1n4148 there, limiting the signal to 0.6V is already a lot more than the sensor will output, 13mV-40mV depending on the tip type.
« Last Edit: May 26, 2022, 06:22:58 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: asupsp700

Offline soldermarc

  • Newbie
  • Posts: 8
  • Country: de
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2998 on: May 26, 2022, 09:51:22 pm »
Of course I missed that when desoldering the iron front connector (for adding the programming header to the pcb).  |O
With the H and T+ pins closed everything works great now! I also added the diode, but so far only the T12 handle is in use.

Btw: great firmware with tons of options and super fast display and menu response. 8)
I think I have to spend more time and money for calibration now...
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5892
  • Country: es
Re: CFW for KSGER/Quicko STM32 Soldering Stations
« Reply #2999 on: May 26, 2022, 11:14:02 pm »
Get a cheap DMM with temp. probe, you don't need anything fancy. +-10°C won't change anything!
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf