mrrrk.net

Yet another narcissistic load of old cobblers that no-one will ever read.

The Day of Erection

What?  Erection is a perfectly normal and suitable word.  Stop sniggering.  So, now it's time to put up the wind turbine that will help power my Chacmool project.

Here's a step-by-step idiots' guide.  As in, you're probably an idiot if you do this like I did.

First, I soldered 3 m of extra cable onto the short leads that come out of the bottom of the turbine flange.  I haven't really soldered for years.  I found I need glasses to do it now.



Then I added heat-shink tubing 'cos I thougt it'd be nicer than wrapping it in tape.  I added extra tape in the end 'cos my soldering is awful and there were sharp bits where strands of wire stuck out as I'd mashed the two ends together, willing them to stay still long enough to accept my molten fixative.



I then bolted the flanges together, the other flange being the tube clamp wall plate.  I added a solid-neoprene spacer between the two faces (bought off Ebay and cut to size with scissors.)  The bolts look excitingly chunky.  Looks like proper engineering.  The reason the nuts are upper-most (rather than the bolt heads) is that the washers won't fit on the other side 'cos the tube clamp collar is too wide.



Next, the blades need bolting onto the hub and the hub is tightened to the spindle using the hex socket in the middle:



Then I added the shorter tube and snapped on the nose-cone to complete the upper assembly:



You might notice the notch I needed to cut near the bottom, with drill and hacksaw (and filed off aterwards), to allow the wires to branch sideways into the shed:



Now I needed to assemble the bottom tube and brace it to the shed.  I decided to reinforce the shed panel from the inside with a sheet of MDF.  I then drilled some holes and fixed the tube, the base plate and the T-piece in place.  I'd done all this already without taking pictures as I went but you can see the results below.

Now comes the idiot step.  I seriously wondered if I could manage this without help (my wife was in Leeds that day) and I probably shouldn't have tried.  Undaunted (well, a bit daunted, actually) I managed to climb the stepladder, carrying a turbine weighing too-many kilogrames swinging around on the end of a 1.3 m steel pole.  Finding myself in this new precarious position, I needed to feed the yellow wires round 90° through the T-peice and into the shed while simutaneously supporting the unweildy, top-heavy turbine and myself - without falling and breaking several bones or rupturing internal organs in the process.  There's no way I would have comtemplated this if there'd been any wind - but there wasn't any.  Anyway, got there in the end.  The tube found it's way home with a statisfying thunk and I'm pretty sure I managed not to trap any wires.  Do not try this at home kids.  Or at least get a grown-up to help you.

One thing to note is that the wires need to be shorted together if they're not connected to the charging controller.  If it's windy (presumably very windy!) it's apparently possible for the turbine to spin so fast that it damages itself.  Shorting the cables stops this becuase any generated current will create an opposing magnetic field in the coils and will resist the turning.  You can feel this when you try and turn the blades - it's not locked up but its quite stiff to turn.  Once connected to the controller, it should handle all of that sort of thing automatically.

Anyway, here are some pictures of the final assembly:








At the time of writing, the blades haven't turned an inch on their own yet.  I did mention it wasn't windy though...

It isn't easy being green

None of my wind turbine and mast components actually need painting since they're made from either plastic (possibly glass-fibre reinforced) or galvanised steel.  However, the thing will be hoisted 3.5 metres in the air and be in full view of me, my wife and various neighbours and so I spent some time last weekend painting the wind turbine and the tube clamps to make them stand out less.  As you can see, this is truly a green energy solution:


 

Rather than paint the tubes, I wrapped them in brown PVC electrical tape:

 



The instructions on the paint tin specified a temperature range of 15 °C to 25 °C for application.  The painter himself would have appreciated a temperature in that range too but the paint and I had to put up with a mere 5 °C along with splashes of rain carried into the garage by gusts of unwelcome wind.

The plastic parts were sanded over with some roughish sandpaper to provide a key and given a couple of coats of primer followed by a couple of coats of green gloss.  I gave the blades more coats since they'll get the most punishment.  It'll be interesting to see how well the paint stands up.

Here's a scruffy diagram of what I'm trying to build:


The tube is split into two sections to be joined by the T-piece.  This is so I can man-handle the tube plus turbine section and make it easier to erect.  The wires will also run through the T-piece and into the shed.


The bottom base plate will be fixed to concrete with self-tapping concrete bolts.


I'll also be adding some MDF reinforcement inside the shed on the other side of the T-piece + base plate since this will be taking quite a lot of lateral force and torsion when the wind blows hard.  I did wonder about trying to calculate some of the wind loads - but then I reasoned that the shed is basically an enormous sail - and it's still standing.  It can handle a bit of extra push.  I hope.

In pole position

You may recall that I'd found these cool and groovy tube key clamps that will solve my problem of how to construct some sort of mast for my wind turbine.  The wall plate, T-piece and base plates were easily ordered and delivered through Ebay but ordering 3 metres or so of heavy steel tube (think scaffolding pole) seemed less simple.  I'd seen suitable tube listed at £2 per metre - but only it was by collection only.  It just so happens there's a steel supplier just round the corner from where I work - so I paid a visit to Nottingham Steel Supplies.  This is nestled deep in an old industrial estate, surrounded by buildings that must date back to the 1950s or earlier.  In more industrial times I'd probably have heard the grinding of metal and seen the blue light of arc-welding through various of the old cast iron-framed windows.  I approached the chip-board reception desk, which I'm sure a few years ago would have been adorned with calendars featuring semi-naked ladies sporting power tools, and relayed my requirement for 3 m of 42 mm diameter galvanised steel tube to the doubtful looking chap who came to see what this idiot wanted.

"Hmm.  We only supply 7 metre lengths," he said - possibly hoping to get rid of me that way, knowing there's no way I could deal with that without some form of goods vehicle.

I countered with, "If it's cheap enough, like it is online, I'll just buy 7 m.  Can you cut it?"

"No.  And we'd have to send it away to be galvanised.  How much was it online?"

"£2 per meter," I said neglecting to mention the lack of delivery options which would increase the cost.  I could tell he thought I was bullshitting though.

"Yeah, well, you're probably better off buying it online then."  And that was the end of that.

As it happens, I found 3.5 m lengths of the tube I wanted, including delivery, for sale on Ebay from DC Iron up in Newcastle (https://www.dciron.co.uk/).  For a shade over thirty quid, they sent me *two* lengths of tube, delivered to me at work the next day!  As well as the two steel poles, I now had two problems:  where to put them and what to do with the spare one.  Some vigorous hacksawing allowed me to bring them inside, sorting out the first problem and also making it possible to transport the tube home by car.

Still dunno what to do with the extra tube but I'll think of something.  I know it's tempting but do not send me any clever suggestions that involve parts of my anatomy.  Thanks.

A case of wind

In a previous post (Chacmool Power), I mentioned that I thought my solar panel wouldn't be enough to power my project and that I'd ordered a wind turbine from China through Ebay:


It's the three-blade model and rated at 100 W, 12 V with a three-phase AC output.  I actually wondered about getting one of those little jokers you see on small yachts and house boats - but they're pretty pricey and have built-in charge controllers.  As I have previously mentioned, I have already invested in an over-engineered combiled 1 kW solar / wind charge controller so I wanted a turbine that could wire straight into that.  This was the smallest one I could find that fitted that bill and seemed physically small enough to stick on a wooden shed.

Actually, i think it's that bloody charge controller itself that's using up all my precious, hard-won solar charge.  Ironic that the charge controller is running down the battery.  So I could:

  • Get a more sensible charge controller
  • Fit more solar panels

...but where's the fun in that?  Much better to blunder down the course I've set for myself with my stupid power-hungry 1 KW combined charge controller and erect a breezy power harvester that's more likeley to pump the electrons round when the sun's not shining.

Anyway, the wind turbine arrived.  Seeing it in the flesh so to speak, I realised it's bigger and heavier than I thought it would be.  I'd foolishly wondered about mounting it using am aluminium TV arial pole from B&Q, cleverly reinforced with a wooden dowel down the middle.  Composite materials!  But looking at what arrived in the post, I quickly realised that I'd need a bigger metaphorical boat and that my clever composite pole would probably have been snapped like a twig at the first sign of a breeze.

So what could I use as a mast?  The turbine has a big, meaty looking metal mounting flange (you can see in the picture above) so I'd need to accommodate that.   I Googled about for "wind turbine mounting", "mast", etc. and found little of use.  Then I found out about these tube clamps you can get (Google for tube key clamps, or "kee klamps" to see what I mean).  I could build my own robust mast in sections of galavanised steel tube, joined and fixed with these tube clamp fittings.  The other bonus is that wall plate that matches the 42 mm tube (there are several diameters available) also matches the flange on the turbine!  Awesome!

...so I ordered a wall plate for the turbine, a base clamp to fix to the ground (the concrete shed foundation) and a T-piece plus another base plate to brace the whole lot against the shed.  All I need now is the steel tube.  More on this later...

The Sun and the Moon

For my Chacmool project, I want to display sunrise and sunset and also the moon phases.

I found some Python code to calculate the Sun times here:

http://michelanders.blogspot.co.uk/2010/12/calulating-sunrise-and-sunset-in-python.html

I did find some code for calculating the moon phases elsewhere (e.g. https://stackoverflow.com/questions/2526815/moon-lunar-phase-algorithm) but it looked pretty bloody complicated and I failed to get the Python 2 code I found to compile in my Python 3 project despite trying to modify it.  I'm not a Python expert!  It was after this minor failure that I discovered that you can make a much simpler calculation as long as your happy for it to be inaccurate by a few hours here or there.  Fine by me.  All you have to do is get the length of the average lunar cycle (see box), take the date and time of a recent new moon and see how many cycles fit in to the time span between then and now.  You then take the remainder from that and compare it to the cycle time to find out how far through the cycle you are.  Easy!

The synodic cycle (or lunar month) - which takes into account the Earth's movement relative to the Sun as well as the Moon's movement - is the time between new moons as observed by us here on our spinning Earthy platform.  This is different to the siderial month which is basically how long the Moon takes to do one orbit round the Earth without worrying about the Sun or what we see.  The siderial month is about 27.3 days whereas synodic month is about 29.5 days.

My Moon code can be found here:

https://gist.github.com/mrrrk/e100225508ad8b6882844de99d264ca7

I'll probably put all the code for my project up on Github or Bitbucket at some point in the near future.

You've just been mooned.


Chacmool Pi

Here's a quick and general precis of the computer hardware and software I intend to use for my weather project.

The Actual Computer

I want a computer that consumes little power and that I can connect lots of interesting little weather sensors to.  An Arduino board might work but I want to serve web pages from it and that might be asking too much from one of those.  At this point, the choice of a Raspberry Pi seems pretty much of a no-brainer.  There are other similar tiny computers (Beaglebone, etc.) but the Pi is well known, well supported and to top it off, it's British.  It's even made in Britain.

So that's easy.  The next choice is what operating system and programming framework I should use. 

Operating System and Programming

The basic requirements are:

  • Needs to poll data from several sensors
  • Needs to support a database of some form to store these readings
  • Needs to serve up web pages

My usual weapon of choice at work is Microsoft's ASP.NET with SQL Server.  As it happens, there is a version of Windows 10 that runs on the Pi: the Windows 10 IOT (Internet of Things) Edition - and it's free.  However it's not entirely clear that you can run ASP.NET on it.  I think it's possible - but not what the OS is intended for.  Also, polling the sensors with C# code would be tricky (but possible.)  And I'm pretty sure running SQL Server will be asking too much.  So in the end, I've decided on the default Raspbian operating system, which is a version of Linux designed specifically for the Pi.

With Raspbian, I could have still gone for Microsoft's ASP.NET because the new ASP.NET Core version will run on Mac OS and Linux - including the Pi - but I'm doing this for fun so I might as well chose a language and framework I don't use at work!  So I'll be doing the programming in Python.

There seem to be a number of options when it comes to Python libraries for serving up web pages and in the end I settled on something called Flask.  It looks pretty similar to the ASP.NET MVC way I know.

Fun fact:  Python is named after Monty Python's Flying Circus.  Written by a Dutch bloke who I suppose was (is) a fan.  And in turn, the Raspberry Pi is so named because of Python (it seems to me it should really be Raspberry Py on that basis, but that's quibbling).

Database

I'm also going to use Sqlite to store all the good stuff coming from my sensors.  Sqlite was apparently designed originally as a light-weight SQL database for use on US Navy guided missile destroyers!  It's used pretty much everywhere now, from storing browser settings in Firefox to storing who-knows-what on your smartphone.


Web Front-End

As mentioned, I'm using Python + Flask for the back end and as well as the usual HTML5 for the web stuff, I'll be using Typescript to do the programming around that.  I'll be using a similar approach to the one I use at work where the HTML is essentially a static shell and the clever stuff happens via client-side scripts which call APIs on the back-end and manipulate the browser view.  I'll also be using Knockout.JS to do data-binding.

Typescipt was designed by Anders Hejlsberg, the American Dane that the geeks out there will know for things such as Turbo Pascal, Delphi and C#.  He's genius but he pronounces Delphi as "delf-eye" and everyone knows it's "delf-ee" - so he's also an idiot.  No, sorry, he's not a real idiot - he's just lives in the US.

Displaying it All

The idea is to use a 7" (Nexus 7) tablet I've got (and rarely use) to display the weather data in the house.  Maybe I'll need to write an app to show the page that the Pi is sending out in "kiosk mode".  Or maybe not.  More on that later.


Chacmool

Chacmool is the name of my new weather project.  This is to keep me off the streets since I'm not doing an Open University degree anymore.  The idea (long term) is to make automated weather observations and use "artificial intelligence" to try and predict the weather.

This project will live in the garden shed, run on solar power and be controlled using a Raspberry Pi computer.

I've already done a lot of the fun stuff, i.e., buying various parts off Ebay and Aliexpress but I intend to keep some sort of log of my progress from here on in.

Why is it called Chacmool?

I saw a chacmool statue in Merida, Mexico a few years ago and thought it was sort of cool.  And according to Wikipedia, "Aztec chacmools bore water imagery and were associated with Tlaloc, the rain god."  That's all the excuse I need.


Why an AI weather station?

I've read "Make Your Own Neural Network" by Tariq Rashid and it was an excellent book - I'd recommend it to anyone who wants to know how things like 'deep learning' (or whatever it's called this year) work.  That got me idly wondering what I could use a neural network for, other than reading hand-written digits (the classic 'hello world' application of AI).  On the hardware side, I'd already got some bits from an abandoned shed-based project to use a Raspberry Pi for "off-site backup".   That gave me the idea then that I could build a shed-bound neural network and feed it with sheddy weather data - and see what happens...