Sunday, 23 December 2012

Oh the Places that have Yule without Snow!

How quickly our lives fill up.  I’m trying to think of why I’m not a more active blogger and the best answer I can give is that life a world away has quickly taken on the semblance of the life we left.  Not in every respect (and arguably not in the most important ones), but certainly in this one: we have more than enough to do.  We have been blessed with great friends and a desire to see more of them.  Our kids have places to be and things to do.  We have doctor’s appointments, church activities, buses to catch, a house to clean, groceries to buy… all of the usual.  We also have a beautiful country to explore and now warm weather to make the most of.  And with a small home filled to overflowing with a 4 year old and an almost-2 year old (who tend to prefer the 2 cubic meters of space around Mommy anyway), we have every encouragement to get out and about.  But I shouldn’t make it sound like we’re always running; we do get a couple hours of quiet most evenings.  Sheri is good at making the most of it to stay in touch with people, plan meals, and even lately is trying her hand at sewing.  If I’m honest, I could be using that time for blogging (or otherwise keeping in touch with all the friends that are often on my mind and that never know it), but I don’t.  And why not?  Because I’m selfish and so easily and frequently tired.  And the big difference between now and when we first came to NZ is that I have collected the means to entertain myself.  We have a TV, computers, books, and all the usual trappings of modern first-world life.  I still believe, as I said before, that no one would really want a steady log of my stream of consciousness, but this time I confess that I have had much to write about and simply haven’t taken the time.  For that, I beg forgiveness.
 
So, what’s been going on?  I’ll start with my research.  When last I wrote, Qbot2 had been shelved in favour of advancing progress on Qbot3 (being studied by one of the undergrads).  Final project demonstrations for the undergrads were only a few weeks away and I was content with my progress and keen to give them every advantage.  A fourth year mechanical engineering student had designed his own airframe and he had it made by the University’s 3D printing lab.  He assembled the mechanicals and I then installed the motors and circuitry.  In a short while, I was able to get that new quadrotor operational (his design was spider-like and he painted webs on the legs, so I dubbed it Araqnobot). It wasn’t long before I had it free-flying around the room.  In my hubris, I tried attaching my cell phone to it with rubber bands so that I could generate some inflight video but I then crashed it and broke one of the motor mounts.  Thankfully we had a spare and it was only out of commission for a couple of days.  I worked for a while to get automatic altitude control working, but the sensors we have for indoor operation are simply too unreliable.  Imagine driving a car with an electronic windshield that randomly displays obstacles ahead as either being really far or really near and only hits the accurate distance 50% of the time…  It’s a little hard to work an autonomous control system around that.  In any case, our ultimate goal is not indoor navigation and we’ve intentionally spent little effort there so far.  My next airframe (which will be my third) will have GPS and a pressure based altimeter and it will be the primary platform for autonomous development.  In the meantime, I’ve been showing off my current bot; it seems that most engineering visitors are brought around for a demonstration.  Last week, we also performed our first outdoor flight.  It was a gusty day and we had some difficultly, but we eventually managed a short hop.
 

