Flight Controller
Flight Controller
CONTROLLER
BY PRIYANSHU KOTIYAL
BIBLIOGRAPHY
I have used several resources like different websites, AI models, Certain pdfs and
many more websites.
Different websites include:-
www.mouser.com
www.researchgate.com
www.robolink.com
www.wikipedia.com
www.electronicswing.com
www.towardsdatascience.com
www.kalmanfilter.net
www.renesas.com
www.gunjanpatel.wordpress.com
The mechanism of drones, breaking down their key components and how they work
together to achieve flight are:-
1. Power Source: The heart of any drone is its power source. Most commonly,
drones utilize rechargeable lithium-ion batteries, similar to those found in laptops and
smartphones. These batteries provide the electricity needed to run the motors and
other onboard electronics. The flight time of a drone is directly related to the capacity
of its battery, with larger batteries enabling longer flights.
2. Motors and Propellers: The thrust that propels the drone upwards comes from
its motors and propellers. Most drones are multi-rotors, meaning they have several
small motors mounted on arms extending from the central body. Each motor is
attached to a propeller, which spins rapidly to generate lift. The number and
configuration of propellers vary depending on the size and type of drone. For
example, smaller hobbyist drones typically have four propellers arranged in a
quadcopter configuration, while larger commercial drones might have six or eight
propellers in a hexacopter or octocopter configuration.
3. Flight Controller: The brain of the drone is its flight controller, a small computer
responsible for maintaining stability and controlling the drone's movement. The flight
controller receives input from various sensors, such as accelerometers, gyroscopes,
and magnetometers, which provide information about the drone's position,
orientation, and movement. Based on this data, the flight controller calculates the
necessary adjustments to the motor speeds and propeller angles to keep the drone
stable and maneuver it as desired.
ROLL
Roll, in the world of drones, refers to the tilting of the drone from side to side along its
longitudinal axis. Imagine the drone standing upright like a person; rolling is like
leaning to the left or right. This movement is distinct from pitch (tilting forward or
backward) and yaw (spinning left or right).
The way a drone rolls depends on its specific design and control system. Most
commonly, roll is controlled by adjusting the speeds of individual propellers. For
example, to roll left, the propellers on the right side might be sped up while the
propellers on the left side are slowed down. This creates a difference in lift forces on
each side, causing the drone to tilt in the desired direction.
PITCH
"Pitch" refers to the rotation of a drone around its lateral axis (side-to-side). It's one
of the three primary rotational movements that control a drone's orientation in space,
along with yaw and roll.
• Control: Pitch is typically controlled by adjusting the speed of the front and
rear motors.
• Forward Tilt: Increasing the speed of the rear motors relative to the front
motors causes the drone to pitch forward, tilting its nose downwards.
• Backward Tilt: Conversely, increasing the speed of the front motors relative to
the rear motors causes the drone to pitch backward, tilting its nose upwards.
• Level Flight: Equal thrust from all motors maintains a level pitch, keeping the
drone flying horizontally.
• Ascent and Descent: Pitch is essential for controlling a drone's altitude. Tilting
the nose upwards initiates a climb, while tilting it downwards initiates a
descent.
• Forward and Backward Movement: Pitch also plays a role in forward and
backward movement, as it affects the drone's angle of attack relative to the
airflow.
• FPV Camera Control: In drones with first-person-view (FPV) cameras, pitch
control allows you to adjust the camera's angle, directing its view up or down.
• Acrobatic Maneuvers: Experienced drone pilots use pitch control to perform
various acrobatic maneuvers, such as flips, rolls, and dives.
YAW
Yaw refers to the rotation of the drone around its vertical axis. Imagine
the drone standing upright, like a person. Yawing is the movement where
the drone spins left or right, like it's twisting its body. It's different from
pitch (tilting forward or backward) and roll (tilting sideways).
• Change direction: By yawing, a drone can quickly turn left or right without
losing altitude or changing its forward speed. This is essential for
maneuvering around obstacles, following a curved path, or simply changing
its heading.
• Stay stable: Drones use yaw to maintain their balance and
orientation. Gyroscopes and other sensors detect any unwanted yaw
movements, and the flight controller automatically adjusts the motor speeds to
compensate.
• Perform certain maneuvers: Some advanced drone maneuvers, like spins and
barrel rolls, involve rapid yaw movements.
• The yaw rate, or how quickly the drone spins, can be controlled by the
pilot. Most drone controllers have a dedicated yaw control stick or button.
• Yaw can be combined with other movements, such as pitch and roll, to create
complex maneuvers.
• Yawing can be affected by wind and other environmental factors. Pilots need
to be aware of these factors and adjust their controls accordingly.
Throttle
Throttle, in the context of drones, refers to the control of the overall power output of
the drone's motors. It essentially governs the drone's altitude and vertical movement.
• Increasing throttle: More power is sent to the motors, causing the propellers to
spin faster. This generates an increased downward thrust, lifting the drone
and making it ascend.
• Decreasing throttle: Less power is sent to the motors, slowing down the
propellers. The downward thrust also reduces, causing the drone to descend.
• Maintaining throttle: A constant level of power is sent to the motors, allowing
the drone to hover at a specific altitude.
Throttle is one of the most fundamental controls for flying a drone. Pilots constantly
adjust the throttle throughout the flight to maneuver the drone up, down, and
maintain its desired altitude. Here are some key points to remember about throttle:
• Smoothness is key: Jerky throttle movements can make the drone unstable
and difficult to control.
• Throttle sensitivity: Different drones have different throttle
sensitivities, meaning how much the drone ascends or descends with each
small adjustment.
• Throttle management: Efficient throttle control is crucial for maximizing flight
time and preventing battery drain.
• Safety considerations: Be cautious with aggressive throttle
movements, especially near the ground or obstacles, to avoid crashes.
What is a flight controller? Why it is needed in
drones?
The flight controller is the brain or central nervous system of the drone. It's a small
computer board packed with sensors, software, and communication interfaces that
manage and control every aspect of the drone's flight. Here's why it's absolutely
essential:
Importance of the Flight Controller:
The MPU6050 is a popular and versatile inertial measurement unit (IMU), meaning it
combines two sensor types: a 3-axis gyroscope and a 3-axis accelerometer. These
sensors work together to provide valuable information about the motion and
orientation of the device they're mounted on.
Gyroscope:
Accelerometer:
By combining the gyroscope's rotational data with the accelerometer's linear data,
the MPU6050 provides a comprehensive understanding of the device's motion and
orientation in 6 degrees of freedom (6 DoF). This makes it incredibly valuable for
various applications, including:
• Drone flight control: Drones use the MPU6050 to maintain stability, balance,
and precise control during flight.
• Virtual reality (VR) headsets: The MPU6050 tracks head movements for
immersive VR experiences.
• Robot navigation: Robots rely on the MPU6050 for precise movement and
obstacle avoidance.
• Gaming controllers: Motion-controlled games utilize the MPU6050 for gesture
recognition and control.
• Wearable devices: Fitness trackers and smartwatches can use the MPU6050
to track steps, activity levels, and orientation.
BLDC motors vs BDC motors, why BLDC is
used in case of drones?
Brushless Dc motor(BLDC)
3. Combines Corrections: The PID controller sums these three terms to create a
total output correction signal.
4. Applies Correction: This correction signal is then sent to the system's actuator
(e.g., a motor, valve, or heater) to adjust its behavior and bring the process
variable closer to the desired setpoint.
• The magic lies in tuning the three PID constants (Kp, Ki, Kd) to achieve
optimal control for a specific system.
• These constants determine how strongly the controller reacts to each term,
influencing its responsiveness, stability, and accuracy.
Common Applications:
PID controllers are incredibly versatile and found in countless applications, including:
Propeller pitch and rotation direction (clockwise vs. counterclockwise) play crucial
roles in generating thrust and controlling the drone's movement. Here is how they
work:
Propeller Pitch:
• Imagine the propeller as a screw. Pitch refers to the angle of the blades
relative to the plane of rotation. A higher pitch angle means the blades are
"screwing" more air, creating more forward thrust. Conversely, a lower pitch
angle creates less thrust but allows for higher rotational speeds.
• Adjusting the pitch angle of the propellers affects the amount of thrust
generated. Increasing the pitch on all rotors provides more lift for takeoff and
climbing. Decreasing the pitch can offer smoother control and longer flight
times.
• Combining pitch adjustments with different rotation directions allows for fine-
tuning the drone's movement. For example, tilting the CW rotors more while
slightly reducing pitch on the CCW rotors can initiate a turn to the right.
How to assemble/ make pixhawk drone? Learn
about telemetry escs, gcs
"Pixhawk drone" refers to any drone built using the Pixhawk flight controller. These
drones come in various configurations, sizes, and capabilities, depending on the
specific components chosen and how they're assembled.
• Frame: Choose a frame compatible with the desired drone size and payload
capacity. Popular options include quadcopters, hexacopters, and octocopters.
• Motors and ESCs: Select brushless DC motors and Electronic Speed
Controllers (ESCs) matched to the frame size and weight, ensuring the ESCs
handle the motor's current draw.
• Propellers: Propeller size and pitch should be compatible with the motors and
desired flight characteristics.
• Pixhawk Flight Controller: Choose the appropriate Pixhawk model based on
features and sensors needed.
• Power Supply: Select a lipo battery with sufficient voltage and amperage to
power the drone efficiently.
• Radio and Receiver: Choose a compatible radio system for controlling the
drone from a handheld transmitter.
• Telemetry Module: Enables real-time data exchange between the drone and
the Ground Control Station (GCS).
Key Terms:
• Telemetry: Allows for real-time data transfer between the drone and the GCS,
including flight parameters, battery voltage, GPS location, and more. This aids
in monitoring and controlling the drone effectively.
• ESCs (Electronic Speed Controllers): These regulate the power to the
brushless DC motors, enabling precise control over their speed and direction.
• GCS (Ground Control Station): Software running on a computer or tablet
used to configure, monitor, and control the drone.
PWM vs PPM Signals: Controlling Your Drone's
Movements
Both PWM (Pulse Width Modulation) and PPM (Pulse Position Modulation) are
signaling techniques used to control the motion of drone motors and other devices.
PWM:
PPM:
• Function: PPM combines several PWM signals into a single pulse train. Each
channel is represented by the position of its corresponding pulse within the
train. The delay between pulse starts determines the control signal for each
motor.
• Implementation: Requires only one wire for all motors, making it ideal for
lightweight drones and simplifying wiring.
• Limited channels: The number of channels supported by PPM is generally
lower than with PWM, restricting the variety of control options available.
• Jitter sensitivity: PPM signals are more sensitive to timing variations
(jitter), which can affect motor response and drone stability.
The optimal choice between PWM and PPM depends on your specific needs and
priorities:
• Precise control and multiple motors: Use PWM for drones requiring fine-tuned
control of individual motors, like racing drones or those with complex
maneuvers.
• Lightweight and simple setup: Choose PPM for smaller drones where weight
and wiring complexity are crucial, or for applications where simpler control
suffices.
Additional factors:
• Compatibility: Ensure your flight controller and other electronics support the
chosen signal type.
• Performance requirements: Consider the level of responsiveness and
precision needed for your specific drone project.
Complementary filters
Complementary filters are clever signal processing techniques that blend data from
multiple, often noisy sensors to produce a more accurate and reliable estimate of a
physical quantity. They're particularly valuable in applications where sensors have
complementary strengths and weaknesses, such as in inertial measurement units
(IMUs) commonly used in drones and other devices.
Key Concepts:
Benefits:
Here are the key algorithms and formulas for complementary filters:
• Equation:
angle_estimate = alpha * (angle_gyro + angle_gyro_prev) + (1 - alpha) *
angle_accel
• Variables:
o angle_estimate: The filtered angle estimate
o angle_gyro: The current gyroscope angle measurement
o angle_gyro_prev: The previous gyroscope angle measurement
o angle_accel: The accelerometer angle measurement
o alpha: The filter gain (between 0 and 1, typically around 0.95)
• Equations:
angle_gyro_filtered = angle_gyro + gyro_bias
angle_estimate = angle_gyro_filtered * dt + angle_accel_filtered
gyro_bias += (angle_accel_filtered - angle_estimate) / tau
• Additional Variables:
o dt: The time step between measurements
o tau: The filter time constant (controls how quickly the filter adapts)
3. Tuning Parameters:
4. Implementation Considerations:
• Sampling Rate: Ensure consistency in sampling rates for all sensor data.
• Initialization: Provide initial estimates for angle and gyro bias.
• Bias Correction: Implement mechanisms to address gyroscope bias drift over
time.
• Noise Reduction: Consider additional techniques like low-pass filtering for
accelerometer data if needed.
Kalmann Filters
The Kalman filter is an algorithm that estimates the state of a system from measured
data. It was primarily developed by the Hungarian engineer Rudolf Kalman, for whom the
filter is named. The filter’s algorithm is a two-step process: the first step predicts the
state of the system, and the second step uses noisy measurements to refine the
estimate of system state.
The future target position can be easily calculated using Newton's motion
equations:
Key Components:
• State vector: Represents the dynamic variables we want to estimate, like a
drone's position, velocity, and attitude.
• System model: Describes the evolution of the state over time, governed by
physical laws or mathematical equations.
• Measurement model: Relates the state to the sensor readings we observe.
• State estimate and covariance matrix: Capture our current understanding of
the state and its associated uncertainty.
• Kalman gain: A matrix that determines how much weight to give to the
prediction and the measurement update, based on their uncertainties.
Applications:
The Kalman filter finds applications in a wide range of fields, including:
• Navigation and guidance: Drones, robots, spacecraft, and autonomous
vehicles rely on it for precise positioning and control.
• Signal processing: Filtering noisy data from sensors in various fields like
communication, robotics, and medical imaging.
• Target tracking: Predicting the movement of objects like vehicles, aircraft, and
celestial bodies.
Learning Resources:
If you're interested in delving deeper into the Kalman filter, here are some helpful
resources:
• Wikipedia: https://en.wikipedia.org/wiki/Kalman_filter
• Kalman Filter Tutorial: https://www.kalmanfilter.net/
• Understanding Kalman Filters Tutorial:
https://www.mathworks.com/discovery/kalman-filter.html
Extended Kalman Filters (EKFs)