I tried a new power board, but the problem persisted. So what was it in the end? A loose connection, it seems, between the pad(?), the grey thing that runs from the motherboard , under the XO☐△ buttons and into the powerboard and the motherboard. When I pressed down on that cable close to the motherboard the charge light would go off. I disconnected it and reconnected it, and the problem went away. Thanks to all who read and thought about this question.