Saturday, August 28, 2010

Using a Complementary Filter to Combat Vibration

This is the data I received from the IMU along the y-axis (pitch). Accelerometer data is in radians and the gyro data is in radians per second. The data points from 0 to 41 are before the motors turned on. 41-89 is the quad tilting left. 89-129 is the quad tilting right. 129- is the quad tilting to the left again.



As you can see the accelerometer data is quite noisy. I tried dampening the vibration using foam underneath the circuit board, but that didn't help much. Looking at the gyro data it is quite smooth in comparison.

So I looked into using filters that combine the accelerometer data with the gyro data. Using the code for a Complementary Filter (thanks to RoyLB). I was able to produce the following results.

Sunday, August 22, 2010

First Balance Test



I adjusted the support rig to hold the quadcopter at the left and right arms allowing it to pivot in only one axis. Above is a video after spending 3-4 hours tweaking the code and adjusting the PIDs (I'm still out one motor and I disabled the other motor for testing). It seems to start the balance quite well but begins to destabilized. After some debugging it looks like the receiver chip is receiving some bad signals. Sometime this week I'm going to debug the receiver code to figure out what's happening. I may also try to remove the receiver code for now to see if I can get a stable balance.

Puff!!! There Goes A Motor.

During a firmware upgrade one of the motors started making a very strange noise. After 3-4 seconds a puff of smoke, the motor was dead. Still not sure what happened. Unfortunately that means ordering another one from Hobby City which has the best price but takes at least a week to get here.

Sunday, August 15, 2010

First Take-Off



I managed to have a clean take-off and landing. I don't have any of the sensor data mixed in yet just the R/C receiver throttle. I have the quadcopter held down using zip ties. Next step, new rig to get higher and more control over the flight.

Circuit Physical Layout



Before I sent the PCB off to BatchPCB I wanted to make sure the physical layout would work. I printed a 1:1 version of the circuit and took a piece of foam and tried out the parts. Good thing I checked because I had an overlap between a couple of the components. My circuit also has expansion ports for GPS, general IO and other TWI components.

My ciruit on BatchPCB

Quadcopter Eats Some Propellers



My quad ate it's first propellers. During my first hover I guess things weren't secured as well as they should have been and the propellers and speed controllers had a collision.

Here is what I think happened: I had the speed controllers taped to the board and the quad took-off and ripped the tape up. Then I landed and the speed controllers went up into the props. Thankfully the speed controllers came out with only a couple of gashes.

Quadcopter Circuit



I'm using 3 ATmega328P processors for the prototype circuitry. The first is used to communicate with the R/C receiver and filter the results. The second is used to communicate and process the sensor data from the accelerometers, gyros, and compass. Those talk to the main processor over TWI which combines the receiver and sensor data to control the motors. The main processor also sends out telemetry data using an XBee serial connection as well as monitor the battery voltage.

Quadcopter Prototype



My first project is a quadcopter (prototype pictured). The frame is made from 3/4" aluminum square tube. The proto breadboard in the center has the accelerometers and gyros (IMU 6DOF Razor), the Magnetometer (HMC5843), and breakouts for the 4 speed controllers (TURNIGY Plush 30amp Speed Controller). The four motors are Turnigy 2217 16turn 1050kv 23A Outrunners with APC 12x3.8 standard and 12x3.8 pusher props. Not connected in the photo is the ZIPPY Flightmax 4000mAh 3S1P 20C battery.



Here's a closeup of the power distribution. I'm still working out options that are lighter but for now this should work for prototyping. With each motor pulling up to 20Amps times 4 for a total of 80Amps I needed some pretty beefy power distribution. The wire is Turnigy 12AWG which has very high braid count for more amperage capacity. I used a terminal block (available at Home Depot) and terminal wire connectors.

ATX Power Supply Conversion



I had a bunch of old ATX power supplies laying around, so I decided to convert one into a bench power supply until I could find one. The on/off switch on the right is hooked up to the green wire and black wire of the 20pin connector. I also brought out a hand full of grounds (black banana plugs), as well as +12V, +5V, and +3.3V. It's kind of hard to see in the photo but I also added a small LED to the left of the switch to indicate power status.

Welcome to 5Volt Blog

Welcome! I'm starting this blog to document my electronics hobby. Ever since my son Ian was born I've had to put my other hobby, woodworking, on hold. I decided to get back into electronics, a hobby of mine since I was young, which is much quieter.



One half of our unfinished basement is reserved for my woodshop. I decided to take over the other half of the basement for electronics, and repurposed some old storage furniture for a work space. Above is a picture of my electronics workbench. Since most of the projects I have planned require quite a bit of firmware I've set up a computer on the left. On the top shelf are various components. On the middle shelf I have my old Radio Shack multimeter, a converted computer power supply, an Aoyue 2900 Soldering Station, a PanaVise 350 Work Center. On the bottom I have various hookup wires and tools. Off to the right I have more storage.

If it weren't for all the unused baby stuff lying around, my basement would be my version of a perfect "man cave."