I’m working on a custom tiltrotor drone setup in Gazebo with ArduPilot. The vehicle has four motors, and all of them are tiltable using servo-controlled joints.
However, I’m facing two major issues:
Drone crashes on takeoff:
When I arm and give a takeoff command, the drone starts to spin and loses control, eventually crashing. It appears to rotate uncontrollably before hitting the ground.
Motors spin while disarmed:
Even when the drone is disarmed, I notice that the propellers are spinning in the simulation. I expected all motors to be completely idle when disarmed.
I suspect the issue may be related to joint PID values, motor directions, or how the control plugin is configured in Gazebo. Any help or suggestions would be really appreciated!
@shraddha - would need to see the model and logs to understand the issues.
Motors spin while disarmed:
PIDs for velocity joint controllers are not correct. Best guide is to start with an existing model with similar dimensions and use the same control settings. There are a number of examples, including tilt rotors, here: SITL_Models/Gazebo/docs at master · ArduPilot/SITL_Models · GitHub
Drone crashes on takeoff
If the velocity joint controllers are badly tuned then the autopilot will struggle to control the vehicle. Once the Gazebo controllers are working well, move onto tuning the attitude and rate controllers as you would for a RL vehicle. If the vehicle is initially unstable in STABILIZE, reduce the gains by 1/2 until the oscillations cease. It may help to initially set D gains to zero on Gazebo models.
Update: The drone crashing issue is now resolved. It turned out that there was a mismatch between the PWM values .
However, I’m now facing a yaw issue:
Once the drone takes off and reaches the target altitude, it starts to yaw continuously even though no yaw input is given.
I’m attaching:
A screen recording showing the yawing behavior after reaching altitude.
I’d appreciate any suggestions on what might be causing this. Thanks again for your support!