From the news release: "Generating sustainable wealth from New Zealand’s vast ocean resources requires us to proceed carefully, according to a new paper produced by the Royal Society of New Zealand. Marine mining, bio-discovery and marine power generation all provide opportunities to generate extensive wealth for New Zealand in the future but there is a lack of information about the vulnerability or resilience of our ocean ecosystems."
Download the paper or listen to the briefing from the Science Media Centre.
And if it's TL;DR, then the conclusion is: "In just a few decades, the fisheries industry has transitioned from crisis to a substantial and long-term generator of wealth for New Zealand. As shown by New Zealand’s experience with the fisheries Quota Management System, institutions matter. Our developing understanding of New Zealand ocean energy, minerals and petroleum, ecosystems and biodiversity all suggest that more potential sources of wealth are present in our oceans. However, appropriate management frameworks (i.e. institutions) are critical if New Zealand is to develop its marine resources efficiently and responsibly."
And my personal view is that we can manage and limit the environmental impacts of offshore activities, even up to and including major drilling for oil and gas. However, to do so we need an ability to regulate any offshore industry, to stop the companies from capturing and controlling the regulators, and the capacity to cope when mistakes are made. As shown by the Rena fuckup, marine industries are not adequately regulated, and I'll just refer here to my post last year on Is NZ ready for a major oil spill?, the answer being oh ffs no!
You will need a drill, spirit level, masking tape, pencil, and a tile-cutting drill bit.
First, look at the instructions in horror. Find the section that claims to be written in English, sit down, read it through twice, and then scratch your head:
Taking a break from the hammering and painting and cycling and networking and coding and training and choreographising, we wandered into town on a sunny Sunday arvo:
The Mitochondrion, Mark 4.1, reached the spinnable stage, but had some irritating flaws. Hence I'm taking that learning into the Mark 4.2, using almost the same hardware and design as the 4.1, but with a new main board. Here I'm testing out the design. You're looking at an Arduino Nano, 128 kB external memory chip, a combined compass/gyro/accelerometer motion sensor board and the upright bit is a Bluetooth module, all mostly behaving themselves so far.
Oh, and a level shifter, coz one of the things I learnt from the Mark 4.1 was that the motion sensor runs 3.3 Volts internally and has a voltage regulator so you can power it from a 5 Volt supply. However, it also has pull-ups on the I2C communication lines, pulling those up to 3.3 V. If you're running the rest of the I2C network at 5V, everything all gets very unhappy very quickly.
Progress so far: motion sensing and external memory working just fine and my phone can see the Bluetooth module. Yup, one of the aims for the Mark 4.2 is to control the Mitochondrion from my phone. And for it to act as a thermometer, and possibly portable clock, coz everyone at festivals needs to be reminded that they are up past their bed-time.
Next steps are either getting the audio circuit design tested in hardware, getting the Bluetooth to work from laptop and phone through the software-serial port, refactoring all the software from an OO perspective, or shifting all the floating point maths into fixed point for a dramatic speed up. Coz you know me, I want to make pretty lights turn on and off and clearly the way to do that is not to buy some pretty lights and an on/off switch, but instead to start by writing my own code to perform basic mathmatics, coz other people's addition and subtractions functions just aren't good enough.
Hmm... oh, and more skirting boards. Only another 27 metres to go, for which I will be starting with pieces of wood that look nothing like skirting boards.
You'll note that it isn't plugged in to a computer, that the batteries are powering both the LEDs and the microcontroller, and that it is electrically complete and ready to be mounted in the tube. There's still a couple of pieces of hardware to test (audio analysis circuit, accelerometer, reset socket) and lots of code to write, but it's ready for Kiwiburn.
In other news, I'm now back from Kiwiburn. I was alternately social and effectively productive. The large shade structure/dance floor roof didn't blow away or tear itself apart, the portable shade structure worked fine. Other people have pics, I have a huge pile of washing and six bean bags left in the van.
I'm working away on the next version of the Mitocondrion. In an effort not to do everything myself, the next version uses assorted bits and bobs from others but everything comes together and gets wired up by the one main board. This holds the Arduino, the big DC-DC converter that powers the LED strips, the little DC-DC converter that powers everything else, the status indicators, the motion sensor board, the battery monitoring, the extra memory, and the audio analyser. It also joins together the two battery packs, the LED strips, the power, programming, and reset connectors, and the microphone. It's busy.
So, here's the board being made, from design, through masking, etching, building and testing the step-down power converter, and then once that was checked and working, populating the rest.
The status LEDs are the smallest things I've ever soldered, 1.6 mm long and 0.5 mm wide. It was a mission to get five of them in place, even getting them out of the packaging without losing them was a mission. Admittedly, there's supposed to be six of them. One is now on the floor somewhere. Can you spot the missing LED? Hell, can you spot the five LEDs in the picture?
So it's built, but mostly not tested yet. As I mentioned, it does a lot of different things.
The Wellington Circus Trust is celebrating christmas and their move into a new venue, in true carnie style, by putting on a show!
This coming Saturday evening, tieke will be doing the first ever performance on her new aerial dance apparatus. She's been developing this work semi-secretly for the last 6 months and I personally think it's rather awesome. There'll also be a short show from the Wellington Youth Circus, followed by a cabaret of work by adult professionals and advanced students. There's some lovely work going on and I think it'll be a really great show. After the show, there'll be a party of some sort .... it'll be a fun night, and it'd be great to see you there!
Most programming these days seems to consist of banging other people's code together until it all behaves. This wasn't much different.
I've been playing around with some algorithms for the Mitochondrion, Mark 4.1. For one mode, I want smoothly flowing and random patterns. There's a kind of noise that suits called Perlin noise, invented by Ken Perlin and used to generate natural patterns like clouds in possibly every movie ever.
So, I found an implementation for Arduinos by some guy on a forum, tried it, horribly slow. Like a couple of hundred times too slow to give me a smoothly changing pattern on the hardware I'm using. There's another kind of noise called simplex noise, also by Ken Perlin and faster. Found someone's implementation in Java, ported it, tried it, faster, but still not fast enough. Scratched my head for a while, slept on it, had a shower and in the shower came up with the only original idea here, which is to just run the simplex noise for a few of the LEDs spaced out along the LED strip and just interpolate to fill in the gaps. Tried it, total speed up of around three hundred and now I've a hundred LEDs all doing what I want.
So cubic interpolation makes me happy, although to be honest, I wouldn't have thought of doing it like this if I hadn't asked an entirely different answer a few months back and received the answer that "Catmull–Rom splines, mate, see you right". And it's not exactly a new idea to say "slow algorithm is slow, so only do slow algorithm occasionally and use fast algorithm to fill in the gaps".
Anyway, here's a vid of the Perlin, simplex, and interpolated modes. (On anything less than 720p it's a little jerky, but that's Youtube's compression, not my code.)
Question for people who actually know about this stuff: Perlin and simplex noise produce noise with a (roughly) normal distribution, i.e. across the interval from -1 to 1, but mostly clustered about zero. What if I want smooth noise with a flat distribution, i.e. with equal probability of occuring in the interval from 0 to 1? I ask as I'm changing the above code from RGB to HSV so that I can control the saturation (coz max saturation FTW) and I'd like to pick hues with an equal chance of getting any hue.
Is there an algorithm that does smooth noise with a flat probability? I haven't found one, but I don't know where to look. Right now I'm just expanding, scaling, and clipping the simplex noise, which isn't really very flat at all.
In the year or two since I finished the Mark 3.5, I've had time to give it a good workout and to have a think about what worked, what didn't, and how to do it better.
Next comes the Mark 4.1, running off an Arduino Nano and displaying using Adafruit's addressable RGB LED strips. Tech has progressed so much in the last couple of years that I'm happy to mostly buy other people's parts, making it so much easier to throw it all together. Still, I expect there'll be the usual fun and swearing along the way.
For the Mark 4.1, I have light coming out of the LED strips controlled by the Nano and I'm writing code to make that light dance. The physical design is done. I spent last night ordering 3D printed bits for the structure and there's some aluminium strips sitting in the workshop waiting to be cut, drilled, and bent for the spine. I think the electronic design is finished, but it needs to be checked. Hence there's a massive order of electronic parts currently being filled at element14. The critical path currently looks like: await electronic components -> check centre board layout against the real size of those parts -> make/order centre board -> assemble -> debug -> write more code -> party.
Tips for making circuit boards - (tiny, dense, double-sided boards in your kitchen):
Like a fool, I tried to pack far too much into far too small a space. Hence the PCBs had to be equally dense and tiny. But then again, fitting electronics into a 25 mm tube is never going to be easy.
With all of those, I could happily make some pretty detailed boards in the kitchen, suitable for surface mount chips with 0.8 mm spacing. Still, a 40X1 in surface mount is lots of time and hard work.
I don't like dumb objects. I don't like noticeable user interfaces. I want shiny things that just do what I want, without me telling them what I want. And anyway, given that any physical connections to the outside world will have to come out through the tiny, busy ends, then it's not like I can cover this staff with buttons unless I want to drill holes in the polycarbonate tube, making horrible stress concentrators and greatly reducing the toughness of the tube. Hence I wanted to squeeze a whole bunch of sensors into the Mark 3.5.
So, the accelerometers worked but were noisy, the ultrasonics didn't fit, and the audio was too much for the Picaxe to deal with. In the end, the Mark 3.5 turned out dumb. Hell, that's one reason why I'm building the Mark 4.
For the purposes of shiny toys, LEDs come in two kinds: bright ones and painfully bright ones. The painful ones draw 350 mAmps or more, need fancy constant-current power supplies for each LED and will melt without proper heatsinking. I went for the bright ones that draw 20 mAmps each and only need a resistor to protect them.
I chose the Piranha-style square LEDs, for the brightness and broad spread of the beams (like these ones from Sparkfun. I thought about going for smaller, surface-mountable ones, but chose the through-hole LEDs for shock resistance.
If I did this all again, I'd be tempted to spend much more time on battery management. For instance, actually having regulating charging and pack balancing would have stopped the batteries geting so munted. Then again, I'm not quite sure how I would fit that into the space that I've got.
Knowing nothing about microcontrollers, I chose something easy to start, the Picaxe family. The learning curve is easy, it's designed for schools. Of course, something this simple is going to have limitations and by the end of two years of development, I've bumped up against most of them, but I wouldn't have done this differently.
Your program goes in the program memory, which can hold a total of about 1000 lines of code. Hence my initial idea of generating assorted pretty patterns failed abysmally and I went a much simpler route, which I'll describe in the next installment.
Firespinning is fun, but I thought to myself: 1) It's been done 2) This is the Twenty-First Century and we have semiconductors 3) This is the Twenty-First Century and burning fossil fuels for gratuitous reasons is just so Twentieth
So a plan formed in my head to make a glow staff. Now, coz I'm stupid an overachiever, I decided to make one with bells on. A glow staff that pushed the boundaries, a glow staff like no other. The only limits are technology, time and money. The technology I can handle, and I don't have kids or a TV, so time and money are no problem.
There was a slight drawback, in that I hadn't done any electronics since school and wasn't entirely sure what a microcontroller was or where to get one. I'd never designed a digital circuit or etched a circuit board, but hey, it can't be that hard, right?
Several years later, the Mark 3.5 is quite shiny. Forty RGB LEDs, all individually addressable, over a hundred patterns, and bright enough to hurt*. So at long last and before I get too carried away with the Mark 4, it's time to write down and share what I've learnt, both about glowstaffs and electronics. This writeup is an attempt to help other people avoid making the same mistakes as me. And there were a lot of mistakes.
The writeup is going to look like this, one per weekday, until we're done:
Physical structure and layout
Picaxe microcontroller
LEDs and drivers and power and batteries
Sensors - this really didn't work
Making PCBs
Debugging & Reliability
Doing it better next time
* - Mostly the Mitochondrion hurts other people, coz when I'm spinning it, I can't see anyone or anything else.
For those of you who are not Antipodean, the Triton workcentre is an Australian icon. How many other power tools have an owners' club? Each one mounts a circular saw onto a carriage, mounts that carriage onto a table, and lets you cut wood across and along. In 1975, that was all any man needed to feel fulfilled.
The classic workcentre is the Mark 3, from 1984. The Mark 3 brought along a major step forward for the Triton world, the bright orange paint that they still use today. My Mark 3, like all good tools, came from the in-laws. It's covered in shavings, a bit rusty, and does the bloody job.
So now I've fixed the workcentre and the last twenty metres of skirting for the house are underway. A quick look at the Triton forums suggests there's a few other people in a similar situation, so if anyone else wants these pins, then you can buy them from Shapeways.
POSTSCRIPT: Of course, once I'd made the perfect replacement locking pin, what did I find?
Yup, the old ones were buried downstairs, in a box, ready and waiting to pop up just as soon as I'd sorted out the new ones. Anyway, at least I now know that other people can replace their locking pins, should they do a better job of losing their parts.
In Reading, Berkshire, where I grew up, there's a great big statue of a lion in a park. Sixteen tonnes worth of cast iron. It's the Maiwand Lion and it commemorates those from the "Berkshire Regiment who gave their lives for their country at Girishk Maiwand and Kandahar". Where, you might ask? Afghanistan, in the Second Anglo-Afghan war, in the year 18-something-or-other.
I can only think of the line from Monty Python's "The Meaning of Life", about trying "to remember the names of all those from the Sudbury area who so gallantly gave their lives to keep China British".
Anyway, in today's news, another Kiwi soldier has been shot in Afghanistan: Soldier's death devastates family. John Key has offered the family his condolences and declared that NZ's presence in Afghanistan is necessary. Well, right up until 31st March 2012, when our presence isn't necessary and our people get to come home.