Monthly Archives: October 2012

Thoughts go out to all my readers on the East Coast…

If you or your loved ones are in the areas affected by Sandy, you may not be able to read this, but my thoughts are with you all. If you aren’t in the affected areas, considering helping out in the relief efforts by donating either money or blood to the Red Cross. You can donate $10 by sending a text to 90999, or go to the Red Cross website and donate with a credit card or Paypal. The bad weather is likely to cause shortages of blood and platelets, so finding a donation center for blood would be a great idea as well.

Hang in there!

Mini balloon tracker…

I was listening to Amateur Radio Newsline to a story about a lightweight balloon payload that crossed from Great Britain to Sweden carrying a payload which weighed less than 100 grams and using just 10mw. I thought that was cool, so I googled around and located these neat instructions on building a lightweight GPS tracker. The same could be used to log information on an RC airplane too. Stashed for later.

New tail for my experimental trainer prototype…

Okay, yesterday I admitted that I could not do math. According to Sean Foster’s hints on trainer design, the horizontal stabilizer should have had an area of between 20 and 30 percent of the area of the main wing. My main wing is 30 inches with a six inch chord, so it has an area of 180 square inches. For some reason, I did the math wrong, and yesterday’s tail had an area of only about 27 square inches. Today, while watching Pablo Sandoval lead the Giants to a 1-0 lead over Detroit in the World Series (three home runs in his first three at bats? I love this game!) I decided to make a new tail with just about double the total area. I was out of white Dollar Tree foamboard, but I did have some black lying around, so I decided to give that a go. I started by cutting a 5×15 inch rectangle, and then tapering each side to 2.5″. That ends up with 56.25 square inches, which seemed pretty good. I made the vertical stabilizer out of a 5×5 inch square, which I then tapered to just 2.5″ at the top. I didn’t bother cutting in the rudder and elevator, because this was really just a model (which I might use as a glider test platform later, but not as an RC model).

The black foamboard doesn’t photograph well, but here’s the tail installed.

New tail on the prototype…

I think the proportions are more pleasing. In the real RC model, I’m thinking I’ll need to stiffen the main body, either by embedding struts, or doubling (or tripling) the body thickness. The balance of the glider is almost dead center now, well behind the wing, so it won’t fly as is. But I think it will probably fly pretty well once I get some more weight in the nose (in the RC version, it seems likely the motor, receiver, servos and batteries can compensate).

With some luck, I’ll get to a flight test this weekend.

Addendum: I tried to balance the plane by taping some weights to the nose and giving it a few practice tosses. Sean’s page suggested that the CG would be about 25-30% back from the leading edge of the wing, but when I adjusted the weight to balance, the plane was clearly nose heavy, and accelerated into a dive. Just before bed I plugged the numbers into a CG calculator, which suggested that with the spacing I chose, the CG should be better placed about 3.5″ from the leading edge (or about 60% of the way back). I’ll have to give that a try soon. But it’s time for bed.

CG calculation

More experimentation with foam and foamcore…

I haven’t done much flying this week, in part because we’ve begun to get some rain here in the SF Bay Area, but also because I have just been having difficulty controlling the Nutball. I began to think that what I needed was a proper trainer airplane. A couple of weeks ago, I read this interesting post by seanfoster on the flitetest website, detailing some basic design dimensions that you could use to generate a docile trainer. I decided to try to use this proportions and mate them to the KFm-2 wing that I made a couple of days ago, to see what the overall proportions would look like. I decided to use some of my pink 1/2″ foam for the body, and made a tail out of Dollar Tree foam board. The idea here was not to generate a flying model, but really just to put together the pieces in the proper proportion to see what it looked like, and judge the overall balance and sturdiness of the construction, and just whether I liked the overall size and shape.

Here’s a couple of pictures of the resulting airplane, just hot glued together and photographed in my living room.

