Picopter improvements

I finally managed to get access to a decent camera on a day with good weather! The following video is mostly demonstrating the quadrotors stability under the new four-state Kalman filter I have implemented, that estimates both the current pitch/roll and two gyroscope biases. Most of the flight is hands-off, with the occasional input to correct for wind and inevitable position drift.

I feel this angle control is pretty much perfect, so I will now be moving on to integrating extra sensors to allow for direct velocity and position control. I'm excited to see just how complex I can make the navigation system before the Pi cracks, but it seems for now despite using unoptimized  double precision floating point math for everything it still has plenty of headroom to go!

The (rather messy) code is available at Now that the first stage is finished I can start going through cleaning up the spaghetti of test code, but that will have to wait for now.



Comments (18) Trackbacks (1)
  1. Can you do a post listing the components in your build? Thanks

  2. hi
    One more person really excited by this, right here!
    Looking at the fotos you seem to be using a lot more than just the RPi, I spy your own pcb design with what looks like a PIC16F877, please at least describe the hardware, incl the speed controllers & motors!
    Thanks so much, it is indeed awesomeness.

  3. The motors are Turnigy 200W 900Kv outrunners,, and the ESC’s are 30A hobbyking blueseries, flashed with simonk’s firmware. The frame is a lunar lander 4, but I can’t remember which site I got this from.

    As for the electronic hardware, the two main components are the Raspberry Pi and a dspic30f6011a. The PIC is just there to provide hardware output compare and input capture, providing rock solid motor and receiver interfacing, which the Pi then accesses over I2C. The sensor board is a freeimu v4.3, containing gyroscopes, accelerometers, magnemometers, and a barometer. This is also accessed over the same I2C bus. There is also a 5V SMPS to power the board, along with PCB space for a second SMPS and a GPS unit for when I get the time to add one.

  4. Can this thing lift any weight? if so, how much? A camera would be nice addition

  5. Keep on the good job !

    and yes please, schemas would be terrific (hardware, software .. any kind 🙂 , as long as they explain the concept 🙂

    @Hadi need to lift more or less weight ? this quad might lift a half kilo i guess;
    For more (or less), you need to understand the relations between total weight / motor rpm / propellers size & tork . Using the same “brain”, you could build your own quad or hex or otco etc .. and lift whatever you need to lift

  6. Hi Matthew,
    Great job. Hopefully you’ll get back to it and integrate it with Something like the diy drones apm, so that after you get the gps on it, and a telemetry system, etc. you can program waypoints, etc. Have you checked out the Openpilot site (I saw this on diy drones site)? Both the open pilot and diy drones ground control stations are easy to use and may save you some time in the next phase of this. I really like your picopter smoothness. Should be great for fpv and aerial pics, eventually. Thanks for makingnthe code available too. That will be nice to compare it with the other open source code.

  7. Hi Matthew,

    Great work. I’ve been doing quite a bit with the RasPi and GPIO – nothing realtime yet but that’s always been at the front of my mind. Everyone seemed to kibosh the idea but here it is working in reality.

    In your code you calculate Timer.dt and log it out. What’s the worst you’ve seen for this? Your comments mention 400Hz for your main loop (Timer.compenste_) but then PERIOD is 5,000,000ns which would be 200Hz. I’m wondering how far from this the RasPi gets.

    What distro do you use. ArchLinux? Raspbian? Something else?

    Keep up the great work and thanks for sharing your hard work and experience.

    • Sorry yes, I haven’t made a new commit since I upped it to 400Hz from 200. As for dt, I would say 999 out of 1000 iterations occur at exactly 2.5ms, with the remainder jumping to between 10 and 20ms. There are sometimes larger blips in the range of a few 100ms, but these are rare enough to not pose a major issue yet. With a bit more digging I’m sure I could remove these.

      I’m currently using Raspbian. There may be a better distro out there, but with my limited Linux experience at the start of this project I didn’t know enough to evaluate other distros properly.

      And thanks, I’ve still got a lot more work to do on this project.

      • Sounds pretty good. I switched from Raspbian to ArchLinux for the work I’m doing on the Pi. It’s a lot more stripped down than Raspbian and suited as a base for work like this. Might be worth a go to see if it reduces the longer blips as there’ll be a lot less running on it.

  8. Nice job! I am also very interested in more details of this project (schematics, your finalized code, quadrocopter assembly, etc.). I am in the process of building a different project with my raspberry pi, but it will soon be completed. I have always been interested in, but have no experience with quadrocopters, and the combination of the two would be the perfect match.

  9. Great job! I just got a RPi myself today. If it doesn’t have a name, I suggest “Shoo-Fly Raspberry Pi(e) In-the-Sky”…or Raspberry PiTS for short. 🙂

  10. Wow amazing.
    Organizations – such I will try to create
    To control smartphones
    I’ve got a question.
    I do not know yet, a lot of the way
    The board under the RPi Please tell us what you
    Ever homemade sour geotingayo
    I not speak English using Google translate.
    It just tried to see directly down the’d be back at your earliest convenience to View
    I’m sorry, but you on the board of RPi below to send us e-mail?
    Can you send me a little information on the development, or Are You

    Please …

  11. I want pcb engle file too. Thank you.

    I see this project is same you.


  12. Are you going to publish PCB for montage? Dream to build one, but my constructor’s experience is worse than my english) Greetings form Russia.

Leave a comment