Shop OBEX P1 Docs P2 Docs Learn Events
Solar Tracker - First Project — Parallax Forums

Solar Tracker - First Project

NewbieNewbie Posts: 5
edited 2008-06-17 16:29 in Robotics
Hi everyone, I've had my BS2 for 2 days now and was playing around today and made a solar-type tracker that finds the brightest light and stops.
I know it's not much but I'm happy it works at all considering this is my second day.· My formulas are rusty so if anyone knows a way to have it search for the brightest light without a predefined variable I'd appreciate the help.· I'm always open to suggestions and look forward to meeting everyone on the boards.· I've attached my code and a pic.
480 x 360 - 53K

Comments

  • dechief micheldechief michel Posts: 75
    edited 2006-04-30 07:33
    Hello, your project is very interesting but I invite you has to read "Experiment with renewable energy".Also if you looks on the
    " SANDBOX "you will see that this could become much more complex.
    Friendships, Michel

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards from Belgium,
    Michel Dechief.
    Engineer and professor at Brussel's university (artificial intelligency)
  • Pezi_Pink!Pezi_Pink! Posts: 32
    edited 2006-04-30 09:17
    Hi!

    Excellent first little project – do you have any further plans for it? Perhaps you could invert its operation and make it find the darkest spot for fun

    On the programming side, you asked if there was a way to do this without using a pre-defined variable? I think it’s better off staying with the variables, this way you can easily adjust the sensitivity (based on your original program)

    In your bunch of IF statements you check some stuff that you don’t need to. For example the first check is if quality < 10, then the second check is if quality >10 and <20. Well you don’t need to check if quality is < 20 here, you could just do this which has the same effect as you can see:

    IF quality <= 10 THEN catchall
    IF quality >10 THEN adjust = good
    IF quality >20 THEN adjust = fair
    IF quality >30 THEN adjust = poor
    
    



    Another little point, in your program if the value is 10,20 or 30 then the program won’t know what to do and just use the last value of ‘adjust’ in the loop, as the < > operators check for a value greater than or less than but not equal to. You can use >= and <= (greater than or equal to / less than or equal to) to be inclusive of the value if you want to (like above), and by removing the redundant checks (like above) this will allow the program to set ‘adjust’ to the next appropriate value rather than not doing anything. You can also wrap these all into one big if statement, like this, which is more effecient:

    IF quality < 10 THEN 
      'note this is only values 9 and under
      GOTO catchall
    ELSEIF quality < 20 THEN 
      'this will catch 10
      adjust = good
    ELSEIF quality < 30 THEN 
      adjust = fair
    ELSEIF quality >=30 THEN 
      adjust = poor
    ENDIF 
    
    



    And ultimately swap in the variable names instead of the values so you can simply change the initial variable values to affect the whole sensitivity, something like this

    IF quality < good THEN 
      GOTO catchall
    ELSEIF quality < fair THEN 
      adjust = good
    ELSEIF quality < poor THEN 
      adjust = fair
    ELSE
      'this will be any other value above poor
      adjust = poor
    ENDIF 
    
    



    One other little thing, although space is not an issue at all here, most the variable types could quite easily be reduced to a byte instead of a word. A byte will hold a value up to 255 which is easily sufficient for your purpose, a word variable can hold up to 65535 which is way more than you are using except in ‘range’! In fact for the good / fair / poor you could just replace these with a CONstant value instead of having them as variables if you don’t intend the program to change them at all.

    Nice work though, glad you are having fun! (and nice solar panel btw smile.gif )

    Ans as Michel says, do some reading and you will see this could become much more complex!

    Pezi
  • dechief micheldechief michel Posts: 75
    edited 2006-04-30 11:32
    Hello still,
    you reflected on the fact that the sun moves on 2 axes(est towards west according to the hour but towards south or north according to the season). Friendships, Michel

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards from Belgium,
    Michel Dechief.
    Engineer and professor at Brussel's university (artificial intelligency)
  • NewbieNewbie Posts: 5
    edited 2006-04-30 14:36
    Thank you all for your replies... I do realize this could be much more complex and I'm sure I will upgrade it several times.· I just wanted to get a feel for some code and something that I found "fun" at the same time.· I do plan on eventually adding a North / South axis as well.· Ideally I would like to find a way to import an azimuth table based on Lat / Long that would "track" the sun whether is was actually a sunny day or·cloudy.· Regarding the VAR Word, I used word simply because outdoors my quality values could be much higher, currently I'm getting low values based on the fact that I have a 60 watt light bulb not more than 14 inches from the tracker.· But thank you all for your suggestion :-) it's great hearing from you.
  • GadgetmanGadgetman Posts: 2,436
    edited 2006-04-30 15:44
    A suggestion...

    Mount it on an axle that is parallell with the Earth's own axis. That will more or less keep it pointing at the sun with no complicated mechanics.
    (If you don't consider summer/winter deviations, which can easily be adjusted by a small motor and a table of adjustment values, which again will demand a working calendar and... and... )

    One way of increasing accuracy and therefore what is collected by the solar panel is to add another sensor, but at a few degrees angle from the first.
    Then you can compare values to find the direction to rotate the panel.
    (Will need a bit of 'inertia' built into the program or it might end up vibrating as the system constantly adjusts the position)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • SciTech02SciTech02 Posts: 154
    edited 2006-04-30 21:03
    Very good.· I had a similar idea, but it would be on a·much larger scale and it would have a tilt too.· Good job. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There is always an answer.

    There is always a way.
    There is always a reason.··· -SciTech02.
  • dechief micheldechief michel Posts: 75
    edited 2006-04-30 21:37
    Tracking sun is easy if you use photoresistor(a lot of for)one for north, one for sud, one for east, one for west.
    Easy to do when resistor are into a tube

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards from Belgium,
    Michel Dechief.
    Engineer and professor at Brussel's university (artificial intelligency)
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2006-04-30 22:38
    I have used a "tube" method as dechief michel describes, using
    small 1"x2" solar cells as the sensors. Basically, the idea with a
    tube is that if you are not pointing directly at the sun, then at least
    one of the sensors will have a shadow of the tube cast upon it.

    If you have 2 sensors per axis mounted 180 deg apart from one
    another adjacent to the axis of interest. A simple comparator circuit
    can be used to determine the equality of the sensors, and then based
    on the comparison, you move your solar collector accordingly.

    Here is an example of what a 2 axis sensor would look like.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    518 x 272 - 32K
  • Jim RicheyJim Richey Posts: 82
    edited 2006-05-01 12:47
    Nice work,newbie!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thanks, Parallax!
  • RinksCustomsRinksCustoms Posts: 531
    edited 2006-06-29 03:50
    Nice work newbie, is that one of those new flux-matrixed-positron-cored solar pannels? lol j/k For day #2 that's great. You could take something like those lil cone shaped water cups, lay it down, flaten it (use your imagination), paint it black, stick it to a photo resistor and orient the small side of the cone toward the sensor. Make two sensors like this, tape them together like this "||", and tape the sensor side together so that the two cups are at a slightly different angles.

    Then you can use the RCTIME comand with a sweeping motion on the servo to determine the brightest part of the sweep. Then adjust the center PWM of the servo to hold that position.

    Notice that it took more effort to describe the making of the sensor housing than it did the coding involved, that's how easy it is to use! Enjoy discovering and experimenting with this powerful tool!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Definetly a E3 (Electronics Engineer Extrodinare!)
    "I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2006-06-29 04:29
    Good work Newbie,
    ·
    Do you have any follow-up news on your project?
    ·
    ·
    Just an FYI, you may find this interesting.· I was digging around and cleaning up·some disk space on an old computer,
    and came across an old solar project that I was working on a few years back.· This design used a 3 foot x5 foot parabolic
    trough to focus the sun onto a 3/4 inch·diameter·pipe (painted flat black in picture) which also serves as one of the
    gimbaled axis.· This was used to pre-heat water·into a 20 gallon re-circulating hot water heater.
    ·
    ·
    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    1200 x 950 - 262K
    783 x 462 - 6K
    834 x 661 - 11K
    745 x 571 - 9K
    372 x 567 - 4K
  • steve_bsteve_b Posts: 1,563
    edited 2006-06-29 13:39
    Very cool Beau.

    how well did it work?
    Do you have a picture of the whole thing (didn't think I saw a water pipe there)....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2006-06-29 15:49
    steve_b,
    ·
    This actually worked pretty well.·· As a test along the way... I·closed one end (the bottom) and poured water (about 1 cup) into the top end of the pipe, after about 15-20 min the water
    started to·boil, steaming out the top of the pipe.
    ·
    Sorry, I don't have any more pictures.· The water pipe is the black vertical; better seen in the right image.· It is actually stationary to the reflector and also acts as a pivot axis for
    the reflector.· When laying out the parabola, I used a 1/4 rule which works out so that what ever width you have, if you use 1/4 of that for your depth then your focal point will be the
    center of your width at the top.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    887 x 433 - 60K
  • steve_bsteve_b Posts: 1,563
    edited 2006-06-29 17:22
    Sounds interesting....wonder what the flow/temp readings would be!

    OFf topic...but got me thinking!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-06-29 19:06
    Beau,

    The hacker in me loves the use of the cordless screwdrivers for motors, clamped into the angle parts [noparse]:)[/noparse]

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2006-06-29 20:16
    Ryan,

    Sorry to "hijack" this thread.... Not sure where Newbie went. ....But perhaps there is some motivation in there somewhere for a BS2 controlled version.

    "The hacker in me loves the use of the cordless screwdrivers for motors, clamped into the angle parts"
    Ummmm.... it's a poor-mans compression fit sleeve smilewinkgrin.gif

    I always keep an eye out for “clearance sales” on cordless screwdrivers for robotic type applications.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • bennettdanbennettdan Posts: 614
    edited 2006-07-01 21:42
    Beau,
    I have been thinking about building a simular device and focuse it on a stirling engine and spin a generator. Do you mind telling me where you got the parabolic material?
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2006-07-01 22:27
    To form the parabolic curve, I wrote a simple computer program that indicated the proper position to 1/16th of an inch. With this I constructed "ribs" spaced every 5
    inches or so. I secured a thin (about 1/64th of an inch) flexible plastic to the ribs... over the thin plastic I used 2 inch wide adhesive foil tape used in air-conditioning
    duct work. ....If I had to do again, I would select something much more reflective. I'm also a cheapskate so I would use something such as the inside liner of a chip
    bag ... a little 77spray adhesive and a spoon to work out the bubbles and your in business.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • CJCJ Posts: 470
    edited 2006-07-01 22:38
    looks like it is one of those reflective mylar emergency blankets

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Who says you have to have knowledge to use it?

    I've killed a fly with my bare mind.
  • bennettdanbennettdan Posts: 614
    edited 2006-07-02 02:28
    I might try one of the mylar blankets I have a couple here I also have a friend in the glass business that might get me some broken peices of mirror.
  • PLJackPLJack Posts: 398
    edited 2006-07-05 22:54
    First off, Newbie great first project!

    Beau,
    said...
    and came across an old solar project that I was working on a few years back

    You "came across" a 1300W Collector!?
    What else do you have "hanging" around the house. [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.
  • khaikhai Posts: 1
    edited 2008-06-16 14:12
    Hi Newbie,

    I have a my BS2 kits and still learning.
    I'm current a student and I have an idea for my school project similar like yours.· To start out with the project,
    I would like to make it small where I'm able to gather enough energy and which allow me to use SOME KIND OF EQUIPMENT
    that would boil the water.· If successful, I will use it as for a larger project like the water heater.

    I would really appreciate if you could draw out the schematic and post a clear design so a rookie like me can learn.·

    Program codes would be very helpful too.

    Thanks
  • Robert AshRobert Ash Posts: 6
    edited 2008-06-17 16:29
    I have converted a Sat dish using plain foil. We placed a 12" square of corrugated in the focal and it burst into flames, witnessed in photo and other examples at http://groups.yahoo.com/group/RNA_Craftshop/ Feel free to comment on my text in the files section. http://f1.grp.yahoofs.com/v1/gN9XSPIDuIw-2CMnQmwTW2B23OoGuEVv9L69JUV9i07k3y19ThftSnqZ5GrrkJ9wZEOwqjZnon-wkt5r0DRz2A/AA - My energy concepts.txt

    Robert
    NDBGA
Sign In or Register to comment.