Sunday, January 12, 2014

Quadcopter Requirements and Parts Planning - Phase Alpha

Hi!  My name is Jordan!  This will be my first blog entry for our quadcopter project.  I'm very excited to get started on the project, but my Dad is advising me to calm down and run this like a true design project.  He said that "we need to limit our initial goals to the basics, so we don't tie up too much money in the project before we get it to fly properly", so we will be leaving the GPS tracking and GoPro Hero 3 purchases for a later time... dang it!

On a 2-mile walk with the family, my Dad and I got a chance to have a long talk about the quadrotor project.  We talked about the list of requirements for the first version of the project, which we are calling "Quad Alpha".  We also discussed things like Beta and revision numbering for the hardware and firmware.  My Dad insists on calling the programming part "firmware", probably because of his work experience.

List of "Quad Alpha" Requirements
·         Autonomous Flight
·         Autonomous Take-Off
·         Autonomous Landing
·         Maintaining Level Flight
·         Object Avoidance in X/Y/Z Directions
·         Microcontroller control (required for autonomous functions)
·         Data Communication with Controller Board to send basic commands, like
o   begin take-off routine
o   begin landing routine

Starting with the list of requirements above, we discussed the parts that would be needed.  For the basic flight system, we would need four motors, two clockwise and two counter-clockwise rotors (explained here), four Electronic Speed Controllers (ESCs), a controller board, a battery and a frame to hold them all together.  We are going to forego the full remote control at this time, mainly because of the high cost and small number of commands we need to send.  We will try to send commands to the device through some type of simple data communication, like infrared, for the Quad Alpha phase.   

To maintain level, we will need a gyroscope.  To do take-off and landing, we will need a longer-range sensor on the bottom.  Dad suggested some type of sonar sensor.  To do object avoidance, we will need a single long-range sensor and four shorter-range sensors.  I used ultrasonic sensors for proximity sensing with my Lego Mindstorms NXT 2.0 and in First LEGO Robotics League.  I'm very familiar with their usage.  We talked about the placement of each part on the body of the quadcopter, like the sonar sensors on the top and bottom of the quad so that it can determine how high it is flying when indoors.  The ultrasonic sensors would be placed under the four rotors so the program could determine distances between objects and the rotor ends to protect the rotors.  The gyroscope would be mounted in the center of the quadcopter to sense the small changes in level.

We created a "Bill of Materials" in a spreadsheet to keep track of the items for this part of the project.
 

Part Description
Quantity
Motor
4
CCW Rotor
2
CW Rotor
2
ESC
4
Microcontroller Board
1
Quadcopter Frame
1
Gyroscope
1
Sonar Sensor
2
Ultrasonic Sensor
4
Battery Pack
1

For the next blog entry, we will put together a schematic showing how all these parts will be wired together.  This will help us pick the right parts the first time.

Monday, January 6, 2014

The Most Important Part

What is *THE* most important part of a digital design project like this, besides motivation, good planning and research skills, and a little money?  The micro-controller board, of course!  But which board to choose?  If you go with a board that has too few digital I/O pins, too few A/D channels, or not enough PWMs, then you're stuck purchasing another board.  At $50 or higher per board, that could be a big mistake.  Most people would say "The one with the most of everything, then I would be covered!"  That's not always true.  What if that board with everything and a side of chips (pun intended) is really bulky and heavy, but needs to be very lightweight and small because it will eventually be used in a quadcopter or flying drone application?  All those extra pads and the massive board real-estate could be a benefit during development, but would come back to bite you in the end because it literally won't get off the ground.

For the purposes of picking the board, and for that matter, every other piece of hardware involved in the project, we must clearly DEFINE the project.  Granted, in an educational sense, you want to maintain your flexibility so that you can do a multitude of projects with the hardware you purchase.  Even with that in mind, you have to find that "ultimate project" and determine the goals based on that.  If that requires an additional purchase of another micro-controller board later to get that quadcopter off the ground, then plan accordingly.  

Jordan and I will be working towards our ultimate goal of, you guessed it, a QUADCOPTER!  Ever since seeing some of the online videos of wild, acrobatic, nimble, and truly amazing stunts performed by quads several months ago, we were both hooked on doing a closely related project.  Here are some links to a few of those videos, mostly from the GRASP Lab at the University of Pennsylvania:
Any hard-core RC people out there are probably saying "You don't need a micro-controller board to make a quad!"  You're right.  You don't.  Warthox's video above is non-autonomous flight, not controlled by a micro-controller.  You could buy a frame, an RC transmitter and receiver, 4 motors and 4 motor controllers and be flying in no time.  I don't want to offend anyone, but that's more of an exercise in learning to fly the quad than making and learning from an awesome digital design project.  That's where you DO need a micro-controller.  If you want the flexibility and educational benefit of programming, like changing flight characteristics based on changes in sensor readings or programming an autonomous take-off and landing routine, you need a micro-controller.  This DOES NOT remove the possibility of hooking up a nice RC controller and flying it manual.  It just adds an ever expanding dimension.

