Can MPU9250 output to STM32F4 via SPI?

Firmware/software/electronics/mechanics
Maxzor
Beginner
Posts: 11
Joined: Sun Jan 17, 2016 11:01 am

Can MPU9250 output to STM32F4 via SPI?

Post by Maxzor » Mon Jun 27, 2016 10:11 am

Hello,
topic,
Best regards



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

Re: Can MPU9250 output to STM32F4 via SPI?

Post by tobias » Mon Jun 27, 2016 1:14 pm

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?

Maxzor
Beginner
Posts: 11
Joined: Sun Jan 17, 2016 11:01 am

Re: Can MPU9250 output to STM32F4 via SPI?

Post by Maxzor » Mon Jun 27, 2016 1:24 pm

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! :)

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

Re: Can MPU9250 output to STM32F4 via SPI?

Post by tobias » Mon Jun 27, 2016 2:30 pm

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?

Maxzor
Beginner
Posts: 11
Joined: Sun Jan 17, 2016 11:01 am

Re: Can MPU9250 output to STM32F4 via SPI?

Post by Maxzor » Mon Jun 27, 2016 2:33 pm

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!

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

Re: Can MPU9250 output to STM32F4 via SPI?

Post by tobias » Mon Jun 27, 2016 4:15 pm

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 ;) .

Maxzor
Beginner
Posts: 11
Joined: Sun Jan 17, 2016 11:01 am

Re: Can MPU9250 output to STM32F4 via SPI?

Post by Maxzor » Mon Jun 27, 2016 7:48 pm

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 :)

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

Re: Can MPU9250 output to STM32F4 via SPI?

Post by tobias » Tue Jun 28, 2016 11:47 am

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

Maxzor
Beginner
Posts: 11
Joined: Sun Jan 17, 2016 11:01 am

Re: Can MPU9250 output to STM32F4 via SPI?

Post by Maxzor » Wed Jun 29, 2016 2:28 pm

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 :)

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

Re: Can MPU9250 output to STM32F4 via SPI?

Post by tobias » Wed Jun 29, 2016 8:58 pm

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!

Post Reply