I like to be challenged, so when everything goes awry and I have no clue on how to solve something extremely important, that usually motivates me.
I also like it when someone says:"That's impossible!"
I like to prove them wrong. Time and time again
Freedom and having a fair amount of control on the solution direction strengthens my motivation, bureaucracy and too much dependency on others demotivates it .
Cheers!