Limit USB-C port's PD power draw

Hello, I would like to ask whether it is technically possible to limit Framework Laptop 13(AMD 7040 series)'s power draw from the type-C port from software/firmware/embedded controller even if the power source support higher charging wattage.

I would like to prevent the laptop from draining my power bank too fast.

Thanks in advance!

It’ll just charge up the laptops battery, so it’s not as if the power is just gone. Or you’re actually using it because CPU/whatever is running and crunching whatever. So I think the proper question is what are you doing that’s causing the laptop to use more power. If you’re playing a game or doing number crunching, that’s just reality.

If you’re doing very little with modest screen brightness, might be something unexpected and possibly unwanted running in the background.Fix that, and your battery life will improve.

If there’s nothing to fix… Get a 2nd battery pack of a larger one. I can’t think of a reason why you’d be worried about an external battery pack having charge when it’s just going into the laptops battery. I’m curious if there is one that isn’t occurring to me.

I want my power bank to be able to charge my other devices while keeping the laptop’s battery at a relatively high capacity. I don’t need to charge the laptop to 100% while I’m outside.

Can’t you charge your other devices from the FW in that case?

Also, if it’s already at or near 100% before you put it on the external battery, it won’t use any more power than the laptop is actually using to run itself. Otherwise it’ll start to run down it’s internal battery.

Basically you’re talking about current (or voltage) limiting below the capabilities of external battery pack, which is not something USB-PD is really designed to do. Maybe, just maybe, with the EC FW can talk to the CC/CV charging chip in the laptop and tell it to pull less current. But I don’t know that anyone has ever thought that’d be something they want to do.

Alternatively…just unplug the laptop until it gets low, then plug it in. It’ll effectively be the same, more or less. Only draining the external battery when you want it to.

with “ectool” you can set “chargecurrentlimit”, see Exploring the Embedded Controller

3 Likes

Wow, I had no idea, that’s awesome.

Specifically this comment Exploring the Embedded Controller - #78 by Nils

And full documentation appears to be up at The Framework Laptop's Embedded Controller (EC) :: HowettNET

1 Like

The power bank supports more voltage/current combinations then the Framework Laptop’s type-C port and is preferred to be used.

But I don’t know that anyone has ever thought that’d be something they want to do.

It is quite common for (rooted) Android devices to expose a current_max sysfs entry to limit the input power.

While that option sure is helpful it is slightly different from what I needed in this post, which is to limit the maximum power draw instead of the maximum battery capacity to stop charging.

What I hope to see is the functionality to tell the PMIC to only draw as much as 30/45/60W, even if the power supply itself is capable of outputting more wattage like 100W.

It is in fact what you wanted - there is both!

  • “ectool chargecurrentlimit” is the power draw limit (… if you factor in the charge voltage)
  • “ectool fwchargelimit” is the battery level limit
4 Likes

I overlooked that one, thanks for mentioning it!

I have a UBS-C charger for my car that gets absurdly hot if I leave it plugged in too long.

The real problem is the electrical connection between the 12v socket and the charger’s plug. I know the sockets were designed for cigarette lighters, but it still makes me uncomfortable when it gets too hot to touch, because cigarette lighters disconnected themselves when they got too hot, and I don’t trust my charger to understand how hot the plug is getting.

I’ve tried two chargers and they both have this problem. It’s a defect of the chargers, IMO, but until I find one that doesn’t suck, limiting the laptop’s charge current would be the next-best-thing.

Now I just need a Windows version of ectool…

Depending on how much you want to limit it, using an unmarked marked cable may already be enough (limits to 3.25A).

1 Like

Did they still get hot when no device is connected to the output?

No, it stays cold until/unless I plug my laptop into it.

I hadn’t thought of cables as a power limiter but I’ll have to look into that.

For power purposes there are basically 3 kinds (usb-c cables can contain a little e-marker chip that tells the charger and devices of it’s capabilities), unmarked cables can do up to 20V 3.25A, then there are 5A cables (also refereed to as 100W cables) and “240W” cables that are marked for 5A and extended voltage range up to 48V. For limiting current you only really have the granularity of choosing between 3.25A and 5A by limiting cables (unless someone made extended power range car chargers already).

1 Like

Thanks for the info. The charger is rated at 90 watts, and limiting it to 65 watts would probably help somewhat, but I was really hoping to bring it down much further.

It’s fine if the laptop is already charged, because then it only pulls a little bit of power… but if I plug it in with a low battery, the cigarette-lighter plug seems hot enough to actually light a cigarette. Which might be acceptable, if I had some reason to believe that the temperature was going to stop climbing before starting a fire on its own. :slight_smile:

The contacts are clean and shiny and wiggling the connector doesn’t make a difference in the heat, so I don’t think that connection is going to get any better. I’m halfway tempted to try to make something that sits between the lighter socket and the charger plug and cycles the power, like 10 seconds on, 20 seconds off. It would charge slower of course, but at least it would charge safely.

What shape are the contacts?

Sometimes cigarette-lighter socket devices have metal contacts which a bent in one direction, like a cylinder, others have contacts formed into a partial sphere. The later may only provide a tiny point of contact. Draw current though a narrow choke point, and you’ve made a resistor. Enter high amps and you can get a lot of heating.

If you’re thinking of making something, perhaps you could make something to provide a wider contact area. Or at least more points of contact.

If it’s any consolation, pretty much all the dc-pd chipsets I have played with had thermal self protections. Outside of putting batteries in the wrong way I have not managed to get one of them to actually destroy itself by overheating, either it kept throttling the power or just cut out but they always came back when they cooled back down.

Also human perception of temperature isn’t great, do you know how hot it is actually getting?

That sounds extremely barbaric and with how well the pd controller in the fw is programmed I am allmost certain it’d get confused at some point from the constant renegs.

1 Like

A PWM with 33% duty and 0.0333Hz frequency

You can use ectool
$ sudo ectool chargestate param 2 1000
This will lower the PD input current to1A

Beside using an unmarked cable that is probably the best solution. At least infinitely better than “PWM” idea.

1 Like