At first, I make a uniaxial one：motion sensor installed on the base, and the servo arm supporting the upper platform.
The following is the program:
The following is the address of the video：
The next is the biaxial one.
The program is to calculate the current motion angle through the background algorithm, and then use the servo to make motion compensation for the attitude angle, to make the upper platform stay level all the time.
The following is the address of the video of the biaxial ：