Difference between revisions of "S15: Quadcopter - It flies"

From Embedded Systems Learning Academy
Jump to: navigation, search
(Software Design)
(Software Design)
Line 190: Line 190:
 
=== Software Design ===
 
=== Software Design ===
  
[[File:CmpE244_S15_Quadcopter_Sofware_Arch.JPG|400px|thumb|right|Fig 2. Quadcopter Software Architecture]]
+
[[File:CmpE244_S15_Quadcopter_Sofware_Arch.jpg|400px|thumb|right|Fig 2. Quadcopter Software Architecture]]
 
The software needed to make this project possible required a robust programming language. The entire software is structured by using object oriented programming techniques in C++. C++ allows for a very reliable communication between the software and hardware of the entire system.  
 
The software needed to make this project possible required a robust programming language. The entire software is structured by using object oriented programming techniques in C++. C++ allows for a very reliable communication between the software and hardware of the entire system.  
  

Revision as of 08:25, 20 October 2015

Grading Criteria

  • How well is Software & Hardware Design described?
  • How well can this report be used to reproduce this project?
  • Code Quality
  • Overall Report Quality:
    • Software Block Diagrams
    • Hardware Block Diagrams
      Schematic Quality
    • Quality of technical challenges and solutions adopted.

SpartansQUAD

Abstract

As efforts to make the world a safer place, advancements in unmanned aerial vehicles (UAV) technology have skyrocketed. It is now possible for soldiers to remain out of the war zone and still be effective. The concept of UAVs has now ventured from the military platform to one that can be utilized by civilians. Drone technologies are currently under development which will enable law enforcement agencies to monitor public areas without having to put any actual officer lives at danger. Furthermore, drones are the assistant to the workhorse of the future. Not only will drone be used for surveillance in the future, they will be used more extensively in other fields such as film production. Drones will be the cameramen of the future. Their capabilities of being able to move in the third axis will enable drones to aid disaster search and rescue operations.

This report documents the build process of our quadcopter aptly named The SpartansQUAD. The build process, from the software development to the physical building of the quadcopter frame will be discussed in detail. The purpose of this report is to give any reader a very detailed understanding of our concepts and vision for this project.

Objectives & Introduction

The objective of The SpartansQUAD is to interface various components with SJSU’s College of Engineering SJ One Board and use it as a flight controller to sustain stable hovering. The quadcopter is to be controlled via a 6-channel transmitter and receiver combination which will also be interfaced with the SJ One Board.

Team Members & Responsibilities

  • Jashan Singh - Lead Engineer
  • Onyema Ude - Lead Engineer

Schedule

Week# Start Date End Date Task Current Status Things hindering progress
1 4/14 4/28 Ordering Parts/(Re)Assembling Frame Essential parts received; frame built with motors attached; misc. items to be ordered throughout project N/A
2 4/14 4/19 IMU SJOne Board Interfacing Complete Lack of familiarity with breakout board and unable to get training
3 4/21 - Decoding RC Signals for SJOne Board Interfacing Complete - (Throttle values obtained (code already finished by other group?); Testing motor output from RC input) Remote control mode configuration
4 5/5 5/7 Coding SJOne Board for parsed IMU data (post-assembly) Complete -
5 5/12 5/01 Pairing IMU and RC input to output to the motors Complete -
6 4/14 5/24 Fine tuning and testing Test rig built, testing in progress Smooth collaborative flight across pitch and roll axis

Parts List & Cost

Qty (Extra) Description Manufacturer Cost
4(2) Afro ESC 30 Amp Speed Controller (SimonK Firmware) Turnigy $84.00
2 Motors & Propellers Combo T-Motor $180.00
1 Turnigy 9X 9Ch Transmitter w/ Module & 8ch Receiver (Mode 2) (v2 Firmware) Turnigy $59.99
1 Turnigy nano-tech 4000mAh 3S1P 25-50C Lipo Pack Turnigy $26.90
2 Hobbyking SK450 Glass Fiber Quadcopter Frame 450mm Hobbyking $36.00
2 Landing Kit Set Hobbyking $20.00
1 Hobbyking Quadcopter Power Distribution Board Hobbyking $3.39
1 Hobbyking Lipoly Low Voltage Alarm Hobbyking $2.15
1 Turnigy Battery Strap Hobbyking $1.59
1 Mounting Pad Hobbyking $1.99
1 3.5mm Bullet Heads Polymax $1.83
1 Turnigy 3000mAh 3S1P 30C Lipo Pack Turnigy $21.98
1 iMax B6 Battery Charger IMAX $33.46
1 Hobbyking 2.4Ghz 6ch Tx USB cable Hobbyking $2.99
1 Arduino Wireless Bluetooth Transceiver Module Slave 4Pin Serial + DuPont Cable KEDSUM $9.99
1 FlySky FS-T6 2.4ghz Digital Proportional 6 Channel Transmitter and Receiver System FlySky $57.99

