I have a program which contains the auto take off and landing function in the Semi-Auto mode for my Quad using the APM board with the Sonar sensor LV EZ0. My approach is by sensing the height from the sonar sensor for the auto take off and landing.
For the Auto take off function, it will be activated when the height value from the Sonar is less than 16cm from ground and by pushing the throttle stick to the middle position. This function currently works fine for my Quad.
The problem I faced is with the Auto Landing function of my Quad. The auto landing function is activated by pushing the throttle stick all the way down. The moment I activate the auto landing function, the Quad will decrease in altitude from the altitude hold height around 1 meter to 15cm. The problem I faced is that the Quad will maintain at 15cm in height and the motor will only stop after maintaining at that height for 10-15 seconds and the Quad will just drop from 15cm to the ground.
How can I go about improving the auto landing function so that my Quad will have a smooth landing and not a sudden drop from 15cm in height?