Monday, April 27, 2009

What's the collective noun for "annoyance"?

I have learned several things the hard way over the last two weeks.

Sensors, such as the accelerometers, magnetometers, and gyroscopes that I'm using, have a significant amount of fixed bias (in addition to a nontrivial amount of variable bias). That is, the zero point of any particular sensor is really nowhere in particular. As far as I can tell from reading about other people's autopilot projects, they just take a lot of calibration measurements. I'm about to write some scripts to do the same.

The magnetometers are extremely fiddly and sensitive to noise. I guess I knew that in theory, but now I know it in practice, too. One thing I wouldn't have guessed is that the radio is hugely disruptive to the magnetometer signal (easily dwarfing the Earth's field -- and it's not a purely AC disruption, either, it adds DC bias as well). After an evening or two of cursing, I ended up relocating the radio to the end of one of the prop arms (yes, the propeller clears the tip of the antenna):

Note that the radio is strapped to the motor speed controller. The first time I did this, I strapped it directly to the heat sink of the speed controller whose auxiliary voltage regulator (aka "Battery Elimination Circuit") I'm using to power the electronics. Turns out that heat sink gets hot and that's a bad idea. Now it's strapped to the opposite side of a different speed controller.

I also wrapped the sensor board in four layers of aluminum foil (sandwiched between paper to avoid accidental shorts):

It looks ridiculous, and I could be imagining it, but it does seem to help the magnetometer noise. The idea is that the nonferrous aluminum shouldn't interfere with the Earth's magnetic field, but should help shield RF noise from the radio.

On the bright side, in testing so far running the motors doesn't seem to bother the magnetometer at all. I would have guessed quite the opposite -- that the 2.4GHz 100mW radio wouldn't bother the magnetometer, but 200W+ of low frequency electromagnetic grunting coming out of the motors would drive it crazy. But other people report the same thing, and apparently modern brushless motors really don't leak much in the way of AC fields. (It probably also helps that they are perched on the ends of arms several inches away from the magnetometer.)

I set up a test rig to calibrate motor speed and thrust:

Features of the test rig include:
  • An elevated stand (EVERT by IKEA) to avoid ground effect
  • A kitchen scale (0.5g resolution) to measure collective thrust
  • A stroboscope to measure propeller RPM
  • Foam sheets (from House of Foam) to soften the impact of crashes
  • A cat, for general assistance and interference purposes
Originally I had each of the two batteries powering two motors. I had been hoping that the speed controllers would regulate motor speed independent of battery voltage, but it turns out that's not the case -- at a given power setting, motor speed varies depending on how charged the battery is. (This was one of the first things I discovered on the test stand.) That meant that two of the motors run slower than the other two, especially since one of the batteries is powering the electronics and the other isn't.

So I spent some time and rewired the power harness so the batteries are in parallel, so everything gets a uniform voltage. Then I measured thrust (in grams, all 4 propellers spinning) and RPM at a variety of power levels (expressed as % of maximum power):

Measurements stop above 55% power because that's where it started to take off. (I could have extended the measurements by weighting down the craft, but I didn't.)

After taking all the measurements (which of course drained the batteries some) I went through the whole set again, which are the "low battery" measurements. The bad news, as noted, is that as the battery drains the speed changes. The good news is that it doesn't change all that much. The other good news is that power level, RPM, and thrust are all (above the zero level) more or less linearly related. I'm certainly hopeful that within the range of 40%-60% power, where I expect to be operating, that I can assume output is basically proportional to input.

Also, the tomato plants are doing ridiculously well:

The real bummer is that I only have a week of leave left, and plenty of puzzle hunt related work in that time, so it's looking increasingly less likely that I'll actually get to the point of stable flight -- witness how the last two weeks were spent fussing with one annoyance or another. Still, I'll see how far I can get.

2 comments:

  1. > What's the collective noun for "annoyance"?

    As long as you keep getting past them, "progression".

    ReplyDelete
  2. good luck Dan!!! Ounce loves you!

    ReplyDelete