I have not used such a sensor but I am disturbed by the choice of its place - on the head !? Wouldn't it be better on the dupe (or at least close to it) for this purpose? Also, if I understand your program correctly, you only read the angular deviations from the gyroscope. It seems more logical for me to read the accelerations from the accelerometer (for just getting up and sitting).