Introduction: Rowan University Mechatronics Quadcopter
This instructable is a guide on how to build a quadcopter. To start off, this is not an easy project. our group spent much time testing and trouble shooting the code.
This sight was immensely helpful when making the copter:
http://robots.dacloughb.com/project-2/testing-hove...
The next website was used to get the library that would be used for the balancing device
Step 1: WARNING
Be careful with lithium batteries, if used incorrectly, the can explode violently.
Ok so i've burned out 2 motors. I was from a novice mistake but one that is rather easy to make. The electronic speed controller was designed to put out a maximum of 20 amps, the motors could take a maximum of 12-14 amps. The wires of two of my motors couldn't handle this amperage and they burned.
Step 2: Materials
LiPo Battery Pack-We chose a 5000 mah(milli amp hours) LiPo battery that was 20C. The 20C times the 5000 mah will tell you that the battery can put out a max of 100 amps.
Motors (4) and Speed Controllers (4) - make sure 2 spin clockwise and 2 spin counterclockwise- the motors and electronic speed controllers were purchased as a combo
Propellers (4x 11inch diameter)-this size was specified on the motor.
Aluminum sheet (12” by 12” by 1/8”)-This was used due to the powerful motors. Check how much thrust the motor can put out before choosing a material
Aluminum strips (1” by 9”) (Need 4)
Screws (12x the type of mounting screws needed for the motors)
Gyroscope-6050 MPU, This device is a gyroscope and accelerometer combo. The first page contains a library that will allow it to be used easily.
Wireless Components-More detail is given here:https://www.instructables.com/id/Wireless-CarXbee-S...
Arduino Uno-Micro controller that will be used in the remote control and the receiver on the copter
Xbee-Wireless device used on the arduino
Xbee shield
Step 3: Design the Frame
The frame design consists of a 5” by 5” aluminum square
with four 1” wide arms protruding from the corners. The arms protrude 8.75” in order to allow for clearance of the 11” propellers. The holes on each arm include four mounting holes for the motors, a clearance hole for the spinning motor shaft, and a mounting hole for the legs. Care was taken that the entire frame design be symmetrical, as any eccentricities would cause flight instability. The frame was designed to be both lightweight and highly supportive by using a skeletonized design with truss supports across the arms. The design was drawn up in Solidworks and fabricated using the laser cutter.
Step 4: Original Frame
Our original frame utilized a tough plastic 1/8” sheet in
this shape, as seen in the figure below. We believed that this material was a good one to use because it was so light. Unfortunately, the motor/propeller combination that we chose was quite powerful and therefore exerted enough force on the arms to make them bend. Thus, we switched to the more durable aluminum sheeting that can withstand the extra force. However, if the aim is for a light, less powerful machine, this material is still a good option. Just make sure you use smaller equipment.
Step 5: Motors
Screw all four motors into the given spaces on the top of
each arm. It is important here to ensure that the propellers are mounted far enough away from each other that they won’t hit each other when the copter is in flight.
Th motors used were Emax XA2212 Brushless Motors 980KV.
The specs on the motors I used can be found here.
Step 6: Landing Legs
Take the 1” by 9” strips and bend them into a U shape, with
1” by 4” by 4” side lengths. The shortest side was used allow for flush mounting to the underside of the quadcopter arms. It’s ok if the bends aren’t quite 90 degrees. This gives the legs a bit of spring that eases the landing.
Step 7: Electronic Speed Controllers Motor Speed Range
The Electronic
Speed Controller, ESC, used for the project was a Simonk 20A ESC. This section will help instruct you on how to program your’ ESC to it’s full range of speeds USING an ARDUINO UNO. If you attempt to use the ESC with a brushless motor before doing this, your ESC will work but it may not be able to achieve max speed.
#include
#define MAX_SIGNAL 2000
#define MIN_SIGNAL 700
#define MOTOR_PIN 9
Servo motor;
void setup() {
Serial.begin(9600);
Serial.println("Program begin...");
Serial.println("This program will calibrate the ESC.");
motor.attach(MOTOR_PIN);
Serial.println("Now writing maximum output.");
Serial.println("Turn on power source, then wait 2 seconds and press any key.");
motor.writeMicroseconds(MAX_SIGNAL);
// Wait for input
while (!Serial.available());
Serial.read();
// Send
min output
Serial.println("Sending minimum output");
motor.writeMicroseconds(MIN_SIGNAL);
}
void loop() {
}
Once you upload the code to your Arduino, attach one ESC to your Arduino. ONLY plug in the ground and the signal pins from the ESC into the Arduino. Once that is done, turn on your serial monitor and type any character into the monitor but DO NOT PUSH ENTER YET. Then plug in the main battery to the red and black terminals. As soon as you hear 2 beeps, press enter to send the character to the serial monitor. According to the instructions in the code you should wait 2 seconds but I found that if you do, the ESC will enter programmable mode.
Step 8: Gyroscope/Accelrometer Combo
6050 MPU.
The website for the 6050 MPU Library I use is here:http://www.i2cdevlib.com/devices/mpu6050#source
I liked it more then the Arduino version because it gave multiple options for what kind of output you could get. I wanted the yaw pic and role for this project.
I used the picture above to wire it correctly.
The ardiuno website goes into much detail regarding the 6050 MPU
http://playground.arduino.cc/Main/MPU-6050
This is the board I got. Relatively cheap so don't expect it to be perfect.
Step 9: Picture of Quadcopter Construction
Here are some pictures that show both the acrylic and aluminum frames and the wiring. To be fare this is just a prototype so it doesn't look very pretty but it's on its way.
Step 10: Test Code for the Copter
This Code will allow you to control the motors by changing the code to test the different speeds. It is easy to manipulate. I am currently using it to only control 1 motor so a few of the sections have been excluded.
#include
#define MAX_SIGNAL 1900
#define MIN_SIGNAL 800
#define M1 3 #define M2 6
#define M3 9
#define M4 11
Servo motor1;
Servo motor2;
Servo motor3;
Servo motor4;
int speed;
Pin=A0;
int speed1=0, speed2=0, speed3=0, speed4=0;
void setup() {
Serial.begin(9600);
pinMode(speedPin,INPUT);
Serial.println("Program begin...");
Serial.println("This program will test the 4 motors.");
motor1.attach(M1);
//motor2.attach(M2);
//motor3.attach(M3);
//motor4.attach(M4);
motor1.writeMicroseconds(MIN_SIGNAL);
//motor2.writeMicroseconds(MIN_SIGNAL);
//motor3.writeMicroseconds(MIN_SIGNAL);
//motor4.writeMicroseconds(MIN_SIGNAL);
Serial.println("Sending minimum signal. Power on motor and wait for beeps.");
delay(4000);
Serial.println("After beeps, type a signal length terminated by m and the motor number to motor. For example,"); Serial.print(MIN_SIGNAL);
Serial.println("m1 to stop the motor 1. ma is for all motors.");
}
void loop() {
int input, number;
// Wait for input
//input=analogRead(speedPin);
//speed1=map(input,0,1023,1000,1400);
motor1.writeMicroseconds(1800);
//motor2.writeMicroseconds(1800);
//motor3.writeMicroseconds(1800);
//motor4.writeMicroseconds(1700);
}
Step 11: Enjoy Your Quadcopter!
Now that everything’s been built and tested, the copter
can be used as desired. Hang an iPhone from the center supports and film the skies, or buzz the crowd at graduation next week!
This Intractable will continue to grow since this is an ongoing project.