-
Hello, when my crazyflie begin to fly, its initial z-value is about -18 meters. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I need a bit more information about the expansion decks you might be using with your Crazyflie. However, assuming you’re not using any positioning decks, the Crazyflie defaults to the complementary filter for estimation, which relies primarily on the barometer for altitude initialization. If you’re seeing an initial z-value of -18 meters, and you're not actually 18 meters below sea level or in a depressurized environment, it’s likely due to barometer bias. For instance, the Crazyflie on my desk currently reads 130 meters below sea level, even though we're at about 7 meters above sea level. This bias doesn’t affect relative accuracy, though: if I move the Crazyflie up by 1 meter, it reads 129 meters below sea level, indicating that while absolute values may be off, relative changes remain accurate. To address this in your setup, you could add a correction offset to the barometer readings in the |
Beta Was this translation helpful? Give feedback.
To achieve a more consistent initial z-value, you can try dynamically setting the barometer bias upon initialization. During startup, read the current barometer value and use it as a baseline or bias for altitude calculations. This way, each time the Crazyflie initializes, it will account for the ambient pressure and start with a z-value close to zero, minimizing discrepancies across power cycles.
Keep in mind that without any expansion decks, the Crazyflie will likely experience noticeable drift in both the X and Y axes due to the lack of external positioning references. Additionally, the barometer alone has limited precision on the Z-axis. For more accurate position tracking, you might …