New Post: Librem 14 Runtime and Charging

Check out this post and video for all of our L14 battery tests and results:
https://puri.sm/posts/librem-14-runtime-and-charging/

8 Likes

The second video is corrupted
https://videos.puri.sm/promo/L14_half_screen.mp4?_=2

2 Likes

I downloaded it and tried it with VLC on android. It says the video 10s long and has a high resolution (wider than 4500 pixels). When playing it the screen shows a static picture.

It’s indeed 10 sec long with 4592x2584. However, for me playing it with either Firefox, mpv or VLC works just fine (although that’s on a PC).

1 Like

Re-uploaded in 1920x1080. It should work fine now.

2 Likes

i appreciate the talent and work that has gone into this piece of machinery with the only exception being the i-ME blackbox code that is still present but disabled ^^

it’s great that the battery and efficiency of this machine holds up to modern time expectations set by ‘others’ that shall NOT be named :wink: but unfortunately i can NOT confirm these claims since i haven’t gotten my L14 yet and neither have i received any shipping NOW notifications.

while my mouth is watery and this machine looks yummy i can only watch …

1 Like

Hi @david.hamner ,

You mention in the post that the L14 comes with a 66.8 Wh battery. Is there a reason upower reports a full battery as 52.8 Wh?

$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep energy-full-design
    energy-full-design:    52.8 Wh
$

Set to fill to 80%?

Is that a setting you are referring to?

$ cat /sys/class/power_supply/BAT0/charge_control_start_threshold 
63
$ cat /sys/class/power_supply/BAT0/charge_control_end_threshold 
100
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep energy-full-design
    energy-full-design:  52.8 Wh
$ 

Not so much a setting as just pointing out that 52.8 Wh / 66.8 Wh is 79%

well, first we’d want to know where upower is getting that value / how it’s calculating that value, since it’s not directly reported by the battery/EC. The battery/EC reports the charge_full/charge_full_design values in mAh, which for the L14 4-cell battery is 8800 mAh

I dug into the upower code to figure out where this value is coming from. upower is using the voltage_min_design value (6 V) with the charge_full_design (8800 mAh) value to calculate the energy_full_design value (8800 mAh * 6V = 52.8 Wh).

...
/* used to convert A to W later */
	voltage_design = up_device_supply_get_design_voltage (supply, native);
...
		/* these don't change at runtime */
		energy_full = g_udev_device_get_sysfs_attr_as_double_uncached (native, "energy_full") / 1000000.0;
		energy_full_design = g_udev_device_get_sysfs_attr_as_double_uncached (native, "energy_full_design") / 1000000.0;

		/* convert charge to energy */
		if (energy_full < 0.01) {
			energy_full = g_udev_device_get_sysfs_attr_as_double_uncached (native, "charge_full") / 1000000.0;
			energy_full_design = g_udev_device_get_sysfs_attr_as_double_uncached (native, "charge_full_design") / 1000000.0;
			energy_full *= voltage_design;
			energy_full_design *= voltage_design;
                        ...
		}

where the up_device_supply_get_design_voltage method prioritizes using the voltage_min_design value before the voltage_now value:

/**
 * up_device_supply_get_design_voltage:
 **/
static gdouble
up_device_supply_get_design_voltage (UpDeviceSupply *device,
				     GUdevDevice *native)
{
	gdouble voltage;
	gchar *device_type = NULL;

	/* design maximum */
	voltage = g_udev_device_get_sysfs_attr_as_double_uncached (native, "voltage_max_design") / 1000000.0;
	if (voltage > 1.00f) {
		g_debug ("using max design voltage");
		goto out;
	}

	/* design minimum */
	voltage = g_udev_device_get_sysfs_attr_as_double_uncached (native, "voltage_min_design") / 1000000.0;
	if (voltage > 1.00f) {
		g_debug ("using min design voltage");
		goto out;
	}

	/* current voltage */
	voltage = g_udev_device_get_sysfs_attr_as_double_uncached (native, "voltage_present") / 1000000.0;
	if (voltage > 1.00f) {
		g_debug ("using present voltage");
		goto out;
	}

	/* current voltage, alternate form */
	voltage = g_udev_device_get_sysfs_attr_as_double_uncached (native, "voltage_now") / 1000000.0;
	if (voltage > 1.00f) {
		g_debug ("using present voltage (alternate)");
		goto out;
	}

	/* is this a USB device? */
	device_type = up_device_supply_get_string (native, "type");
	if (device_type != NULL && g_ascii_strcasecmp (device_type, "USB") == 0) {
		g_debug ("USB device, so assuming 5v");
		voltage = 5.0f;
		goto out;
	}

	/* no valid value found; display a warning the first time for each
	 * device */
	if (!device->priv->shown_invalid_voltage_warning) {
		device->priv->shown_invalid_voltage_warning = TRUE;
		g_warning ("no valid voltage value found for device %s, assuming 10V",
			   g_udev_device_get_sysfs_path (native));
	}
	/* completely guess, to avoid getting zero values */
	g_debug ("no voltage values for device %s, using 10V as approximation",
		 g_udev_device_get_sysfs_path (native));
	voltage = 10.0f;
out:
	g_free (device_type);
	return voltage;
}

From https://cgit.freedesktop.org/upower/tree/src/linux/up-device-supply.c#n637

2 Likes

it doesn’t make sense to me that they would use the voltage_min_design value only for that calculation. It should be (voltage_min_design + voltage_max_design) / 2 * charge_full_design. Which is (6.0 + 8.7) /2 * 8800 ~= 64.7 Wh

Not sure; don’t disagree there. Looks like it’s been this way since at least 2009: https://cgit.freedesktop.org/upower/commit/src/linux/dkp-device-supply.c?id=bf9758fabf722203e725a24af70c2c05872b21ce

I don’t see the voltage_max_design attribute in /sys/class/power_supply/BAT0/, for what it’s worth:

$ ls /sys/class/power_supply/BAT0/voltage*
/sys/class/power_supply/BAT0/voltage_min_design
/sys/class/power_supply/BAT0/voltage_now
$

At least this explains where the 52.8 Wh value is coming from.

Maybe that’s why the code is not using it. :wink: