Botched
16May/125

Quadrocopter Source Code

Since I've been getting a lot of requests for the source code I figured I might as well make it public and easy to access. I've tried my best to get a git repository set up, so hopefully if you follow this link you should be able to view the full source: https://github.com/big5824/Quadrocopter

It's all written for the dsPIC33FJ128GP202 in MPLAB using the C30 compiler, so in theory you should be able to open the .mcp project file and successfully compile everything. The only required change I can think of is for some reason the IDE didn't like some of my includes when referenced to the root directory, so I gave in and just used a full path, meaning you will need to edit this to suit your enviroment.

Comments (5) Trackbacks (0)
  1. Thanks !
    Is it a mistake, in the code (filter.c) ?

    {
    COMPLEMENTARY_XANGLEPREV = COMPLEMENTARY_XANGLE;
    COMPLEMENTARY_XANGLE = (COMPLEMENTARY_XANGLEPREV + GYRO_XRATE*dt)*a + ACCEL_XANGLE*(1-a);
    COMPLEMENTARY_YANGLEPREV = COMPLEMENTARY_YANGLE;
    COMPLEMENTARY_YANGLE = (COMPLEMENTARY_YANGLE + GYRO_YRATE*dt)*a + ACCEL_YANGLE*(1-a);
    }
    In Y angle this “COMPLEMENTARY_YANGLE = (COMPLEMENTARY_YANGLE……….”

    “COMPLEMENTARY_YANGLE = (COMPLEMENTARY_YANGLE……….”
    but should not be:
    “COMPLEMENTARY_YANGLE = (COMPLEMENTARY_YANGLEPREV………”

  2. Woops yes, that is incorrect. However, the PREV variables are actually just legacy code from when I was debugging, so other than wasting a cycle or two that code should still work, but anyway I’ve fixed the code and committed it to the git. You will probably find a lot of this kind of thing dotted around, once my exams are over in two weeks i’ll have time to go through and start optimising things.

  3. Have you got code for Arduino?

  4. Just a note for others using the code The AD0 Pin must be kept high to be compatible with the address in MPU6050.h (0x69 with a write bit on the end) Amazing project and excellent code x

  5. Hello I would like to help with a project Quadcopter, you would pass the eletric circuit of your project, we’re trying to make a quadcoptero also but here in Brazil and not so easy until the components had to be imported, please if you can help us I thank the attention a great day atenciossamente Cicero Gomes.

    ——————-

    Ola gostaria de uma ajuda com um projeto de quadcopter, voce teria como me passar o circuit eletric do seu projeto, estamos tentando fazer um quadcoptero tambem mas aqui no brasil nao e tao facil ate os componentes tivemos que importar, por favor se puder nos ajudar, agrade├žo a atencao um otimo dia, atenciossamente Cicero Gomes.


Leave a comment

No trackbacks yet.