## Inherited Project!

Any other Phidget projects you've done not related to the above subjects
kimble01
Phidgetsian
Posts: 6
Joined: Mon Oct 10, 2011 6:17 am
Contact:

### Inherited Project!

I'm currently working on version 3 of a commercial solar project which uses an 8/8/8, 2 limit sensors, and 2 light sensors to track the sun and position the trough. It's a very cool project! The trough is 50' by 8' an it's the first time I've sat with a laptop debugging outside under this thing! What we want to do now is hook an inclinometer to the 8/8/8 and calculate the sun's position at a given time of day and lat/long. But I'm having trouble identifying an inclinometer that will work. Any help would be appreciated! I saw lunartick, and apparently the scope and celestial object is about the major difference...well maybe a little more than that...

Patrick
Posts: 3078
Joined: Mon Jun 20, 2005 8:46 am
Contact:

### Re: Inherited Project!

What do you want to use the inclinometer for - To measure the inclination of the solar trough? I'm not sure about inclinometers, but maybe you could use a rotation sensor? You could also use an accelerometer.

As for tracking the sun's position - I image you could do this totally in software for a known lat/long/date/time and not need sensors at all. You just need to find the right software library.

-Patrick

kimble01
Phidgetsian
Posts: 6
Joined: Mon Oct 10, 2011 6:17 am
Contact:

### Re: Inherited Project!

I already have the algorithms written and am testing. The problem is they all return a degree, either in relation to the position or the offset from the horizon. So while i can find the sun computationally, I need now to set my trough's degree of inclination to match. See what I mean?

Patrick
Posts: 3078
Joined: Mon Jun 20, 2005 8:46 am
Contact:

### Re: Inherited Project!

A quick search on digikey pulls up this model: http://search.digikey.com/ca/en/product ... ND/1016739

Runs off 5v with analog output, so it should interface perfectly with the 8/8/8.

-Patrick

kimble01
Phidgetsian
Posts: 6
Joined: Mon Oct 10, 2011 6:17 am
Contact:

### Re: Inherited Project!

OK, so we bought that and have struggled through their formula: arcsine(Vout-offset/Sensitivity) where Vout is the output, offset is the output at 0 degrees(noon) and Sensitivity 2V/g. I have no idea how to apply or what value 2V/g is since we're not using this as an accelerometer. In another place a less accurate measurement had sensitivity as 35mv. When I plug it in and use real numbers it comes out to Offset being 900 (ratiometric) and using (35*1000) for the sensitivity value...Phew!

I have 2 more problems besides the one stated: the degree of the suns position for a given lat/long and time comes out to 38.5 the output of the sensor is -0.0063143256789 not even related to degrees. The other problem is that it will arrive at this value in both directions from zero, so I can't just tell it to "go to position X" because it could be pointing at the wrong quadrant of the sky...

Any help/thoughts would be appreciated.

Patrick
Posts: 3078
Joined: Mon Jun 20, 2005 8:46 am
Contact:

### Re: Inherited Project!

Output at 0 degrees should be sensor value 500 - assuming that the inclinometer is flat at 0 degrees.

I believe that your formula should be:

degrees = arcsin( (sensor value - 500) / 400).

Also, remember that most arcsin functions will output in Radians - so you'll have to convert to degrees:

degrees = radian * (180 / π).

This should give you a range of -90 - 90 degrees over the sensor values 100 - 900 (0.5V - 4.5V).

You will want to put the InterfaceKit into ratiometric mode.

A simple PID would make it easy to use the sensor change event to drive the motor towards the target angle, and keep it there as the target angle changes. Just make sure that change trigger is 0 if you use this method.

-Patrick

kimble01
Phidgetsian
Posts: 6
Joined: Mon Oct 10, 2011 6:17 am
Contact:

### Re: Inherited Project!

Thanks so much! I'll give it a go tomorrow.

kimble01
Phidgetsian
Posts: 6
Joined: Mon Oct 10, 2011 6:17 am
Contact:

### Re: Inherited Project!

Output at zero is 900...does that affect your divisor value of 400? After applying your formula, we are very close! By that I mean the computed angle of ascension is -30.58 and I can arrive at that same angle with the Inclinometer. Thanks so much for your help.

Patrick
Posts: 3078
Joined: Mon Jun 20, 2005 8:46 am
Contact:

### Re: Inherited Project!

If the output is 900 that implies that the inclinometer is 90 degrees off level - this really just depends on how you have it mounted.

-Patrick