First successful GPS position hold tests!

I added a GPS module, a compass and a pressure sensor to my tricopter to enable automatic position hold. GPS is implemented using a PD control loop, compass is P only, and height is PID. And... it works! Still not optimal, but in principle it is already ok. There are some things that have to be optimized of course, e.g. a one-axis compass will probably not work for waypoint navigation and position hold when there is wind. And my code is still far from being optimal. At the moment, I have to make my copter hover at the position + height that I want. Then, I flip a switch (connected to channel 6) - current position, heading and height is stored and used as setpoint for position hold. I think I will have to switch to a 3-axes compass in combination with an additional 3-axes accelerometer. That will enable tilt compensation for the compass, as well as improving the D-term for height stabilization.
The tests that you see in the video where done with no wind at all. The tricopter stayed mostly within a circle of around 3m diameter. So that is close to GPS precision. Funny to watch the tricopter for 30 minutes without doing anything...

Additional components used for this setup (maybe I'll try different ones):
Pressure sensor: BMP085
Compass: HMC6352

And here for the DLXm (parameters don't fit yet, but pressure sensor is also very close to the propellers...):


  1. Congratulation Willian .
    if you like... i can help you to make this code.
    I am developing a navigation routine (waypoint)and in near future i adapt a video motion for position hold and auto land and take-off.
    i love your code and your frames.


  2. willian, what the name of music track ?

  3. Hi, this is digitalism - idealistic . You could help me with a brief description of how to make a waypoint navigation. i have several ideas of how to make it, but I don't know how this is usually done...

  4. well, i supose that for Position Hold you are calculating the diference between the actual and desired. The result are used in a PID correct ?

    In my first test i use the sabe algorythm but in the in the desired i put the waypoint´s.

    The problem is the cross wind and other disturbances.

    i talk with you by e-mail right ?

  5. Hi, yes I am using a PD to make position hold. I am not using the I term, because I heard that this leads to instability of the position. But I will test this in the future. I am thinking of the following for waypoint navigation:
    The copter is in position A, the target is position B. First a straight line between A and B is calculated. Using pitch and yaw, the copter follows the line at a given speed. Roll is then used to compensate for wind and to stay centered on the straight line. Maybe this could work...

  6. Yeah ... this will work good but you change the bearing of copter when moving. I prefer that the copter move with out change the bearing but your idea is good and seems to be more simple.

    The BIG problem of navigation is discover the error when you have a cross wind.
    I search for my paper and send to you see my calculations.

  7. Hello, nice video and congrat on advancement. What sensors are present in the configuration of the tricopter in this video ?


  8. Hi Magnus,
    I just added the info to my post.

  9. William, I have become a big fan of your innovations. I'm currently designing a tricopter of my own and you are much of my inspiration. I am a software engineer and have even started dusting off my skills in Matlab/Java. I have a nice desktop CNC in my shop so if you or any other readers of your blog need something, or wish to collaborate on a project, I'm available.

    I have a few questions if you don't mind.

    What kind of transmitter/receiver is delivering the gyro/gps/altitude to the computer? I assume the computer on the ground is deciphering the data and sending flight adjustments to Shrediquette.

    How are you interfacing the pressure sensor and gps inboard? Wiring diagram or picture?

    What kind of transmitter is delivering flight corrections to Shrediquette? I believe I wad somewhere that is is not gghe R/C transmitter but rather, the computer.

    Thanks in advance and keep all of the great work and updates coming. I can't wait to see what it does next.

    Take care,
    Matt - St. Louis, Missouri

  10. Hi Matt,
    the GPS, pressure and compass sensors (see the post for the names of the sensors) are mounted to the copter. There is an additional microcontroller on the tricopter which computes everything for the PID control loops. The "compressed" data is then transferred via UART to the main controller on the copter. Pressure sensor and compass are interfaced via I²C so the wiring is pretty simple. I am using a laptop only for debugging purposes, currently the laptop doesn't send anything to my tricopter.

  11. how to do gps position.can u pls explain me briefly?

  12. wheather i will go for seperate loop for both lat and long??or i will calculate the heading using the compass and correct it.

  13. This comment has been removed by the author.

  14. I want one of these :) My tri is on a back burner presently

    I have a Ar5duino/Xbee controller working now for those interested please see

  15. I added a GPS module, a compass and a pressure sensor to my ...


Post a Comment

Popular posts from this blog

My 15 inch long-range setup for 2020 (with CAD files)

Part 1/3: Side Force Generators (SFGs) in FPV Racing

Aerodynamics in racing multirotors!

Part 2/3: Side force generators - Forces and turning

Finished I²C to PWM converter and TriGUIDE mini