Sensor initialise position

I've made a self balancing robot using an MPU6050 sensor. I have calibrated it and found the offset values:

Sensor readings with offsets: 6 -6 16379 -4 0 0
My offsets: -400 -1330 855 67 -41 3
Data is printed as acelX acelY acelZ giroX giroY giroZ

My problem is that whenever I plug in the board, or reset the Arduino, the sensor changes the initialising position to be the "horizontal". I.e. if I reset the Arduino at 10°, then the robot will try balance around 10°.

Is there a way to initialise the robot so that it always tries to move towards the true horizontal 0° point, regardless of resets, etc.?


(The offset values were calibrated multiple times, they are not 0 as the sensor is at a slight fixed angle on the robot frame)

The offsets are intrinsic to the sensor and don't change with orientation. Think about turning the sensor 90deg on its side. Just subtracting offsets will subtract all the gravity signal.