This is called a Hypnic Jerk

I get this too when I lay down for extended periods of time on my back