Design & Implementation

The various designs incorporated in makings of the SpartansQUAD vehicle were implemented with cost, efficiency, and sustainability in mind so that it would be easy to replicate or improve various aspects of the system.

Hardware Design

The hardware design of the quadcopter was based on the "plus" (+) configuration. That is, one motor would be assigned a direction based on the two dimensional plane -east, west, north and south.

This is the electrical hardware interface diagram on which the quadcopter was based on.

Hardware Interface

In this section, you can describe how your hardware communicates, such as which BUSes used. You can discuss your driver implementation here, such that the Software Design section is isolated to talk about high level workings rather than inner working of your project.

The speed of the motors is determined by a PWM (Pulse Width Modulation) signal to the ESCs (Electronic Speed Controllers). A PWM signal is a digital signal which is usually implemented to obtain the effects of a analog signal. It works by altering the width of a square wave (pulse) and the amount of time it is at a logical 1 and logical 0. The altering of the logic zero and one many times during one time frame (or period) determine the duty cycle, the percentage of time the signal is a logical 1 during one period. The ESCs used on the SpartansQUAD were given the initialization PWM signal of 500 hertz (Hz) and were given a duty cycle between 10 and 95 percent: i.e 10 percent equaling 0 throttle and 95 percent equalling full throttle. On the SJOne microcontroller board, GPIO pins P2.0, P2.1, P2.2, P2.3, with PWM capabilities, were each attached to the north, south, east, and west ESCs respectively.

To obtain orientation values of the quadcopter, the Adafruit 10 DOF IMU (inertial measurement unit) was utilized. The sensor was data was transmitted to the SJOne board via the I2C(2) bus. This allowed for the logging and calculating of the gyroscope, magnometer and compass values to the SjOne board at the rate of 500 hz. The software used these three values in tandem to calculate the orientation of the quadcopter and based on the orientation, the software sent out proper values to the motors to counter any change in orientation.

Software Design

Fig 2. Quadcopter Software Architecture

The software needed to make this project possible required a robust programming language. The entire software is structured by using object oriented programming techniques in C++. C++ allows for a very reliable communication between the software and hardware of the entire system.

Our project was made possible with the use of FreeRTOS (Free Real Time Operating System) to run the various tasks in a priority based hierarchy.FreeRTOS utilizes an interrupt based system where a higher priority task can interrupt a lower priority task to provide real time operation of the quadcopter hardware and software.

In our software, the "Quadcopter_task" task was given the highest priority to run. This is due to the fact that this task encompasses all the main processes needed for basic flight. This task processes the raw sensor data values from the IMU (inertial measurement unit) sensor which are fed to various filters and then applied to the flight controller inputs to fly the quadcopter.

Testing & Technical Challenges

The main challenges that arose from the creation of The SpartansQUAD mostly dealt with low level understanding of the system. For instance, understanding the workings of PID control systems before testing would have helped a lot. Since quadcopters solely rely on this concept, it is critical to have a full understanding of the parameters that are involved. In our case, testing was done with a high level understanding of the concept, so there was some uncertainties during testing. Being comfortable with the parameters, units, and even theory of PID control while transitioning into the testing phase of the project will definitely increase productivity and control of the system.

Challenges

# Technical Issues Adopted Solutions
1 Unorganized peripheral layout that resulted in wiring and weight distribution problems Redesigned a more centralized setup with secure wire connections
2 Sporadic transmitter values being sent to receiver module Replaced part with a transmitter that had single channel control
3 Finding suitable testing rig for single axis tuning Designed and built an uncommon testing rig that was more efficient than most
4 Simultaneously testing pitch and roll without undesired reactions Unresolved

Conclusion

Overall, we tried to keep minimalistic tenor throughout this project so it would be easier to fix or build upon existing system modules. Mechanical and electrical modules; for instance, played a huge role within the construction of The SpartansQUAD, and issues that arose within each module remained separate which made them easier to handle. The best way to describe the development process of this project would be to use the waterfall model, since each stage depends on the completion of previous tasks. It is important to note that having a detailed schedule and allotting specific time blocks throughout the week are two phases of planning that will ultimately contribute directly to the success, or failure, of the project development process. We learned that planning plays a larger role than most may think, so it is critical that each team member hold one another accountable for different parts of the project and deadlines are met or eventually accounted for when issues arise.

As a whole, execution of this project increased our knowledge of each of the following:

  • PID control theory
  • Project management
  • Time/priority management
  • Quadcopter rotorcrafts/vertical take-off and landing vehicles (VTOL)
  • RC Signal Processing
  • Sensor interfacing
  • Control system configuration

Project Video

Upload a video of your project and post the link here.

Project Source Code

Project Pictures

References

Acknowledgement

Any acknowledgement that you may wish to provide can be included here.

References Used

List any references used in project.

Appendix

You can list the references you used.