Using NMEA - HDT message as heading/yaw source instead of compass

Hi,

I am kindly new to ardupilot/arducopter firmware. I have read all the discussion here but to be honest that I have no idea, already tried but does not help.

What I am trying to do is replacing/lowering the weight the compass yaw angle by heading angle from HDT message (NMEA).

I have the GPS output GPGGA and GPHDT. Right now, GPS is read (readable long/lat in Mission planner status) but YAW is still drifting. GPHDT is fine when checked it standalone with terminal software . I disable COMPASS_USE, EK2_YAW_M_NSE, EK3_ENABLE are set, what else parameters do I miss?

Sorry if it is considered as a duplication but any suggestions are very much appreciated.
Thanks in advance!

What ArduPilot firmware version are you using?
Here are the key things to check:

  • need to be using master as copter 3.6 does not support this (4.0 will)
  • need to be using EKF3, by setting EK3_ENABLE=1 and AHRS_EKF_TYPE=3
  • need to set EK3_MAG_CAL=5

If it still doesn’t work then let me know.
Cheers, Tridge

I tried both version 3.6 and 4.0 here http://firmware.ardupilot.org/Copter/latest/CubeBlack/
But it is still the same.

I am pretty sure that the EKF3 is already enable and change the AHRS_EKF_TYPE to be 3.

ahh, sorry, one more thing you need is EK3_MAG_CAL=5
If that doesn’t work then please send me a log of it failing and I’ll see if I can work it out

It would also be good to get a terminal capture of the data coming from the GPS

Could you show me how to do this, or a reference link? I am kindly new to this thing.

You have previously said “GPHDT is fine when checked it standalone with terminal software” so I assumed you already had a terminal setup to look at the NMEA data.

Sure, I have tested the GPS module standalone and currently, output GPGGA and GPHDT at 5Hz. I am tuning the parameters.

great, can you send me an example of the NMEA output you see?

Compass is disable
suppose that the yaw and HDT is the same but it is not. When powering up the Cube, yaw is 0 or 360 degree, not the HDT read

This is right at the moment I power up the Cube

Can you please set LOG_DISARMED=1, then boot with GPS lock and let it sit for 5 mins.
Then set LOG_DISARMED=0 and send me the log off the microSD card

Hello,

I will check the log LOG_DISARMED later. However, I am facing another problem.
Everything seems to be ok when working with GPS NMEA at Serial 4, but when I change it to Serial 3 (the primary GPS) with the same setting on SERIAL3, it does not work. Ardupilot does not recognize the GPS NMEA from SERIAL3.

May I have you suggestion on this?

PreArm: Compass not calibrated
PreArm: Compass not calibrated
PreArm: 3D Accel calibration needed
PreArm: Throttle below Failsafe
PreArm: Compass not calibrated
PreArm: Compass not calibrated
PreArm: 3D Accel calibration needed
PreArm: Throttle below Failsafe
PreArm: Compass not calibrated
PreArm: Compass not calibrated
PreArm: 3D Accel calibration needed
PreArm: Throttle below Failsafe
PreArm: Compass not calibrated
PreArm: Compass not calibrated
PreArm: 3D Accel calibration needed
PreArm: Throttle below Failsafe
PreArm: Compass not calibrated
PreArm: Compass not calibrated
PreArm: 3D Accel calibration needed
PreArm: Throttle below Failsafe
EKF primary changed:0
EKF primary changed:1
EKF primary changed:0
EKF primary changed:1
PreArm: Compass not calibrated
PreArm: Compass not calibrated
PreArm: 3D Accel calibration needed
PreArm: Throttle below Failsafe
EKF primary changed:0
EKF primary changed:1
EKF primary changed:0
EKF primary changed:1
EKF primary changed:0
EKF primary changed:1
EKF primary changed:0
EKF primary changed:1
EKF primary changed:0
EKF primary changed:1
EKF primary changed:0
EKF primary changed:1
PreArm: Compass not calibrated
PreArm: Compass not calibrated
PreArm: 3D Accel calibration needed
PreArm: Throttle below Failsafe
EKF primary changed:0
EKF primary changed:1
EKF primary changed:0
EKF primary changed:1
PreArm: Compass not calibrated
PreArm: Compass not calibrated
PreArm: 3D Accel calibration needed
PreArm: Throttle below Failsafe
PreArm: Compass not calibrated
PreArm: Compass not calibrated
PreArm: 3D Accel calibration needed
PreArm: Throttle below Failsafe
EKF2 IMU1 tilt alignment complete
EKF2 IMU0 tilt alignment complete
EKF2 IMU1 initial yaw alignment complete
EKF2 IMU0 initial yaw alignment complete
Frame: QUAD
CubeBlack 002B003C 34355108 38393730
ChibiOS: ab2f8d8d
ArduCopter V3.6.11 (f0d59294)

This problem is solved by feeding Mavlink message GPS_INPUT. Thanks!