# Control Methods Comparison for the Real Quadrotor on an Innovative Test Stand
## 3 Experimental Setup and Results
### The Software  
An application shown in Figure 8 was created using C# language and it serves as the interface between operator and the flying platform (Figure 8 Section A). This application also performs the function of being the interface to the test stand used to verify the proposed control algorithms (Figure 8 Section B). This application was also used to tune all designed attitude controllers (Figure 8 Section C). The main purpose of the application is to control and monitor the behavior of the real platform. The application is divided into two parts, namely the part dedicated to the real platform and the part dedicated to the test stand. The following commands can be sent to the real platform if the connection is established:  
* To enable/disable motors via checkbox \"Control ON\".
* To enable/disable logging data via checkbox \"Data reading\".
* To define the desired quaternion.
* To define the desired thrust that is used to compute desired torques of the quadrotor.
* To select one of the three controller types, namely PD, LQR and backstepping controller via corresponding checkboxes (i.e., \"PD controller Enabled\", \"LQR controller Enabled\" and \"Backstepping controller Enabled\").
* To change each parameter of selected type of the controller several buttons are used that are located next to writable textboxes. If all parameters of the selected controller should be sent to real platform then the \"Par to QR\" button should be used.  
Figure 7: Scheme of all peripherals connected to the control board (PWR—power, IMU—Inertial Measurement Unit, ESC—Electronic Speed Controller, USART—Universal Synchronous/Asynchronous Receiver and Transmitter, Aln—Analogue Input, DOut—Digital Output).  
When the connection to the real platform is established and the data logging is enabled, the following variables are obtained via Bluetooth from the real platform:  
* Actual quaternion
* Actual angular rate of the quadrotor [rad\(\cdot\)s\({}^{-1}\)]
* Calculated desired torque [N\(\cdot\)m]
* Torque identified via attitude disturbance observer (DO) [N\(\cdot\)m]
* Actual voltage of the LiPo battery [V]
* Single bit that monitors the change of the desired quaternion.  
The application is updated every 500 ms, while the change of every parameter is logged each 10 ms and it is recorded into the text file \"QR_data.txt\". Furthermore, the application contains the button \"Par to File\" that is used to store actual parameters of the all controllers to the text file \"Control_param.txt\". If this file exists during the start of the application, the last-stored controller values are used to automatically prefill controller parameters. The part dedicated to the test is used to establish and terminate connection between the test stand and a computer. Further, there is checkbox \"Data reading\" used to start reading and logging data from the test stand to the text file \"Stand_data.txt\". The data monitored from the test stand are all Euler angles that are displayed every 100 ms but, as in the previous case, the data is logged with finer sampling (i.e., every 10 ms).  
Because the test stand is equipped with absolute rotary sensors, the option to calculate offset was added to the application via button \"Null act. values\". The corresponding offset is displayed next to recalculated actual values of Euler angles. The offset can be reset any time using the button \"Null offset\".