For some reason what has always worked for me is just abandoning rational thought entirely and working day-to-day.
I go into a project thinking "I bet I can get 50% to 100% of this thing done today" and that's almost never the case, but the thought of it gets me excited. That's all the motivation I need. I work like crazy until I'm ready to stop working. I say "Wow I sure made a lot of progress. Tomorrow I'll probably finish it off." feeling satisfied. This repeats forever. Maybe it's a kind of madness, but it gets the job done!
Design each two week goal so that you get a dopamine rush from doing it, get some value out of it, and it also helps your long term goal.
I share my attempt at doing just that here: https://www.zainrizvi.io/blog/do-more-by-doing-less/