making a quadcopter

I built a quadcopter.. out of wood. But I am having some minor problems with the stability....

My first plan consisted out of an arduino nano a 6dof gyroscope, barometer and a 5 channel 2.4 Ghz transceiver. I use a Qbrain 4in1 motor controller for the brushless motors.

The problems I ran into:

  • 1 of the motors turned slower than the other 3. This problem lies by the Qbrain controller. I use the servo library of arduino. I do not yet own an oscilloscope and my school is closed in the summer :frowning: so I have not examined the servo signals on a scope yet.
  • the 2.4 Ghz receiver is one of those typical RC plane's one and it sends out 5 servo signals. I use the the PulseIn() function to read out these signals and though it works perfectly fine... it takes time to read.
  • I tried to use only the accelerometer data and a PID controll. So far I have not used the gyroscope data. The controll worked to a certain extend I could on the monitor see the motor speeds and those matches according to the angle of the quad. So when I tilted it backwards and to the left, I saw the rear left engine turning hardest. This controll was way to slow on instable, perhaps it could have been solved with better values for the PID control, but I figured it would be better to make the PID run faster @ atleast 20-50 Hz

My plan for the code was and still is as follows: with my 2.4GHz transceiver I send 2 setpoints for X and Y pitch/yaw and for rotation of Z axis I just want to manually adjust the engines to turn a little bit faster/slower in order to turn. These setpoints are fed into a PID function along side the accelerometer data.

My revised plan for the hardware, I want to develop a new PCB with two atmega328 chips. There will be one master controller and the other atmega serves to read out the 2.4Ghz receiver as this is the most time consuming process. With I2C the master requests the 5 bytes of data.

The main controller also gets a bluetooth module, I want use the BT module to transmit new P, I and D values wirelessly during stability testing. The 2nd atmega will get a GPS module. If I can ever let my quadcopter fly I would like to let it fly pre-defined routes for several kilometers and I would like to climb several kilometers high (far above whatever is legal :wink: ) I will use our pcb milling machine to fabricate the PCB (I really really hate soldering wires, I think I overdid that...)

I want to make use of the gyroscope without a library other than wire.h. I use the MPU-6050 6DOF gyroscope. From what I understand the MPU-6050 is rather complicated you can even program it to make certain time consumingvector calculations.

For now I am going to use my now working 3D printer to make me a better frame.

I would like to hear some feedback on my approach and other hints or tips would also be much appreciated.

For instance is it even possible to make a stable flight controll using only the accelerometer data? I read once that somebody used both the data in a double PID controll.

bask185.

P.S.
@ paulS if you are going to post something rude, sarcastic, retorical, off-topic or not-helping-at-all. I respectfully ask you not to.

I think your problem is using pulseIn() for reading the radio signals. That takes too long and will cause your quadcopter to be unresponsive. Use pin change interrupts:
http://playground.arduino.cc/Code/ReadReceiver