I recently bought a new HP Pavillion laptop (AMD Ryzen 5 processor, Radeon Vega Mobile graphics, and 12GB of RAM) and installed Kubuntu 18.04 alongside Windows 10. Ubuntu runs perfectly fine when the laptop boots while plugged in, but when it boots on battery it runs considerably slower and crashes after attempting some actions, such as opening or closing some programs. However, if the laptop booted while plugged in and I then unplug it it keeps working fine, and the corresponding opposite happens when it boots on battery and I then plug it in. Windows has no such problems; it runs fine whether on battery or plugged. This makes me think the problem likely comes from some process Ubuntu sets on boot or something.
Furthermore, the OS doesn't seem to interact well with the battery in general, as it shows the wrong amount of charge in the taskbar (e.g. 85% when it's been charging all day) and running the command upower -i /org/freedesktop/Upower/devices/battery_BATO returns the following, which diverges pretty significantly from the result that the webpage I got the command from obtained:
power supply: no
updated: mié 31 dic 1969 18:00:00 CST (1583787746 seconds ago)
has history: no
has statistics: no
Finally, I should mention that when I originally installed Kubuntu, it would fail to load the desktop completely when on battery, and this was solved by going into the BIOS -> system configuration and setting battery remaining time to enabled.
Hope someone can help me with this.