Problem with internal magnetic sensors PIXHAWK 3 PRO

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

You need to be a member of diydrones to add comments!

Join diydrones

Replies

  • 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,

  • 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,

    QGC1.JPG

    QGC2.JPG

    QGC3.JPG

    value.it - This website is for sale! - Value Resources and Information.
    This website is for sale! value.it is your first and best source for all of the information you’re looking for. From general topics to more of what y…
  • 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,

    Problem with internal magnetic sensors PIXHAWK 3 PRO
    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 directio…
  • 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,

    Problem with internal magnetic sensors PIXHAWK 3 PRO
    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 directio…
  • 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,

    Problem with internal magnetic sensors PIXHAWK 3 PRO
    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 directio…
  • 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,

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

  • 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,

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…