Firmware version: PX4 v1.10. Hardware: Pixracer; I use one external magnetometer (HERE2) and turn off the internal one.
These jumps are followed by the message [sensors] MAG #0 fail: STALE!. During the “jumps”, mag indeed outputs a fixed value by all 3 axis:
I know that I haven’t provided much data nor steps to reproduce, and also this “bug” is very subtle. I am creating this post in hope that maybe someone has encountered the same issue. Any advice/questions are welcome.
I have seen spikes with Here 2 over I2C but never timeouts like this. Have you checked that the I2C lines are not too long and not close to other wiring? Does it happen when you move the cables in a way?
In general they recommend to use the Here 2 over UAVCAN but I think this issue should tracked down nevertheless.
Some more data points that would be interesting:
Does it happen on other hardware, e.g. not with a Pixracer but something else?
Does anything else in the log file have these pauses?
Does it happen with other Here 2 hardware, or do you only have one?
Does it still happen with a fast (more expensive) SD card? (There could be some other effects be happening.)
Could you upload that log to http://logs.px4.io please, so I can have a look? Thx.
I continue to see the these glitches. Some of them are П-shape like on the plots above, followed by MAG #0 fail: STALE! message, and some look like pikes:
@CarlOlsson can you please specify the model of magnetometer you use (is it here2?), do you connect it over I2C or UAVCAN and what is the voltage on your board?
I have the same behavior.
My configuration is Pixracer R15, PX4-1.8.2, LIS3MDL internal magnetometer is used for priority and no external magnetometer is used.
While flying: Strange magnetometer surges happen! and errrormessage “MAG #0 fail: STALE!”
Then switch to another mag:
2:14:834 WARNING [sensors] Remaining sensors after failover event 0: Mag #0 priority: 1
2:14:834 WARNING [sensors] Remaining sensors after failover event 0: Mag #1 priority: 50
I’m running PX4 (1.13.0 and 1.13.2) with PixHawk Cube 2.1 Black w/ Here 2 GPS and I’m still getting magnetomter failed message. Its hit and miss. I have to do several reboots to get good measurement from magnetometer. But if it starts with good readings, it stays good as long a power remains on.
I currently have nothing connected to CAN1. I have ESC and UACAN adapter (Babel) connected throguh CAN2.
I’m using Here2 GPS (ICM20948 and MS5611) connected with standard 8-pin cable (Serial3 and I2C1) through a custom interface board. Is MAG #0 data from ICM20948? When I execute the "icm20948 status at MAVLink Console, I get “INFO [SPI_I2C] Not running” message. I do seem to have xmag, ymag, and zmag reading throught SCALED_IMU and SCALED_IMU2 (both FC and GPS installed in their default orientation with no rotation) but they don’t match. xacc,yacc, zacc do for both IMUs match.
Is there an easy way to deteremine which sensors and mapped to the various data in PX4 and through which interface?