PowerBook G4 Suddenly went to sleep

hi guys at first i though it’s because the battery was hot but apparently more and more often when i’m in the middle of something my powerbook g4 just went to sleep suddenly even though I plug it in my computer…

anyone know why and how to fix it ?

it’s a PoweBook G4 (Tiger OS X)