When the Christmas holidays are over, we will hopefully have everything in place for the next major effort.  I designed a new airframe to hold the bigger motors that we have acquired.  It will also house our new circuit board that features an ARM CPU operating at 700MHz and running a bare-bones embedded linux operating system.  Our new batteries are monsters, weighing in at over 600 grams (1 and a third pounds) and boasting 11000 mAh at 11.1+ V (that’s a lot).  The primary orientation sensor costs over $2000 USD and has integrated GPS and an ARM processor all its own.  The fully assembled machine will be a fairly big beast, measuring roughly a meter across and weighing about 4 pounds with the battery on.  Hopefully it works.  The Uni mechanical shop is working on the airframe (aluminium … slightly fancier than aluminum) while the electronics technicians are having the circuit boards manufactured.  My goal is to have everything assembled and flying by the end of January.  As time is now counting down, the days will begin to matter more and more.
But we do continue to make the most of our days when I am free from my studies.  I can now officially say that I have been snowboarding south of the equator.  We have made friends with some other Canadians doing the temporary Kiwi thing (Will & Danielle and their two daughters Naomi and Eva) and Will offered to keep me company on a trek to Mt. Ruapehu.  Sheri and Danielle came along as far as Taupo and we booked a private house (known as a ‘bach’ to New Zealanders) there.  A friend from church lent me his gear (fancy board with near-new flow bindings; they’re okay, but I still like my old fashioned ratchet system) and I was all set.  It was a beautiful spring day and while others were getting lobsterized, I was lathering on the sunscreen.  The snow was icy at the top and slushy granular at the bottom; the runs were half-heartedly groomed and down to rock in some places.  So, it wouldn’t be my first pick for quality, either of the snow or the runs.  For the experience of snowboarding on a Volcano and following canyons of snow between jagged Mordor-like black rocks, though, it can’t be beat.  Riding the snow while looking out at a countryside of rolling green as far as the eye can see is also pretty cool.  Plus, it had a fun and exciting system of not really protecting you from cliffs… they just post a few signs along the top edge that show a stick figure upside down over some rocks.  Conveys the gist pretty well, but I’d generally prefer some ropes or something to give the poor sap who has temporarily lost control a bit of a chance.  Maybe that’s just me.
Another weekend, we spent our Saturday driving out to the Coromandel peninsula with Will and Danielle.  We visited Cathedral Cove and let our kids and theirs run on the beach and through the cave/arch (sadly, we never turned up in Narnia).  We then headed over to the famed hot water beach, intent on digging our own hot tub.  Unfortunately, it was getting dark and it was cold and windy, so we decided to call it off.  The adults all agreed that it would have been fun, adventurous, and romantic sans kids, but with them it would have been unhappy, frustrating, and mostly crazy.  We agreed to run away in the hopes of fighting again another day, but the weather never did cooperate on the few times that our schedules coincided again.
Our next noteworthy outing took us to Puhoi with the Hilsdens (our pastor & his family).  Our ultimate destination was Wenderholm park and we had a barbecue picnic there while our kids and theirs explored and went on “safaris” through the bush.  Having invested in a charcoal “chimney” I was able to light our coals and Rowan and I worked together to get the meat all cooked.  It all worked well and we had a great time together.
With Will and Danielle, we had formulated a plot for reciprocal child care that would enable us both to complete the Tongariro crossing.  They would take our kids for a day and then we would switch.  We decided to go for an extra long weekend (<Marge> Homer, your boss called and said that if you’re not at work on Friday, don’t bother coming in on Monday!  … <Homer> Woohoo!  Four day weekend!) so that we would have a day to drive there and then at least one day to accommodate inclement weather.  When the time finally came, though, there was only one decent-weather day and the next best was the day we had allotted for driving there.  After some quick negotiation and decision making, the plan switched to an aggressive drive-and-hike-all-in-one-day affair that would take advantage of that pretty-good day.  Being good Canadians, we were all very polite and did our best to make sure the other couple could seize the better day if they truly preferred it.  In the end, though, it was a politeness stalemate and a coin toss decided that Sheri and I would scamper over the pass on day 1.  With a plan to be up and on the road without delay, I naturally slept very poorly and I figure I had about 5 hours of sleep all in as we climbed into the car that Friday morning.  We drove for 4 and a half hours, snarfed down some lunch in the parking lot, and were boldly hiking down the trail at about 1:15 pm.  The sky was a bit overcast, but it was otherwise warm and bright and we set off with high hopes and the sort of light-hearted contentment known only to the parents of young children who find themselves temporarily without them (and that feeling is amplified, of course, after a long drive in a car with said children) (<she> Listen, Honey!  Do you hear that?  Isn’t it wonderful?    <he> Hear what? … <she> Exactly!).
The first couple of kilometres ticked by and I was busy doing the math in my head: let’s see, 2 kilometers in 30 minutes, we have 20 kilometers to go (19.4 actually, but we might slow down a bit in the steep parts, so I’ll approximate that with the extra 0.6 to keep the math easy), so that’s 300 minutes which equals 5 hours.  No problem, we’ll be done this on time easy peasy!  And the math held up for a couple more kilometres, so I figured it was all good.    Then we came to the stairs.  I gather the stairs weren’t always there, but for us, there were stairs… and then there were more stairs… and after you climbed those, what would you like to chase them down? … how about some more stairs?    And maybe you’d like some stairs to go with your stairs… you can have them in pairs!  And it may surprise you to learn that it takes a lot longer to cover a few kilometres worth of stairs than it takes you to walk along a few kilometres of level boardwalk.  No, no, don’t argue with me…  It’s true!  (Especially when the stairs somehow magically go backward for a bit as I’m convinced these ones did.)  In any case, we eventually came to end of the interminable supply of steps only to see that the ascent continued in the distance.  The next uphill section was loose gravel and I found myself wishing for more of the much maligned stairs.  But, ever onward and upward we continued and my mind began forming a new definition of kilometre that was several times longer than I had previously ever thought.
As we climbed, of course we appreciated the views.  They are amazing… But the effort involved left them somehow wanting.  For a while, that is.  There is a point in the Tongariro crossing where you come into view of The Red Crater and suddenly, you know why this hike is one of the most popular in the world.  And why is that, you may ask?  I’d like to tell you, but I don’t think I can.  I’d like to show you, but a picture won’t really do it justice.  There are some things on Earth that simply must be experienced to be appreciated (and this is true not just of things you see but also of things you believe; ‘For I know whom I have believed’… ).  So, what’s so great about the Red Crater?  Is it sparkly and iridescent?  No; it’s red.  Is it in the shape of a famous president?  No, it’s just a crater.  But it is somehow surprising and otherworldly.  A sculpture done by an artist whose medium is mountain and a painting done by one who doesn’t merely employ colour but rather defines it.    It actually made me think of my Dad and I wished he could have seen what I was seeing; he was such a great world adventurer, but he did it through books (he was a Reader, after all).  He read about safaris and jungles and deserts and mountains, but his life was a humble one.  And then I realized how silly I was; because I know whom I have believed, and because Dad did, too, I know that the surpassing greatness of knowing Christ was consummated for Dad the moment he breathed his last.  What is there on this Earth that could ever compare to that first moment in Glory?  It cannot be conceived.  But the Red Crater still points us to our awesome creator and my heart thrilled to see and wonder at it.
And finally, we reached the point of descent.  It begins as you come around a peak and look down onto two of bluest little lakes (ponds?) you’ve ever seen.  It also begins with a reprieve from the alpine wind that had been lashing us and reminding us why we brought those extra layers.  We had been debating for a while where we would stop to eat but had continued to push on in the hope of finding somewhere relatively warm and calm.  And so it was that we took off our packs, set down our gear, and gave thanks for our food next to a beautiful azure alpine lake at the top of the bottom of the world.  It was heavenly…
But we still had a ways to go and my math had increasingly lost integrity.  We were shy of halfway and almost 4 hours in.  It was now after 5 o’ the clock and we could only expect sunlight until about 8 pm.  So, we set forth again and now there was snow in the path.  You’d never know we were Canadians from the way that I wandered into the white for a picture with the stuff.  As they say, though, absence makes the heart grow fonder and I think snow may be a part of me.  Through the snow we trekked and then up another slope.  It wasn’t long before we came to signs indicating that a nearby vent had erupted in August and that hikers were encouraged to walk briskly and minimize stopping through the danger area.    We weren’t likely to dawdle too much anyway, but I had trouble understanding the encouragement.  I guess so long as you look at life as a random series of events dictated by probabilities, it kind of makes sense…  Certainly an eruption was no more likely to occur whether we went quick or slow.  In an actuarial light, I suppose that the probability of us being harmed in a volcanic eruption was increased dramatically during the time we were in that area, but I would imagine that the overall odds remained incredibly low and half as long or twice as long would make only a drop of difference in the bucket of the danger we encounter in our lives.  It’s a bit like saying we should minimize our time in airplanes (make them all go faster!) because, sooner or later, one is going to crash.
Having said that, allow me to rabbit-hole for a moment and mention a related statistical annoyance/observation I have.  We were at the Auckland aquarium (Kelly Tarlton’s) the other day and they had up this note on how wonderfully good and friendly sharks are: apparently, you are as likely to be struck by lightning twice as you are to be attacked by a shark.  Alright, that sounds good.  But, how many people on this earth live with either no access, no ability, or no inclination to swim in shark-inhabited waters?  I’m going to go out on a limb with the supposition that it is the absolute vast majority.  Now, compare that to the number of people that live under an expanse of sky capable of producing lightning…  Doesn’t it seem an odd comparison to you?  Now, if they said that you’re no more likely to be attacked when swimming in shark-infested waters than you are to be struck by lightning while holding a metal rod out in the middle of a field during a thunderstorm, I might think they were being a bit more fair…  but it wouldn’t really help their message, would it?
In any case, the unpredictable random event never occurred and our quickness was, I suppose, rewarded because it did erupt a week and a half later.  We had crossed over and through and now the path out stretched before us.  Standing at the top of the far side of the crossing, I admired the many paths down the mountain.  We could see trails on the left, trails on the right, and trail segments snaking over the rocks straight ahead of us.  I wondered where they all led and over the next few hours, I discovered that they were all connected and formed the single trail down to the car park.  I’m sure they had good reasons for making the most meandering trail since Mobius had devised the infinite, but it was lost on me.  We knew that they had mastered the art of building steps into a mountainside.  Why didn’t they simply make a set of steps leading us out?  We could have covered in 15 minutes what took us over an hour.  Nevertheless, we kept trucking and we were just running out of light when Will met us on the trail at 8:30.  Five minutes later we were in the car headed to our bach; the trek had taken us 7 hours and 15 minutes (give or take a few).  Our legs were tired and our feet sore and dirty, but we had done it and felt very blessed to have had the opportunity.  (You’d think we would have slept like babies that night, but we have babies of our own and Everett was up for a good chunk of the night; Sheri only managed a few hours of sleep; we were both pretty wrecked for the next day.)
Will and Danielle took up the torch for Saturday and made the trek in better conditions (normal time of day, clearer skies, and a bit warmer) but those things added to the weekend factor to make it a much, much busier path.  In the end, it’s debatable who had the better end of the deal but I know that we all came away thankful for friends and for the ways in which two (families) (or more!) are better than one.  Since Sheri and I had spent quite a bit of time now around Taupo and Tongariro National Park, we were keen to spend our tourist time in more novel ways.  So, I pushed to come home on Sunday even though I had secured Monday away from the lab.  Sheri wanted to capitalize on the fact that we were halfway down the island and unlikely to come that way again.  So, as we drove west from Turangi, we decided that rather than head north, we would continue west and try a stretch of road called the Forgotten World Highway.  Sounds fun, doesn’t it?
In general, the roads of the New Zealand countryside are ridiculously winding and anything but level.  They also do fun things like off-camber roads (sloped away from the turn) and they have a spotty (at best) approach to shoulder barriers.  But the Forgotten World Highway takes everything to a whole new level!  It really is the closest you’ll come (I hope) to a roller coaster ride in a road vehicle.  And I’ve never before seen falling rock signs where there is actually fallen rock in the road before… in some places, the lane against the cliff face was completely blocked.  And shoulder barriers?  Who needs shoulder barriers when you’ve got a dilapidated barbed-wire fence to keep your 3000 lb vehicle from tumbling down a nearly vertical precipice?  (At least you’ll have some nice soft sheep to squish along the way.)  At one point, we had to wait for 10 minutes while a busload of tourists wandered through a single-lane hand-hewn tunnel (which, admittedly, was pretty cool).  Then we left New Zealand and spent some time in the small village of Whangamomona.  Apparently they declared themselves a Republic after some arbitrary re-zoning decision was enacted against them back in 1988.  It was a nice enough place, but hot chocolate is expensive in their Republic and we made the kids share one $5 cup.  Having somewhat re-settled our stomachs, we bravely re-entered New Zealand and made our way over to Stratford, near Mount Taranaki.
The next day, we visited said Mount and, since it was pouring rain, we had it completely to ourselves!  Sadly, we could only endure about 45 minutes before we were soaked, cold, crying (mostly the kids), and done…  In that time, though, we managed to see the Goblin forest and Dawson falls, so we weren’t completely shut out.  From there, we went to New Plymouth and admired the Tasman from the sea wall before pointing Buster north for a drive along the coast.  It was, as so much here is, stunning and lovely and we had a fairly uneventful trip back up to Auckland.  And so it was that I returned to school after another action-adventure packed long weekend.
Since then, we have stayed a bit closer to our home base here.  We have been to Devonport a couple of times (North side of Auckland harbour) and have the ridden the ferry back and forth (Annalise was a bit disappointed to learn what a ferry boat was… she had been expecting a ‘fairy’ boat, which, undoubtedly, would have been even more exciting).  We have been to St. Helier’s beach, Karaka Bay, Mission Beach (our church did a baptism service there!), Browns Bay, Mount Eden, and, well, you get the idea.  Here and there and back and forth again.
For December, we launched the holiday season with Sinter Klaas on December 6.  We had Will and Danielle over for a bit of a Canadian feast.  I brined a Turkey overnight and the big question was how long to cook it.    You think that’s a no-brainer, don’t you?  Well, the trick is that Kiwi’s don’t really do Turkey and so they sell them in large-chicken size.  Ours was just over 5 pounds and I challenge you to try and find a recipe for a Turkey that small.  It would seem that our North-American roasting guides have never heard of a Turkey of less than 8 pounds.  In any case, we slow roasted it and it was done with plenty of time to spare.  I made gravy with the drippings, Sheri made pumpkin pie, Danielle brought stuffing and veg and we all ate like Canadian kings.  It was fantastic (I think Will said it was the best meal he had had so far in Auckland)!
And then just last week, Sheri and I had the ridiculously nice blessing of 2 nights away on our own.  We went to a spot near the little town of Raglan, about an hour and a half away from Auckland on the west coast.  It’s a cute little town with shops and cafes and a quiet tourist-friendly atmosphere.  It also boasts a large backpacker hostel and decent surfing, so there’s a significant surfer contingent wandering around.  The place we stayed was very lovely, but it was just the peace and solitude that we revelled in.  We really, really love our kids but there is something good for the soul in spending a night or two away from them every now and again (our last opportunity was at the beginning of January).  For this, I really have to thank my Mom for providing us with the means and a young woman in our church, Madeleine, for taking on our hooligans for 45 hours.  (Madeleine is a Australian who really wants to see the kingdom of God advance in New Zealand and has been here doing all she can for our young church and for Rowan and Sarah as they lead it and get it off the ground.  She’s pretty amazing.  (And Annalise was very excited to have her come, so that says a lot about how cool she is.))
And now here we are at Christmas.  It doesn’t feel like Christmas to me… Ottawa just got a big pile of snow and I really wish I was there to plow it, make a slide, and thrash out some snow angels.  But I made a sand castle at the beach today (December 22) and that definitely has its own charm.

