Could be cortisol cycling gone bad... cortisol (adrenals) controls sleep/wake cycles ... magnesium plays a key role
I would start with a test from traceelements.com... this test is very affordable and non-invasive. It helped me tremendously in identifying the underlying cause and provides guidance from a nutritional perspective.
I suspect problems with the calcium/magnesium balance and sodium/potassium areas.