This platform can determine the angle of the upper platform according to the acceleration of its base, to ensure the objects on the upper platform will not be affected by acceleration.
The following is the program：
At first, collect the acceleration on the vertical axis and horizontal axis, and then operate trigonometric function calculation to work out the direction of the resultant force. Then assign the direction and the change rate of the resultant force to the servo to make the upper platform perpendicular to the direction of the resultant force all the time.
The following is the video：