Software Design – Multiwii 328P IDE Design

Posted by: Luis Valdivia (Project Manager)
Written by: Anthony Becerril (Mission, Systems, and Test Engineer)

 

With most if not all quadcopters, there is a flight controller that is the brains of all flight operations. The flight controller’s IDE must be working correctly for controllers, motors, and more to all sync up properly. For our quadcopter we used the MultiWii 328P Flight Controller default IDE. The latest version we found and used was version 2.4 and can be found here. We took in this code and modified it as needed for use in our testing.
The code is compiled of the following files:

Multiwii
Alarms.cpp
Alarms.h
EEPROM.cpp
EEPROM.h
GPS.cpp
GPS.h
IMU.cpp
IMU.h
LCD.cpp
LCD.h
Multiwii.cpp
Multiwii.h
Output.cpp
Output.h
Protocol.cpp
Protocol.h
RX.cpp
RX.h
Sensors.cpp
Sensors.h
Serial.cpp
Serial.h
config.h
def.h
types.h

 

The main code we had to focus on was the configurations (config.h). We first had to setup the type of multicopter in use. For our case we had the QUADX setting. The reason we did not go with the QUADP, or plus, is because our setup flies smoother with the X method of control rather than the + method. They are theoretically identical and can both be considered for usage.

tonysoftware123

We also had to specify the board being used under the boards and sensor definitions:

tonysoftware1123

Next we looked into the motor maximum and minimum throttle:

tonysoftware3123

This became critical for our testing due to fine tuning the throttle to match the thrust being made from the additional fans. We ranged from 1200 to 1850 which was too low with no flight and too high with no control respectively.
We have yet to dig deeper into the code regarding the PID tuning and seeing how we could manipulate it or disarm it for our testing. We have had some attempts in adjusting the code but it has disoriented the flight stability too much and is still in need of further work.

tonysoftware4123

Additional Resources:
Previous Blogpost: Bluetooth Module Update Spring 2016
MultiWii Code Archive
MultiWii Configuration: Basic Setup