AxxAxx / AxxSolder

STM32 Based soldering station for JBC cartridges, 9-24 VDC and USB-PD power
GNU General Public License v3.0
487 stars 39 forks source link

Automatically detect USB-PD supply capability and limit power #49

Closed AxxAxx closed 1 month ago

AxxAxx commented 3 months ago

Automatically ask USB-PD supply of it's power capability with the STUSB4500 negotiation chip and limit the output power based on the capability.

There is currently no such check and if you power AxxSolder with a 65W capable USB-PD source and try to use a C245 cartridge (which will draw 120W) AxxSolder turns off as the supply voltage can not be kept by the supply.

c0d3z3r0 commented 2 months ago

AP33772S might be a good replacement for STUSB4500 to add EPR support (240W). It requires a few more external components, though. https://www.diodes.com/part/view/AP33772S?BackID=10099

AxxAxx commented 2 months ago

Nice, they are finally arriving, the PD3.1 sink controllers! Seems like one has to wait a bit more to get the hands on the AP33772S IC's though. Not availible anywhere for now what I can see?

I assume more IC manufacturers will release PD3.1 sink controllers too in the near future.

The STM32G431CB MCU has built-in USB "Power Delivery controller peripheral" (UCPD) which supports EPR messages. That is also one way to go - to do the USBPD negotiation from the MCU and not use an external controller. Need a new MCU with more flash memory for that though. Probably a STM32G473CCT3 or similar.

c0d3z3r0 commented 2 months ago

Oh oops, didn't check availability and just assumed it is :D There one ftom Hynetek as well, but also not available anywhere.

Yeah, maybe even G4931 with 512KB. Shouldn't need too much code change.

Hmmm, weird. Datasheet says PD spec 3.0 only o.O UCPD page lists G4 series

AxxAxx commented 2 months ago

OK, haven't digged into it too much but here it says:

STM32 UCPD MCUs are compliant with the latest USB PD r3.1 specifications and support:

And lists STM32G4 series to have one UCPD interface Don't know.. :)

c0d3z3r0 commented 2 months ago

Yeah, maybe it only depends on the sw stack or the datasheet is outdated, no idea

c0d3z3r0 commented 2 months ago

At home again, so I could have another look....

W....T....F....

AxxAxx commented 2 months ago

Thanks for summarizing your finds! Indeed the information is a bit all over the place.

Maybe it will clear out with time as PD3.1 EPR is getting more mature

NightHawk32 commented 1 month ago

Power negotiation and dynamic power limiting is handled in #62