Controlling drone with microcontroller

Hi,
I’m trying to use a microcontroller to be able to control a drone automatically and make it go up, down, left, right etc (without input from the remote controller). In order to do this, I need to be able to connect the output from the microcontroller into the flight controller somehow. Also, the microcontroller’s outputs need to be able to be understood by the flight controller (with the minimum amount of updating of the software as possible; I’m still very new to that). If anyone has any ideas about how I could do any of this, it would be very greatly appreciated. Thank you!
 
Totally possible the big question is why? The stm32 on most FCs is running open source software so you could just add routines to that instead of having separate input, you could also use pwm or some other protocol as though your mcu is a receiver and send in control but not sure why you wouldn't just modify betaflight itself if it doesn't have some capabilities and contribute that back rather than trying to bolt something on top (unless you need extra cpu/memory to do something more advanced)
 
Last edited:
I am trying to use an rf link between the drone and the person to get the drone to be able to pathfinder back to the person controlling it. For this, I am taking the rssi values from some receivers placed on the drone and analysing them (hence the microcontroller) to figure out which way it needs to go. So, if I were to do all this on the flight controller, would there be space for these rssi inputs to enter? And how easy would it actually be to modify the code to do what I want it to?
Again, thanks for all your help.
 
Hmm yeah betaflight already internally handles reading RSSI values from the receiver if it is sending that data along but from what I've heard you really want "link quality" that includes more information about the received/missed/resent packets of info rather than RSSI which is more of just received signal amplitude but might not reflect actual data rates/distance accurately. Ultimately I think compass/GPS with iNav is probably the best option with regards to doing navigation but I don't think you'd have a problem running your sub-routines within betaflight or iNav itself though tbh you'd need to get into the github issues or find the right channels to contact devs working on that more hands on to say for sure. I can tell you that some FCs have microSD card usually used for "blackbox logging" that keep track of all the receiver and gyro data that was seen during a flight and I know if you up the frequency for the PID loop you can stress out the older F3 processors but F4 or now F7 ones from STM32 have a lot more headroom in terms of CPU speed and UARTs (lots of places you can change to be inputs for RSSI or other signals).




Since talking navigation iNav might be closer to what you actually want out of the box since that project really focuses on the path/waypoint manipulation and handling control based on GPS/compass (believe both code bases came from "Cleanflight" but "betaflight" more focused on racing/acrobatic "manual" piloting whereas iNav more focused on the waypoint/control from phone type flying where a mission is planned and carried out by the quad). Betaflight supports GPS/compass but only feature they support I know of is "return to home" so if activated or it loses signal can go into return to home mode and will go to a set altitude or the highest altitude flown during a given flight then point itself back to the take off position using the compass (and known GPS location from take off) and will fly toward the take off location then reduce throttle to come down (not necessarily safe landing but will get back to roughly where it came from).



This guy is always doing interesting things with iNav too if want to see some "real life" examples of iNav uses suggest checking out his channel (also just generally very informative guy)
 
Back
Top