The overall body length is 30″, which is five times the six inch chord of the wing, which has a 30″ wingspan. The body has a maximum height of 3″ (10% of the it’s length) and the nose section tapers down to 2″ symmetrically, while the back section starts tapering back to just 1.5″, starting at 12″ from the front of the nose. The tail is 9″x3″, with a 3″x3″ vertical stabilizer, and 1″ elevators and rudder sections. The resulting aircraft is quite tail heavy, but of course lacks the motor that a real RC airplane would have. I don’t have any spars in place, so the body itself was pretty floppy. I’m not displeased with the overall shape, although I wonder about the tail: it seems a bit small to me. I also did not give much thought to the ailerons or elevators. I was thinking of having just elevator/rudder control, and wonder if their relatively small control surfaces would make the plane difficult to control. The guidelines provided are for four-channel control, I was wondering if a three channel rudder/elevator would be easier to do, and would therefore also require additional tail changes. I’m trying to come up with something docile and easy to fly, rather than acrobatic, so perhaps less is more.

I might try weighting the nose of this prototype a bit to get it to balance, and then see if it works in a glide test. If I do, I’ll be sure to shoot some video and let you know how it works out. Stay tuned.

Addendum: Sigh. Apparently, I can’t do math. The recommendation is that the tail have between 20 and 30 percent of the area of the main wing. My wing has an area of 180 square inches, whereas my tail has an area of just 27 square inches (about 15%). A better tail would be 12″ by 4″, with a 4″x4″ vertical tail, which would have an area of about 48″, which would be about 27% of the main wing area. Luckily, a little isopropyl alcohol on the tail section will dissolve the hot glue, and I can try replacing it. I should have double checked my math before starting.

Experiments in foamcore…

As I was watching Vogelsong pitch a gem against the Cardinals, I thought it might be cool to try some additional experiments with paper/foamcraft and try to create a simple (even trivial) wing from some Dollar Tree foamboard.

I had previously experimented with building an Armin wing as described by Ed at Experimental Airlines. It generates a nifty wing, with a true airfoil shape. But it’s kind of complicated, and I wanted to see how simple I could make a wing using Dollar Tree foamboard. I had very modest goals: just something that might provide a little better lift than a flate plate. I decided to try fabricating a 30″ wing with a 6″ chord, in the style of a Kline-Fogelman airfoil, in particular the KFm-2 design, which has a step at 50%.

Fabrication couldn’t be simpler: I just cut two pieces from foamboard, one 6″x30″, another just 3″x30″. I could have just hot glued them together, but I decided to be a bit more refined. I stripped the paper off one side of the 3″x30″ piece, and scored and stripped a section the same size off the 6″ piece, so that I would be gluing foam to foam. I then spread a fairly reasonable amount of Gorilla glue to one side, and wiped the other with a dampened paper towel (the water is supposed to enhance foaming, making the glue spread out). I then placed them together, and put my 2″ wide steel ruler over it, and clamped it down to my workspace to set. The hardest thing is waiting for glue to dry, but after an hour, I could see that the foaming had caused a tiny amount of the glue to eek out of the side. I unclamped it briefly to check it out: it seemed very much stiffer than the single layer, and might not even need additional stiffening to use it in a small, lightweight trainer. When it’s completely set, I’ll cut a bevel onto the front, which should give it a tiny bit of aerodynamic efficiency and then cover the leading edge with some packing tape.

The specifications on the Wiki page say that a KFm-2 wing should have a thickness which is 7%-9% of the wing chord, which means a thickness of about .4″ to .54, this wing turns out to have a thickness of about 3/8 of an inch, which is a tiny bit thin, but I’m going with it anyway. For a novice trainer, some dihedral angle would be useful as well, so I think I’ll score the middle and fill it with hot glue. I could add some ailerons, but I think maybe just elevator and rudder controls would make sense, so that would probably be it for the wing.

Not sure what I’ll do for the body yet. But my goal is simple, simple, cheap and simple.

Pictures later.

Addendum: Okay, here are some pictures.

The full wing…

The bevelled leading edge…

I didn’t do an amazing job: it’s just an experiment after all. I cut a rough 45 degree angle through the top layer of the wing, and then beveled it with a dry wall sanding block. The results are pretty reasonable. I scored through the bottom of the wing, and cracked it, filled it with glue, and held it in place at the dihedral angle (just the height of a book I had on hand) until it set, and I then covered the joint with packing tape. Overall, I’m pretty happy with the result of the experiment. I think it’s usable.

