This is a basic quadcopter simulator built using Three.js as a fun weekend project. The simulator solves the nonlinear dynamics of a quadcopter, taking into account the equations of motion of the body, the dynamics of the four rotors and the battery charge. The included controller uses a simple proportional control in ACRO mode, controlling angular rates based on linearized dynamics, without any thrust compensation.
The easiest way to run the simulator is from your web browser The simulator will render a 3D quadcopter model, and you can control it using a keyboard (WASD for roll/pitch, arrows for thrust/yaw).
As this is a weekend project, several assumptions were made to simplify the model:
These assumptions have a strong influence on the accuracy of the simulation. Note that this simulator is a basic implementation and may not be entirely accurate or realistic. It is intended for experimental purposes only.
[1] A. Gibiansky, βQuadcopter dynamics, simulation and controlβ, Blog, 2012
[2] E. Gopalakrishnan, βQuadcopter flight mechanics model and control algorithmsβ, Master Thesis, Czech Technical University, Prague, 2016
[3] L.F.M. Mendoza et al., βTrajectories generation for unmanned aerial vehicles based on obstacle avoidance located by a visual sensing systemβ, Mathematics 2023, 11(6), 1413
Other useful resources: