How to calibrate compass with PigeonIMU?

We are experimenting with a PigeonIMU and want to see if we can read its compass heading. It is constantly returning 0, which the user manual says is a result of not calibrating the compass, but there is nothing about calibrating the compass in the manual and only something about temperature calibration in the new docs. The enterCalibrationMode method in the api doesn’t seem to do anything either.

(We’ve update pigeon firmware and phoenix tuner to latest versions)

Anyone have any luck with using the compass? We want to use it to try to get an absolute initial heading on the field since there doesn’t seem to be a reliable way to get a good starting heading this year besides being one of two robots starting right on the wall.

Officially, there isn’t a released method to do this. I’d recommend emailing them (unless @ozrien doesn’t mind posting something in here?), though you’ll probably get a response saying it’s not recommended for FRC applications due to the magnetic interference experienced indoors and near motors.

How bad would the interference be? I would hope to use it just to home the gyro before or at the beginning of a match, before anything is running, but I can imagine why being indoors would ruin this.

Is there any other way to zero the gyro I’m this case?

Generally, zeroing against a wall has been the only way to know your orientation absolutely.

Are you certain that the Pigeon works correctly? Can you see any data being returned in Phoenix tuner?

Our students were struggling with something similar on the weekend and it turned out to be a subtle difference in the constructor for the Pigeon object in Java. If your Pigeon is directly wired into your CAN bus, then you initialize it one way. If your Pigeon is connected via a Talon data port, you initialize it a slightly different way. If you get it wrong, you’re reading a ghost Pigeon that always returns 0.

Edit: We read the fused heading, not the compass value.

Compass heading will return 0 (compass is default un-calibrated). The Yaw signal will read correctly, which is likely what you are looking for. This will also match the yaw reading in the Tuner self-test.

The Pigeon-IMU compass calibration was never added to the doc despite being supported in Pigeon firmware. In testing our IMU (and other popular FRC IMUs) we found that the magnetometer typically causes more problems then solves since placement near magnetic/ferrous materials is common and can wreak havoc on compass readings, particularly in an indoor environment. If you rely on magnetometer, your placement requirements becomes complex . Finding a spot on the robot that is center-of-rotation and far from steel/magnets can be difficult.

You will stand to benefit far more by performing the thermal calibration strategy, its far simpler to perform, only needs to be done once, and temperature is a far greater contributor of IMU error in FRC then anything else, second to maybe center-of-rotation placement.

1 Like

How long does the thermal calibration take? We tried to do it on last year’s robot. We enabled calibration and went to dinner, and it was still going when we came back. The documentation implies that calibration should take 5-10 minutes. We rebooted after 40 minutes or so as we felt that something must have gone wrong and we needed to use the robot. Should we have tried to wait longer?

Temp calibration isn’t based on time - it requires the Pigeon seeing a certain amount of temperature change during the calibration.

In theory if you leave it for several minutes the Pigeon will generate heat while it’s in temp cal mode, but that depends on the ambient temperature of the room.

This is why the temp calibrating instructions say to use a heat lamp or something like it - start the temp cal, use the heat lamp to make the Pigeon change temperature, then when there’s a large enough change in temperature the calibration will finish and the LEDs will blink green.

How bad is it though? I’d simply like to zero the gyro before/at the very beginning of a match, before any motors start; will the interference of it being indoors be that significant? By how much would it vary just by being indoors?

Thanks. I do remember seeing the suggestion about using a light bulb. The room we attempted the calibration in was on the cold side of “room temp” with concrete floors and rather thin walls, on a Canadian winter day, so I could believe that the Pigeon might not have been self-heating adequately. The placement of the Pigeon on that robot was such that we could not easily get a heat source over it.

We’ll try again on one of our test platforms. Am I correct in assuming that this calibration only needs to be done once per sensor, ever? Or is it good practice to periodically repeat the procedure?

The calibration only needs to be done once per sensor, the calibration is persistent.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.