element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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 - The Control Switch and ChipKit Pi
  • 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: 6 May 2015 1:28 PM Date Created
  • Views 818 views
  • Likes 3 likes
  • Comments 5 comments
  • quadcop_project
  • design_challenge
  • sci_fi_your_pi
Related
Recommended

QuadCop - The Control Switch and ChipKit Pi

screamingtiger
screamingtiger
6 May 2015

Previous Posts

 

Application Information
http://www.element14.com/community/community/design-challenges/sci-fi-your-pi/blog/2015/04/22/some-information-from-my-application

ChipKit Pi Vs Arduino Pro Mini
http://www.element14.com/community/community/design-challenges/sci-fi-your-pi/blog/2015/05/01/quick-update-on-the-quadcop-and-the-chipkit-pi

Quadcopter Assembled (You call that a Quadcopter?)
http://www.element14.com/community/community/design-challenges/sci-fi-your-pi/blog/2015/05/06/quadcopter-assembled

QuadCop -The Control Switch
http://www.element14.com/community/videos/16202/l/control-switch-explanation

 

 

The Control Switch

 

I've been using the ChipKit Pi and have really enjoyed learning its abilities.  I originally thought it was an Arduino clone of some sort, but I realized quickly this is not the case.  It does have some Arduino type libraries but it quickly diverges into its own paradigm.

 

Here is a video to show what I am doing followed by a more in depth explanation below.

In this video:

  • Demonstration of the control switch
  • QuadCopter Test platform
  • How to power Raspberry Pi with a 6.6V battery
  • Overall powering of all equipment
  • Test flight plan with Raspberry Pi model B+ and Camera
  • Rambling!

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

 

 

My original design called for Arduino Pro Minis, however I have decided instead to use the ChipKit Pi to replace the functionality of the minis.  One such functionality is called the "Control Switch".

 

From my application:

"This is a custom configured Arduino Mini that is connected to both the Radio receiver (Rx) and The Rasberry Pie Flight System (RPFS).  It is used to generate PWM signals to the flight controller either by reading the RPFS or the Rx depending on if the flight mode is manual or auto.  It is responsible for switching signals when it detects mode changes between auto and manual.  All PWM input from the Rx and PWM outputs to the flight controller are done with the control switch.  Digital output is fed back to the RPFS to indicate the modes read off the Rx.  This relieves the RPFs from having to detect pulse widths from the Rx as well have having the Rx connected to two different systems."

 

 

So what this entails at a high level is that I can control the QuadCop Manually, and then I can tell it to start flying in automode.  This means that my manual control must be overridden.  Further, I can take back control at any time.  This requires the reading of PWM signals, and the generation of PWM signals.  Both of these are done differently on the ChipKit Pi than they are done on the Arduino.  However because the Pic32 is so much faster, the Interrupt Service Routines (ISR) are much faster, and have less overhead.  This means a smoother signal can be generated when generating multiple signals.

 

The Control Switch is reading 7 PWM Signals and writing 5 PWM signals to control the QuadCop when in manual flying mode.

 

There are several pieces of code out there that do the above, but I wanted to write my own from scratch using C.  I prefer to understand everything that is going on under the hood with not black box concepts.

 

When in autoflight mode, the RPFS takes over.  The RPFS will be described more later, but at a high level it is reading the GPS, and executing the waypoint macros.  It does this by sending a "control byte" to the control switch via I2C.  The control switch reads and parses the control byte out and then moves in the desired directions.

 

There are 8 movements a quadcopter can do:

Forward

Reverse

Left

Right

Climb

Dive

Rotate left

Rotate right

 

These motions can be represented in 1 byte, each bit representing a direction.  Of course we cant request both forwards and backwards motion at the same time and such a condition is checked for validation of the control byte that is received.   The RPFS sends a control byte, a register command, and a Control Byte Check (CBC) over the I2C bus.   The CBC is simply the remainder when dividing the control byte by 17 (control byte mod 17).

 

One thing that is missing is speed information.    Per my initial design,  speed will be ignored and the Quad will move at a constant slow speed.  The RPFS has a command available to increase the speed in any direction in the case of a strong wind not allowing the QuadCop to move in a certain direction at the set speed.

 

The control switch will be powered by the RPFS which is turn controlled by a 5V linear regulator attached to a 6.6V LIFE pack commonly used in Radio Control applications.

  • Sign in to reply

Top Comments

  • fvan
    fvan over 10 years ago +1
    The video is still set to "private"
  • fvan
    fvan over 10 years ago in reply to screamingtiger +1
    All good now
  • DAB
    DAB over 10 years ago +1
    I look forward to seeing how well your autopilot works at keeping the copter stable. DAB
Parents
  • DAB
    DAB over 10 years ago

    I look forward to seeing how well your autopilot works at keeping the copter stable.

     

    DAB

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

    It may take some adjusting to my initial design.  I am building all the code from scratch and not going to peak at any open source stuff.  My thought is if I update the control byte several times per second it may be enough to keep it within a 1 meter radius of my desired spot.  I may have to allow more granular speed commands.  We'll see!

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

    It may take some adjusting to my initial design.  I am building all the code from scratch and not going to peak at any open source stuff.  My thought is if I update the control byte several times per second it may be enough to keep it within a 1 meter radius of my desired spot.  I may have to allow more granular speed commands.  We'll see!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
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