Interfacing Arduino with an iPhone to make hexacopter autopilot system

Hi,

This topic is rather unusual and I hope someone here has experience with this.

I have a hexacopter and I am looking to construct an autopilot system. My choice of using an iPhone is due to lack to computational power in Arduino or even Pi. Regular autopilot systems operate using feedback control from GPS, Gyroscope and Accelerometer, however my ambition is to use control theory to achieve more precise control over manoeuvres.

This process involves building differential equations for the object in question i.e. motor torque vs rpm, prop drag vs rpm, arbitrary moment of inertia, vs relative air pressure... list goes on. Using all of these equations in combination with feedback control will result in ability to execute a most efficient path to achieve at a desired result without losing control of the vehicle, not to mention other fun stuff that can be done. Possibilities are endless, well ΔxΔp≤ℏ/2, anyway..

see here: The astounding athletic power of quadcopters | Raffaello D'Andrea - YouTube

Most of my work will involve mathematical and computational work however I have hit a major hurdle. I am unable to use iPhone to calculate all the above as there is not a reliable way to communicate.

As starters I need the Arduino to interface with 6 ESC's, 10 Ultrasonic Sensors, several temperature probes and battery voltage and current measuring instruments. All that will need to be transmitted to iPhone.

iPhone will then take input from its internal GPS, Gyro, Accelerometer, Tesla Meter and the previously known model of the vehicle to calculate the next change in motor throttle and signal back to the Arduino to act accordingly.

All this needs to be repeated again in under 20-25ms to be able to avoid a runaway arbitrary oscillation.

I have an Arduino Mega which will be the interfacing board. Not yet sure if it can hold here.

In my testing iPhone is able to solve 15 differential equations with 50 different initial conditions and arrive at the result in under 10ms even without optimisation and running on CPU only so iPhone is promising.

So in summary.

What is the best way to communicate between Arduino and iPhone that has low latency and decent transmission rate?
Is Arduino Mega able to handle all these accessories?
Any other guidance is appreciated.

Thanks

building differential equations for the object in question i.e. motor torque vs rpm, prop drag vs rpm, arbitrary moment of inertia, vs relative air pressure

How do you intend to measure and/or parametrize all the required input variables for the system model? That is far more difficult than solving the DEQs.

My initial plan is to have a runtime calibration procedure. Which will just like a regular auto pilot and change ESC throttle and observe the physical changes detected. Then once it has decent differential equations ready, it can use those to further improve the parameters.

Another option is to fly the vehicle normal without autopilot and log all data, then it can be analysed in third party software and equations can be manually fed into the system.

Or a more aggressive way of achieving this would be to model a physical system in a virtual environment and simulate the system. This requires a lot of computing power and most the work needs to be done manually.

Therefore building the equations on the fly seems to be most suitable option, followed by log analysation and finally virtual modelling. This is the plan at least, none of these may be suitable I would only know if I have a system that can tested upon.

jremington:
How do you intend to measure and/or parametrize all the required input variables for the system model? That is far more difficult than solving the DEQs.

Most people use PCs in the early stages of a project like this, connected by a wire harness to the robot.

I'm not entirely sure what your trying to accomplish but it sounds like that kind of thing has already been done and in a simple easy to use form.

All the movement types are preprogrammed on board, you just send the signals to make it happen. Stuff like rotate, forward, left are well within an arduino's calculation capability. Even complex movement types are done on board like flips, it won't be able to know exactly when its going flip or what height its going to re-stabilize but if it hits the ground or a tree, that's the controllers fault.

If you want it to jump through a moving hoop in real time and not hit the wall 1 foot behind it, then you'll need to do off board calculations but that is way beyond what people can answer on these forms.