Author Topic: Adding hysteresis to solar tracker  (Read 972 times)

0 Members and 1 Guest are viewing this topic.

Offline liviu.geleaTopic starter

  • Contributor
  • Posts: 29
  • Country: ro
Adding hysteresis to solar tracker
« on: March 11, 2021, 03:59:04 pm »
Hello. I'm trying to create a polar alignment solar tracker for fun.
The input is provided by 2 photoresistors configured as a voltage divider and placed at an angle
The outputs are meant to be fed to an H bridge for driving a hi-geared dc motor.
And yes, there will be some voltage regulation and lead-acid battery involved.
This is what I came up with so far: https://tinyurl.com/yc6gkbvk

By adding the additional threshold resistor on the bottom I could make it so that the chances of oscillations are reduced and I can easily adjust how close I want the panel to follow the light.
Now I would like to make the circuit "overshoot" a little, to prevent starting the dc motor too often, especially since the sun movement is predictable and always towards the west.
One idea would be to ad a monostable 555 timer to just one of the outputs making the westwards movement always overshoot a little

SO ::) Is my idea complete horse manure? Hould I do it some other way?
Additionally I may want some amount of remote control and monitoring since the 30w panel can surely spare some current to power some  remote monitoring. Should I  dump the opamp thing and just arduino through it all?
 

Offline jmelson

  • Super Contributor
  • ***
  • Posts: 2779
  • Country: us
Re: Adding hysteresis to solar tracker
« Reply #1 on: March 11, 2021, 07:06:40 pm »
This might be a good case for a microcontroller, maybe AT-Tiny family or something.  Everything is so slow when tracking the sun.
R-C time constants would be troublesome.  You could put in some logic to know when clouds are affecting the sensor.

Jon
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Adding hysteresis to solar tracker
« Reply #2 on: March 11, 2021, 08:03:42 pm »
Actually, the sun is one of the more predictable things in our lives.
Right now it's at 54.1° elevation and 184.7° azimuth for me.
It's also cloudy and I'm sure that would play havoc with any simple photo detector.
Even the crummiest µC today can do the math to figure out where the sun is.
Yes, there is a lot of math (equation of time, etc), but you can check your implementation against an online calculator.
 
The following users thanked this post: Siwastaja

Offline liviu.geleaTopic starter

  • Contributor
  • Posts: 29
  • Country: ro
Re: Adding hysteresis to solar tracker
« Reply #3 on: March 11, 2021, 10:35:14 pm »
Thanks guys. uC it is then.
Your point about figuring out sun position is a great one,  but I was hoping to avoid absolute positioning since I'm not using servos. Now the 12v polulu motor I have does come with an encoder so perhaps I can use discrete movements with some feedback from a current sensor which measures panel output?  I'm thinking... sending the panel forward until current starts dropping and then just pausing until sun catches up. Rinse and repeat. Of course I would have to take some details into  account, such as clouds.
Or i might even do some "focus seeking"mhe way cheap digital cameras do, get  and then estimate sun ascension based on internal clock. Or just go blind and do some correction from time to time via current sensing, or perhaps just use those sensors and add some IC after that....
So many options...
 

Offline jmelson

  • Super Contributor
  • ***
  • Posts: 2779
  • Country: us
Re: Adding hysteresis to solar tracker
« Reply #4 on: March 12, 2021, 12:09:56 am »
You could have the panel home to a limit switch every night, and then count steps during the day.  When the sun is strong, it could read the photosensor for best tracking, and when cloudy it could compute sun position and put it close by computation.

Jon
 

Offline liviu.geleaTopic starter

  • Contributor
  • Posts: 29
  • Country: ro
Re: Adding hysteresis to solar tracker
« Reply #5 on: March 12, 2021, 11:54:30 pm »
Just an update
I built a prototype. It seems i didn't take the photoresistor resistance curve into account. So even if I trim it for a certain light level, at different light levels it's again off balance. I can minimize the effect by using more photoresistors  but then I don't know what effect time and UV exposure will have on the devices. I think I will create a calibration curve using a current sensor in the solar panel and compensate in the microcontroller.
 

Offline rfclown

  • Frequent Contributor
  • **
  • Posts: 412
  • Country: us
Re: Adding hysteresis to solar tracker
« Reply #6 on: March 13, 2021, 12:39:47 am »
I knew a guy who updated the electronics for a solar tracking system in a large array of parabolic reflectors in the 1980's. The old system used four (I think) light sensors on each dish to track the brightest point. The system had trouble with clouds and reflections. His system made the dishes point to where the sun was (like Renate suggests). It worked well.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3275
  • Country: gb
Re: Adding hysteresis to solar tracker
« Reply #7 on: March 13, 2021, 10:46:16 am »
Just an update
I built a prototype. It seems i didn't take the photoresistor resistance curve into account. So even if I trim it for a certain light level, at different light levels it's again off balance. I can minimize the effect by using more photoresistors  but then I don't know what effect time and UV exposure will have on the devices. I think I will create a calibration curve using a current sensor in the solar panel and compensate in the microcontroller.

Presumably you have each photoresistor on a separate ADC channel?  Explaining how you are performing your calculations in the micro, or even showing the code would be useful.

If you are looking at difference in ADC counts between the two photoresistors and comparing to a fixed deadband value, then your deadband will vary considerably with absolute light level.  Instead you should normalise the difference term using the sum term e.g.

Error = (ADC1-ADC2)*k/(ADC1+ADC2)

Where k is some scaling factor, assuming you are using integer math rather than floating point.  This will make the error term independent of total light level.
 

Offline liviu.geleaTopic starter

  • Contributor
  • Posts: 29
  • Country: ro
Re: Adding hysteresis to solar tracker
« Reply #8 on: March 14, 2021, 01:20:55 pm »
I have just built the original circuit in the attached diagram. It's not connected to a uC yet so no adc. But the issues are the same.
Take a light level of W:
photoresistor A has resistance 10kOhm
photoresistor B has resistance 9kOhm.
Increase light level to 2W and the values are
hotoresistor A has resistance 6kOhm
photoresistor B has resistance 4kOhm.
So, ADC or not, the ratio between tje two is not guaranteed to be constant at different light levels.
1193666-0
In other words, in complete darkness the circuit is 100 sure it needs to veer left :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf