Shop OBEX P1 Docs P2 Docs Learn Events
Solar tracker project — Parallax Forums

Solar tracker project

littlej040littlej040 Posts: 6
edited 2008-06-18 19:54 in Propeller 1
Hello all,

Im new to the forums, and had a few questions based on the parallax proto board. For my senior design project im working on a Solar Tracker, that is using 2 LDR's to sense the change in light dependant on the direction of the panel. We are using the LTC1298 A\D to feed digital data into the microcontroller. Right now our current concern is how to effectively use the change in resistance, and be able to distinguish which resistance equates to which direction the panel needs to move. We are using a Zex servo motor as our drive of the panel. Is a comparator circuit the way to go? Or is there a simpler solution to getting the change of the two resistances?

thanks,
jeff

Comments

  • RaymanRayman Posts: 14,233
    edited 2008-06-16 20:03
    I think you could just code a comparitor instead of using some external circuit...

    Personally, I think I would just calculate the solar angle based on longitude/latitude and time...
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-06-16 20:07
    I envy you Jeff. I'll be doing my senior design project in a couple of years, but can't wait to start.

    I assume you are designing the LDR's like this...
    http://www.doctronics.co.uk/ldr_sensors.htm

    From what you've said, this sounds pretty simple. Can't you just make an algorithm that goes like this:
    Move panels left
    Check Resistance from LDR
    If Resistance increased(less light?)
    Move Panel back to the right
    If Resistance decreased
    Move Right again and repeat resistance/movement checking

    Bascially, the microcontroller makes the servo move in the direction that equates to more light, right? Motion control is fun, but doing Maximum Power Point Tracking is even more fun. I'm doing that right now. With MPPT, you are bascially matching the best load to your solar panel, dynamically. I'll post a link to a thread I did.
  • GreyBox TimGreyBox Tim Posts: 60
    edited 2008-06-16 20:54
    Hi Jeff,

    If you are getting a numerical input from the Linear ADC, you should be able to use the >/</= functions in "spin" to see which is larger. A simple register that sets the direction of the servo based on the result of the comparison's outcome would good (in case your motor or inputs are reversed). Based on the magnitude of the difference you can move your servo more (and faster).

    The same applies for a dc motor or a stepper motor. Whichever LDR is getting more light you more the motor in the direction of that sensor, if there is a lot more light on one side than the other it should move faster (like for sunrise - when the array tracker was pointing in the direction of the last sunset). If you add a variable hysteresis amount to the routine - it can allow the servo/motor/stepper to "sleep" when it is not needed to adjust the position of the array. This would prevent the actuator from "hunting" and using valuable solar power in the process...


    I do have to agree with Rayman's point though... Why not use a GPS or other time receiver to get the time? With GPS you get the lat/lon/Alt/Time - so you can calculate the angle/azimuth of the sun for a given calendar day and second, after a single calibration (array-base "heading", and the motor "transit" numbers) you could do an X/Y array tracker without the requirement for a clear day - as a light sesitive tracker may have trouble when the sky is over-cast (it creates a diffused light that can trick your LDR circuit...). If you accumulate the stationary GPS Lat/Long/Alt data over several weeks - the accuracy will go up a whole lot (accuracy down to a few centimeters/inches).


    -Tim
  • Jesse DruehlJesse Druehl Posts: 25
    edited 2008-06-16 21:07
    A few years ago I built a BEAM microcore based tracker. Super simple and it worked well. Attached is the schematic.
    237 x 376 - 3K
  • littlej040littlej040 Posts: 6
    edited 2008-06-16 21:11
    wow. thanks for such quick replies... I was considering the GPS system to track however, I have a limited amount of time to finish this project, as well as 4 other classes that im taking so i can graduate in August [noparse];)[/noparse].

    Can any of you point me in the direction on how to create a comparator within the uC? I'd love to use SPIN to its potential, as more than likely I'm going into this type of work after I graduate, namely DSP for audio and what not.

    This is my first crack at programming, and i already love the versatility this chip has

    >>Jeff
  • scottascotta Posts: 168
    edited 2008-06-17 13:41
    Jeff,

    Check this out :

    http://www.srrb.noaa.gov/highlights/sunrise/azel.html

    It would be even more impressive to know exactly where it its
    in advance. Also, you could dither the tracker to pick up the
    sweet spot (highest power point).

    Spin will make this task pretty easy. You can build a table of
    dates and times in a DAT section and feed them one by one
    into the algorithm to cross check them against NOAA.

    Scott
  • Sniper KingSniper King Posts: 221
    edited 2008-06-18 03:37
    You could do a simple LC circuit.· Using radioshack CDS cells you could charge a capacitor through a CDS cell for each side of a shadow panel.· Measure the pulse width for each cell and get a light/shadow reading and then turn the panel in the appropriate direction.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • littlej040littlej040 Posts: 6
    edited 2008-06-18 19:02
    hi again,

    So we have decided to design our project still using the LDR's and just using a simple voltage divider to output a voltage to the A\D. We've made a few conditional measurements in full sunlight to get our max and min impedances so that we can design a linear SCC circuit to provide the 0-3.3V out to the A\D. My concern now is how to find the "sweet spot" and how to code the propeller to adjust the panels location to maintain this value consistently. We're still tinkering with the servo motor as well, which is taking time, because i am not completely up to snuff on PWM to control it.. any more insight would be great thanks!
  • jazzedjazzed Posts: 11,803
    edited 2008-06-18 19:30
    I've controlled servos in two ways: 1) continuous rotation and 2) standard positioning.
    For a finely tuned position like you require, continuous rotation will not work.

    A standard servo (i.e. R/C control) for positioning is controlled by the PWM which will be centered with a positive pulse width of about 1.5ms. The "zero" portion of the cycle should be on the order of >= 2ms. As you change the positive pulse width length, the servo arm angle will change, so the angle becomes a simple ratio that can be easily adjusted to use degrees or radians. There are various objects you can use. The Servo4.spin being the simplest. I recommend not moving more servos simultaneously than necessary as you can cause a VCC voltage dip when too much current is drawn.

    Have you tried any experiments with an IR detector instead of LDR? Not trying to throw you off course, but IR might be more effective on a cloudy day ... I'm just guessing and have not done the experiment myself.

    I found an LDR I used on a project needs a very large resistor in the voltage divider. There are A/D circuits that can be made with Propeller and passive components; I've had little luck measuring small voltage changes with them though.

    I'm sure there are other useful and more verbose opinions you will find here.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • littlej040littlej040 Posts: 6
    edited 2008-06-18 19:40
    I might be mistaken, but I was planning on using a 1k resistor for the known resistance in my voltage divider. Our range of resistance (in full daylight) was between 60.5 ohms to 18 ohms depending on the direction the panel was facing. The LTC 1298 has an accuracy ( i think) using +5V for vcc equivalent to 0.0012V. Do you think this will be enough sensitivity using a 1k resistor? I will have to make some more measurements to make sure that this will work.
  • jazzedjazzed Posts: 11,803
    edited 2008-06-18 19:54
    Experiments are required of course in all conceivable product target conditions ... more than one or two [noparse]:)[/noparse] I suppose trying to find the sun is pointless if it's too dark outside. Also, don't forget the effects temperature has on components.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sign In or Register to comment.