Page 1 of 2

Can MPU9250 output to STM32F4 via SPI?

Posted: Mon Jun 27, 2016 10:11 am
by Maxzor
Hello,
topic,
Best regards

Re: Can MPU9250 output to STM32F4 via SPI?

Posted: Mon Jun 27, 2016 1:14 pm
by tobias
Hi,

As the SPI of the MPU9250 is not routed to the STM32F4 I'm afraid no. May I ask you what you are trying to achieve?

Re: Can MPU9250 output to STM32F4 via SPI?

Posted: Mon Jun 27, 2016 1:24 pm
by Maxzor
Was wondering if Raceflight software running 32kHz interrupts from gyro, could be ported on the crazyflie.
At the moment this is the only F4 board I have and I love the project. But with I²C gyro output is capped at 2kHz.
Bad luck, on the Crazyflie 3.0 maybe! :)

Re: Can MPU9250 output to STM32F4 via SPI?

Posted: Mon Jun 27, 2016 2:30 pm
by tobias
I think it is possible to overclock the I2C buss to 800kHz which could potentially double the data transferring. I'm not sure it will improve the flight dynamics much though?

Re: Can MPU9250 output to STM32F4 via SPI?

Posted: Mon Jun 27, 2016 2:33 pm
by Maxzor
It is definitely the land of diminishing returns, but 32kHz appears to reduce aliasing even further and is being quite adopted by the FPV racing professionals!
Ty for information still!

Re: Can MPU9250 output to STM32F4 via SPI?

Posted: Mon Jun 27, 2016 4:15 pm
by tobias
I thought the MPU9250 could only do 8 kHz output, or maybe it is only the internal bandwidth? Reducing the time from a new sample to motor output could improve the flight dynamics, so high speed data transfer would make sense but how much it will improve is another question, if it is noticeable/measurable at all. We could always make a deck board with a MPU9250 connected to the SPI bus and evaluate/compare ;) .

Re: Can MPU9250 output to STM32F4 via SPI?

Posted: Mon Jun 27, 2016 7:48 pm
by Maxzor
Well 8kHz is indeed hat is displayed on the Invensense datasheet but Raceflight guys on RCGroups swear upon their parent's head that they get real 32kHz sampling from it. I guess most of the progress is obtained with higher PWM rates between ESC and motor. Raceflight runs up to 32kHz gyro interrup/fc "looptime" - 32 kHz PWM to ESC - 32kHz harware PWM from ESC to motor. And yes measurement is a big deal.

The testing deck is a nice idea :)

Re: Can MPU9250 output to STM32F4 via SPI?

Posted: Tue Jun 28, 2016 11:47 am
by tobias
If we made a testing deck with a MPU9250 SPI would you play with it? ;) Shouldn't take long to but together, it is just that we won't have time to play with it but it might be worth it if someone else did :D

Re: Can MPU9250 output to STM32F4 via SPI?

Posted: Wed Jun 29, 2016 2:28 pm
by Maxzor
After overnight thought yes.
I could do the dirty ASM/C job porting Raceflight to it and comparing at home with your very nice updated flight control code.
Left to you to then further measure any significant improvement, since you are miles away from my electromechanical engineering skills :)

Re: Can MPU9250 output to STM32F4 via SPI?

Posted: Wed Jun 29, 2016 8:58 pm
by tobias
You said it, I'll get to it ;) :D .
I actually have a port of cleanflight running but haven't had time to tune it so it doesn't fly so well. Another reason is that It requires an external RX (CPPM) and the one I got was pretty imprecise making the controls bad. With some time put into it things can change though!