Flight_Main - jofranco/multi-rotor-on-FPGA GitHub Wiki

Overview

Our quadcopter currently supports the following flight modes: Horizon, Rate and Object Avoidance. The commands vary for each Flight Mode therefore it is necessary to have a core dictate which command to use and pass to the PIDs. Flight_Main behaves as a mux, selecting commands based on flight mode input from user. It also forces the motors to zero if the ARM flag is not set and will allow the motors to idle when it is.

Interface

Flight Main takes in rc commands and object avoidance command of data type ap_fixed<13,3>. It selects the final command to be sent to the PIDs of data type ap_fixed<13,3> as well. If ARM Flag is not set then commands are set to zero.

Function

Flight Main selection is made according to Flight Mode and Arm state selected.

  • ARM State = 0 -> Set Command to 0

  • ARM State = 1 -> Pass RC Command

  • Flight Mode = 0 -> RATE MODE

  • Flight Mode = 1 -> HORIZON MODE

  • Flight Mode = 2 -> HORIZON OBJ AVD MODE

Additional Notes

Flight Main logic streamlines passing command data to other HLS cores.

Additional References

https://blog.owenson.me/build-your-own-quadcopter-flight-controller/

⚠️ **GitHub.com Fallback** ⚠️