2016年2月29日 星期一

A quadcopter controller on a Raspberry PI


The only external devices needed are a MPU6050 for attitude measurment and a Wifi dongle. The quadcopter is remotely controlled via wifi and an Android App


The Raspberry PI hosts:
  • PID controller
  • ESC signal generator (ServoBlaster)
  • UDP server to get command from an android device
  • Communication with the MPU6050 through I2C.
The repository has several folders, that I initially made to code and test the different functions of the controller. The entire controller is in the PILOT folder.
Folders :
  • AND2RPI : a first version of socket programming for communication with a remote control over network
  • MODELS : some C programs that simulate the dyanmics of Quadcopter
  • MPU6050s : Richard Ghirst's MPU6050 tools with wrappers in order to simplify its use
  • PILOT : the complete controller currently under development
  • SERVOS : a cpp class used to write the ESC comands into /dev/servoblaster
This project is greatly inspired and using source code from :

Hardware

This projects includes :
  • 4 brushless motors (TURNIGY 2204-14T 19g Outrunner)
  • 4 Electronic Speed Controllers (Turnigy Multistar 10 Amp)
  • 1 LiPo 3s 3700 mAh battery
  • 1 sparkfun MPU6050 breakout board
  • 1 QuadCopter frame
  • 1 Android device for remote
Wiring (接線)
MPU6050 : -VDD -> 3.3V 
                   -GND -> GND 
                   -SDA -> SDA 
                   -SCL -> SCL 
                    -VIO -> 3.3V
ESCs: 
                   -GND -> GND 
                   -Signal Servo 0 -> pin 4 
                   -Signal Servo 1 -> pin 23 
                   -Signal Servo 2 -> pin 24 
                   -Signal Servo 3 -> pin 25
===================================================================

MPU6050s/

mpu6050_dmp.cpp contains routine to set-up, initialize and obtain Yaw, Pitch,
Raw angles from an MPU6050.

setup()
MPU_init()
MPU_setup()        (combination of both former ones)
MPU_getYPR(ypr[3]) (returns Y P R angles ina table)


SERVOS:

https://github.com/richardghirst/PiBits/tree/master/ServoBlaster


REMOTE_APP_ANDROID:

android source code

PILOT :  所有的code 都整合在這邊.....

===========================================================
當出現下面的error 的時候....
‘Sleep’ was not declared in this scope

只要include 這個檔頭就可以了
#include <unistd.h>


桔色 才是控制她的訊號
棕色GND
紅色是電變可供電給飛控的5V



Reference : https://github.com/vjaunet/QUADCOPTER?files=1

沒有留言:

張貼留言