UAV Systems Engineering · Interactive simulation · M1-L1
Quadrotor Dynamics Simulator
A full rigid-body quadrotor in your browser: tilt it, push it with wind, and see when the controller and the motors run out of authority.
What you are looking at
The vehicle starts in a hover at the target height with the initial roll, pitch and yaw you choose. Cascaded controllers bring it back: a position loop turns position error into a desired tilt, an attitude PID turns tilt error into torque, and the motor mixer turns thrust and torque into four motor thrusts. Each motor follows its command through a first-order lag.
The animation shows the vehicle (orange line = body forward axis, bars = motor thrust). The plots show attitude, motor thrusts against the saturation limit, and position. The statistics report peak tilt, settling time, how long any motor was saturated, and the thrust-to-weight ratio.
Try this
- Set the initial roll to 55°. Lower the maximum thrust per motor until the thrust-to-weight ratio is near 1.2 and watch the motors saturate.
- Set Ki to 0 and add 3 N of wind. Then add the integral gain back and compare the steady-state offset (in this model the integral acts on attitude, so the horizontal offset persists: position needs its own integrator).
- Increase the motor time constant to 0.12 s with the default gains. The lag adds phase delay to the attitude loop: find the point at which the response starts to oscillate.
- Raise Kd to 15 and lower Kp to 5: a heavily damped, slow attitude loop. What happens to peak tilt after a 40° initial error?
- Double the mass without raising maximum thrust. What is the thrust-to-weight ratio, and why does a ratio near 1.2 leave no room to correct attitude?
Model and its limits
Included: rigid-body translation and rotation (Newton–Euler, ZYX Euler angles), an X-configuration mixer, per-motor thrust limits and first-order lag, linear plus quadratic drag, a sinusoidally varying wind force, and a mixer that drops yaw first when saturated. Inertia is scaled from a typical 2 kg, 0.25 m-arm vehicle (illustrative, not a measured value).
Not included: propeller aerodynamics (thrust is applied directly, not derived from rotor speed squared), battery voltage sag, ground effect, gyroscopic rotor torques, sensor noise and estimator delay, or a real autopilot’s rate-controller details. Euler angles are used for clarity and are singular at ±90° pitch; real autopilots use quaternions (lesson M5-T4).
Saved in this browser and synced to your account when you are signed in.