Watch Out! Mark attempts to fly his Nutball once again…

Carmen suggested that we try to go out and fly my Nutball, since she hadn’t seen it in the air before. Our local park seemed too small, and Cesar Chavez turned out to be windy, so we did a quick websearch and discovered that the Lime Ridge open area in Concord was popular with fliers, especially on Sunday. So, we headed over there and gave it a whirl. It is indeed a pretty nice area, and there were a couple of other fliers giving it a try (and doing a much better job of it). My own attempt at taking the Nutball up resulted in a couple more snapped props. Sigh. But I did have my little camera in the back, and Carmen shot some video of my launch, so at least you all can laugh at it. Here it goes:



The Larger than Life variant: Bugs…

Having written the previous FFT based implementation of Conway’s life, we can easily implement life variants with larger neighborhoods which run just as fast. This is a variant called Bugs, which has a neighborhood of radius 5, and includes the center square. If it is “alive” and has between 34 and 58 neighbors (inclusive), it remains alive. If it is “dead”, it is born if it has between 34 and 45 neightbors (again, inclusive). This rule is a simple modification of the code I previously posted, and computes generations in the same time as the simpler Conway neighborhood. Neat!



Crazy programming experiment of the evening…

I was struck by the lunatic programming muse again today. While reading my twitter feed, I encountered a description of SmoothLife, a generalization of Conway’s classic Game of Life. Instead of being implemented on a grid of discrete binary values, SmoothLife is implemented over a continuous, real valued field. What’s kind of neat is that “gliders” exist in this world, but unlike the discrete version, they can travel at any angle. I found it really intriguing. Witness!



Pretty neat organic shapes.

In reading up on how this works, I discovered that the implementation was unusual in a way I had not considered. It dawned on me that it would be possible to implement the “summation of neighbors” part of Conway’s life using a simple convolution. As a bonus, we’d get the “wrap around” for free: the indexing would be pretty simple. I hypothesized that I could write it using the fftw library in just a few hundred lines. So I did.


Here’s the code!

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <complex.h>
#include <unistd.h>
#include <fftw3.h>

#define SIZE    (512)
#define SHIFT   (18)

fftw_complex *filter ;
fftw_complex *state ;
fftw_complex *tmp ;
fftw_complex *sum ;

