Arduino Mega ADK + Android + GY-80 + Multiwii

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
NicQb1
Posts: 1
Joined: Tue Oct 13, 2015 3:51 am

Arduino Mega ADK + Android + GY-80 + Multiwii

Post by NicQb1 »

So I've been working on this project for an X quadcopter using my android phone, connected to a arduino mega ADK. I've been using the phone's sensors with promising results. It is connected to a PC program (soon to be ported to Windows 10?, Android and iOS thank you Zamarin!) with an XBOX 360 controller. Looking at the code for my setup it looks like all I would need to to do to make this code (which seems so much more comprehensive) work with my setup would be to alter the RX code to take in the values sent over my cell/wifi signal. I'd really like some input from some developers here. I'm at a point where I can kind of fly my quadcopter in a limited space and am getting only sporadic instantaneous horizontal inversions which I'm hoping to fix with Multiwii and a GY-80 sensor.......or should I continue on my own and stumble through PID algorithms and quantum vacuum energy binomial equations. I think I can figure it all out but I think I would need to do a whole simulation software thing with logging and 3D rotations and I sucked at Linear Algebra. Right now it's a 2'X2'-ish unpredictable mess. I've been able to fly it in my garage (yes I know but I only controlled the throttle. The Roll, Pitch and Yaw target angle were all set to 0 programically) for a second or two. I do have some control but I also have some lag that seems a little excessive which I'm hoping is a Kp error. That and the G.D. Yaw drift. So, basically I'm asking is what is the estimated effort to incorporate ADK for pulling commands from an Android device. I'm already pulling the commands and sending to the Arduino.......what are the pitfalls of :

//############ MAIN LOOP ##############
void Read_OpenLRS_RC() {
#if (ANDROID_ADK==1) //New pseudo code start here
{
updateAndroidData(); //easy peazy android ADK communication method
rcData[ROLL] = AdroidData[0];
rcData[PITCH] = AdroidData[1];
rcData[THROTTLE] = AdroidData[2];
rcData[YAW] = AdroidData[3];
rcData[AUX1] = AdroidData[4];
rcData[AUX2] = AdroidData[5];
rcData[AUX3] = AdroidData[6];
rcData[AUX4] = AdroidData[7];
} else //everything else
{ //ends here
uint8_t i,tx_data_length;
uint8_t first_data = 0;

if (_spi_read(0x0C)==0) {RF22B_init_parameter(); to_rx_mode(); }// detect the locked module and reboot
if ((currentTime-last_hopping_time > 25000)) {//automatic hopping for clear channel when rf link down for 25ms.
Red_LED_ON;
last_hopping_time = currentTime;
#if (FREQUENCY_HOPPING==1)
Hopping(); //Hop to the next frequency
#endif
}

Post Reply