Update frequencies of sensor signals/states

Firmware/software/electronics/mechanics
Post Reply
joyner
Beginner
Posts: 15
Joined: Mon Nov 18, 2019 12:37 pm

Update frequencies of sensor signals/states

Post by joyner » Sun Feb 16, 2020 9:42 am

Hello,

as I can see in https://github.com/bitcraze/crazyflie-f ... tary.c#L44,
the attitude update rate is 250 Hz (angle Pitch/Roll/Yaw) and position update rate is 100 Hz (X,Y,Z). But what are the update frequencies of the sensor signals, e.g. angular velocities of Pitch/Roll/Yaw and translational acceleration/speed (e.g. stateEstimateZ az, vz)? I'd be glad if anybody knows where to find the frequencies.

Joyner



tobias
Bitcraze
Posts: 2013
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Update frequencies of sensor signals/states

Post by tobias » Mon Feb 17, 2020 1:34 pm

The sensor readings of Acc and Gyro run at 1000Hz and the PID rate controller is coupled to that. The different estimators might then run attitude and higher level of estimation at lower frequencies.

joyner
Beginner
Posts: 15
Joined: Mon Nov 18, 2019 12:37 pm

Re: Update frequencies of sensor signals/states

Post by joyner » Wed Feb 19, 2020 4:33 pm

Thanks! Do you know where I can find the definition (1 kHz) in the code?

kimberly
Bitcraze
Posts: 369
Joined: Fri Jul 06, 2018 11:13 am

Re: Update frequencies of sensor signals/states

Post by kimberly » Thu Feb 20, 2020 7:54 am

You can find those in the IMU driver: https://github.com/bitcraze/crazyflie-f ... .c#L57-L62

joyner
Beginner
Posts: 15
Joined: Mon Nov 18, 2019 12:37 pm

Re: Update frequencies of sensor signals/states

Post by joyner » Sun Mar 01, 2020 6:29 pm

Thank you for your help! But another question occured to me recently...

I am using the flow-deck and I noticed that frequencies of acceleration, speed and position (stateEstimateZ az, vz, z) are different than without flow-deck. Where can I find these frequencies? That would help me a lot. I already searched in Flow-Deck driver "flowdeck_v1v2.c" but couldn't find anything.

kimberly
Bitcraze
Posts: 369
Joined: Fri Jul 06, 2018 11:13 am

Re: Update frequencies of sensor signals/states

Post by kimberly » Mon Mar 02, 2020 3:34 pm

Hi! That might be due to that the flowdeck driver is forcing the kalman filter to be initialized (estimator_kalman.c), but without the flowdeck, the complementary filter is initialized (estimator_complementary.c), which is the default. Since that is a smaller and simpler estimator, I would assume that the estimation goes much faster on that one.

joyner
Beginner
Posts: 15
Joined: Mon Nov 18, 2019 12:37 pm

Re: Update frequencies of sensor signals/states

Post by joyner » Mon Mar 02, 2020 9:13 pm

Ok, but I think the update frequencies of stateEstimateZ az, vz and z differ among each another. So it's probably not the same frequency as the estimator_kalman is running at, I guess? I want to simulate signal-noise, so I need the exact update rates of stateEstimateZ az, vz and z when using flow-deck. I tried to find out the frequencies by logging them with increased logging-rate (1khz), but the results were not usefull because update rates were irregular.
If anybody knows in which file the update frequencies are defined, please let me know.

kimberly
Bitcraze
Posts: 369
Joined: Fri Jul 06, 2018 11:13 am

Re: Update frequencies of sensor signals/states

Post by kimberly » Tue Mar 03, 2020 8:45 am

All the update frequencies are all defined in modules/scr/estimator_complementary.c in the crazyflie firmware. The stateEstimate.Z is estimated at a 100 hz with the zranger, but the accelerometers are being integrated at the speed of the attitude rate, which is 250 hz. This might explain the difference.

Post Reply