int
main(int argc, char *argv[])
{
    fftw_plan fwd, rev, flt ;
    fftw_complex *ip, *jp ;
    int x, y, g ;

    srand48(getpid()) ;

    filter = (fftw_complex *) fftw_malloc(SIZE * SIZE * sizeof(fftw_complex)) ;
    state = (fftw_complex *) fftw_malloc(SIZE * SIZE * sizeof(fftw_complex)) ;
    tmp = (fftw_complex *) fftw_malloc(SIZE * SIZE * sizeof(fftw_complex)) ;
    sum = (fftw_complex *) fftw_malloc(SIZE * SIZE * sizeof(fftw_complex)) ;

    flt = fftw_plan_dft_2d(SIZE, SIZE, 
                filter, filter, FFTW_FORWARD, FFTW_ESTIMATE) ;
    fwd = fftw_plan_dft_2d(SIZE, SIZE, 
                state, tmp, FFTW_FORWARD, FFTW_ESTIMATE) ;
    rev = fftw_plan_dft_2d(SIZE, SIZE, 
                tmp, sum, FFTW_BACKWARD, FFTW_ESTIMATE) ;

    /* initialize the state */
    for (y=0, ip=state; y<SIZE; y++) {
        for (x=0; x<SIZE; x++, ip++) {
            *ip = (fftw_complex) (lrand48() % 2) ;
        }
    }

    /* initialize and compute the filter */

    for (y=0, ip=filter; y<SIZE; y++, ip++) {
        for (x=0; x<SIZE; x++) {
            *ip = 0. ;
        }
    }


#define IDX(x, y) (((x + SIZE) % SIZE) + ((y+SIZE) % SIZE) * SIZE)
    filter[IDX(-1, -1)] = 1. ;
    filter[IDX( 0, -1)] = 1. ;
    filter[IDX( 1, -1)] = 1. ;
    filter[IDX(-1,  0)] = 1. ;
    filter[IDX( 1,  0)] = 1. ;
    filter[IDX(-1,  1)] = 1. ;
    filter[IDX( 0,  1)] = 1. ;
    filter[IDX( 1,  1)] = 1. ;

    fftw_execute(flt) ;
    
    for (g = 0; g < 1000; g++) {
        fprintf(stderr, "generation %03d\r", g) ;
        
        fftw_execute(fwd) ;

        /* convolve */
        for (y=0, ip=tmp, jp=filter; y<SIZE; y++) {
            for (x=0; x<SIZE; x++, ip++, jp++) {
                *ip *= *jp ;
            }
        }

        /* go back to the sums */
        fftw_execute(rev) ;

        for (y=0, ip=state, jp=sum; y<SIZE; y++) {
            for (x=0; x<SIZE; x++, ip++, jp++) {
                int s = (int) round(creal(*ip)) ;
                int t = ((int) round(creal(*jp))) >> SHIFT ;
                if (s) 
                    *ip = (t == 2 || t == 3) ;
                else
                    *ip = (t == 3) ;
            }
        }

        /* that's it!  dump the frame! */

        char fname[80] ;
        sprintf(fname, "frame.%04d.pgm", g) ;
        FILE *fp = fopen(fname, "wb") ;
        fprintf(fp, "P5\n%d %d\n%d\n", SIZE, SIZE, 255) ;

        for (y=0, ip=state; y<SIZE; y++) {
            for (x=0; x<SIZE; x++, ip++) {
                int s = ((int) creal(*ip)) ;
                fputc(255*s, fp) ;
            }
        }

        fclose(fp) ;
    }
    fprintf(stderr, "\n") ;

    return 0 ;
}

Pardon the slightly odd code, but I wrote it while watching the VP debates and the last of the Game 5 between Detroit and the Athletics. (Thanks to the Athletics for a great season!)

It’s kind of a ridiculous way to implement Conway’s Life (there are more efficient and compact implementations), but it has one interesting feature that SmoothLife (or any other discrete life with larger neighborhoods) would use: the run time doesn’t increase with increasing size of neighborhood. I’ll try to work up a SmoothLife implementation soon.

It was just a bit of thought provoking fun, like my previous attempts at implementing bignum arithmetic with the FFT.

Addendum: Each frame (512×512 resolution) takes about 48ms on my MacBook. Not really competitive with more conventional implementations, but not miserable either.

My own launch wasn’t as smooth and care free as it might have been…

Ouch…

Okay, my last blog mentioned the over-pressure situation aboard the SpaceX Falcon 9 launch. Today, I experienced my own launch failure: flying my homebrew Nutball RC plane. This was my “new, improved” version, with a swappable fuselage, and 5 degrees of down angle on the motor. Mark Harrison and I decided to get out and give it a try this morning around 8:00AM, before the wind picked up. Sadly, traffic was miserable, and I didn’t make it to the Berkeley Marina until almost 8:30 (averaging a whopping six miles an hour, sometimes I hate the Bay Area).

Once I arrived, we did a quick check, and launched. I should have notice two things: the new Nutball is significantly more tail heavy, and we needed to trim the elevon position down. The net result is that the plane did a quick loop, traveling a distance of about twelve feet, and mashed right back into me, hitting my hand fairly hard. Ouch. Just banged it up, and put a couple of scrapes. It’s then that I learned that real RC enthusiasts keep bandaids in their fly kit. I’ll be getting some for mine soon. Luckily, Mark had some.

