I am having troubles with my drone. I tested manual, position and hold mode. Unfortunately it doesn’t follow accurately the setpoints when in position mode, it basically drifts away. I am using motion capture and I am indoors. What should I do? What is wrong with my set-up, calibration or parameters. I have problems flying in offboard mode as well
Best would be to upload a log file to https://logs.px4.io, then link it here, and maybe describe what happened, or post a video to explain it.
Basically since my drone crashed a lot in offboard mode I decided to test other modes and it doesn’t look good.
These are the logs, in manual mode it doesn’t follow strictly the given commands, I am using a joystick at 100hz rate. In position mode after the manual mode it just drifts away and crashes in my walls.
It is probably due to set up, calibration or parameters but I am clueless how to change it.
And some more from today
Same thing. Pitch, yaw, roll not really good.
Ok, so I looked at the very first log and I can see that you first fly in stabilized mode which seems to work ok. Then you switch to position control.
Now, the attitude still seems to be following the attitude setpoint fine, however the velocity and position diverges rapidly. This let’s me believe that something about the coordinate system must be wrong. Have you checked that the heading is correct with North defined in your position system and that all the signs are correct? It is likely that the mag is off indoor where you have a lot of magnetic interference.
Edit: Also, it seems that your magnetometer is also disturbed by the motors and or power cables. You can see the correlation between thrust (= more current) and the magnetic field here: https://logs.px4.io/plot_app?log=cd0fb154-cd8c-4eb5-b885-438d103d3ae8#Nav-Thrust-and-Magnetic-Field
I suggest that you use an external magnetometer like the ones on the GPS and move it far away from wires and motors. And also make sure to twist all cables that have DC current on them such as battery to power module and power module to ESCs, this also reduces the electromagnetic field.
Another idea would be to use the optitrack for the yaw angle instead of the magnetometer but I don’t know how or if that can be done.
THANK YOU SO MUCH , @JulianOes!
I will dig into that. Thanks again for your responses and really helpful answers.