Arduino MPU6050 or MPU9250 Height Control

Hello to everyone. Trying to do quadcopter with arduino. I was unable to stabilize the MPU6050. How to stabilize the floor to a height of 20 cm from the ground. I'd appreciate it if you could help me out.

4 DC MOTOR
ARDUINO PRO MICRO
MPU 6050

The MPU6050 doesn't have a barometric altimeter so you can't use it for maintaining altitude.

I'd appreciate it if you could help me out.

Sure. Connect the MPU 6050 to the Arduino using very stiff 20 cm wires. Then, glue the MPU 6050 to the floor. Mission accomplished.

There would be no pressing need to glue the MPU6050 to the floor.

It could easily detect contact with the floor, as well as sliding along the floor, etc. and could thus would serve as a fine altitude reference.

A TOF device such as a LIDAR would give you quick and nicely precise distance readings at that range to help hold your quadcopter at the desired altitude. I like the TFMini.

pcparticle:
I was unable to stabilize the MPU6050. How to stabilize the floor to a height of 20 cm from the ground.

MPU6050 is an accelerometer & gyroscope & you can't get altitude using it. What you need is something like BMP085 which is a barometric pressure sensor, also called altitude sensor. It will help.