Inertial Measurement Unit (IMU) in Flight Controller Application (Part 2)

Add 2 or 3 IMUs in Flight Controller

Have more than 1 IMU in Flight controller sound the best practical solution instead of using only 1 IMU because it can be increase their stabilization and accuracy right? Is it possible? The answer is YES. Since the IMU using a SPI communication, you can added more than 1 IMU into your Flight Controller. This is the example that if you use 2 IMUs configuration.

image.png

The question is, How this can be programmed into our Flight Controller?

You can programmed based on C++ on STM32CubeIDE, but you should refering to Ardupilot and define into your firmware what the IMU Series that you used in your flight controller. But remember, don't you use the same series an IMU. I recomened you use different IMU and select it based on the best practical used from their manufacture and datasheet. for example IIM-42652 has industrial grade standrad for the main IMU, ICM-42688P is the accurate IMU sensor to compare the data. For the fusion both of two IMU, you should use the Kalman Filter. A Kalman filter enhances IMU data by optimally combining sensor measurements and system dynamics to reduce noise and improve estimates of orientation, velocity, and position. If you want to refer on Industrial Flight controller that used 2 or 3 IMUs, this is Cube Orange Plus for the example from Ardupilot website. The Cube Orange/+ With ADSB-In Overview — Copter documentation

image.png

Cube Orange Plus use 2 IMU in their Board (Invensense ICM42688 IMU and ICM20948 IMU/MAG), looked into Specification on the website.

Choosing the Right IMU for Your Application

When selecting an IMU, consider the following factors:

  • Degrees of Freedom (DoF) – Most IMUs come in 6-DoF (accelerometer + gyroscope) or 9-DoF (accelerometer + gyroscope + magnetometer) configurations.
  • Accuracy & Sensitivity – Higher-end IMUs provide lower drift and better precision.
  • Power Consumption – Critical for battery-powered applications like wearables and drones.
  • Interface Compatibility – Ensure compatibility with microcontrollers, SoCs, or FPGA-based systems.

6 Axis vs 9 Axis IMU

The 9 Axis maybe sound better than 6 Axis for Flight Controller IMU right? But it doesnt necesarry at all, it depends on your necessity.

6 Axis: three-axis (XYZ) accelerometer + three-axis (XYZ) gyroscope (also called angular velocity sensor)

9 Axis IMU (AHRS) Combines Accelerometer, Gyroscope, and Magnetometer (3+3+3 axes) to provide total orientation (Roll, Pitch, Yaw). They used Algorithms (Kalman Filter, Madgwick) to fuse data: Accel gives gravity vector (Roll/Pitch), Mag gives North (Yaw), and Gyro provides fast updates and smoothing. For the example, the 9 Axis IMU is using for VR/AR tracking, sophisticated drone control, robot localization, etc.

So 6 Axis module can form VRU (Vertical Reference Unit) and IMU (Inertial Measurement Unit), 9-axis module can form AHRS (Attitude Reference System).

LSM9DS1 is the example for 9 Axis IMU, it combines 3D accelerometer, 3D gyroscope, 3D magnetometer into single chip.

lsm9ds1.pdf

image.png

The 9-axis IMU is a key component of advanced sensor fusion, forming the foundation for accurate insights across various applications. By integrating sensor fusion software and AI algorithms, industries can achieve higher standards of accuracy and efficiency.

Pro Tips

To make your guide even more valuable for beginners, consider adding these "Flight Controller" secrets:

  • Power Integrity (The LDO Factor): Mention that IMUs are extremely sensitive to power noise. Beginners should use a dedicated Low-Dropout Regulator (LDO) with high PSRR (Power Supply Rejection Ratio) specifically for the IMU to prevent "gyro drift" caused by noisy power from the motors.
  • Trace Routing: Advise them to keep the SPI traces as short as possible and to keep them away from high-current paths (like the battery leads or ESC signals) to avoid electromagnetic interference (EMI).
  • Mechanical Orientation: Remind them to look for the small dot on the chip. In the drone world, the orientation of the IMU on the PCB must be known so that the firmware can be configured to know which way is "Forward" (X), "Left/Right" (Y), and "Up/Down" (Z).
  • The "Ground" Warning: Regarding advice to ground the INT pin add a small disclaimer. Some IMUs might drive that pin HIGH by default; it is safer to suggest a 10k Ohm pull-down resistor rather than a direct short to ground to prevent accidental hardware damage during firmware boots.
