Differences between simulation and real drone

Hi guys,
I have customized the firmware to add the control of tilting multirotors, like voliro VOLIRO - The Omnidirectional Hexacopter - YouTube and this one A tilting-rotor unmanned aerial vehicle for enhanced aerial locomotion and manipulation capability - YouTube.
I have created the simulator in Gazebo for both types and it works in different flight modes (tested in stabilized, altitude, position, mission and offboard). This is an example of a simulation of a flight in position flight mode (https://review.px4.io/plot_app?log=c323d9f3-d3ce-48ff-8160-bfc686f10f26).
Today we tested the firmware on the real drones (the same kinematic as the simulated ones) but I had a strange behavior:

  1. both drones fly really well in stabilized
  2. when i switch to altitude, the drone like voliro has a problem with the yaw. Specifically, it always rotates only in one direction independently from
    the value of the stick. This is strange because it works fine in stabilized. Does the altitude flight mode change something on the yaw control?
  3. In position flight mode, both drones have problems staying still in hovering and subsequently diverging toward some directions. Even while diverging, if I try to correct the position with the radio controller, the drone follows the right direction but when I release the sticks, it goes around (sometimes also increasing the velocity). Moreover, it has the same problem on the yaw as in altitude (so I’m thinking that could be a problem of the allocation matrix, but it’s strange that this problem is not present in stabilized mode). This is a log from one of today’s experiments, where we used the Optitrack motion capture system for the position feedback (https://review.px4.io/plot_app?log=2659558f-4152-4cbb-a466-4a8848b12c26).
    In the end, I add that these drones fly well with the normal standard firmware, so the problem must be in my customization.
    Do you see something in the logs that I’m missing?
1 Like

Regarding point 2, yes the altitude mode does affect yaw control (compared to stabilized)!

I know this is super unintuitive as well, but at least it is explained here: Discord

I got to learn about this while tuning a quad, where I experienced yawing (like you observed) as soon as I switched to altitude mode!

@junwoo0914 thank you very much. Then the problem with the yaw can be also related to the feedback.
Do you have any thought about the third problem?

What do you mean? Do you have a log with that?

Also it would be nice to know how your custom controller is different (is it still using MPC parameters for position controller? Etc)