Matek vs Matek, Compass calibration

Configuration:

  • Controller: Matek H743, mounted where arrow points to Drone left size, hence AHRS_ORIENTATION set to YAW270 (option 6). Accelerometer calibrated with no issue, and on Data tab orientation of quad seems OK.
  • GPS/ Compass: Matek M8Q-5883, mounted with arrow forward with settings as per my understanding of manufacturer’s CW270Flip: WAY270/ Pitch180, COMPASS_ORIENT=27.
  • Frame type: FRAME_CLASS= QUAD (option 1). FRAME_TYPE=BetaFlightX (option 12).
  • Servo mapping: Only settings I can get to have motor test go in correct sequence (i.e. front right A → B ->C ->D) is Servo 1: Motor 1, Servo 2: Motor 2, Servo 3: Motor 3, Servo 4: Motor 4. NOTE, motors are mounted on quad such that 4-2 are in front (2 on the right), and 3-1 in the back (1 on the right), typical Betaflight setup. Note, any other mapping produces ABCD tests out of sequence.

Issues:
1- When controlling the quad, Pitch axis is reversed. Seems it is still considering motors 1-3 are in front. If this is the case, what is the mapping that would produce correct test sequence for stated configuration?!
2- Cannot get compass to calibrate with stated settings - no magnetic interference etc. Maybe a knock on effect of issue 1.

Your help is highly appreciated.

  1. This is typical. Reverse the pitch/elevator channel on your Transmitter. Every model I have (many) this is done.
  2. Set the Compass orientation back to default. COMPASS_AUTO_ROT is enabled by default and should determine and update the orientation parameter correctly when the compass calibration is performed
  • Yup, reversed pitch channel, only way to fly it at the moment.
    COMPASS_AUTO_ROT set to 2 or 0, no give, Calibration bar keeps incrementing with every move, whether pointing each side to ground with rotation or not, whether fast or extra slow, doesn’t matter, just keep recycling and restarting at 1%. I had another setup where after initial rotation there is not much progress on bar (I think not too much deviations) and it notifies me calibration is done/ saved, restart. With this one, two new compasses are not getting there, so, I doubt they are both defective.

It does this after you have set COMPASS_ORIENTATION to 0?

Yes Sir.
From My Arduino days, which are not much, I recall determining axis is as simple as rotating each of them North and when it faces North it gives max reading when it faces south it gives lowest reading. Augment that with Flight controller axis direction and figuring out the compass axis and its offset should not be such a pain, yet, it’s been very painful thus far trying to get this to work.

Note, I also changed quad setup to quad-x, remapped motors and got their ABCD sequence right, and as part of the change recalibrated accelerometer in case that changes its offsets (yet it is still at YAW270). Yet, no luck getting the compass to calibrate.

Yea, I don’t think that matters. I have a couple of quads with that same combination of FC and compass and didn’t have a problem. But on those I used the standard FC orientation. That said, on other craft where it wasn’t the Auto Rotation performed correctly during calibration.

Relative to your comment about determining compass orientation there is additional info on the Wiki about that:
Compass Setup

Yes Sir, been through that and was interested in the note “When rotating your aircraft through all axes each of the compasses should move in the same direction”, but it didn’t help.

Hmm. Post a parameter file or a link to a .bin flight log perhaps there is something to see.

1 Like

Will do when I get a chance, this flight controller (Matek H743 Wing V3) seems to have some issues. Beeper does not work if bidirectional dshot is installed. If normal build is installed, it keeps disconnecting from Mission Planner with every operation change, e.g. change mode, calibrate compass etc. Not sure what the issue is. Also, the command line gives binary code, no matter what connection baud rate is. lots of inconveniences.

What command line?

If I go into Setup → Advanced → Terminal and Connect to APM, all I get is binary information. not clear text, and it keeps scrolling through it.

Thought that’s what you meant. Terminal hasn’t been useful for anything for a very long time. It means nothing.
Old CLI
You said you flew it so a .bin flight log could be useful.

Thanks @dkemxr , will do, I will be flying it this weekend. If you need me to enable certain logs other than compass please let me know.
By the way, I had a brief look at code related to 3885L compass code. Not understanding much, yet it seemed to me it adds an angle to the axes, so, revised Matek spec and realized orientation should be set to None for ArduPilot (unlike BF and INAV CW270FLIP!). I did that, yet no calibration was possible. Another brief look at compass calibration code and it seems to indicate the calibration process assumes the rotation of the drone takes place in one direction (for all axis). So, I did that and interestingly, I got compass calibration several times ONLY if I rotate all axis lets say in positive direction. Any other rotation I tried did not yield successful calibration. Not sure if this is normal or it is just my imagination.

A newbie question, how do I upload the file here, I don’t see attachment icon?
I thought I figured it all, however, I experienced couple of things.
1- At the start of each flight, it yaws left or right randomly then stabilizes. Not sure why is this if compass already aligned.
2- At the end of a 10 minute flight that included switch between ALTHOLD, POSHOLD and STAB, and during a full throttle in STAB followed by POSHOLD (which passes through ALTHOLD switch position), the drone just crumbled and fall of the sky. Hopefully when I post the log you maybe able to provide a hint why this happened.

You don’t. Attach a link to where it’s stored (Dropbox, etc).