I’ve said above that I know whom I have believed.  That’s a quote from 2 Timothy 1:12: “…I am not ashamed, for I know whom I have believed and am persuaded that He is able to keep what I have committed to Him until that Day.”  In Christianity, much is made of what we believe (and, sometimes, what we don’t), but it is important to make clear that it is so very much more about in whom we believe.  John 1 starts in this way “In the beginning was the Word, and the Word was with God, and the Word was God. 2 He was in the beginning with God. 3 All things were made through Him, and without Him nothing was made that was made. 4 In Him was life, and the life was the light of men. 5 And the light shines in the darkness…” and a few verses later continues: “And the Word became flesh and dwelt among us, and we beheld His glory, the glory as of the only begotten of the Father, full of grace and truth.”  As we step through the last few days before Christmas, I marvel anew at this concept; the One of power and life (the light of men!) through whom all things were made…  did what?! Seized the reins of human order and set all things to right? No. Became flesh. 


Annalise & Her Manger
Became a baby… baby boy.  Like my Everett.  Philippians 2 says “Let this mind be in you, which was also in Christ Jesus:  Who, being in the form of God, thought it not robbery to be equal with God: But made himself of no reputation, and took upon him the form of a servant, and was made in the likeness of men”.  Like me, like you.  It’s incredible, and incredibly wonderful.  “For unto you is born this day in the city of David a Saviour, which is…” (Luke 2:8)  and I’ve intentionally left 3 words off the end there.  The word in the first blank forms the first syllable of Christmas, which identifies him (and means Messiah, Saviour, Liberator), the second is ‘the’ which defines him in singularity (‘the’, not ‘a’), and the final word defines his position in all of time, space, and existence.  It can also be found in 2 Timothy, part of which I quoted above, as Paul lays out the reason for the reality that faces every one of us.  Whether you believe today, or not, there is a title that you will one day acknowledge (and relinquish) to this One who became flesh (not least because he became it for you)… continuing from the quote above “made in the likeness of men: And being found in fashion as a man, he humbled himself, and became obedient unto death, even the death of the cross.  Wherefore God also hath highly exalted him, and given him a name which is above every name:  That at the name of …” who? “Jesus” Yes! That’s the name we know him by, but not the one referred to as being above every name.  That’s still to come… “… at the name of Jesus every knee should bow, of things in heaven, and things in earth, and things under the earth; And that every tongue should confess that …” here it comes…  Who is it that was born on Christmas day?  Who is it that died for you?  “Jesus Christ”  Yes!  Jesus the Messiah is his name, but still not his ultimate position, not his title for your life, for mine, for everyone and everything else’s… that’s not the blank left open above, nor what I hold my breath for as the current quote continues with “is…”  Yes, yes… “is” … what?!  I am here to tell you, friends, that at Christmas, the baby who came was and is and always will be… “Lord.”  The blanks are all filled in.  “For unto you is born this day in the city of David a Saviour, which is Christ the Lord”.  I know whom I have believed.  Do you?

