Adding hysteresis to solar tracker - Page 1
Forum section: electronics / beginners

author: liviu.gelea
author_rank: Contributor
timestamp: March 11, 2021, 03:59:04 pm
content: 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 angleThe 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/yc6gkbvkBy 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 littleSOIs 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?

author: jmelson
author_rank: Super Contributor
timestamp: March 11, 2021, 07:06:40 pm
content: 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

author: Renate
author_rank: Super Contributor
timestamp: March 11, 2021, 08:03:42 pm
content: 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.

author: liviu.gelea
author_rank: Contributor
timestamp: March 11, 2021, 10:35:14 pm
content: 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...

author: jmelson
author_rank: Super Contributor
timestamp: March 12, 2021, 12:09:56 am
content: 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

author: liviu.gelea
author_rank: Contributor
timestamp: March 12, 2021, 11:54:30 pm
content: Just an updateI 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.

author: rfclown
author_rank: Frequent Contributor
timestamp: March 13, 2021, 12:39:47 am
content: 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.

author: mikerj
author_rank: Super Contributor
timestamp: March 13, 2021, 10:46:16 am
content: Quote from: liviu.gelea on March 12, 2021, 11:54:30 pmPresumably 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.

author: liviu.gelea
author_rank: Contributor
timestamp: March 14, 2021, 01:20:55 pm
content: 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 10kOhmphotoresistor B has resistance 9kOhm.Increase light level to 2W and the values arehotoresistor A has resistance 6kOhmphotoresistor B has resistance 4kOhm.So, ADC or not, the ratio between tje two is not guaranteed to be constant at different light levels.In other words, in complete darkness the circuit is 100 sure it needs to veer left