#This ReadMe is Deprecated , Will Update before 2020.12.10
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
-
JSON_LIB : https://github.com/nlohmann/json
-
wiringPi : http://wiringpi.com/
-
all of them need to build and install at Raspbain
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
- 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
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.
Being updated,please wait
- 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
- install wiringPI (google youreself)
- 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
- 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
-
Type_RC: receiver mode: 0 for IBUS mode, 1 for SBUS mode, please put receiver at /dev/ttys0, this will be improved later
-
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)
-
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.
-
Update_Freqeucy: It can't be changed now,If you change this item, you may cause a personal accident.
-
_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
-
_flag_Accel_Pitch_Cali: _flag_Accel__Roll_Cali: Horizontal correction of aircraft acceleration sensor,it needs to be adjusted
-
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
-
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