Yeah, you're doing it to yourself. Your "circadian rhythms" are messed up, it sounds like (look that up if you don't know the term). You've gotta get back into a better routine. Try laying off the caffeine, eating more regularly, and getting to bed at a more regular time and not sleeping so late. If you have to stay up all night and day for a couple of days till you're so dead tired you can barely stay awake, do that. Then once you can get to bed at a more decent nighttime hour and get some real sleep, you should be able to get yourself straightened out. Some people find that a supplement called melatonin helps with insomnia/circadian problems, but I don't know to use that supplement for that purpose. You could probably find out yourself on Google if you are interested enough to do so.