# Helicopter/Howard Community College/Fall2012/p1-504-anwk
### Problem Statement

Develop a functional program for the Arduino that can autonomously balance four motors simultaneously during flight, and to build an effective balance to test the motors on.

### Team Members

Kim Andrew Will Nathan

### Summary

Building off of the previous work of HCC students on the quadcopter, our goal is to construct a better working balance to test the motors on. This balance will have more degrees of freedom, and allow us to balance the motors with less risk of damaging the motors, the ESC's, and the arduino itself. Additionally, we will take a closer look at the software used to control the motors and seek to improve it. This involves gaining a deeper understanding of PID and how it relates to the software from the previous team's work.

### Story

Building a fully automated quadcopter within three weeks is still a ways away, even with the progress that the previous team made on the project. One key factor that was holding the project back was the see-saw the previous teams were using for balancing the motors; It was broken, unbalanced, and unable to expand from its original purpose. We decided as a team that creating a new balance would be the first step in building a complete quadcopter.
In the first week, Kim came up with the new design for the balance. Will investigated the how the previous balance was wired up, Andrew researched the controller used for balancing the motors, called PID, and Nathan researched the arduino, the microcontroller used for running the PID software.
To create the gimbal joint used in the new balance design, a ball joint and skateboard bearings will be combined. This combination will allow a broader range of motion for the platform hanging from the end of the shaft.
After putting the parts together, we inserted it into the motor platform.
* Disassembled U-joint with hand files.
* The U-joint and ball bearing as they arrived.
* U-joint in the midst of sanding.
* Andrew grinding down the joint.
The Gimbal Joint and Motor Platform

### Decision List

None Made

### Material List

| Product Name | Description | Quantity | Price |
| Traxxas Front & Rear Half Shaft | TRA5151 | 2 | $7.44 |
| Hacker A10-13L Brushless motors | These are strong, despite their weight and size. | 4 | ~$54.00 |
| Thunderbird 9 ESC | Thunderbird 9 | 4 | $29.95 |
| Arduino Mega | Mega | 1 | $58.95 |
| Jumper Wires Premium 12" M/M Pack of 10 | Male to male | 2 | $4.50 |
| Breadboard Small Self-Adhesive | 5x5 pins or more | 1 | $5.95 |
| 5 DOF gyroscopic sensor | Allows for input of X, Y, and Z accel, as well as X and Y rates. | 1 | ~$49.95 |

### Software List

Arduino Coding Software

### Time

35

### Tutorials

None

### Next Steps

We need to finish constructing the balance, and get the motors working with the arduino software once the balance is complete.

### Problem Statement

To finish creating the balance for the quadcopter motors and test the software on the arduino on the balance beam.

### Team Members

Kim Andrew Will

### Summary

We started out the second part of this project by creating a new gimbal joint out of aluminum. Additionally, we had to make a decision whether or not to continue using the current software, or to switch to an open-source quadcopter program called Aeroquad. Using a decision matrix, we decided to continue using the current software. We conducted some tests on the current software on the ardunio with the accelerometer.

### Story

We started out the second part of this project by creating a new gimbal joint. The older one had worked temporarily, but the plastic holders that secured the metal ball in place were broken. We experimented with reconnecting the plastic sides of the joint by 'soldering' it back with plastic from the 3D printer, but it was ineffective and the joint broke again after undergoing some stress. To continue working on the balance as we had planned it, we decided to begin by creating new holders for the gimbal joint.
The older plastic holders were just two U-joints for a RC car, so what we needed to do was construct a bracket that was about the same size as the former holders. At first, we experimented with using wood for a material for the holders. However, during construction, the holder that we were making broke, and we decided that wood was too weak of a material considering the stress that it would be put under once the balance is being used. We switched to using aluminum as the brackets, which provided two distinct advantages: fabrication of the joint would be much easier, and inserting and removing the metal ball at the center of the gimbal joint would be much faster than with a wooden or plastic joint. However, using aluminum for the sides of the brackets is a risk, since the aluminum is more prone to warp under the stress of the motors on the balance. Once the balance is complete, the rigidity of the joint will need to be tested. We fabricated the joint by snipping out a thin strip of aluminum, bending it about a piece of plywood about the same width of the metal ball, and then drilling a hole through the metal piece using a bit that's slightly larger than the poles on the metal ball. After filing down the sides of each bracket a little bit, we inserted the ball into the two holders and had the main piece of the gimbal joint.
We also had to make a decision whether or not to continue using the current software, or to switch to an open-source quadcopter program called Aeroquad. Using a decision matrix, we decided to continue using the current software for now, but if problems arose, we will switch to using Aeroquad. Details regarding this decision can be found below, under Decision List.
Additionally, we tested the software of the quadcopter using Serialchart by Starlino. This program was made by the same coder who created the majority of the code for the PID controller of the accelerometer, and it displays data generated by the ardunio using a graph. A tutorial of how to connect the ardunio to serialchart is below. Our results from the serialchart output indicated that there was a discrepancy between the input of the accelerometer and the output from the PID controller software. This was most likely due to the discrepancy between the sensitivities for the IMU; the program was tuned to use an IMU created by the coder, and we are using a sparkfun IMU with different sensitivities for the accelerometer and the gyroscope. After replacing the sensitivities in the code with the figures appropriate for our IMU, there is still some fluctuations in the X-Y axis output when the accelerometer is flipped over 180 degrees.
* Andrew drills a hole in the new gimbal joint.
* The new gimbal joint, disassembled.
* The new gimbal joint, assembled.
* Graph generated by Serialchart from rotating the Arduino along the x-axis.

### Decision List

We needed to decide on which software to use for the arduino as we approach the point of testing the motors out on the new balance. Kim found an open source software called Aeroquad for the arduino that is more friendly towards users who don't have much programming experience. However, using this software would involve purchasing a new gyroscope for the arduino at the very least. The team used a decision matrix to resolve this problem.
In the end, we decided to keep using the current software by a small margin. We all agreed that if we need to drastically change the current software to have it begin working with the new balance's setup, we will switch over to aeroquad and see if it will be easier to work with.

### Material List

| Product Name | Description | Quantity | Price |
| Traxxas Front & Rear Half Shaft | TRA5151 | 2 | $7.44 |
| Hacker A10-13L Brushless motors | These are strong, despite their weight and size. | 4 | ~$54.00 |
| Thunderbird 9 ESC | Thunderbird 9 | 4 | $29.95 |
| Arduino Mega | Mega | 1 | $58.95 |
| Jumper Wires Premium 12" M/M Pack of 10 | Male to male | 2 | $4.50 |
| Breadboard Small Self-Adhesive | 5x5 pins or more | 1 | $5.95 |
| 5 DOF gyroscopic sensor | Allows for input of X, Y, and Z accel, as well as X and Y rates. | 1 | ~$49.95 |

### Software List

Aeroquad Serialchart by Starlino Software from Previous Group

### Time

33

### Tutorials

Serial Chart Tutorial

### Next Steps

The balance needs to be finished. This encompasses attaching the gimbal joint to the shaft, finishing wiring the escs and IMU to the ardunio, and attaching the motors and electronic components to the finished balance. Additionally, the discrepancy between the raw input from the accelerometer and the output from the PID software needs to be addressed.