Open LuKo91 opened 7 years ago
I would run the gyro and accel at 1 kHz smale rates. The bandwidth for this application can be large, i.e., the same as the sample rate. Then you want to run the Madgiwck filter at 5 - 10 x the sample rates if you can.
Hello,
first of all, thank you very much for your great codebase! It helped me a lot so far on my own project. I am new to working with IMU's and Pose Estimation filters, so I do need some help and I hope that I am right here ;) To ask my questions, I think it is necessary for me to describe my system setup and my project first.
My system consists of 2 subsystems:
Subsystem 1: A mobile platform with an cortex m3 connected to the MPU9250. This is the subsystem that I want to track in orientation and position. Subsystem 2: Exact hardware is unimportant. Just need to know, that it is a fast and static backbone system.
What happens in Subsystem 1:
Inside the MPU9250, all the sensor data will be sampled in a certain frequency (I will call it fSensorRate) and a certain bandwidth (bSensor).
Depending on my configuration of the Sample Rate Divider, I do have another frequency (fOutputRate)
In my loop() function running on the cortex m3, I will read out the IMU data with another frequency (fLoop) via I2C, which is dependant on how fast the CPU works and how much it has to do. At the moment it is between 250-500 Hz.
In the same loop() function I will call an Madgwick update step with the newly read IMU data. Depending on if I call this update step in every loop() iteration or not, this will have the same frequency as fLoop or a smaller one. I will call it fCallMadgwickUpdate.
The estimated orientation (in quaternions) as well as the acceleration will be transmitted wireless to subsystem 2 with 10 Hz. This frequency is fixed and can not be changed. That is the reason why I am estimating the quaternion directly on subsystem 1, because here I can have a higher update frequency. In subsystem 2 I will still have a quaternion update only every 100ms, but these quaternions should be more accurate than estimating them later in subsystem 2.
What happens in subsystem 2:
I do have 2 different tracking scenarios:
Questions: 1) How should I choose the bandwidth of the gyroscope and accelerometer ? In my understanding, it is best to minimize noise as much as possible through choosing the smallest bandwidth which still can measure the movement accurately. Is that right ? Given the two decribed scenarios, which bandwidth (bSensor) should I take ? 2) fSensorRate will probably be 1kHz. How should I choose the fOutputRate/Sample Rate Divider then? Due to the fact, that the data will be used by the Madgwick update step more often than it will be transmitted to subsystem 2 (only 10Hz), I should choose fOutputRate/Sample Rate Divider close to fCallMadgwickUpdate, right ? 3) If I have a Sample Divider of 1 for example, what does it mean? Does it mean that the readable registers of the IMU are just updated every second time there is a measurement with the latest measurement? So that half of the measurements are not taken into account? Or is there some kind of averaging (in this case, the average of the latest two measurements) ? 4) Well what is the best for fCallMadgwickUpdate then? Can I choose fCallMadgwickUpdate = fLoop and use the varying fLoop as SampleFreq inside the Madgwick algorithm for each step? Or should I better use a timer for the call of Madgwick update to have a static, but smaller SampleFreq in the Madgwick algorithm ?
I hope it is ok to write so many questions, but I am left alone to myself here and I really need help.
Thank you very much!!
Greetings, Lucas