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 2288 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…
Parents
  • ravi_butani
    ravi_butani over 10 years ago

    Great ... I also want to do something similer....and want to see how you use PID to achieve all this functionality...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • ravi_butani
    ravi_butani over 10 years ago

    Great ... I also want to do something similer....and want to see how you use PID to achieve all this functionality...

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

    I wont have to deal with PID.  I am using a prefabricated quadcopter controller (KK 2.1.5) for controlling the quadCOP.  The flight computer sends commands to a control unit, the converts that to PWM and sends it to the KK control board.  All I have to worry about is adjusting a vector to counteract any external forces such as a strong wind.

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

    fine... even though if quad wants to hold the GPS location or fly through predetermined path with out bigger oscillation around the position or path , i think PID is needed and it is totally different from PID used to stabilize orientation of Quad. This is just my thinking .. may be I am wrong

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

    My intention is to have a accuracy of 2 feet.  the main issue will be wind.  for that I have developed something I call "Constant Bearing Vector".  this is the wind's heading or bearing, and a force vector is applied in that direction.  I use the Law Of Sines if I rotate the quad, so it can apply the vector constantly.  I am hoping this using the type of method to "preempt" the external forces instead of trying to react to them on a micro level.

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

    I agree with this method, Joey as I have developed the same to work - without wind - on maps with a 1ft precision. I had to use the more complex Haversine instead of the law of sines only but the principle is the same.

    Instead I was thinking to another problem, that maybe more malicious than the wall (that you can easily fire with one of powerful arms on your drone). What is on the drone trajectory appears something unexpected? E.g. a flying baloon, a falcon, a hawk, a parachute with a man attached, an asteroid, and UFO a flying pig (only with the PinkFloyd music together) ? Do you have considered this option ?

     

    Enrico

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

    I have a sensor array, which has yet to be introduced.  it has ping sensors on it to avoid collisions.  However, if man with parachute comes down drone may hit him.  But he is trespassing so it is his fault image

    • Cancel
    • Vote Up +1 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