I am doing a quadcopter as a project at my university. I have a plan and started testing my devices but before I actually start real work I wanted to ask you - what do you guys think about it all, if it's okay etc. So my setup is:
- STM32F103C8T6 board
- USB2TTL adapter
- gyro+acc MPU6050
- barometer BMP180
- WiFi ESP-12 ESP8266 (it will be used for controlling the quadcopter, I know it's not the best solution but it's cheaper this way)
- 7.4V 2000mAh 25C Lipo Battery
- 6x4 Propellers
- 4x A2212/6T 2200KV Brushless Motors+30A Speed Controllers
I want to connect MPU to I2C1, BMP to I2C2, WiFi to UART1. Power these devices from the board. Power board and ESCs from the baterry using simple power distribution board (and also use a voltage regulator for connection between distribution board and the main board to make the voltage lower, around ~3.289V). Will it work this way?
I wanted to use stm32 standard peripheral library because there are a lot of examples for it but I had some problems with simple UART communication, probably wrong clock settings in my project but I just couldn't figure it out or find working project for my board. So then I tried HAL library with generated settings and it was working fine. I moved to testing devices, I edited this library https://stm32f4-discovery.net/2014/10/l ... r-stm32f4/
to make it work on my stm32f1 and I succeeded but data received from MPU was really messy - I mean, without touching the device data was jumping up and down. I thought MPU was faulty but then I used jrowberg/i2cdevlib library (and stm32duino) and it's working flawlessly. I'm just guessing, but is it because jrowberg's library uses DMP and the first one I posted doesn't so one would need to use filter along with it
Anyhow I loved how simple it is to write code in Arduino. So even though I really don't want to give up on Arduino, I'm not sure if my teacher will let me do this project this way as "it's rather high-level programming", so as a backup plan I would like to ask you if there is any alternative to jrowberg library for MPU6050 with DMP using SPL or HAL libraries as I couldn't find any.
Besides all that stuff, I wanted also:
- use freeRTOS to control whole program
- read data from MPU and BMP and pass it to functions which would figure out how to change motors speed
- pass simple information through wifi from my laptop/phone, like fly forward etc.
I am rather a newbie in the electronics and microcontrollers world so any advice is really appreciated. I could make some easier projects first but I really wanted to do something cool and interesting I know it would be best to write my own libraries rather than use ready stuff but unfortunately I don't have enough time for that