Firmware v1.7.3 & QGC v3.3.0


During test flights I noticed that the drone does not fly the route I specified, but always flies in any other direction. Several times I recalibrated all sensor systems with QGroundControl and still got the following warining: preflight failed mag sensors inconsistent

After a few searches, I found the cause:
One internal magnetic sensor provided data that differed greatly from the other internal magnetic sensor and the magnetic sensor of the external GPS compass module. I created plots in all three axes using FlightPlot.

Internal magnetic sensor (sensor_mag_0 & sensor_mag_1):

External magnetic sensor (sensor_mag_2):

I can’t tell which sensor is exactly mag_0 and which is mag_1.

mag x
mag y
mag z

In the X-axis the magnetic sensor 1 has an offset, in the Y- & Z-axis it looks as if the signal is mirrored.

First tried to change the orientation of the sensor (CAL_MAG1_ROT), but after the QGC after the fifth time, set the value back to Internal mag, we left this.
As a result, I have deactivated the magnetic sensor in QGroundControl, which has a systematic deviation (CAL_MAG1_EN set to Disabled).

cal_mag

Since that moment, the drone has been flying exactly as planned!

My questions are this now:

  • Where could the error come from with the wrong signal?
  • How can you fix it yourself?

Thanks for your help!
Regards Cédi

Views: 454

Reply to This

Replies to This Discussion

Hi @Cedi,

Did you figure out your issue? I am also facing a similar problem.


But first, may I know how did you plot up those sensor_mag values? Is there a parameter to enable to visualize the mag values separately?

Regards,

To me it looks you didn't set the orientation (s) proper of the magnetic sensors.

Hi Armin,

Thanks for the insight. Actually, I have set the system such that vehicle and the external compass points in the same direction. Before calibration of the compass in PX4 firmware, I have set the orientation of auto-pilot and the external compass to 'No Rotation' in Sensor Orientation Tab in QGroundControl. 

I would like to investigate the mag sensor values of both the internal and external magnetometers separately. What would be the mavlink messages associated with it? Is there a way to plot these values in QGroundControl/Mission Planner?

Regards,

Same direction, but it looks your external sensor is upside down. I would for testing the external  or both internal sensors rotate 180deg around the x-axis.



Drone_Gandalf said:

Hi Armin,

Thanks for the insight. Actually, I have set the system such that vehicle and the external compass points in the same direction. Before calibration of the compass in PX4 firmware, I have set the orientation of auto-pilot and the external compass to 'No Rotation' in Sensor Orientation Tab in QGroundControl. 

I would like to investigate the mag sensor values of both the internal and external magnetometers separately. What would be the mavlink messages associated with it? Is there a way to plot these values in QGroundControl/Mission Planner?

Regards,

Hi Armin,

The plots that you see in the beginning is not my case. That was the case from the original poster, Cedi. My question is how to get those plots so that I can investigate my case further.

Armin Strobel said:

Same direction, but it looks your external sensor is upside down. I would for testing the external  or both internal sensors rotate 180deg around the x-axis.



Drone_Gandalf said:

Hi Armin,

Thanks for the insight. Actually, I have set the system such that vehicle and the external compass points in the same direction. Before calibration of the compass in PX4 firmware, I have set the orientation of auto-pilot and the external compass to 'No Rotation' in Sensor Orientation Tab in QGroundControl. 

I would like to investigate the mag sensor values of both the internal and external magnetometers separately. What would be the mavlink messages associated with it? Is there a way to plot these values in QGroundControl/Mission Planner?

Regards,

Oh sorry my mistake.

In QGC under the menu Wigets is the Analyze. Use that tool to plot in real-time that data. My suggestion is to connect the Pixhawk directly via USB to your computer. The data update vie your telemetry link is slow and might not provide all raw data depending on your configuration.

Drone_Gandalf said:

Hi Armin,

The plots that you see in the beginning is not my case. That was the case from the original poster, Cedi. My question is how to get those plots so that I can investigate my case further.

