What measures should be taken to ensure stable control of the multicopter in simulation through Gazebo?

I successfully ran a multicopter simulation through Gazebo. However, I tried to control the multicopter with the remote controller, but the attitude control of the multicopter did not seem to work well. I set the remote control and parameters, but it still doesn’t work well. I would like to safely control a multicopter and would like some help. Is there anything I need to do separately in the simulation?

Most of our recent development has been with fixedwings, so we haven’t done much testing with multirotors in Gazebo. However I have tested it briefly and found that you need to recalibrate the IMU every time you relaunch Gazebo, and if you do that then attitude control works pretty well and the multirotor is flyable. This is because Gazebo assigns a random IMU bias when it is launched, and the difference between different IMU biases is enough to result in very un-level flight. You could also set the IMU bias to zero if you don’t want to have to constantly re-calibrate. We’ll likely revisit this once we finish our fixedwing development and move onto multirotors.

Also, currently only attitude and attitude rate control are supported by the rosflight firmware. We plan to add more sophisticated control in either the firmware or ROScopter in the future, but we’re not there yet. It may also be worth mentioning that the firmware’s complimentary filters used to estimate attitude are known to struggle to observe their bias under constant acceleration, so under certain flight conditions (like flying a long ways away at constant input) control may break down. This is also something we plan to visit in the future.

Thank you for your reply. I always perform imu calibration and baro calibration every time I run Gazebo. Multicopter flight is possible in the simulation, but hovering and stable flight are not possible. Before setting up the actual hardware and controlling the multicopter, I want to check whether stable flight is possible through Gazebo simulation. I am curious as to whether there is a place to control PID or modify parameters separately in the simulation.

You said you could set the IMU bias to 0 if you don’t need to constantly recalibrate. Do I need to modify it in the parameters? It’s hard to find as it’s missing a lot. Can you help me? Also, I am currently running a simulation in Gazebo in several cases, but the motor output value is unstable. Could you help me?

You can modify the IMU parameters by adding parameters to the multirotor.yaml file found in rosflight_sim/params. There is also a README.md describing these parameters. The ones you’ll be interested in are the ‘acc’ values. https://github.com/rosflight/rosflight_ros_pkgs/blob/0e4d0ec38a8fd78eb8c63d4a1e0442fa72e34831/rosflight_sim/params/README.md

If you want to try and improve the performance of the firmware’s attitude control, there’s a page on the website about that: https://docs.rosflight.org/git-main/user-guide/improving-firmware-performance/

I don’t think I can help you much more than that. As I mentioned previously, we’re still working on the recent revamp to ROSflight and multi-rotors in particular have yet to receive any attention. We also don’t have firmware targets for any commercially available flight controllers, as our one hardware target is an in-development board that has yet to be released. We’re working on getting all of these issues resolved and polishing everything up, but we’re not there yet.

Thank you for answering my questions.