Over the last couple of weeks we've been experiencing random power failures in the coop for no apparent reason. It turns out that the solar charge controller, which has the ability to turn on and off the load is powering down the system.  Initially this looked like a power related issue within the main unit or a flat battery, but when it was proven that the controller would even power up a standard 12V, 21W car bulb, then clearly something is wrong. The device just powers up and within a couple of seconds disconnects the load.

After many months on the bench, the time has come to finally fit the Rotator, this means that the the previous fixed install needs some modification, primarily to reduce the mast length for correct rotation. There's also the need to order another mast, since being an American unit, it uses Imperial measurements, it needs an inch and a half pole, so the metric equivilent is  37mm has to be used.

Now we have the ability to actually control the Rotator position, we need to be able to turn that into a closed loop system where it can take an angle from the main Arduino and accurately move to that position so that we can point the solar panel at the sun.

As we have a 4 bit encoder on the bottom of the shaft and the zero value of the encoder is aligned with the end-stop jam within the gearbox, which incidentally has the purpose or stopping the wires going up the pole from getting wrapped round and round the assembly and therefore breaking. We can therefore determine within 1/16th of a circle or 360/16 = 22 degrees. This is helpful, but has a number of issues, which are:

Little boys are brought up with motors, they are simple, a battery and a motor, possibly even a couple of pieces of wire, this is simple stuff, but that's for DC motors. AC motors are different, there are two coils that share a common pin.

At this point, the project takes an unexpected detour. I've read about how AC motors work and I'm also looking at the 12V DC supply and know that it takes 18V AC to drive the motor, so I start thinking about differential signals to increase the instantaneous voltage on the coils, like you can with speakers and piezo elements, so I start designing a drive board. I also start thinking that one coil is for clockwise and one is for anti-clockwise (please don't ask why)

With all these modules and sub-systems in the design, its sometimes hard to picture what's where. Lets take a recap on what the modules are and what its like in the chicken coop:

Firstly, its important to recognise that any work in the coop will involve supervision. Today we are being supervised by Clucky, at other times we may be watched by Lotty (aka Mother Hen). At the end of any works, it will be necessary for an inspection and final tidy up to be performed. Sometimes you will even be told to leave, for example if you are trying to work late. This is explained by the girls coming home to roost - irrespective of the state of the coop, any tools, open boxes, diagnostic kit, etc. Its hard to work when all you can see is a line of fluffed up chickens with either their beak, or worse still their bottoms, in the way of what you are trying to work on.