Armin Strobel said:

Same direction, but it looks your external sensor is upside down. I would for testing the external  or both internal sensors rotate 180deg around the x-axis.



Drone_Gandalf said:

Hi Armin,

Thanks for the insight. Actually, I have set the system such that vehicle and the external compass points in the same direction. Before calibration of the compass in PX4 firmware, I have set the orientation of auto-pilot and the external compass to 'No Rotation' in Sensor Orientation Tab in QGroundControl. 

I would like to investigate the mag sensor values of both the internal and external magnetometers separately. What would be the mavlink messages associated with it? Is there a way to plot these values in QGroundControl/Mission Planner?

Regards,

Hi Armin,

Thank you very much for the suggestion. I am using that to check if sensor_mag values are provided individually.But I am only able to find the fused magnetometer value.It shows up in the second pic as "M1:HIGHRES_IMU.xmag" etc.

How do I find the individual sensor_mag values to plot them up?The first pic shows that there are 3 compass(1 external and 2 internal). 

I had also set the SDLOG_PROFILE value to obtain the sensor values individually(See pic 3) but not sure how to see it in the mavlink monitor.

Regards,



Armin Strobel said:

Oh sorry my mistake.

In QGC under the menu Wigets is the Analyze. Use that tool to plot in real-time that data. My suggestion is to connect the Pixhawk directly via USB to your computer. The data update vie your telemetry link is slow and might not provide all raw data depending on your configuration.

Drone_Gandalf said:

Hi Armin,

The plots that you see in the beginning is not my case. That was the case from the original poster, Cedi. My question is how to get those plots so that I can investigate my case further.

Armin Strobel said:

Same direction, but it looks your external sensor is upside down. I would for testing the external  or both internal sensors rotate 180deg around the x-axis.



Drone_Gandalf said:

Hi Armin,

Thanks for the insight. Actually, I have set the system such that vehicle and the external compass points in the same direction. Before calibration of the compass in PX4 firmware, I have set the orientation of auto-pilot and the external compass to 'No Rotation' in Sensor Orientation Tab in QGroundControl. 

I would like to investigate the mag sensor values of both the internal and external magnetometers separately. What would be the mavlink messages associated with it? Is there a way to plot these values in QGroundControl/Mission Planner?

Regards,

Attachments:

Hey Cedi, The MPU9250 (an obsolete component) uses the AK8963 Hall effect sensor and the MPU6500 gyro/accel. The LIS3MDL is a magneresistive sensor, so I would expect the output of the two LIS3MDLs to have similar quality of their plots..

The additional difference is the chip's orientation. The LIS3MDL x-axis is 90 degrees CCW from pin1. The MPU9250(AK8963) x-axis is parallel to pin 1. Therefore, on the Pixhawk 3 Pro from Drotek, I would expect the LIS3MDL to be rotated CW 90 degrees on the PCB or in relation to the MPU9250. This would make both on-board sensors orientation the same. If Drotek did NOT take this into account (I have no image of the PCB), then a correction of 90 degrees would be needed for one of the on-board sensors.

I suggest that more than likely of mag0 and mag1 are the on-board sensors, Mag1 (teal colored trace in first plot image) is the MPU9250(AK8963). Mag0 and Mag2 (blue and pink) are the LIS3MDL. It is apparent in the signal quality difference.

Can you post an image of the Pixhawk 3 Pro PCB?

Good luck!

Hi Thomas,

Are you referring to Cedi's post or my question?

If mine, I was not able to find the PCB image for Pixhawk 3 either.

Does the contents of this link give the required info?

https://pixhawk.drotek.com/en/power-architecture.html

Also, the correction that you had mentioned would mean a constant offset of 90 degrees. Am I correct? In my case, it is not consistent. It might be proper orientation sometimes and flipped during other times.

Do you think the correction of an onboard sensor could solve the issue?

Regards,

Reply to Discussion

RSS

Groups

Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2018   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service