DroneRacing
Inertial Measurement Unit (IMU) in Flight Controller Application (Part 1)

What Is an Inertial Measurement Unit (IMU)?

An Inertial Measurement Unit (IMU) is an electronic device that measures and reports acceleration, angular velocity, and sometimes magnetic field data. It typically consists of:

  • Accelerometers – Measure linear acceleration along the X, Y, and Z axes.
  • Gyroscopes – Detect angular velocity to track orientation changes.
  • Magnetometers (optional) – Provide heading data by measuring Earth’s magnetic field.

By combining these sensor readings, an IMU can determine an object’s movement and positioning, making it essential for applications requiring precise motion tracking.

Application in Flight Controller

This is a typical implementation of an IMU within a Flight Controller using EasyEDA. For supporting circuits like decoupling capacitors, you should refer to the "Typical Application" section in the IMU datasheet. In this example, I am using the IIM-42652, an industrial-grade IMU designed for high-performance flight controllers. You can access the datasheet here:

IIM-42652 Datasheet(PDF) - TDK Electronics.

image.png

Most commonly, IMUs in this field use SPI communication instead of I2C due to its superior speed. While SPI requires more pins specifically CS (Chip Select), SDO/MISO, SDA/MOSI, and SCLK the performance trade-off is worth it.

Most commmonly IMU are using SPI communication instead of I2C or others. this probably needs more Pins, such as CS, SDO/MISO, SDA/MOSI, SCLK. Maybe you asking for INT and FSYNC why they still connected into a netlabel (which is conneted into MCU). The reason is depend on the IMU that you using for. INT (interrupt) is a digital output pin from the IMU that signals the microcontroller when a specific event occurs, so the MCU doesn't have to constantly poll the IMU, saves CPU time and power by avoiding continuous polling, and the MCU can sleep until the IMU signals new data. You can use this pin when your MCU (especially STM32) still have pins that not used, but if not you can float this pin or connected this pin into the ground (check the datasheet for the best termination), but using it is highly recommended for efficiency.

image.png

FSYNC (Frame Synchronization) is a hardware pin and feature used to synchronize sensor data sampling with an external event or device. Basicly it Aligns IMU data samples with an external timing reference (e.g., a camera frame, GPS pulse, or another sensor). But you should be looked at Hwdef.dat to see is the IMU compatible with the Ardupilot environment or not.

Maybe you asked for why I added Ferrite Bead 600 Ohm in Power Rail input for IMU, which is not enter in the datasheet (see the figure in bottom).

image.png

The reason is for filtering the circuit from noise suppression. A ferrite bead is not an ideal inductor, its main purpose is not to“reflect noise and block it.”So It works by dissipating high-frequency energy as loss (heat), that is why ringing is reduced and the waveform settles faster. But because of the oscillation, you should know which the frequency that you used in the circuit (is it High or Low Frequency) and find the Capacitor for the Pi-Filter. This is the Figure that shown Pi Filter used a ferrite bead and two 100nF Capacitor.

image.png

Maybe we can discuss how the Pi Filter work and how to choose the value, connected and layouting them. If youre interested you can watch this video from Robert Ferenac and explained by Eric Bogantin https://youtu.be/HaLMjVkKYMw?si=AxCk40LLvW4WpBE9. But the conclution is, the ferrite bead is important to block the noise thatr can be caused an error data IMU which is can be caused a weird moving into your UAV later.

DroneRacing
Make Your Own Flight Controller for UAV

Hi, I'm Adib Fridiansya. My world revolves around the intersection of RF and Embedded Systems, and today, I'm pulling back the curtain on the most critical component of any UAV: the Flight Controller (FC).