But now that my plane had tasted human blood, I felt we couldn’t let that be. We adjusted the balance by taping an additional battery to the front, and had a couple of relatively unstable flights. I augured in pretty hard once, snapping another prop, but the plane held up pretty well. We decided we needed more weight up front, so I put a larger battery as a counterweight, and sent it up for what would be the best flight of the day. With additional weight up front, it flew pretty stably. Even with the exponential programmed into the transmitter, only very small corrections were needed to direct the flight, and it flew well with about 1/3 throttle. I flew it around for a minute or two… when it suddenly did a fast pitch down into a dive. I managed to cut the throttle, and pulled back on the elevators to bring the nose up. Unlike all my other previous attempts at recovering, this worked out rather well: the nose came up, the plane leveled out about 12 feet from the ground, and I set it down softly on its belly. Unlike all previous landings, I didn’t even knock the taped-down counterweight off. I considered another flight, but decided that it would be tempting fate. We’ll try again next week.

At lunch, I had another RC related bit of fun: Mark had bumped into Hao Chen during a previous outing to the Berkeley Marina, and had discovered that Hao had begun working with the Monterey Bay Aquarium Research Institute. The idea was that he would launch a flying wing equipped with a first-person video setup from a research boat, and fly it around looking for significant oceanic phenomena. At the time Mark met him, he was practicing flying his large flying-wing drone into a capture net as practice before taking it out onto the boat.

It’s very cool!

Here are a couple of his YouTube videos:


Here’s video of the launching operation. It’s also video of what tossing a plane into the water looks like. For some reason, it makes me feel better about my attempts at flying…



All in all, a pretty good RC day…

SpaceX launch wasn’t as smooth and carefree as it might have seemed…

Yesterday was an important day in the history of space flight: for the first time a commercial entity launched a resupply mission to the International Space Station. I thought it was a pretty big deal, but you’d never have known by watching the news yesterday. ABC news cut away from their coverage of politics and baseball just long enough to show a glowing ball heading skyward, with hardly any commentary. I watched the link via streaming video. It was, despite its historic significance, rather boring. A bright light heading to the sky. A bunch of guys sitting in front of a bunch of monitors. It could have been a LAN party. NASA’s own coverage seemed mundane, especially considering how well they did recently in getting us interested in Curiosity.

But it wasn’t as smooth as we might have been lead to believe.

I was apparently not watching closely enough. At about one minute, nineteen seconds into the flight there was a rather bright flash, and clear signs of debris falling from the rocket. Check it out!



In real time, the flash didn’t seem all that serious, but when you see the 1/10x slow motion version, it looks pretty bad: a bright flash, with all sorts of apparent debris shedding. But perhaps we shouldn’t have worried.

Approximately one minute and 19 seconds into last night’s launch, the Falcon 9 rocket detected an anomaly on one first stage engine. Initial data suggests that one of the rocket’s nine Merlin engines, Engine 1, lost pressure suddenly and an engine shutdown command was issued. We know the engine did not explode, because we continued to receive data from it. Panels designed to relieve pressure within the engine bay were ejected to protect the stage and other engines. Our review of flight data indicates that neither the rocket stage nor any of the other eight engines were negatively affected by this event.
SpaceX Mission Update

In other words, despite how it looks, there wasn’t an explosion on board: the shutdown caused a plan ejection of panels. What we see isn’t the problem: it’s the cure. Pretty nifty bit of engineering. Still, I doubt I’m going to be booking my passage on a Dragon flight anytime soon.

Deciphering the Turnigy 9X “trainer” mode…

I’m waiting for new props and the like to arrive for more RC fun, but in the mean time I tried to satisfy some curiousity that I had regarding the “trainer” mode that my Turnigy 9X transmitter has. The idea is that if you have a master flyer (like my friend Mark) and a complete spaz (like yours truly) you can chain two transmitters together with an ordinary 3.5mm stereo cable, and have a sort of “student driver” situation, where the master can transfer control to the novice, but take it back if the situation goes bad.

I wondered what the signal that was being sent back and forth between the radio looks like. Mark had a little pocket digital oscilloscope that he was using to look at it, but because the “trigger” options on the scope were fairly limited, it was hard to see what was going on very clearly. So today at lunch I hauled out my Rigol and decided to have a peek.

