Copter in SITL rotates uncontrollable along the yaw

Copter in SITL rotates uncontrollable along the yaw when low throttle is applied, and the PWM on servo1-4 also starts jumping, what could it be? And how can i fix it?

Hi @VasilkovskiiVS,

I think you’re using gazebo but we need a lot more information to help. Which wiki page did you look at to get this going?

BTW, I’ve moved your topic to the 4.6 category

Hello, yes, I use Gazebo in conjunction with ardupilot. I made my own model of the copter, then adjusted its physics, saw that the drone was spinning. I decided to see how Iris behaves, I installed it according to these instructions, as a result, using the basic parameters of Iris and with the remote control connected via MAVProxy, with a small throttle, the pwm on the motors starts jumping, and the copter starts spinning around its yaw axis.
I have attached a video recording of the screen in the archive.

instruction:
udo apt update
sudo apt upgrade -y

sudo apt install -y git python3-pip python3-matplotlib python3-lxml python3-pyparsing python3-serial
openjdk-11-jdk ant protobuf-compiler libtool make g++ automake autotools-dev autoconf

git clone GitHub - ArduPilot/ardupilot: ArduPlane, ArduCopter, ArduRover, ArduSub source
cd ardupilot
git submodule update --init --recursive
echo “export PATH=$PATH:$HOME/ardupilot/Tools/autotest” >> ~/.bashrc
echo “export PATH=/usr/lib/ccache:$PATH” >> ~/.bashrc
source ~/.bashrc

(Because of Ubuntu 24.04):
cd ~/ardupilot
python3 -m venv env
source env/bin/activate

(after that MAVproxy):
sudo apt-get install python3-dev python3-opencv python3-wxgtk4.0 python3-pip python3-matplotlib python3-lxml python3-pygame
pip3 install PyYAML mavproxy
echo ‘export PATH=“$PATH:$HOME/.local/bin”’ >> ~/.bashrc

(and some libs like setuptools, etc.)
python3 -m pip install setuptools

(start command)
gz sim -v4 -r iris_runway.sdf

./Tools/autotest/sim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --map --console --mavproxy-args=“–load-module=joystick”

@VasilkovskiiVS, is the issue with the standard iris with gimbal model (no modifications)? The only difference I can see is that a joystick is enabled. It would be helpful to see the console output from mavproxy, and commands entered (very hard to tell on the video). It may be that there are competing commands coming from mission planner, the external joystick, and the mavproxy session hosted by sim_vehicle.

If you just run sim_vehicle.py (no MP), and drop the joystick, does the copter behave correctly i.e.

STABILIZE> mode guided
GUIDED> arm throttle
GUIDED> takeoff 10
GUIDED> rc 3 1500
GUIDED> loiter 
LOITER> 

Okay, thanks, I’ll try it today, but this problem is very visible when flying in ACRO mode, I thought it was my model, but the problem starts even on the original IRIS.
The problem itself is noticeable if you just fly up high and release the throttle handle to 0, as soon as the throttle approaches 0, the ardupilot plugin causes the copter to spin around the yaw axis. For comparison, I conducted similar tests with the PX4 SITL, in it the copter just falls to the ground, as in real life (the PWM also jumps), but there is no rotation.

Video recording with comparison is also available on GOOGLE Disk:

So the test is

  • Takeoff and ascend to some fixed altitude
  • Set throttle low
  • Observe behaviour
  • Repeat for various modes

You expect the copter to fall without rotating, and something else is happening.

The behaviour difference is most likely due to the approach used to model motors and props (LiftDrag plugin vs MultiCopterMotorModel). The latter can be set up in ArduPilot as well, so not really a SITL issue as such if this is the cause, but a different approach to the physics modelling.

yes, that’s right, because my model has more thrust, so I often use low thrust, and in flight I can catch this rotation effect.

Should I run the test that you wrote above in Loiter and so on?

Also I didn’t find any information, how I can use MultiCopterMotorModel with ardupilot SITL. Do you have any instructions?

I made a test according to your scheme.:

  1. I started with the joystick, leaving only the throttle channel in yaml (to remove the influence of noise from other channels):
    a) raised the copter in guided mode and lowered the throttle value to 0 in Loiter mode (fell normally);
    b) raised the copter in guided mode and lowered the throttle value to 0 in Acro mode (fell normally);
    c) raised the copter in guided mode and lowered the throttle value to some small value in Acro mode (started rotation).

  2. I started it without the joystick:
    a) raised the copter in guided mode and lowered the rc3 value to 1000 in Loiter mode (fell normally);
    b) raised the copter in guided mode and lowered the rc3 value to 1000 in Acro mode (fell normally);
    c) raised the copter in guided mode and lowered the rc3 value to 1150 in Acro mode (started rotation).

What’s why I think that problem isn’t in joystick. This problem only occurs with small throttle values. This effect is observed in ACRO and STABILIZE mode.

Video of the test at the link: https://drive.google.com/file/d/1mFZScIY6GSwDlBft7k__Nk4t6pAJhkHR/view?usp=drive_link

Hi @VasilkovskiiVS,

If the throttle is pulled to zero while in Acro mode then it’s going to fall to the ground. I wonder why it matters if it rotates or not? In real life it would tumble, spinning in various axis

The copter rotates not when the throttle value is 0, but when it’s close to 0 like 1150. This problem makes it difficult to fly with these throttle values, because at any random moment during flight in SITL in stabilize or acro mode, the copter can start rotating around the yaw axis, and if you suddenly give it throttle, it immediately stops.
Above, I simply described a quick way to test this issue.
If you have instructions how to connect a MultiCopterMotorModel plugin, I’d be grateful, as this effect isn’t observed there.
Otherwise, let’s fix it somehow. If necessary, I can record a video showing how this occurs in flight.

I’ll note that in real-life in acro and stabilize flight modes, I often use low throttle values, and I wanted to enter my copter model and its parameters into SITL, but I discovered this effect, which I couldn’t remove using parameters and coefficients. That’s why I created this topic.

Hi @VasilkovskiiVS,

It might help to enable AirMode which will keep the motors running even if the throttle is zero.

Also if you’re attempting to control the vehicle from an external process (e.g a companion computer) then it’s better to use Guided mode rather than RC inputs. We have a wiki page here with all the various controls available. I’m afraid that we don’t support rate modes in Guided mode (see SET_ATTITUDE_TARGET on the above linked page) but we could add that if you need it.

I tried AirMode, but the effect remains.
Regarding RC inputs, I’m not trying to control them from an external device, only from my tx12. I’m currently working on a student project using ArduPilot, SITL, and Unity to create a universal simulator with both graphics and open source code. I’d really like to fly in the simulator in Acro and Stabilize modes with the same parameters and effects as in real life, but this effect ruins the current version.
So, if there’s no solution to this problem using LiftDrug, could you please provide information on how to reconnect SITL to MultiCopterMotorModel plugin?