Crazyflie drifting, Kalman state warnings

Firmware/software/electronics/mechanics
Post Reply
rampudia
Beginner
Posts: 20
Joined: Fri Mar 26, 2021 4:21 pm

Crazyflie drifting, Kalman state warnings

Post by rampudia »

Hi! I noticed lately that when flying with my flow sensor the Crazyflie does not stay in place like it used to and it starts drifting and in some cases crashing. When reading the console I get the following message:
ESTKALMAN: WARNING: Kalman prediction rate low (98)
And then sometimes:
ESTKALMAN: State out of bounds, resetting
At first I thought that the flow sensor might be damaged but even when I remove it I still get the "out of bounds error" and I have noticed that the front right red LED flashes slower when this error is present. And it takes a long time, if ever, to log "Ready to fly"
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Crazyflie drifting, Kalman state warnings

Post by kristoffer »

That sounds weird. Which firmware are you using and do you have any other decks/tweaks or just the flow deck?

Since you get a warning that the prediction rate is low, it sounds like something is taking a lot of CPU power. You could do a task dump in the console tab in the client. Click the "Task dump" button, wait 5-10 seconds and then click it again, and post the dumps here. The reason you have to click the "Task dump" twice is that the dump shows data since the previous dump and the first time contains and average since startup, but I'm also interested in the load when everything is up and running.

The "state out of bounds" warning means that the estimated position is +-100m which is considered unlikely. This usually happens if there is too little or weird sensor data.
when I remove it I still get the "out of bounds error"
If you use the kalman estimator without any deck this is what is expected. I assume you switched to the kalman estimator manually?
jaakko
Beginner
Posts: 2
Joined: Tue Jun 01, 2021 6:13 am

Re: Crazyflie drifting, Kalman state warnings

Post by jaakko »

Edit: This problem solved when installing client again
Hi.
I have the same problem. I just started with Crazyflie. I'm using Loco position system and I managed to take off few times with the client and everything went well. Crazyflie took-off and was just hoovering. Then I tried to run autonomousSequence.py script to just go up, stay there for a while and then go down, but after take-off the Crazyflie started to drift and crashed to the wall. After that when I try to just take off with the client, Crazyflie start heavily to drift to some direction. Here are my console outputs when after starting when Crazyflie is just center of the floor.

SYS: ----------------------------
SYS: Crazyflie 2.1 is up and running!
SYS: Production release 2021.03
SYS: I am 0x203336473152500700440025 and I have 1024KB of flash!
CFGBLK: v1, verification [OK]
DECK_CORE: 1 deck(s) found
DECK_CORE: Calling INIT on driver bcDWM1000 for deck 0
IMU: BMI088: Using I2C interface.
IMU: BMI088 Gyro connection [OK].
IMU: BMI088 Accel connection [OK]
IMU: BMP388 I2C connection [OK]
ESTIMATOR: Using Kalman (2) estimator
CONTROLLER: Using PID (1) controller
MTR-DRV: Using brushed motor driver
EEPROM: I2C connection [OK].
STORAGE: Storage check [OK].
IMU: BMI088 gyro self-test [OK]
DECK_CORE: Deck 0 test [OK].
STAB: Wait for sensor calibration...
SYS: Free heap: 17888 bytes
STAB: Ready to fly.
DWM: Automatic mode: detected TWR
SYSLOAD: Task dump
SYSLOAD: Load Stack left Name
SYSLOAD: 1.35 256 Tmr Svc
SYSLOAD: 1.05 93 LEDSEQCMD
SYSLOAD: 45.18 127 IDLE
SYSLOAD: 0.43 107 CRTP-SRV
SYSLOAD: 0.71 213 CRTP-RX
SYSLOAD: 0.0 75 PWRMGNT
SYSLOAD: 0.0 255 CMDHL
SYSLOAD: 0.0 115 PLATFORM-
SYSLOAD: 0.0 251 LOG
SYSLOAD: 0.01 91 PARAM
SYSLOAD: 0.0 224 MEM
SYSLOAD: 0.17 159 SYSTEM
SYSLOAD: 0.06 61 CRTP-TX
SYSLOAD: 6.15 366 STABILIZE
SYSLOAD: 5.72 167 SENSORS
SYSLOAD: 1.21 176 SYSLINK
SYSLOAD: 25.45 267 LPS
SYSLOAD: 12.43 282 KALMAN
SYSLOAD: 0.0 114 USBLINK
SYSLOAD: Task dump
SYSLOAD: Load Stack left Name
SYSLOAD: 3.52 171 Tmr Svc
SYSLOAD: 35.31 127 IDLE
SYSLOAD: 1.92 213 CRTP-RX
SYSLOAD: 0.0 75 PWRMGNT
SYSLOAD: 0.0 115 PLATFORM-
SYSLOAD: 0.0 251 LOG
SYSLOAD: 0.0 91 PARAM
SYSLOAD: 0.0 224 MEM
SYSLOAD: 0.12 159 SYSTEM
SYSLOAD: 0.11 61 CRTP-TX
SYSLOAD: 2.81 176 SYSLINK
SYSLOAD: 2.84 93 LEDSEQCMD
SYSLOAD: 1.20 107 CRTP-SRV
SYSLOAD: 7.22 365 STABILIZE
SYSLOAD: 6.04 167 SENSORS
SYSLOAD: 27.06 267 LPS
SYSLOAD: 11.78 282 KALMAN
SYSLOAD: 0.0 114 USBLINK
SYSLOAD: 0.0 255 CMDHL
HEALTH: Acc noise floor variance X+Y:0.004359, (Z:0.017211)
HEALTH: Motor M1 variance X+Y: 1.07 (Z:6.38), voltage sag:0.17
HEALTH: Motor M2 variance X+Y: 0.45 (Z:3.23), voltage sag:0.17
HEALTH: Motor M3 variance X+Y: 1.31 (Z:1.37), voltage sag:0.17
HEALTH: Motor M4 variance X+Y: 0.89 (Z:2.43), voltage sag:0.17
ESTKALMAN: WARNING: Kalman prediction rate low (16)
HEALTH: Acc noise floor variance X+Y:0.004509, (Z:0.023376)
HEALTH: Motor M1 variance X+Y: 1.04 (Z:7.18), voltage sag:0.17
HEALTH: Motor M2 variance X+Y: 0.66 (Z:4.20), voltage sag:0.18
HEALTH: Motor M3 variance X+Y: 1.32 (Z:1.55), voltage sag:0.18
HEALTH: Motor M4 variance X+Y: 1.01 (Z:3.69), voltage sag:0.18
ESTKALMAN: WARNING: Kalman prediction rate low (98)
ESTKALMAN: State out of bounds, resetting

I have three Crazyflies with Loco deck and this happens with all of them now. And if I try to fly Crazyflie with mobile phone everyting goes well. Crazyflie is stable and take-off nicely. But when changing back to client and Crazyradio PA everything goes out of control.
Last edited by jaakko on Tue Jun 01, 2021 11:46 am, edited 1 time in total.
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Crazyflie drifting, Kalman state warnings

Post by kristoffer »

@jaakko Your problem looks different, you are using the Loco Positioning System and the reason you get "Kalman prediction rate low" seems to be that you are running the motor tests. Please start a new thread for your issue.
Post Reply