While the maker community often experiments with Atmega (the 8-bit veteran) or the ESP32 for its built-in connectivity, the industrial drone world has a clear, undisputed gold standard: the STM32 Ecosystem.

If you want to design a professional-grade FC, you need to understand the hierarchy of these silicon brains. I've categorized them into three tiers that define the modern drone landscape:

  • STM32F4 (The Reliable Foundation): This is the 'OG' of 32-bit flight. It's the core of the legendary Pixhawk 2.4.8. While it's an older generation, its stability and wide support make it the perfect entry point for embedded flight logic.
  • STM32F7 (The Efficiency Specialist): The F7 series is the 'sweet spot.' It offers a massive jump in processing power with surprisingly low power consumption. This is why you'll find the F7 as the heart of high-end Monitoring and Inspection Drones that require long flight times without sacrificing performance.
  • STM32H7 (The Absolute Beast): This is where things get serious. The H7 is pure, raw power. Its clock speed is so high it can effortlessly manage Dual or even Triple IMU sensors (Gyro/Accel) simultaneously to filter out vibration and ensure rock-solid stability. This is the top-tier choice for heavy-lifters and elite Racing Drones from industry leaders like Matek and The Cube (Orange/Blue).

image.png

image.png

Are you ready to stop buying off-the-shelf boards and start engineering your own? Over the next 30 days, I’m hosting a Deep Dive Series on Flight Controller design from schematic logic to sensor integration.

DroneRacing
M3 to M6 Screws – Are You Choosing the Right One for Your Project?

In this article https://jlcmc.com/blog/m3-m6-screws-a-complete-guide-and-their-applications, we break down the differences and best use cases for M3 to M6 screws. Plus, you can grab a complete screw kit from JLCMC starting at just $6.7 per set.

🟢Size & Load: M3 for small & precise jobs; M4 & M5 for medium-duty; M6 for heavy-duty applications.

⚙️Thread Pitch: Finer threads for precision (M3), medium for versatility (M4–M5), coarse for high load (M6).

💪Strength: M3 for light indoor use, M4–M5 for moderate strength, M6 for high-stress projects like machinery or automotive.

From precision electronics to heavy-duty industrial equipment, the right screws play a critical role in keeping everything together. Selecting the correct size and material doesn't just ensure a secure fit—it boosts performance and makes your projects way more efficient!

Mechatronic Components
Managing Component Heat: When to Use Thermal Vias vs. Heat Sinks

Heat has the potential to destroy PCBs without producing any noise. If you ignore it, your circuit board will become unreliable and ruin your design. The big question really is how to deal with heat.

Thermal vias are your first line of defense. A thermal via is a small hole plated through to another layer of copper, typically used under or near heat-generating devices such as: regulators, power ICs, etc. Thermal vias transfer heat from the top layer of the PCB to the inner or bottom copper planes. They are small, inexpensive, and effective for transferring and dissipating moderate amounts of heat. A well-designed array of thermal vias—which have proper diameter, spacing and are connected to a large copper pour—will greatly enhance the capability of the PCB to dissipate heat without adding any additional board space.

image.png

PCB with thermal vias

However, thermal vias do have limitations. They are designed to transfer the heat to the PCB copper for distribution. If the PCB does not have adequate copper at the copper plane level(s) to dissipate the thermal energy in a time frame, the thermal energy will continue to place excessive heat on the thermal vias and eventually overheat the device.

This is where heat sinks come into play. A heat sink is a device that is designed to attach physically to the device being cooled and to increase the amount of surface area that will be able to dissipate thermal energy to the surrounding air. Heat sinks are extremely important for devices that generate a lot of thermal energy compared to the capacity of the PCB to dissipate the thermal energy. An example of this would be voltage regulators, power transistors, or LED devices.

image.png

PCB with thermal vias

The decision of whether to use thermal vias or a heat sink depends on the application requirements and the available space. In general, thermal vias and solid ground planes are adequate for compact designs such as wearables and IoT nodes. In high power applications, you can use both thermal vias to transfer heat away from the component and a heat sink to transfer heat to the air.

Airflow should also be taken into consideration when selecting a heat sink; heat sinks in an enclosed space without any form of airflow will not work well.

In conclusion: Thermal vias provide good heatsinking but are not as effective as using a full sized heat sink in a normal way. When used together, they ensure that you don't overheat your printed circuit boards.

image.png

PCB integrating heat sinks and thermal vias

PCB Design
How to Add Artistic Touches to Your PCB Using Silk and Copper

Why Are PCBs so boring with their whole size being a simple rectangle that is usually a dull color? That is changing quickly! With the right imagination, your board can function as both a functional art piece and an incredibly well designed product. Nothing says, “engineer with style,” more than having a well routed ground plane on your board.

The first thing you need to think about is your silkscreen layer, which will be your canvas for logos, labels and subtle design elements. Keep your designs to a minimum (not too high a density) because a high density design will probably get clipped when it goes to manufacturing. When you do design in your silkscreen, make sure you use the right line width, which is usually greater than or equal to 0.15 mm, and don’t put a silkscreen over the pads unless you enjoy having mysterious problems when you go to solder parts onto them.

image.png

PCB silkscreen layer, Logo printing

Next, begin the process of creating your copper artwork. By designing your copper pours or traces, you can design patterns, logos, and elaborate designs directly into the board. Exposed copper (using ENIG or HASL) can look great when combined with different colors of solder mask. However, don’t forget that copper will conduct electricity, and you will not like it if you create an antenna or short to ground with your logo.

image.png

Copper pour designs on PCB

To add some additional pizzazz, try using solder mask openings to expose areas of copper that are under the solder mask. Many companies will now also have various colors of solder masks to choose from such as black, red, or blue as well as some that have a matte finish. This can give you a lot more flexibility for the aesthetics of the board.

Layer alignment is important. If the layer artwork is not aligned properly, it may appear messy. Therefore, it is critical to preview your Gerber files thoroughly. Follow the manufacturer's minimum requirements of spacing and clearance between design components, because the graphics should not negatively impact how the piece functions.

Ensure that the graphic components serve a valid purpose. The artistic portion of the layout helps improve the useability of the overall layout (via clear labels, orientation indicators, and branding), whereas the graphic components merely serve as decoratively increasing the aesthetics of the layout. By designing your PCBs properly, you can have both an attractive and functional product.

image.png

well designed PCB with proper layer alignment.

After you have completed the design process correctly (note there is a long timeline for debugging we will be doing), you will now possess a printed circuit board that functions and appears suitable for display!

PCB Design
How to: choose between analog and digital LEDs for your project

When choosing LEDs for an electronics project, the decision between Analog and Digital (Addressable) is a crucial architectural choice that will influence your MCU’s workload and your power delivery strategy.

Analog LED

Analog strips are simple components. Every LED on the strip is connected to the same power lines, meaning they all change color and brightness simultaneously. To control these, your MCU uses Pulse Width Modulation (PWM). Since an MCU pin cannot handle the high current required by a strip, you must use external N-Channel MOSFETs as switches. The MCU toggles the MOSFET gates at high frequencies to dim or blend colors. On the bright side, they are inexpensive, extremely bright, and offer high color resolution limited only by your MCU's PWM timers. However, you lack individual pixel control, it's all or nothing. Wiring is also more complex for RGB because you need thick, dedicated wires for each color channel to handle the Amps.

Digital LED

On the other hand, digital LEDs, contain a tiny driver IC inside the LED package itself. These use a high-speed NRZ (Non-Return-to-Zero) serial protocol. The MCU sends a single data stream where each LED "consumes" its 24-bit color data and passes the rest to the next pixel. You can control every single pixel independently using just one MCU pin. This allows for complex animations and "chasing" effects which could be very impressive and fun for your projects. However, they are timing-critical. If your MCU's code is interrupted by a background task, the data signal can glitch. They also have a "quiescent current," meaning they consume power even when they are "off."

What should you choose?

Choose Analog for architectural lighting where uniformity is key and budget is tight. Choose digital for dynamic displays, but ensure you include a large filter capacitor (1000µF) across the power rails to prevent voltage spikes from damaging the sensitive internal ICs.

LED Project