The topic of my "Diplomarbeit" (comparable to a master thesis) was the design and implementation of a simulation environment that would allow to simulate multiple quadrotors.

It was important to get the behavior of the quadrotors as realistic as possible, since the decision to conduct experiments on real hardware was based on successful simulation results. It was therefore important for the user to be able to rely on the results. Furthermore, the simulation would be used in hardware-in-the-loop scenarios, e.g., real quadrotors avoiding collisions with simulated obstacles. Therefore, realism was a crucial aspect of the simulation environment.

Quadrotors were controlled by defining desired roll and pitch angles, a desired yaw speed, and a desired thrust of the propellers. The thrust vector stayed constant and perpendicular with respect to the quadrotor frame. Tilting the quadrotor frame would result in an acceleration in the direction of tilt. A PID controller actuated the motors in order to move the body frame accordingly. Feedback was provided by an Inertial Measurement Unit (IMU) that measured angular rates and accelerations. From these sensor readings, the orientation can be calculated and used as feedback to the PID controller. Therefore, a correct simulation of the IMU was key to a correct simulation of the flight behavior.

The requirements for a realistic simulation of the IMU were:

- Realistic IMU acceleration and angular velocity data that includes noise, biases, scaling, and quantization effects.
- Since the IMU is not always in the center of gravity, translations and rotations defined with respect to the quadrotor frame have to be taken into account.

The calculation of the simulated IMU was performed in four steps.

- Obtain quadrotor state information from simulation
- Calculate IMU acceleration and angular velocity measurements
- Perform scaling, add noise and biases
- Perform quantization and limit output

For the first step we obtained the acceleration of the quadrotor, (), gravity (), angular velocity (), and the derivative of the angular velocity () from the simulation environment.

In a second step the acceleration and angular velocity was calculated, with being the translation and the rotation from vehicle reference frame to inertial reference frame of the IMU .

The angular velocity was calculated by adjusting the frame of reference of the measurements obtained from simulation.

For the third step the measurements were scaled, biases introduced, and additive noise applied. Noise was defined using a gaussian distribution for the acceleration and angular velocity. The scaling , biases , and deviations were defined by the user. denotes point-wise multiplication.

The fourth and final step in the calculations was optional and allowed the user to simulate quantization and limit the output values of the sensor. Quantization was implemented by rounding the values to the nearest integer value. Real IMUs have an operating range and exceeding this will result in the sensor providing a maximum (or minimum) value. By defining limits this behavior can be reproduced.

A video that compares the virtual and real quadrotor flight and an analysis of the simulation environment including an in-depth comparison between simulated and real quadrotor flight can be found below.

Johannes Lächele, Antonio Franchi, Heinrich H. Bülthoff, and Paolo Robuffo Giordano (November-2012) **SwarmSimX: Real-time Simulation Environment for Multi-robot Systems** In: *Simulation, Modeling, and Programming for Autonomous Robots*, 3rd International Conference on Simulation, Modeling, and Programming for Autonomous Robots (SIMPAR 2012), Springer, Berlin, Germany, 375-387, Series: Lecture Notes in Computer Science ; 7628. Download