EKF and Motion capture Offboard flight

I have troubles flying offboard with motion capture and ekf. This is my log file: Flight Review
I am using a custom device that provides me with the drones position if it is close. I am trying to test a simple takeoff at 0.80 cm. On the flight log you can see how at 1:30 the x and y are lost, z becomes the opposite so probably switches coordinate systems. And my drone just got higher and continued to move around the room. Can you please tell me how to keep my drone into one position when it reaches certain setpoint and how to prevent switching between coordinates system (if that’s the case)? And why do I have px4flow scanning at the beginning did I do something wrong in my set-up? Please, help me analyse better my log file.

Hi,

Can you inspect the position data without the propellers on? Just move the drone manually. Can you cause the tracking to break? In QGC, go to Inspect>Analyze and look at the Vision messages. ATTITUDE and rate messages can be a good indicator of a problem (i.e. reversed coordinate).

What tracking system are you using? You need something quite precise, <1 cm resolution.

Also, it looks like you lost tracking at 1:25. The Local Position Z becomes > 0, which would be under the floor, assuming you origin in on the floor.

While moving manually, the measurements are accurate. But after flying to the setpoint it stays for half second then continues to go up. How can I stop it at one position?

What I mean is that the issue may not with the controller not keeping the position: it may be with the Pixhawk position estimator. Look at the graph ‘‘Local Position Z’’ at 1:30. The position does not seem to make sense. This can happen when tracking from your tracking system is lost momentarily. Could the vibrations on the drone cause that issue? The position estimate could be fine when moving manually, but the vibration from the propellers could cause issues with the tracking system or with the transmission of data (loose connectors).