Quadcopter nano memory/speed problem

Hi everyone,

Im building a quadcopter using the following compenents: - Arduino nano - DMP6050 (gyro+accel) using the DMP add 200hz - BMP160 pressure sensor - GPS+compass unit (from my naza flight controller)

planning to add: - NRF24L0 2.4GHz Wireless Transceiver Module - Micro SD TF Card Memory Shield Module SPI Micro SD Adapter - and maybe also a Ultrasonic Ranging Sensor

The quad is now fying stable, and can keep altitude (using baro) and position using GPS But the last 2 are far from perfect. I have the quad attached to a very thin wire for safety.

But now im running out of space and speed on the arduino.

I can optimize some things and it will help a bit but i think its still a problem.

So i think i need a different microcontroller or maybe use 2 arduino nano's

2 arduino nanos would be my favorite because i have already have them, but maybe its not the best solution ? If i use that option then i would run the dmp6050 and motor output on 1 arduino and everything else on the other, but it will give me a bit extra code to communicate between the 2 arduinos.

everything should be as small as posible.

Any suggestion would be nice,

maybe is the Teensy 3.1 a better solution

Michel000: Hi everyone,

Im building a quadcopter using the following compenents: - Arduino nano - DMP6050 (gyro+accel) using the DMP add 200hz - BMP160 pressure sensor - GPS+compass unit (from my naza flight controller)

planning to add: - NRF24L0 2.4GHz Wireless Transceiver Module - Micro SD TF Card Memory Shield Module SPI Micro SD Adapter - and maybe also a Ultrasonic Ranging Sensor

The quad is now fying stable, and can keep altitude (using baro) and position using GPS But the last 2 are far from perfect. I have the quad attached to a very thin wire for safety.

But now im running out of space and speed on the arduino.

I can optimize some things and it will help a bit but i think its still a problem.

So i think i need a different microcontroller or maybe use 2 arduino nano's

2 arduino nanos would be my favorite because i have already have them, but maybe its not the best solution ? If i use that option then i would run the dmp6050 and motor output on 1 arduino and everything else on the other, but it will give me a bit extra code to communicate between the 2 arduinos.

everything should be as small as posible.

Any suggestion would be nice,

A different MCU could be a stand-alone ATmega1284P. It comes in a 40-pin DIP, has 128K flash, 16K RAM, 4K EEPROM and 2 hardware serial ports. The chip is about as big as a Nano.

You could wire 2 Nano's up on SPI bus with one running all the sensors and feeding the data to the other which makes the decisions, runs the motors, radio and SD. Reason to use SPI is speed at 1/4 is 500K bytes per second (115200 baud is 11520 bytes per second), you can get a lot of reads out and still not get backed-up. The code to run one Nano as an API Slave is on Nick Gammons blog: http://www.gammon.com.au/spi

On the same blog page is the code to use AVR serial port as a Master Mode SPI Bus Controller. Because how else to hook up the SD without interrupting data one the Nano-Nano Bus? I expect that the SD is to log inputs and process messages?

Using 2 Nano's gives you 2 cores attention on the project.

A Teensy 3.1 is a 32-bit ARM that can run at 96MHz. It's got a lot of RAM and flash. It's got holes along all 4 sides to solder pins to, right next to the hair fine SMT legs of the chips on the Teensy board, and pads to solder or contact on the bottom as well. OSH Park had them on sale for $17 and still might. You can likely get your code running on one with small changes if you are up to the soldering/connecting required. It's shorter than a Nano but perhaps just a bit wider. It also runs on 3.3V, you can wire an SD adapter sleeve direct to 3.3V MCU and run a micro-SD card in that, no shield.

Depending on which GPS library you're using, NeoGPS could save you a couple of hundred bytes of RAM and FLASH, and 600uS to 6mS per second in CPU time.

For improvements all-around, Cosa is alternative framework that can work wonders, if you're familiar with C++. Very fast, very small, and he is currently using Arduino IDE 1.6.4. I got about 500Hz under Cosa with GPS, SD logging, one ADC, and an IMU w/compass & barometer. YMMV.

Cheers, /dev

i found that the lib. im using for the MPU6050dmp is using a lot of space. Im using the raw values now from the mpu6050. and size is a lot smaller now. For now im just try to put everything on 1 nano,

Try either a Bobuino or Mega.