Merry Christmas!
 

Friday, 21 September 2012

Meet QBot1 (Caution: mumbo jumbo ahead!)

I went for a run this morning and there was ice on the wooden bridges in the park!  It's not ice that froze there, though...  it was leftovers from a pretty big hailstorm last night (note: I wrote this paragraph last week).  I wouldn't say it made me homesick, but I definitely had a small bout of home-miss-ness.  This is the first ice I've seen on the ground in Auckland and it made me think of the true North strong and free and the fact that as we transition into Spring down here, a lot of you are transitioning to fall up there.  Here the spring lambs dot the hillsides and calves cavort next to their mothers while the Canadian leaves are falling and Thanksgiving plans are being made.  While I will miss the North American fall, I think it's fair to say that we're looking forward to finally having summer after more than a year without.

At the time I wrote last, I had great intentions of following up with some details on my research.  At that point, I thought I was within a week or two of having my robot airborne.  Now, I don't know about you, but I sometimes feel that despite 36+ years of experience on this planet, my mind has a fairly fragile grasp of the relationship between the amount of work I have to do and the time it will take.  I console myself with the idea that I can't predict the vagaries of circumstance.  For example, on renovation: how could I know that the wallpaper would be glued directly to the drywall without even any primer (who in their right mind would do that)?; on car repair: how could I know that the starter constitutes an effective motor mount and that, on removing it, the motor would drop (ever so slightly) and thereby make installation of the new one virtually impossible (without a jack)?; on building my ramshackle boardwalk: how could I know that I could only carry one 12-foot long, 100-pound log at a time?  (okay, that last one I did kind of know, but I thought I'd be able to walk faster...) (note: all of those are from the past; no renos, no car repairs, and no boardwalk construction for me here in Kiwi-land)  So, yeah, things generally conspire against me (says I) and I have my own internal selfish motto: Nothing is ever easy.  And the implied perspective there is that "Nothing is ever as easy as it should be".  And here, once again, my faith is revealed for the weak thing that it is.  The truth is that things are generally a lot easier, finer, better, and more wonderful than they could be.  What they should be is up to my Maker and not up to me and for that, I would do well to be grateful (alas, easily said, seldom done).
Weeks and weeks have gone by and, I'm very pleased to report, my bot can now fly!  Despite the fact that quadrotor flight is pretty commonplace these days, it's surprisingly complex and tricky to manage it from only parts and first principles.  When I arrived at the University in May, I was presented with an untested circuit board and a bare airframe.  First step was to try out the board and get the microprocessor working with all of its peripherals.  I've done some coding in a computer language called 'C' in the past, but this was my first foray into development for a small embedded processor.  And it's been a long time since I thought that 16MHz was a respectable processor speed or 8-bit a respectable architecture.  Regardless, it was lots of fun to be employing my skills in a whole new area and I spent the first month or so writing code that would enable the microprocessor to talk with its GPS (used for outdoor positioning), its sonar rangefinder (used for low-altitude height control), its Inertial Measurement Unit (used for orientation and acceleration measurements; the key component for stable flight), its current & voltage sensors (used to determine battery and motor state), and its wireless RF communication module (used for bot-to-base communication).  I found a couple of small issues with that control board and the University technicians undertook to make a new one for me.
While I waited for that, I turned my attention to the airframe.  it consists of a plastic/nylon platform in the center with 4 carbon-fiber rods radiating out from it.  At the end of each rod is a platic/nylon motor mount that holds a small electric motor.  (The airframe was designed by an AUT mechanical engineering student and the plastic/nylon pieces were made in-house on a 3D printer - very cool.)  Each motor requires an Electronic Speed Controller that basically allows low-current digital (microprocessor) control of an electric motor that requires high current (lots of power) and is inherently somewhat analog.  So, I wired those up and got them all attached to the airframe.  By then, my microprocessor board was back and the next step was to wire all of the bits together.  That was all done by sometime early-mid July.
With a fully assembled Quadrotor robot (long since dubbed QBot1 (QBot0 and QBot2 are in the hands of the undergrads)), it was time to start writing motor control code to see what it could do.  With not uncharacteristic hubris, my first attempts were largely intuitive and I somewhat ignored the careful equations my thesis advisor had provided me with.  I quickly determined that a quadrotor aircraft is a highly unstable thing.  We have a testing stand that the robot sits atop and that prevents it from flying into a wall or ceiling while still allowing free rotation around it's roll (left/right tilt), pitch (nose up/down), and yaw (compass heading) axes.  On that stand, the whole airframe would gyrate like a thing possessed.  Many days and much analysis later, I was able to get it somewhat stable so long as I held it level when powering up.  To call it "stable" was a bit of a stretch, though; my kids exhibit about the same amount of stability when it comes to their emotions.  A content and happy child one moment is only a slight nudge (for example, the word "no") away from hysterics the next.  Just so with temperamental QBot1.  I tried and I tweaked, I blamed center-of-gravity imbalance and testing-stand interference, but in the end, it was mostly me (as it almost always is).
 I had the wrong sign (+ verus -) on one term of my control loop and I believe that was the majority of my problem.  In the effort to track that down, though, I rewrote everything and applied the principals and equations originally given me by my advisor (Dr. Loulin Huang who holds two Master's degrees and a PhD in mechanical engineering and is one of the most natural and enthusiastic applied mathematicians I've ever seen).  Doing so gave me much better grounding in the principles governing our system and forced me to clean up my code.  With that, I was able to get QBot1 rock solid on his tethered stand (sans battery; which is significant) and I was certain that free flight was only a week or two away.  That was when I wrote my last post.
The next step was to sort out the dynamics for free flight at the high thrust rates needed for takeoff and hover.  For that, I had devised a bearing clamp system that would limit my bot to rotation around a single axis (so that I could test pitch control only, or roll control only).  Early in my tuning and re-testing, though, it became apparent that my motor mounts wouldn't be up to the task.  At the higher (load bearing) RPMs, they would vibrate immensely and it was clear that they wouldn't hold up when airborne.  The young man who had designed them quickly developed new ones but we had to wait a couple of weeks for the 3D printer to have an open slot.  In the meantime, I started adding features to my code to improve communication robustness; I had noticed that my wireless base-to-bot link would occassionally drop information and that could obviously be disastrous during flight.  So, I added checksums to the communicated data (a checksum is a very simple data integrity method that adds together the inherent numerical value of all parts of a computerized message; only if the sum matches between sender and receiver is the data accepted).  But then things really started to get weird.
With the checksums in place and a fresh overhaul of my code structure, I suddenly started getting random reboots, crazy branch paths, skipped instructions and the like.  By changing a few debug messages things could work better, or worse, and the connection between cause (a new change) and its effect entirely broke down.  My first suspicion was that I was the victim of a somewhat common computer issue known as stack overflow.  That occurs in situations where memory regions are too close to one another and/or a program has too many nested subroutine calls (where one calls another that calls another...) (quick description: each time a program calls a subroutine, it sort of sets aside what it is doing in a place called “the stack” and when it finishes up, it picks up where it left off by grabbing that work back off the stack).  Many security issues through the years have come through exploitation of stack overflow vulnerabilities.  In my case, I was certain that my problem was elsewhere; a modern programmer generally relies on his compiler to manage the stack and I was certain that mine would be doing the right thing (I'm using a targeted version of a compiler called gcc - it's known to be very good).  Since I had lots of available memory (I was only using 10% of the total), there's no way the compiler would place my stack anywhere near my program instructions.  So, the problem was presumed to be with my code and I figured that I had stuffed up my memory references somewhere along the way.  I searched and searched and couldn't find anything.  I wrote and rewrote my program, I went down one rabbit trail after another and I was starting to wonder what more I could do.
In the end, by painstakingly watching the processor execute one instruction at a time; I directly observed the source of my trouble.  Guess what it was.  Stack overflow!  Not possible, says inner-me!  I have too much memory for that to be the problem!  Ah yes, says the wiser me that only speaks in hindsight… but did you check the processor specification?  Well, no… but the company who made the chip and wrote the specification also provides the compile environment.  Why would they lie?  Because they made a small mistake and they calculate memory usage not based on what you really have but what you could have.  So, that was it.  What was reported to me at 10% was actually 100% and I was out of luck.  Others have reported the issue to the manufacturer and they have fixed it for themselves, but have yet to roll it out to customers.  C’est la vie, non?
Anyhow, with the communication path up and working, I was back to the races.  I spent some time tweaking my motor control parameters and then spent a bunch of time writing a base station program for windows.  Included with that were the routines to allow remote control of the bot via my playstation sixaxis controller.  After much testing, I put the bot back on its stand and ran it at liftoff thrust; it went crazy!  Bleh!  Can we please get a competent engineer in Aisle 1?    Amazingly, though, I changed 2 control parameters and Blam-o (technical engineer jargon for: Eureka!)!  Rock solid on the stand; with the battery!  I could hardly stop grinning.
The next step was to take it off the stand and attempt the first flight of Qbot1.  I only managed a few inches and things looked very, very good.  Nice, stable holding of position parallel to the ground.  It would drift a fair bit because I have no position controls in place yet but I headed home for a happy weekend.  The next Monday, I tethered it with string to prevent it from drifting out of its cage (or into the walls) and was able to fly it several feet in the air.  It’s pretty cool.  Many people came by to see it work and I had fun showing it off.
But now it’s in pieces.  I have accomplished a lot and the undergrad working on Qbot2 had a controller but no airframe.  So, I donated mine.  Hopefully in the next few weeks, it will be flying again.  Meanwhile, I will be building a new airframe and need to spend some time understanding the advanced theoretical formulas that we will be applying next.  Without the grounding in Kinematics and Dynamics that mechanical engineering students get, I have a lot of foundational concepts to work through.  The fun doesn’t stop…

Monday, 30 July 2012

Found in Translation

Well, we've been here almost three months now and I feel like there's not too much to report.  The truth, though, is that everyone's life is full of trials and adventures, some great and some small, but very few newsworthy in a broader sense.  The minutia of what fascinates, exasperates, and motivates us through the streams of daily life is generally reserved for those (like parents and spouses) who love us enough either to find interest in our mundane or to simply enjoy the sound of our thoughts.  In the case of the latter, I suspect some people have a mental flow consistently worthy of articulation, but I am certain I'm not one of them (the other day, a friend looked at me and said that he sensed I was about to add something deep to our conversation (I was madly googling on my phone); sadly, I was just searching for what was on the Krusty the Clown sandwich (and the answer is: ham, sausage, and bacon, with a smidge of mayo on white bread) (it was offered at a Deli to Krusty’s father who is a Rabbi)).  All that to say that if my posts are a bit infrequent, you can safely assume that I'm doing you a favour.

Life carries on and we’ve found our way into a regular routine here.  We have good friends, a good church, and lots to see and do.  I go to school as if it were a regular job, leaving the house just after 8 and getting home just after 5.  Annalise has Kindy in the afternoon three days a week and is now taking swimming lessons at ‘The Tepid Baths’ (a historic building in downtown Auckland that just finished a massive overhaul).  Sheri takes both kids to an organized playgroup every week and gets a chance to chat with other Moms from our area.  We host a weekly ‘supper’ (explanation to come) that now has about 12 people coming to talk about faith and the Bible.  Our life is full and it is good.
And beyond the routine?  We continue to explore Auckland and its environs.  We try to take in something new most weekends and have been finding that there’s plenty to keep us interested.  One weekend, we went up to the farmers’ market in Matakana (about half an hour north of Auckland if you follow the signs; an hour+ if you follow the GPS, but the ‘scenic route’ involves a twisty gravel road up and down the side of a mini mountain)… we didn’t see much of the market, though, because Sheri was hit with a bout of serious abdominal pain and we ended up heading off to the hospital.  The diagnosis was just an ‘intestinal spasm’ and we were sent on our way after some pills and a shot.  Not fun (!), but now we have a sense of the medical system over here; it’s a bit like dentists back home; you pay at reception and get reimbursed by insurance later.
Last weekend, we went to Karekare beach.  We were actually going to see Karekare falls and we did (they’re cool!), but the walk was short and so we decided to check out the beach as well.  I’m sure I overuse this word, but it was AWESOME!  See this very well:  a huge black sand beach hundreds of feet wide and framed by cliffs and dunes; a massive stone island jutting out of the water just offshore; and the surf… oh the surf!....  monstrous rollers as tall as houses and capable, I’m sure, of swallowing buses.  And now, dear friends, hear the sound; listen as the ocean draws in its watery breath and then hear the thunder as it pours forth speech!  Truly, this glorious firmament has much to say and my heart thrilled to hear it!  I carried Everett up a large dune that was backed by cliffs echoing out the song, and there I marveled at another wonder my Northern Manitoba heart has traveled far to experience.  (But Manitoba sings, too!  There is an aching beauty in a bright cloudless morning at -35C where the air sparkles like crystal and the silence shouts.  (Have you heard these songs?  Do you know what they mean? As the Psalmist says, “Day unto day they pour forth speech, night after night they display knowledge” and I’m humbled by how seldom I see and hear.))
And so it is that we continue to explore even as we settle into a groove of life (and hey, we’re nothing, if not groovy, right? ;).  Everett is busy filling up his mouth with teeth and handling them with all the grace you’d expect from a son of his father (but some of you think I’m a patient, mild-mannered type, don’t you?  I’m sorry to say that I’m not (I’m a work very much still in progress) and you just have to spend a few days with my little boy to have some insight into what lurks behind the façade (it’s scary)).  Annalise is learning to write all of her letters and has become an avid painter; her drawing skills are improving by leaps and bounds.  Sheri is helping to organize a ‘weekend away’ for our church, she is starting a book club, and she continues to amaze us with the range and scope of her culinary talents (100% from scratch lemon meringue pie this week with lemons off the tree in our backyard!).  And me, I’ve picked up some work part time for my professor as a ‘research assistant’.  It’s only a few hours a week and the pay is poor, but every penny counts.
I’ll close off this update with a bit of the differences I’ve been tracking ‘twixt here and home (yep, it’s still home).  First, and most obvious, they drive on the wrong side of the road (otherwise known as the left side, but I’m biased).  (Ho hum, you say?  Everyone knows that! …  Yeah, yeah!  I’m just trying to be thorough.)  Correspondingly, the driver sits on the wrong side and I’ve lost track of how many times I’ve either walked to or gotten into the passenger side before realizing (a wee bit embarrassing in a busy parking lot).  Pedestrians have even less rights over here; even in parking lots if you’re on foot, cars will expect you to stay out of their way and won’t slow down or stop just for little old you.  We’ve already talked about the insulation issue, but just a few days ago I had to replace a pot light in the living room.  Until now, I had at least assumed a modicum of insulation; sawdust, newspaper, cotton candy, … something (anything!).  But now, I pulled the light holder down and I could see the plywood and rafters of the roof a few feet above!  There’s not a whisper of anything above the drywall!  So, that explains that…  Light switches are upside down.  They’re generally a different style than ours back home, kind of a compromise between an old-school toggle and a decora switch, but you have to push the bottom to turn them on.  Power outlets all have their own switches, right beside the outlet (those are upside-down, too) and, of course, the plug configuration is different.  Regular grocery stores don’t sell dill pickles (and they call this civilization?)… eggo waffles and kraft dinner are nowhere to be found… Root Beer is scarce (say it aint so!) and, apparently, in that regard there’s something wrong with the average Kiwi’s taste buds (I deigned to share some of the delicious elixir with a few people and they all agreed it tastes like mouthwash!  That’s crazy talk!  (It just occurred to me that they must have delicious mouthwash over here… I’ll have to get some)).
And then there’s the language.  English is English, right?  And New Zealand has history with Britain, just like we do, right?  Surely we can all agree that Websters or the OED have the generally “correct” definition of a word and we’ll all just go along.  Well, almost…  but there are a few important variations.  Here are a few Kiwi words that you’d think you know the meaning of:
Supper: *not* an equivalent to dinner.  “Supper” is actually dessert or an evening snack.  Learned when Sheri was asked to provide “supper” at 7:30 for the 10+ people coming to our home on Thursday evenings.  Thankfully, the translation issue was found out before we tried to serve a full meal to a group of people who had just had dinner.
Tea: not just a drink and not just a nice get together over a hot drink.  It’s a term used for almost any social gathering (or so it seems to me); we were invited to a potluck “tea” one Saturday evening and we presumed that meant “supper” where we would each bring a dessert to share.  And then someone said they were going to bring a meat dish…  so, it was actually a potluck dinner followed by supper.  Apparently, there is also such a thing as a ‘kitchen tea’ which we would call a bridal shower for kitchenware.  I’m sure there are others…
Biscuit: not a scone-like baked bread item known to be a delicious absorber of butter and great platform for jam (or gravy, if you’re feeling American), but rather a cookie.  That’s right Cookie Monster…  over here, Cookie, Cookie, Cookie, starts with ‘B’.
Cookie: rarely used term for a particularly sweet style of “biscuit”.
Seared: Grilled.  Sheri was trying to get a chicken burger at McDonalds and it was surprisingly difficult to convey that she just wanted it grilled, not breaded.  Eventually, we figured out that meant that she wanted a seared (pronounced not far off from ‘said’) chicken breast.
Jumper: Sweater.
Dairy: Corner store
Methylated spirits: supposedly this works as barbecue lighter fluid.  The owners of our home left us a little charcoal grill and I have had the most ridiculously frustrating time trying to light charcoal with solid fuel starter (over an hour last weekend!).  But that’s all I’ve been able to find in the hardware stores near the charcoal.  Finally one of the guys at school told me to buy some methylated spirits… here’s hoping.
Iced chocolate or Chocolate Frappe: Chocolate milkshake.
Flat white: A latte… but most places have both on the menu; I think only difference is the amount of foam (more for a latte).
Double-glazed: Not an even yummier donut (Tim Hortons should look into that, though).  It’s actually an adjective for windows over here that means double-paned and it’s used with a touch of wonder, as in: “My parents place is sooo warm!  They have (just imagine) double-glazed windows.”
Not even ow! : An expression roughly equivalent to “whatever!” or “no way, man!” (I think)
Sweet as! : Sweet! (the ‘as’ can be added to all sorts of things and it’s left to the hearer’s imagination to append the proper epitomizing comparison… e.g. Crazy as! Cheap as!)
Stuffed it up: Broke it.  As in “We tossed a bunch of nuts into our cheap as food processor, ran it for 15 minutes and stuffed it up.”
All this language confusion makes me think of (what else?) The Simpsons:
Lou: Well, at McDonald's you can buy a Krusty Burger with cheese,
     right?  But they don't call it a Krusty Burger with cheese.
Wiggum: Get out!  Well, what do they call it?
Lou: A Quarter Pounder with cheese.
Wiggum: Quarter Pounder with cheese?  Well, I can picture the cheese,
        but, uh, do they have Krusty partially gelatinated non-dairy
        gum-based beverages?
Lou: Mm-hm.  They call 'em, "shakes."
Eddie: Huh, shakes.  You don't know what you're gettin'.