The Rigol is a great, capable scope for the $400 new that it costs. What saved us here was that we had a number of trigger options that were not available on Mark’s scope. A brief glance at the scope made me think that the 9 channel transmitter was sending a logic level signal with pulse position modulation. I hypothesized that there had to be a pulse (positive going, by the looks of it) which was long to set synchronization, followed by nine pulses with varying times at 5v, and a low time which appeared to be pretty constant. A bit of tweaking with the triggering showed that the sync pulse was about 6.5ms long. The positive pulses ranged from somewhere around 0.65ms to 1.52 ms, and the low durations where a pretty constant .4ms. Each of the nine channels seemed to be matched out in order.

It would be very simple to hook up an Arduino, Atmel, Propeller, what have you to read these pulses and map them to control inputs. I was thinking that making a small board to read them, and then implement a USB HID device to send them a computer might be a fun thing to do. If your cpu uses a 3.3v level, you might want to use a BJT to invert the signal, and then compensate for the flip in software.

I’ll try to get some screen grabs of the control signal soon, and post them here.

Up up and away…

I apologize for not updating my blog recently, but sometimes life intervenes, and it seems like you just aren’t doing too much that would be of interest. A combination of a home burglary, increased load at work, and perhaps just a touch of malaise brought on by the political season has meant that come evening, I haven’t felt much like writing.

But I have been working on RC airplanes. I’ve been trying to record video, and some of that has been going onto my YouTube channel. In case you aren’t a subscriber over there, here’s the result of about a month’s worth of experimentation.

First of all, I must thank Mark Harrison of the Eastbay RC blog. He has been serving as a mentor to me, and has been patiently guiding me toward… well… if not competence then at least experience in RC construction and flying. His F22 inspired me to build one of my own, which he flew during this maiden voyage:



But this plane lacks dihedral and lift, so it’s a bit hard for a complete newbie like myself to fly. To get me some stick time, Mark let me fly (and crash) a series of his own planes, such as his Easy Star:



I decided that if I continued to crash his planes, it might eventually put a strain on our relationship, so I decided to construct a Nutball of my own. I recently took it out, and shot this video with my iPhone. It also shows some of Mark H.’s creations (apologies for the low audio, recording with the iPhone seems impossible for me without covering the mic input):



Here’s some nauseating video filmed looking to the rear from those early Nutball flights:



Since then, I’ve had a few more interesting Nutball flights. Last Wednesday, Mark and I met early in the morning and sent it up. I programmed my Turnigy 9X transmitter with a bit of “exponential control” to help soften the controls, and that seemed to help. I put it tup four times, and only the last one seemed fatal. I did suffer a number of hard nose-first landings, the first of which pushed the axel of the motor back against the firewall, but I simply undid/redid the set screws holding it in place, and we were ready to go again. The next two flights, I managed to get the plane flying for longer and further than I could throw it, but I noted (despite the Nutball’s rather ‘easy to fly’ reputation) that mine seemed to have a proclivity for flipping nose up onto its back. The last flight was going well, right up until the point that an unforseen mechanical failure occurred: the glue joint that held the dihedral angle on the right wing simply gave away, and the wing folded up. Net result was about a 100 foot nosedive, snapping another prop and springing my servo control arms.

Sadly, while I did have the Turnigy camera Velcroed to the wing deck, there seemed to be an electronic issue with the camera: while audio was recorded for the entire flight, when the engine first spun up for launch, the video glitched and was not recorded for these dramatic events. Rats.

I could actually repair the plane fairly simply, but I realized that my Nutball lacked a feature that most instructions inform you to do: angle the motor down by about five degrees. Mine was always parallel to the wing deck. So, rather than fix the old one, I’ll be scavenging it’s internal organs and installing them in a new and improved wing deck. To guard against the glue failure I had last time, I’ll also run a strip of tape along the glue joint to guard against vibrations which expand the joint.

Perhaps by next week, I’ll be back in the air again. Stay tuned.

Oh, one last video: Mark H. brought his tiny quadcopter out to play, which he demoed with a short flight. We put the little keychain camera aboard and recorded this flight. It was very stable and smooth in the air.

Mark’s small quadcopter, in a box! It’s so cute!