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 »

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: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Update frequencies of sensor signals/states

Post by tobias »

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 »

Thanks! Do you know where I can find the definition (1 kHz) in the code?
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Update frequencies of sensor signals/states

Post by kimberly »

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 »

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: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Update frequencies of sensor signals/states

Post by kimberly »

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 »

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: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Update frequencies of sensor signals/states

Post by kimberly »

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