Memuat
Memuat
Watch every step above performed live, with English narration.
0 plays
Class book
Page 1 / 7
Cover: Class Quadrotor Control Sliding Mode Control #1: 6-DOF Quadrotor Dynamic Model
Click a page or use ◀ ▶ to turn · swipe on mobile · to enlarge
Want to go deeper?
Join one of our courses or ask us directly on WhatsApp.
Picked from the software, topic, and level of “Class Quadrotor Control Sliding Mode Control #1: 6-DOF Quadrotor Dynamic Model”.
Other ways we can help with Python.
Learn with a mentor
Scheduled Simulation & Engineering courses with live guidance and a certificate.

Course/Training Ansys ~ Heat Transfer and Heat Flux Analysis
★ 5.0 (10)

Course/Training MATLAB — MATLAB App Design: The Ultimate Guide to MATLAB Apps
★ 5.0 (10)

Course/Training Ansys — Airflow Simulation of a Car Radiator with ANSYS
★ 5.0 (9)
Have it built for you
No time to learn Python? Our team can do the project for you.

Matlab Development Service — Complete Neural Signal Processing and Analysis Zero to Hero
★ 5.0 (59)

Ansys Maxwell Development Service
★ 5.0 (50)

Petrel Development Service
★ 5.0 (14)
Get notified about new Python classes
At most one email a week. Unfollow anytime with one click.
The full narration of this video. The current sentence is highlighted while the video plays; click any sentence to jump there.
This is the final result, a 6-degree-of-freedom quadrotor dynamics model that we wrote ourselves with Python, and it has been proven to be accurate, hovering still when the thrust equals the weight, free-falling exactly as per the formula, and moving sideways when tilted. Let's get started. Hello, welcome to the research tutorial series, quadrotor UAV stability control with integrated sliding mode control and observer. A quadrotor is an inherently unstable system and easily disturbed by wind, so it requires strong control. In this 6-episode series, we build everything from scratch, dynamics model, PID, sliding mode control theory, SMC for quadrotor, disturbance observer for wind, up to 3D trajectory testing. In the first episode, we model the quadrotor.
We open the terminal through the terminal menu, new terminal, then install numpy and matplotlib. This series does not require any special simulation libraries, we write all the quadrotor physics ourselves so that every equation is clearly visible.
Create a file called quadrotor.py Physical parameters, mass 1.2 kg, moment of inertia for the roll axis, peak, and yo, arm length, as well as thrust limits and motor torque limits. The rotation function creates a matrix that transforms vectors from the drone's body frame to the earth frame, with the order yo, peak, roll. This matrix explains why pushing upwards becomes a lateral force when the drone tilts.
The derivative function is the core of the model. The quadrotor state consists of 12 numbers, position, velocity, 3 Euler angles, and 3 angular velocities. Linear acceleration comes from the thrust rotated into the earth frame, minus gravity, plus disturbance forces like wind. Euler angular velocity is calculated from the body angular velocity, and angular acceleration comes from the Euler equations for rigid bodies. The constraint function keeps thrust and moments within motor limits, and the step function integrates everything with fourth-order Runge-Kutta.
Create a test file named underscore_model_dot_py and run 3 tests. With correct thrust equal to weight, 11.77 N, height remains 0 after 2 seconds. Without thrust, the quadrotor falls 19.62 meters, exactly matching the half GT squared formula. Roll moment 0.01 Nm creates a roll angle of 0.4065 radians after 1 second, exactly the same as theory. Our model is correct. Check the graph.
Hover remains level and free fall forms a parabola. The roll angle keeps increasing because nothing is holding it. And as a result, the quadrotor shifts sideways almost 5 meters in 2 seconds. This is the inherent instability of a quadrotor. Without control, a slight disturbance causes it to flip and fall.
Done. We have modeled a 6-degree-of-freedom quadrotor with rotation matrices, translation and rotation equations, motor limits, and Runge-Kutta integration, then validated it with 3 physical tests. In the next episode, we will fly it with a hierarchical PI controller. Currently working on a thesis, dissertation, or research in the field of control systems, drones, and UAVs. Cerdas Inovasi Digital helps implement control systems. From 6-degree-of-freedom quadrotor modeling, hierarchical PI control, sliding mode control, up to disturbance observer for wind as well as opening a Python programming course for electrical and mechatronics engineering. Want to master the entire series, from the quadrotor model up to 3D path testing with wind? All 6 episodes, complete with step-by-step PDF guides and source code, are available to premium tutorial subscribers. Subscribe starting at Rp69.000 per month, save 28% with the 12-month package, or pay once Rp999.000 for lifetime access. Want just one class? Buy the single class with lifetime access. Subscribe now on the premium page cerdasinovasidigital.com. Contact our WhatsApp, or visit cerdasinovasidigital.com. Thank you for watching, see you in the next episode. Thank you for watching,
Type a question or keyword; we find the part of this episode that explains it and jump the video there.
Notes are saved with the current video time and are only visible to you.
Stuck on a step? Ask here; the instructor and other learners can answer.
No questions yet.

Cerdas Inovasi Digital Team
Software developers, BIM & 3D engineers, and AI practitioners
We build software, BIM models, games and AI automations for clients every day, and turn that hands-on work into step-by-step classes: every step is shown on screen and comes with a PDF guide you can keep.
See our clients →