The next blog entry will cover the selection of our micro-controller board.  I already have an idea, but I want Jordan to go through this exercise.

Friday, January 3, 2014

Motivation, Anyone?

So, why have we decided to create a blog about the engineering and programming projects we are starting?  Because I think it’s an experience worth documenting and sharing.  I’ll give a little history of my experience and motivations to take on something like this, and why I’m inspired to see where we will go from here. 

When I was at the University of Oklahoma for Electrical Engineering, my focus was on Digital and Hardware Design.  My absolute favorite course was our Digital Design Laboratory.  This was where the "rubber met the road", per se, where much of our prior coursework found practical application.  As part of our class kit, we purchased a Motorola M68HC11EVBU for about $70, which was a Moto 68HC11microprocessor along with RAM, UARTs, and an EEPROM.  The EVB was short for "Evaluation Board", which gave us plenty of room for additional logic parts and wire wrap posts... yes, I said wire wrap...

Motorola M68HC11EVBU Evaluation Board
Here are a few pics of the actual board we used in school, along with the jumble of wires on the back.



Motorola M68HC11EVBU Board with Wire Wrapped Backplane
Wire wrapping was the cheap way to do "breadboarding", and after spending $70 on an evaluation board as a college student in the 1990s, there wasn't much room in the budget for a super-expensive breadboard.  Plus, wire wrap allowed us to keep the design we were working on "stable" when we had to put it in our backpack and take it with us. With hundreds of students making their way through the labs at all hours of the day and night, nobody would dare leave their precious design board out to be tampered with. After all, this was a competition of sorts.

The project for the semester was fully open to our imagination.  Using the project board and any other parts that we could purchase or scrape together, we were told to develop a real-world application that used the microcontroller.  That was it.  Talk about wide open!  My lab partner and I thought on it for a week and came up with an overly aggressive project, a solar panel tracking device.  The microcontroller would take in a number of sensor inputs and without human intervention and adjust the face of the solar panel to the most efficient position to capture sunlight.  At first light, the panel would scan the horizon looking for the Sun, track it throughout the day, and go into an East facing default position at night, waiting for the Sun to reappear.  If it happened to be a cloudy day and the sun could not be “seen”, the panel would go flat to capture all the ambient light it could.

What was our first error in taking on this aggressive of a project?  We forgot that we were not Mechanical Engineers and we did not have one on the team.  Looking back, it would have been great to call up any of my friends that took the mechanical path and asked for their advice.  Nowadays, I would just run over to the mechanical engineering department and ask “Is this possible?  How can we keep from burning up multiple, very expensive stepper motors?”  Yeah, that is the pain we endured to teach us what all modern companies and our professor knew – “Never hire an Electrical Engineer to design something mechanical, even though their confidence tries to convince you otherwise.”

Beyond our mechanical issues, the project went amazingly well.  We developed a specialized sensor made from photocells and a small box, used analog to digital circuits to sample voltages, used comparators to compare the voltages and determine the desired panel movement, developed a program that analyzed the data and made decisions, and fed a bank of relays to drive stepper motors in the desired direction.  It all worked very well, and we could demonstrate the proper results through the oscilloscope… since we had burned out at least two motors and the last was on order when we had to demonstrate the design for our final grade.

The quote above was used by Professor Tull at our final demonstration to describe the root of our mechanical problems.  Luckily, he completely understood.  Since we were able to demonstrate the proper outputs in the lab via the scope and a light bulb on the end of a long stick, we received a 98% in the course.  That was the top grade for the semester and we received wall plaques for Outstanding Project Award.  We were very proud of our work and I was inspired.
At the time, I thought that little EVBU board was amazing.  We could do almost anything with it.  We could direct huge fields of solar panels and solve the world’s energy crisis, we could prevent world hunger by delivering food via autonomous helicopter to hungry people in out of reach places… or we could just go to work for a large company and spend our talents on a small section of a huge design, which is what both of us ended up doing.  I can't say the I regret it in any way, just that your creativity eventually gets stifled.

After more than 15 years in the digital design industry, I'm feeling inspired again.  Jordan, my 13 year-old son, and I started spending some time on the Arduino site.  Our collective creative minds started going into overdrive.  It reminded me of how much fun it was to develop without bounds.  I want to feel that way again, and I want to share that feeling and experience with my children.

Anything is possible in this new “maker” world.  The tools afforded to this generation allow people to skip many of the small details that, as students, we had to design from scratch.  It swings the doors of creativity wide open, like we've rarely seen before.  Just a few examples are the multitude of maker spaces and fairs available, an abundance of microcontroller boards with "anything you can dream of" plug-n-play, add-on modules, access to 3D printing technologies, and more than anything, the internet.  All of these developments make it possible for any kid with a dream to turn it into reality with a little gumption.

I’m excited about where this project will lead us, and I want to make that journey together.