When you do feel motivation and work on something for some time, leave something undone at the end to pick up on. Something small to get the ball rolling.
Look after the big issues in your life. If there's something looming or lurking, you may procrastinate (which might look like enthusiasm for a diversion) but only at a surface level, like your brain is fidgeting trying to keep your mind off the big bad thing(s).
For something like a PhD, I think it's unusual for internal motivation to last. Most people I know who've completed did it to get it done, rather than relying on internal motivation. They were so sick of the material by the end that enthusiasm had worn away, like a mouthful of food chewed for too long.