element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sci Fi Your Pi
  • Challenges & Projects
  • Design Challenges
  • Sci Fi Your Pi
  • More
  • Cancel
Sci Fi Your Pi
Blog QuadCOP:  Auto Pilot Functionality
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: screamingtiger
  • Date Created: 15 Jun 2015 4:11 PM Date Created
  • Views 2283 views
  • Likes 1 like
  • Comments 19 comments
  • quadcop_project
  • design_challenge
  • microstackgps
  • xtrinsic-sense-board
  • jets
  • sci_fi_your_pi
Related
Recommended

QuadCOP:  Auto Pilot Functionality

screamingtiger
screamingtiger
15 Jun 2015

Its been nice outside so I have been flying RC airplanes and coding on my project in the evenings.  There is much software to write so that is the focus right now.

 

image

 

 

Unfortunately that means my updates are not too exciting.  I can post code but you guys will be bored.

Instead, I will post some functionality I am testing that the QuadCOP will need.

 

As I mentioned I can manually control the quadcopter and then put it in auto fly mode with a switch on my radio.  So here are some things I am having it do, these items will be put to use but I am testing them one at a time.  Each one builds up on the previous one.

 

Loiter - It goes into auto mode and simply tries to stay at the current GPS coordinates.

 

360 degree Loiter - Same as above but it turns slowly 360 degrees (sensor sweep)

 

Autolanding - It goes into auto mode, and using its loiter functionality it tries to land nicely at the current GPS coordinates.  I am going to have to use a ping sensor for anything below 2 feet.

 

Return to Base - using a switch on my radio (macro record) it simply notes the current GPS location.  I then fly it around and when I put it into automode, it returns to the GPS coordinates it noted and then lands.

 

Out of Bounds - Similar to return to base.  It notes the current GPS coordinate on my mark, then it calculates a 400 foot radius arc in FRONT of the GPS coordinates.  I then fly around and if I go out of bounds, the quadCOP will return to base and then give me control back. The Quad COP should never go behind me, only in front.

 

Collision detection - using some ultrasonic ping sensors, it if detects an object it will take evasive action.  The action is a simple square type motion, by turning left and going a certain distance, then turning right again.

 

Once the above is completed, I can use the macro record functionality I built to start navigating waypoint macros. The main point here is altitude and heading information is recorded so I can be much more precise than using an IPAD to program waypoints.  I can very precisely position the QuadCOP since I am manually flying it.

 

Issues I am resolving:
I am trying to use the XTrensic MEMS board for altitude and heading information.  It works great with the Raspberry Pi B+ but not with the Raspberry Pi 2.  I did some research and realized I need to enable I2C "repeated starts". You can read more about it here:
http://scummos.blogspot.com/2012/11/raspberry-pi-i2c-and-repeated-start.html

 

I have the sensors working with the Pi 2 but somehow it gets "out of sync" and I cannot poll the sensors.  I think there may be a voltage or pull-up resistor issue involved.  So I am considering my options, I do plan to include the Raspberry Pi B+ for camera purposes, I could just use it to read the sensors and then pass the info via I2C to the flight computer, or I could do the same thing using the ChipKit Pi.  I'll figure it out! What puzzles me is why it works well with the B+ and not the Pi II because they use the same I2C chip...

 

Another small issue is with the Microstack GPS.  It defaults to 9600 baud and updates at 1hz.  It is supposed to accept commands so I can change the baud rate and the frequency.  I will need the GPS info at least 2hz.  It can go up to 10hz so if I can push 3hz and still not miss bytes I think I will be good.  The QuadCOP wont moving fast but one update per second is really not a good idea if it is gusty out.  In 1 second it can move pretty far if the wind is strong enough.

 

When I find both solutions I will post.

  • Sign in to reply

Top Comments

  • screamingtiger
    screamingtiger over 10 years ago +4
    BTW for my return to base testing, it will just come straight back. The point of the test is to be able to move to a specific GPS point. Using the idea of return to base allows me to set on the fly a point…
  • gadget.iom
    gadget.iom over 10 years ago +3
    Just thinking about your "Return to Base" functionality... will the QuadCOP retrace its steps, or make a direct heading for home?
  • screamingtiger
    screamingtiger over 10 years ago +3
    In the case of the wall, it would fire 2 or 3 photon torpedoes. My initial design would be that it would "traverse" through its recorded waypoints to get where it wants to go (solve for). This means it…
  • balearicdynamics
    balearicdynamics over 10 years ago in reply to screamingtiger

    Yep ! I had to know you before ... Moving to spherical coords for ground distances calculations made me crazy... I had to test haversine and other methods until I have not found the right way to do this...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • screamingtiger
    screamingtiger over 10 years ago in reply to balearicdynamics

    LOL "Almost".  I know I need to write up some more explanation.  I need some more tangible pictures to post otherwise this will get too boring.  I will get my explanations mixed in when I have some more pictures!

     

    For this explanation, I will need a video with a whiteboard.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 10 years ago in reply to screamingtiger

    Sorry, forgot: man with parachute in his hands asking himself what's this ?

     

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 10 years ago in reply to screamingtiger

    Thanks, anyway it's almost clear what you are doing.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • screamingtiger
    screamingtiger over 10 years ago in reply to balearicdynamics

    BTW Haversine is used to calculate distance between points on a sphere, also known as arc length.

     

    For my sine, I am splitting composite vectors into component vectors so I can adjust each component through the angle the quadcop wants to rotate.  I will explain more in another update.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube