we are currently facing a constantly increasing overshoot of the x- and y-position of our UAV when using the position hold mode and have not found a solution for this problem yet. Due to the overshooting, the UAV starts circling around the actual position setpoint and thereby tilts in towards the centre of those circles.
We use an UWB tracking system (pozyx) to capture the current flight position and then stream the information from a companion computer via mavros to the /mavros/vision_pose/pose topic.
We are using the LPE and the tracked position is send to the FCU at a rate of ~ 10 Hz. The position reliably arrives at the FCU and the local_position follows the vision_position quite well.
At the moment only the position data is fused into the LPE, to determine the orientation we use an external compass. Therefore we set ATT_EXT_HDG_M = 2 and LPE_FUSION = 4. We tested different values for both LPE_VIS_XY and LPE_VIS_Z but could not find suitable values, which would prevent the overshooting.
We use the Intel Aero Drone with the px4 1.7.1 stable build.
Please find a log of a test flight here: Flight Review
I have also attached a picture from the log file. As you can see, some seconds after switching to the position hold mode x- and y-position start oscillating around the corresponding setpoint. The amplitude of the oscillation increases until we have to switch back to the stabilized flight mode to prevent the UAV form crashing into the wall.
Could anyone provide help for this issue? Do we need to perform PID tuning, is there a malfunction of the compass or the like?
Thanks a lot in advance!
Does anyone has some ideas about this behaviour?
Without looking at your log your description sounds very much like “toilet bowling”. This can happen if the heading with respect to your reference frame (the one in which you estimate position and velocity) is not estimated well. Did you make sure that your external compass is measuring the correct heading?
E.g. if your UWB reference frame north axis is not aligned with the magnetic north axis you could have a problem.
Thanks for the reply.
I verified that the measurements of the external compass are correct. But you are right, the reference frame north axis is not aligned with the magnetic north axis. The angle between the two north axis is around 45°.
I fear that i lack a bit of understanding at this point. When I set ATT_EXT_HDG_M = 0 is then the external compass used to determine the heading (and I have to make sure, that both north axis are aligned)? Otherwise when I set ATT_EXT_HDG_M = 1, will then the orientation provided by the vision system be taken into account to determine the heading and the data of the external will be ignored?
Im having the same issue. Among others that Ive noted in my “Solid purple light” post. Im a newb and dont have any advice, but willing to try to use mine as a double if you want a confirmation it worked for me too sorta thing… Ill be following.
How are you providing heading information to the attitude estimator? You said something about a compass. Normally when you use MOCAP the attitude estimator uses the estimated attitude and extracts the heading from that.
When you set ATT_EXT_HDG_M = 0 then the system will use the magnetometer data to estimate the heading. In this case you need to make sure that your X axis from your estimation frame points to magnetic north. Your other option is to adjust the declination parameter of the attitude estimator for the offset. So in your case you would set it to ± 45 degrees. Why don’t you give that a try?
I adjusted the declination parameter to the actual offset between the two coordinate systems, and it solved the problem!
The position hold now works well with the pozyx system and we only need to do some tuning to optimise the deviation from the actual setpoint.
Thanks for the help!
@MarLi: which parameter did you use? ATT_MAG_DECL with +/-45 degrees?
Yes, we adjusted the ATT_MAG_DECL so that the x-axis of our estimation frame points to the magnetic north.
But as we couldn’t use the compass to determine the orientation we faced a drift in the yaw angle. Therefore we had to use two pozyx-Tags to be able to calculate the orientation of our multicopter.