Feb-25, 2020 - Got printed circuit boards for transmitter (and li-ion battery charger) from jlcpcb today. Soldered it up and got it running - picture in gallery.
-----------------------------------------------------------------------------------------------------------
It has been a couple months since I have done much direct work on this project but am starting to get back into it a little now. In that time I have been looking into some background projects to help support me in this project. In addition to spending a few day familiarizing myself (and writing libraries) for the NRF24L01+LNA with antenna, I have made project posts on this site on several topics related to this project -
- BMP280 Data Collection With ESP
- A Li-Ion battery (1S - 6S) charger and tester
- Drone Kit Development - Thrust Measurements
- Magnetometer Demonstration
As result of this aside I have decided to try to have my main thrust loop closing in on bmp280 altitude measurements, to build my own battery charger and to try to avoid using a magnetometer. The range of the esp's espnow radio is somewhat of a limitation so I have included an option to use a nrf24l01+ on both the flight controller and the transmitter.
Given that I was closing in on a version of this project that I wanted to build and the breadboard was getting a little crowded (especially after adding the bmp280, the nrf24l01+ and a gps receiver to the flight controller board), I looked into building a printed circuit board. I haven't built a pcb for a home project (well since the old FeCl days as a kid) before, I have done it at work (where I didn't even have the cad tools on my computer) and had techs or vendors do the supervised capture, layout and ordering (did a couple 2 layer test jigs a few times but as I recall those were still in the $200+ range and the software was not very good). This time I tried EasyEDA and was surprised at how easy, fast and cheap pcb design is these days, I had the pcb for the li-ion battery charger done the same day - 5 2-layer 100x100mm boards are $2 with $6.33 3 week shipping - wow! You can install the router easily on windows or linux systems and it will route the board in about a second - very intuitive interface with a schematic capture comparable to industry leaders, extensive component libraries (beware some contributed by individuals and not verified), hurry and download and maybe you can be the one millionth easyeda user!
I have submitted orders for both the flight controller board and the transmitter PCB boards for this project - the boards have completed manufacture and been shipped. Pictures of the boards are included in the gallery.
What is demonstrated working so far as test and co-functional software libraries -
Flight Controller
- ESP32 module with C program written using only software cloned from https://github.com/espressif/esp-idf
- SPI DMA interface to MPU9250 reading gyro data at 8K samples/sec, accelerometer data at 1K samples/sec (spiclk = 5MHz)
- Low pass filter on accelerometer data, and xyz to spherical trig conversion to calculate accelerometer based pitch and roll at 100Hertz (will try to go higher)
- Complementary filter fusion - preserving high speed component of gyroscope data and and low speed component of accelerometer data
- PID control inner control loop (attitude measurement) integrals at 8K update rate, external PID (attitude control) updates at 100+Hz
- PWM generated servo outputs from outer control loop PIDs to four ESCs updated at 480Hz
- MPU9250, BMP280 and ESC calibration functions
- BMP280 pressure data used in altitude control PID
Receiver/Transmitter Radio Set (one for esp8266 transmitter and one for esp32 flight controller)
- Have had receiver working in both TCP/IP and ESPNOW modes, recently added NRF24L01 on flight controller and transmitter
- In TCP/IP mode have hosted remote webpage with a couple virtual joysticks, unfortunately limited to ~5 packets/sec, maybe useful for some...