Compass and Baro Error

I have a Trex 450 Running Arducopter 4 Traditional Heli. The copter is flying well in Stabilise, Alt Hold and Loiter but get the following errors in the logs.

Baro-4 and Compass-4 errors

The Hardware is a Matek F450 wing and a 3DR GPS which is rotated at 270 Degrees. I have calibrated the compass at several different locations and get constants offsets.

Below are Logs and a picture of the setup.

David Ardis

@ardisd Hi David,
Sorry it took me so long to get back to you. I was able to enlist @tridge help on this. He went through quite a bit of different things to figure out the issue. Here is what he thought could be the issue
Poor quality power being supplied to the board
RF interference from an antenna ( you could remove any antennas and see if the problem goes away)
Wiring to GPS causing a problem on I2C (if there is a long wire run to the GPS, you could use a shorter wire and temporarily move the GPS and install the GPS closer and see if the problem goes away)

Looking at the errors, both the compass and baro errors were occurring at exactly the same time which leads us to think it is a communication problem

he asked whether you could reproduce the problem on the bench using a LOG_DISARMED set to 1 and fast logging.

The other thing he suggested was seeing if you saw a similar problem if you put the same set up on another matek same model board. If you could reproduce the problem that way then it could be a board issue.

Along the lines of the problem being an I2C problem, he wondered if you installed a pull up on the I2C. He said that the directions on how to do it are provided by the manufacturer.

Sorry about the uncertainty of the diagnosis but there wasn’t any data that could point us to conclude on what the issue is.

Again I apologize for taking so long to get back to you.
Regards,
Bill

Bill @bnsgeyer

Don’t worry about the delay its not a problem.
Based on the suggestions detailed above I did a few tests.

Power appears to be quite good enclosed is a link to a screenshot from the scope. This was done across the power pins of the GPS Module

The only antenna on the Trex 450 is the Radio receiver I had already removed everything else. I shortened the GPS cable by 150mm and it made no difference.

On the bench I enabled fast logging and set log-disarmed to i and got a lot of BIN files https://www.dropbox.com/sh/hv68d8ge6xvb48z/AAAoH4nA6lNlelONbDlRsyV5a?dl=0

I don’t have another F405 board but could get one.

On the Pull Up resistor issue I don’t see any reference to installing a pull up resistor. perhaps you have a link

I also did a put the scope on the I2C clock and data line below are links to the sreenshots
Clock looks good. But I think there might be an issue with the data. There is a sharp peak, the voltage might be low and the noise.

Clock

Data

Thanks again
David Ardis

Bill

Just wondering did you get my replys to your questions and did it make sence

Thanks

David Ardis

@ardisd I saw them but haven’t had a chance to enlist @tridge help. I need to get you to speak with Tridge directly as I am not a hardware guy. If you have a discord account, you could get on and speak to Tridge about your findings. I will try to catch him tonight and see what he feels the next step would be.

V/R,
Bill

If the scope you are using has had its probe properly calibrated then that is a pretty bad I2C trace. We see a slow rise time, and we’re seeing crosstalk between the clock and data lines. Unfortunately this is also what it looks like when the scopes probe isn’t properly calibrated.
I don’t know if the F405 boards from Matek provide a pullup on the I2C lines. Many boards originally designed for the inav/betaflight community don’t do that as they want to be able to reconfigure the pins as uarts when desired. So they leave off the pullups and let the user add the pullup when they want to add an i2c device.
You’d need to ask Matek if they do have pullups on their boards. If they don’t, then you should put a 1.5kOhm resistor between the SCL and SDA lines and the 3.3v rail.
Cheers, Tridge

I have checked with @Sampson from Matek and the f405-wing does have pullup resistors of 4.7kOhm

@tridge @bnsgeyer Calibrated the scope probes and they where out unfortunately when I checked the I2C Data line there is still crosstalk from the clock line.
Going to strip the Flight controller out and check all the wiring.

David Ardis

@tridge @bnsgeyer Checked all the wiring and could not find anything wrong. Going to order a new flight controller

David Ardis

@bnsgeyer got a new Matek H743 Wing Flight Controller with a CAN GPS. Have done one test flight with no errors. Hopefully in the next few weeks will get the Trex 450 flying setup to fly as well as the other flight controller. Going to put the F405 flight controller in a plane and see if I get any errors.

Thanks for you help and happy new year

David Ardis