Close
0%
0%

Micropython Flight Controller

A stabilization system for drones using a pyboard, a MPU6050 and a RC receiver

Similar projects worth following
The pyboard has a processor much better than commercial flight controllers, so we can made a flight controller similar or better written in python.

The main.py is based is this link:
http://owenson.me/build-your-own-quadcopter-autopilot/

The mpu6050.py is a modified version from here:
https://github.com/cTn-dev/PyComms/tree/master/MPU6050

The pid.py is based from here:
https://github.com/diydrones/ardupilot

To receive the PWM from the RC receiver, I took the code from here:
http://wiki.micropython.org/platforms/boards/pyboard/modpyb/Timer-Examples

To control the speed controls, I take the code from here:

Here is the code: https://github.com/wagnerc4/flight_controller

  • 1 × pyboard micropython board
  • 1 × FrSky receiver 2.4 GHz receiver with telemetry
  • 1 × FrSky transmiter 2.4 GHz transmiter with telemetry
  • 1 × mpu6050 3-axis accelerometer and 3-axis gyroscope

View all 3 project logs

Enjoy this project?

Share

Discussions

wind wrote 02/21/2024 at 16:51 point

Finally found this

  Are you sure? yes | no

tabshi wrote 11/16/2016 at 06:54 point

how about the robust?

  Are you sure? yes | no

wagner wrote 09/12/2015 at 14:42 point

The pyboard build-in accelerometer only have accelerometer.... The mpu6050 have gyroscope and accelerometer.   In the main.py are commented the code for use the build-in accelerometer:

#accel = pyb.Accel()
imu = MPU6050()

.....

#x, y, z = accel.filtered_xyz()
x, y, z = imu.get_xyz()

......

You only have to switch this commented lines.

The problem with the built-in accelerometer is that when you shake, it throw wrong data... I have checked the accelerometer documentation and it can determine shake movements, but this feature seems not implemented in the micropython pyboard.

http://micropython.org/resources/datasheets/MMA7660FC.pdf

The mpu6050 doesn't have problems with shake movements....

  Are you sure? yes | no

deʃhipu wrote 09/12/2015 at 09:34 point

But wait, doesn't pyboard have a build-in accelerometer already?

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates