More maths

What you’re looking at is a case I’ve built to house the accelerometer module for the solar tracker.  It’s connected to the breadboard where the accelerometer itself was located yesterday.  I cut up a standard 6′ network cable and soldered it into a PCB along with the component.  Notice the distinct “North” label on the top of it.  This is absolutely critical in the calculations to ensure that the feedback the accelerometer provides coincides with the values that the MCU is expecting in order for the system to actually point directly at the sun.  This is a bit of an annoying downside of not using light detecting modules as sun-seekers.  It’s now dependent on perfect alignment with the azimuths.  This is, however, pretty manageable with either a hand compass or a compass module placed within the system.

Also, I discovered a slight cock-up with my maths from yesterday.  The Y-axis calculations are much simpler than I’d originally thought if I use the hour angle for the X-axis.  Then the Y-axis is simply the present latitude less the declination angle.  This isn’t a 100% accurate calculation, as it does not take altitude into account.  This is a pretty acceptable margin of error, however, in that it would take miles of altitude to have even a minute effect.

So I did a lot of calculations for nothing, really, is how it turns out.  Also my hour angle calculations weren’t taking DST into consideration, which was causing the expected X-axis angle of the sun to be off by 15°.

But that’s all fixed now and you’ll see the results here:

The Ideal X/Y values are positions the MCU expects the solar panel to be in to be staring directly into the sun.  The Actual X/Y are the values received from the accelerometer.  The reason for the deviation is because I’m just holding the thing to take a picture.  This feedback, however, will drive two DC motors that will manipulate the position of the panel.  Once I design it.  And the build it.

That’s all for now.

This is Sonny.  He’s awesome: