i am working at my arduino drone and its pretty okay till now.
my Main problem is the integration/reading of additional sensors, which will destroy the timed cycle of 4ms in the arduino which takes the function of the flight controller.
I would outsource the reading of the sensors to a second arduino, but i haven't a clue to connect them both properly.
my first idea would be a I2C connection with a master like in this picture.
But i am pretty sure it wont function, cause of the longer reading time and the Slave to Slave connect.
Is it better to connect the arduinos with analog signals to get time insensitive Signals ?
(like A0 for throttle in steps from 0 till 1023
and A1 for turning left right in ....)
i don't understand your reply, sorry!
I need one arduino as the Flightcontroller (it has loop cycle with less than 4ms and cant be expanded)
and i need a second arduino to give the flightcontroller-arduino the directions as example for the position holding routine.
It will need to give the signals for:
Pitch
Roll
Yaw
Throttle
the last one need to be in a range from (0-1000)
the others could bei just "true/false" and the flightcontroller would roll or pitch or yaw with a predefined speed
Show the timing budget for the controller.
In other words, make a list of the steps that the controller performs during each cycle, and show how long each step takes down to the nearest 0.1ms.
If you don't know how long each step takes, then use digitalWrite to toggle a pin for the duration of each step and use an oscilloscope to measure it.
Once you have the data it should be relatively easy to identify suitable points within the cycle where flightdirections data can be transferred and calculations made.
I checked already the budget for the reading in the code, i am sorry, but we will need a second arduino.
(especially i want to further expand the whole thing with ultrasonic sensors which are very time consuming)
I dont have a oscilloscope, so i used timestamps, which i print at the end.
Similar to this: