In this series of articles, you will learn how to collaborate in the development of your drone for stable flight using the PX4 and RflySim platforms. All our development is done within a Windows environment, significantly reducing the entry barrier for beginners. I will introduce the control system of a quadcopter drone, explain how to build the drone control system in Simulink, perform digital co-simulation of the control system, simulate software-in-the-loop (SITL) and hardware-in-the-loop (HITL), and complete the entire development process for actual flight.
When you’re learning to fly a drone, making it follow your desired trajectory becomes the primary focus. Once you know how to operate a drone for flight, it creates a complete flying experience. When you start for the first time, gently push the control sticks, and the drone will make slight movements. As you become more proficient, you can perform more challenging maneuvers. (Note: For simplicity, this article assumes that the left stick controls yaw and throttle, while the right stick controls roll and pitch. Some remote controllers and receivers allow you to switch control modes according to your comfort).
In a quadcopter drone, the four propellers are numbered according to convention, as shown in the figure below, with #1 and #3 rotating counterclockwise, and #2 and #4 rotating clockwise. When we control the drone to fly in different attitudes, the controller adjusts the motor speeds accordingly.
Drones primarily have four attitude control channels:
Roll: Achieved by pushing the right stick to the left or right, controlling the drone’s lateral movement. This is accomplished by pushing the right stick on the controller to the left or right. It’s called “roll” because it effectively rolls the drone. For example, when you push the right control stick to the left, the flight control system simultaneously decreases the speed of propellers #3 and #4 while increasing the speed of propellers #1 and #2 by the same amount. This creates an unbalanced torque, causing the aircraft to roll and tilt to the left. Consequently, a lateral force is generated to the left. Simultaneously, the vertical component of lift decreases and is no longer equal to the weight of the multirotor. Therefore, it’s necessary to increase the speed of all four propellers to compensate for gravity, enabling horizontal leftward flight of the multirotor. The corresponding remote control operation for horizontal lateral movement is shown in the diagram.
Pitch: Achieved by pushing the right stick forward or backward, causing the drone to tilt and move forward or backward. For example, when you push the right control stick upward, the flight controller will simultaneously decrease the speed of propellers #1 and #4 by the same amount while decreasing the speed of propellers #2 and #3 by the same amount. This action results in the quadcopter pitching forward. Consequently, a forward force is generated. Simultaneously, the vertical component of lift decreases and is no longer equal to the weight of the multirotor. Therefore, it’s necessary to increase the speed of all four propellers to compensate for gravity, enabling horizontal forward flight of the multirotor.
Yaw: Achieved by pushing the left stick to the left or right, causing the drone to rotate to the left or right. Essentially, it makes the drone rotate clockwise or counterclockwise. For example, when you push the left control stick to the right, the drone will rotate clockwise. In this case, the flight controller will simultaneously decrease the speed of propellers #2 and #4 by the same amount while increasing the speed of propellers #1 and #3 by the same amount. This action balances the torque for both forward and backward flight as well as left and right flight. According to Newton’s third law, every action has an equal and opposite reaction. Therefore, since the counterclockwise speed of propellers #1 and #3 has increased, it results in an increased clockwise yaw torque. Conversely, the counterclockwise speed of propellers #2 and #4 has decreased, leading to a decreased counterclockwise yaw torque. Ultimately, this generates a clockwise yaw torque, causing the quadcopter to rotate clockwise.
Throttle: To increase the throttle, push the left control stick forward. To decrease it, pull the stick backward. This controls the drone’s altitude. During flight, you should always maintain proper throttle control. To increase the throttle, push the left control stick forward, and to decrease it, pull the stick backward. Ensure that you don’t cut the throttle completely until you’re a few inches above the ground. Otherwise, you might damage the drone, and your training will be cut short. For example, when you push the left control stick forward, the flight controller will simultaneously increase the speed of all four propellers by the same amount, increasing the total lift force generated by the propellers while keeping torque at zero. If the quadcopter is placed on a level surface, when the lift force exceeds gravity, the quadcopter will ascend. Otherwise, if all four propellers’ speeds are decreased by the same amount, the quadcopter will descend. The remote control operations for ascent and descent are shown in the diagram, with red arrows indicating throttle increase, and green arrows indicating throttle decrease.
Multicopter aircraft, though small like sparrows, are comprehensive in their capabilities. They span across eight primary disciplines, including mechanics, mechanical engineering, electronic science and technology, information and communication engineering, electrical engineering, instrumentation science and technology, control science and engineering, and computer science and technology. The characteristics of multicopter aircraft provide tangible and hands-on practical experience for these respective fields, especially in the realm of control practices.
For more detailed information, please visit https://doc.rflysim.com . The basic and advanced trial versions of RflySim can be obtained by providing your email address through the download link at https://rflysim.com/download . For the full-featured complete version, please inquire at email@example.com .