Giter VIP home page Giter VIP logo

rpisingleapm's Introduction

#This ReadMe is Deprecated , Will Update before 2020.12.10

RPiSingleAPM

RPiSingleAPM is a c++ API for RaspberryPi , it was tested on RaspberryPi3B , 3B+ , 4B , using RPiSingleAPM can make RaspberryPi using PCA9685 and MPU9250(MPU6050 , and MS5611) to build a Auto-Leveling quadCotper ,it means that you can easily using RaspberryPi with OpenVINO to make a computer-vision-base quadCotper

*This project is using GPL linsense

Code Dependence

Hardware Dependence

At least you need :

  • PCA9685 to drive 4 Electronic-Speed-Control ,

  • MPU6050 to use for Auto-Leveing the copter

  • Remote receiver now support IBUS , in future will fully support SBUS , you can use IBUS perfect

Build Test Need

  • install nlohamnnJSON
  • using cmake build the code
  • move APMconfig.json to /etc/
  • cd build and run ./SingleAPM -r

* check RC value and change value at /etc/APMconfig.json , IBUS value is diffrent from SBUS , if no ckeck , it won armed

PCB Dependence

网络图片

P5:RX TX 5v gnd P6、P7、P8:SCL SDA GND 3.3V
This PCB provides connection support for PCA9685, MPU9250, MS5611 and more sensor extension interfaces for convenient. you can get more information on file.

Video display

Being updated,please wait

The way to use TestMdule

  1. compile and install nlohmann JSON
  • git clone https://github.com/nlohmann/json

  • cd /clone file directory/.

  • git checkout v3.7.0 Switch to the specified version branch

  • cd build

  • cmake

  • make

  • make install

  1. install wiringPI (google youreself)
  2. Compile SingleAPM (https://github.com/TSKangetsu/RPiSingleAPM)
  • git clone https://github.com/nlohmann/json

  • cd RPiSingleAPM

  • mkdir build , cd build

  • cmake ..

  • make

  • cd .. , mv APMconfig.json /etc/ move APMconfig.json within the project to /etc

  • cd build , mv SingleAPM /usr/bin,sudo chmod /usr/bin/SingleAPM 755 Move SingleAPM executable file within build in /usr/bin/, and set the permission as 755

  • execute SingleAPM -r

Configuration instructions of TestModule:

网络图片

  1. Type_MPU9250: If the mpu9250 or mpu6000 sensor connected to raspberry PI is an SPI connection, select 1, Otherwise(I2C) select 0. Attention:the I2C configuration of raspberry pie needs to be changed to high-speed mode)

Changing the default I2C Speed

The default I2C baudrate on the Pi 3 is 100Kbps (kilo bits (not bytes) per second). 
At this speed, clearing the interrupt register and reading the IMU data 
(14 bytes; 3 16 bit gyros, 1 16 bit temperature, 3 16 bit accels) takes about 6.5ms, which is unacceptably slow. 
Since the data is read while processing the ISR, the slow speed of the data read operation imposes an upper bound of 150Hz on the interrupt frequency. 
It is possible to increase the default I2C baudrate by modifying the /boot/config.
txt file as shown below.  

👆Form http://www.telesens.co/2017/03/11/imu-sampling-using-the-raspberry-pi/

网络图片

You need to restart PI for the Settings to take effect

  1. Type_RC: receiver mode: 0 for IBUS mode, 1 for SBUS mode, please put receiver at /dev/ttys0, this will be improved later

  2. Type_IMUFilter: gyro filter 0 is no filter, 1 is pt1 filter (currently not available), 2 is 50hz low-pass filter (recommend to use first-order filter)

  3. Type_IMUMixFilter: The fusion filter of gyroscope and accelerometer, 0 is the first order complementary filter, suitable for short time flight;1 is the Kalman filtering, suitable for long time operation.

  4. Update_Freqeucy: It can't be changed now,If you change this item, you may cause a personal accident.

  5. _flag_A1_Pin: _flag_A2_Pin: _flag_B1_Pin: _flag_B2_Pin: This is the PWM connection position of four-axis pca9685: fill in according to the pin number on pca9685
    网络图片

  6. _flag_Accel_Pitch_Cali: _flag_Accel__Roll_Cali: Horizontal correction of aircraft acceleration sensor,it needs to be adjusted

  7. PID related:The PID values of Pitch roll yaw need to be adjusted to be stable. It is not recommended to change the max_arbitration value and level_Max
    网络图片

  8. The remote control related:
    Matters needing attention: The PWM values of ibus and sbus have some different, it need to be adjusted by yourself, otherwise they cannot fly or lose control and put Personal safety at risk. The channel of flight control is unlocked in channel 5 of the remote control, please adjust by yourself Reserv represents the reverse direction of the remote control and can only be 1 and -1. Changing to other values will endanger people's safety
    网络图片


rpisingleapm's People

Contributors

tskangetsu avatar pluierry avatar charlesilcn avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.