author
1Instructables19,340Views18CommentsJoined February 24th, 2008

Tell us about yourself!

Complete Your Profile

Achievements

10K+ Views Earned a bronze medal
  • gmartin2000 commented on GreatScottLab's instructable DIY Miniature Solar Tracker6 months ago
    DIY Miniature Solar Tracker

    The PV cell doesn't have multiple outputs such that you can use the "Shadow on a sensor" method used here.

    I'm not sure cost reduction would be the actual target here. Complexity reduction in both hardware and firmware would be the real targets. I think three sensors would be the minimum number. Two for azimuth control and the third for altitude: Keep the two azimuth sensors fully lit then just dither the altitude sensor from fully lit to into shadow. Since the solar panels will be most efficient to within about plus or minus 5 degrees of center, you'll only need to go through the control loop about every 5 minutes or so (Number approximate - I leave it to the reader to determine efficiency angles and solar movement).Then again, if you REALLY want to get minimized, two sensors and one servo would be needed. Azimuth would be controlled by the two sensors and servo while the altitude would be...

    see more »

    I'm not sure cost reduction would be the actual target here. Complexity reduction in both hardware and firmware would be the real targets. I think three sensors would be the minimum number. Two for azimuth control and the third for altitude: Keep the two azimuth sensors fully lit then just dither the altitude sensor from fully lit to into shadow. Since the solar panels will be most efficient to within about plus or minus 5 degrees of center, you'll only need to go through the control loop about every 5 minutes or so (Number approximate - I leave it to the reader to determine efficiency angles and solar movement).Then again, if you REALLY want to get minimized, two sensors and one servo would be needed. Azimuth would be controlled by the two sensors and servo while the altitude would be manually reset about every two weeks.The divider between the sensors would be three walled forming an upside down "T" for the three sensor model and a simple vertical wall for the two sensor model.

    The system can be very efficient if the positioning loop is executed once about every 15 minutes and then put to sleep during the delay. The servos don't need to be run continuously (that really reduces their life). They only need to be run long enough to position the panel.And yes, it is very efficient since this circuit will use only about 100ma when driving the servos. If you execute the control loop every 15 minutes and urn of the servos and go to sleep between loops you can really increase the efficiency! Assume 10 seconds to position and do this four times an hour. That's 100ma for 40 seconds out of an hour. or about 1.1mah current draw. If you're using a small 100mah panel, that's a pretty high efficiency there alone. Image what the effivc=ciency will be with a 10watt panel!

    Yeah, so there is a special place in wherever for people that don't comment their code ;) Having said that, it looks like the coder is trying to "BitBang" the servo positions (which considering the slow speed of apparent solar motion, isn't really needed here - but hey, people try to get "style points" with this type of coding - net result, negative points for posting uncommented cryptic code in an instructable).There's a whole Arduino library for servos that works just as good and is very well documented. What happens with servos is they position themselves based on pulse widths received at their input. I'm not really going to go into detail here. Plenty of documentation elsewhere on the web and in Arduino example code.Pins 9 & 10 can be used for PWM control of ...

    see more »

    Yeah, so there is a special place in wherever for people that don't comment their code ;) Having said that, it looks like the coder is trying to "BitBang" the servo positions (which considering the slow speed of apparent solar motion, isn't really needed here - but hey, people try to get "style points" with this type of coding - net result, negative points for posting uncommented cryptic code in an instructable).There's a whole Arduino library for servos that works just as good and is very well documented. What happens with servos is they position themselves based on pulse widths received at their input. I'm not really going to go into detail here. Plenty of documentation elsewhere on the web and in Arduino example code.Pins 9 & 10 can be used for PWM control of various things including servos. So that takes care of the "Pin 9/Pin 10" lines of code.Next up is the code that controls the internal registers that drive the PWM functions of Pin 9 & Pin 10. The names TCCR1A, TCCR1A, TCCR1B, ICR1, CR1A, OCR1B are built-in control registers that are manipulated to generate a pulse width that drives the servos to specific locations. You'll have to study the MicroChip Microcontroller manual to understand how these registers work and how they interact to create a pulse train sufficient to cause controllable operation of the servos.As for the constants COM1A1, COM1B1, WGM11, WGM13, WGM12, and CS11, I don't have a clue what they are. They are probably defined in some underlying Arduino module - The hunt is on!For the remainder of the code, it's just some kind of manipulation of values to write to the OCR registers to change the pulse width according to the photoresistor values. I have seen some caveats about using the keyword "DELAY" when driving Servos. It has to do with the base timer being used by both the internal clock and the PWM code. This would need to be looked into to make sure some kind of conflict isn't taking place.I'm also not much of a fan of using raw, unaveraged, noncalibrated values from photoresistors like this.It's a start for a "Proof of concept" but the code needs significant improvement for reliable, stand-alone long term operation.

    View Instructable »