Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

stm32 flight computer with freertos

simple flight controller code for stm32f411 blackpill. uses freertos to run multiple tasks.

how it works

  • read mpu6050 sensor data via i2c
  • kalman filter to fuse accel and gyro (get pitch and roll)
  • pid controller to compute motor values
  • uses mutex so tasks don't overwrite orientation data

structure

  • Core/Src/main.c: starts freertos tasks (imu_task 200hz, control_task 100hz)
  • Core/Src/imu_driver.c: i2c reads for mpu6050
  • Core/Src/kalman_filter.c: maths for angle estimation
  • Core/Src/pid_controller.c: pid loops with anti-windup clamping

build and run

to compile for stm32 (requires arm-none-eabi-gcc):

make

it compiles all object files and creates flight_computer.bin which is ready to flash to the microcontroller.

also has a simple pc simulator to check the pid/kalman maths:

make sim
./flight_sim

About

simple flight controller firmware for stm32f411 running freertos with kalman filter and pid loops

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages