solar tracker controller


Closed Thread
Results 1 to 40 of 42

Hybrid View

  1. #1
    CIRE's Avatar
    CIRE Guest

    Smile solar tracker controller

    hello to all in the forum!
    I'm new here in the forum and starter in this picbasic programming. please anyone could help me to rewrite this code.
    I just added this two lines to the original code and it won't work.
    the portb.0 and portb.1 connected to the H bridge.
    Code:
    if PORTA.1 = 0 then face_east   'limit switch1 
    if PORTA.2 = 0 then hold     'limit switch2      
    
    ****************************************************
    
    @ DEVICE PIC16F84,WDT_ON,PWRT_ON,PROTECT_OFF
    INCLUDE "bs1defs.bas"
    
    start:
    low PORTB.0            'pin portb.0 low 
    low PORTB.1            'pin portb.1 low 
    Pot PORTB.2,255,b0        'read first cds sensor
    pot PORTB.3,255,b1        'read second cds sensor
    
    
    if b0 = b1 then start        'if equal do nothing
    if b0 > b1 then greater    'if greater, check how much greater
    if b0 < b1 then lesser    'if lesser, check how much lesser
    
    if PORTA.1 = 0 then face_east   'limit switch1
    if PORTA.2 = 0 then hold       'limit switch2
    
    greater:            'greater routine
    b2 = b0 - b1        'find the difference
    if b2 > 10 then cw        'is it within the range? if not go to clockwise/ solar panel facing west
    goto start            'if it is in the range,do it again
    
    lesser:                            'lesser routine
    b2 = b1 - b0                    'find the difference
    if b2 > 10 then ccw          'is it within the range? if not got counter clockwise/solar panel facing east
    goto start                   'if it is in the range, do it again
    
    cw:                          'turn the motor shaft clockwise / solar panel facing west
    high PORTB.0                 'pin portb.0 high / facing west
    pause 100                    'let it turn for the moment
    goto start                   'check again
    
    ccw:                         'turn the motor shaft counter clockwise/ solar panel facing east
    high PORTB.1                 'pin portb.1 high/ solar panel facing east
    pause 100                    'let it turn for the moment
    goto start                   'check again
    
    face_east:                   'facing east
    low PORTB.0                  'pin portb.0 low  /stopping the solar panel for moving
    low PORTB.1                  'pin portb.1 low  / stopping the solar panel for moving
    sleep 14400                  'wait for 4 hours 
    high PORTB.1                 'pin portb.1 high /solar panel back facing east ready for next day sun shine
    sound PORTB.4,[124,12000]    'tone
    pause 1000                   'wait for 1 sec
    goto start                   'check again
    
    hold:                        '
    low PORTB.0                  'pin portb,0 low / stopping the solar panel for moving
    low PORTB.1                  'pin portb.1 low / ----- do ----
    sleep 3600                   'wait for 1 hour 
    goto start                   'check again
    end
    'Copied from pic microcontroller project book by John Iovine
    Last edited by ScaleRobotics; - 1st March 2011 at 16:18. Reason: added code tags

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    For starters CIRE what is the code not doing? Next, what are the settings for PORTA? Input or Output?

    Dave Purola,

  3. #3
    CIRE's Avatar
    CIRE Guest


    Did you find this post helpful? Yes | No

    Default solar tracker controller

    hello Dave!
    The PortA.1 and PortA.2 is the input which is connect to a limit
    switch. Pulled up by 10 Kilo ohms, when PortA.2 is in 0/ground, it should be stop. After 4 hrs. it will turn back to original position(panel facing east). PortA.1 is also a limit switch,on reverse function. The original title of this code is Light tracker and it's working well, when I added the line . won't work anymore.
    " if PORTA.1 = 0 then face_east 'limit switch1"
    " if PORTA.2 = 0 then hold 'limit switch2 "
    Yes, the code compiled in Picbasic Pro 2.44

  4. #4
    anj's Avatar
    anj Guest


    Did you find this post helpful? Yes | No

    Default

    Gday CIRE
    One possible problem and one definite.

    ...................
    Pot PORTB.2,255,b0 'read first cds sensor
    pot PORTB.3,255,b1 'read second cds sensor


    if b0 = b1 then start 'if equal do nothing
    if b0 > b1 then greater 'if greater, check how much greater
    if b0 < b1 then lesser 'if lesser, check how much lesser

    if PORTA.1 = 0 then face_east 'limit switch1
    if PORTA.2 = 0 then hold 'limit switch2
    .......................

    1) possible
    in yr above code, if bo=b1 you will loop endlessly. Try getting an LCD to output the actual bo and b1 values, to see what you are actually getting

    2) definite
    The three "if B0.. " lines cover all options, and result in branches to other labels in the program
    as such the two lines you added can never be reached and therefore will never be executed. Hence have no effect on basic program you started with.
    Andrew

  5. #5
    CIRE's Avatar
    CIRE Guest


    Did you find this post helpful? Yes | No

    Question solar tracker controller

    Hello there Andrew!
    Thank you for your response and I am tried to get the idea.Well
    I have 1 week to go for the coming 2m & 70cm DXing contest. Enclosed the schematic diagram. Surely when I turn to 60yrs. I'm
    expert in this like the others and you,hi hi hi.
    Attached Images Attached Images  

  6. #6
    Join Date
    Oct 2013
    Posts
    1


    Did you find this post helpful? Yes | No

    Default Re: solar tracker controller

    Quote Originally Posted by CIRE View Post
    Hello there Andrew!
    Thank you for your response and I am tried to get the idea.Well
    I have 1 week to go for the coming 2m & 70cm DXing contest. Enclosed the schematic diagram. Surely when I turn to 60yrs. I'm
    expert in this like the others and you,hi hi hi.

    hello friend,
    pls send me the code for solar panel tracking system, this is my mail id ([email protected])

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: solar tracker controller


  8. #8
    anj's Avatar
    anj Guest


    Did you find this post helpful? Yes | No

    Default

    Gday Cire
    60? whats that.
    Looking at yr diag, i assume the limit switches are used to set the amount of travel for the tracker.
    So operation would be

    start pointing east
    track sun during day
    when hit west limit switch stop tracking and wait for sun to go down
    quickly slew back to east until hit east limit switch
    wait until light again
    repeat process

    if this is the case i would do this
    move the new call to stop tracking so it is checked before anything else
    delete the other call to "hold" routine
    ................
    start:
    low PORTB.0 'pin portb.0 low
    low PORTB.1 'pin portb.1 low

    if PORTA.1 = 0 then face_east 'limit switch1 <- move to here

    Pot PORTB.2,255,b0 'read first cds sensor
    pot PORTB.3,255,b1 'read second cds sensor
    ................
    modify new routines

    face_east: 'facing east
    low PORTB.0 'pin portb.0 low /stopping the solar panel for moving
    low PORTB.1 'pin portb.1 low / stopping the solar panel for moving
    sleep 14400 'wait for 4 hours
    high PORTB.1 'pin portb.1 high /solar panel back facing east ready for next day sun shine

    'Add this next bit to wait until east limit switch closes
    ' dont go back to start, do all here
    hitsw:
    if PORTA.2 = 1 then hitsw 'loop until you have hit the switch
    'note, now use = 1, ie while sw is open, just keep slewing until it closes
    low PORTB.0 'pin portb,0 low / stopping the solar panel for moving
    low PORTB.1 'pin portb.1 low / ----- do ----
    sound PORTB.4,[124,12000] 'tone

    sleep 3600 'wait for 1 hour
    goto start 'check again
    end

    Andrew
    Last edited by anj; - 26th March 2004 at 22:24.

  9. #9
    CIRE's Avatar
    CIRE Guest


    Did you find this post helpful? Yes | No

    Question Solar tracker controller

    Hello Andrew!
    60yrs? Hmmm.. When I reach 60 years old, might be an expert on this field like the others and you!
    You got the idea on two limit switch'coz the Solar Panel frame I've made is limit to 45 degrees east and 45 degrees west.
    Disregarding the
    "if b0 = b1 then start 'if equal do nothing
    if b0 > b1 then greater 'if greater, check how much greater
    if b0 < b1 then lesser 'if lesser, check how much lesser
    and other supporting lines will turn the motor on high speed
    back and fort direction. The idea of like "SUN Flower" makes no sense at all. What do you think? (pardon my bad english)

  10. #10
    ultimatekiller's Avatar
    ultimatekiller Guest


    Did you find this post helpful? Yes | No

    Default

    Hi all,
    I m a new member... and i m now doing a same project too... named "PIC microcontroller solar tracker"... Does anyone has the circuit or schemetic of the solar tracker?? and some explanation of the circuit?? i need that badly... Thx...


    Regards,
    Ultimate Killing Machine

  11. #11
    Join Date
    Mar 2011
    Posts
    6


    Did you find this post helpful? Yes | No

    Smile Re: solar tracker controller

    hello
    can anyone check my proramming
    i am doing the same project.....

    solar tracker
    pic 16f877
    2cds with dc motor


    Code:
    v1 var byte                       'variable v1
    v2 var byte                       'variable v2
    v3 var byte                    'variable v3
    
    
    TRISA = 1                       'Set all PORTA pins as inputs
    TRISc = 0                     'Set all PORTc pins as outputs
    
    start:
    
    pot porta.0,255,v1             'Read 1st CdS Sensor (east)
    pot porta.1,255,v2            'Read 2nd CdS Sensor (west)
    
    if v1 <= 230 then skp        'start program
    if v2 > 230 then slp        'is it dark enough to sleep? (sleep mode)
    
    skp:
    if v1 = v2 then start        'If equal, do nothing
    if v1 > v2 then greater        'If greater, check how much greater
    if v1 < v2 then lesser        'If lesser, check how much lesser
    
    greater:                    'Greater routine
    v3 = v1 - v2                  'Find the difference
    if v3 > 10 then cw             'Is it within range? If not, go to cw
    goto start                    'In range do again
    
    lesser:                        'Lesser routine
    v3 = v2 - v1                'Find the difference
    if v3 > 10 then ccw            'Is it within range? If not, go to ccw
    goto start                    'Do again
    
    slp:
    low portc.0                       'stopping the solar tracker for moving 
    low portc.1                    'stopping the solar tracker for moving
    goto start 
    
    cw:                            'Turn the sensor array clockwise
    high portc.o                  'Turn on h-bridge
    pause 100                     'Let it turn for a moment
    goto start                    'Check again
    
    ccw:                         'Turn the sensor array counter clockwise
    high portc.1                   'Turn on h-bridge
    pause 100                     'Let it turn a moment
    goto start                    'Check again
    
    end
    Last edited by ScaleRobotics; - 1st March 2011 at 16:19. Reason: added code tags

  12. #12
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: solar tracker controller

    Muzakyo, I don't see where the motor is commanded to stop.. Must operate like a windshield wiper unless it's asleep?

    Dave Purola,
    N8NTA

  13. #13
    Join Date
    Mar 2011
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Re: solar tracker controller

    i am a newbie in pic......

    but from the proramming the motor will run for a certain time (100 miliseconds) and then it will get back in the start loop....

    for the motor i am not sure.... but when i compile it there are no problems.

    did i need to do like the slp: programming..?

    for this program i refer to the pic microcontroller project book by John Iovine and pic robotic : a beginner's guide to robotic by john iovine... (first post)

  14. #14
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: solar tracker controller

    muzakyo, I don't see anywhere in your code that you are stopping the motor if your system is "on target". You need to place some kind of DEAD BAND limits that are within the ON TARGET criteria. I mean +- so many counts... You should have at least 4 states, 1 for sleep (waiting for next morning), 1 for going east, 1 for going west and 1 for stop during the day when system is on target.

    Dave Purola,
    N8NTA

  15. #15


    Did you find this post helpful? Yes | No

    Default Re: solar tracker controller

    hello can anyone uplode the programme for single axis solar controller pl...................

  16. #16
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: solar tracker controller

    http://www.scalerobotics.com

  17. #17


    Did you find this post helpful? Yes | No

    Default Re: solar tracker controller

    post the entire reports.....including circuit desgin and value of resistors and all plz..............(solar tracker)

  18. #18
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: solar tracker controller

    Quote Originally Posted by manjunath000 View Post
    post the entire reports.....including circuit desgin and value of resistors and all plz..............(solar tracker)
    He does post the schematic. The resistors look to just be pull ups. Pick a good pullup value, and you should be good. Most people don't post their board drawings, but I suppose it doesn't hurt to ask
    http://www.scalerobotics.com

  19. #19


    Did you find this post helpful? Yes | No

    Default Re: solar tracker controller

    Quote Originally Posted by manjunath000 View Post
    post the entire reports.....including circuit desgin and value of resistors and all plz..............(solar tracker)
    If you read the schematic, you will see in the bottom right hand corner that all resistors are specified as 10K, 1/4 watt

  20. #20
    Join Date
    Oct 2013
    Posts
    1


    Did you find this post helpful? Yes | No

    Default Re: solar tracker controller

    please send the programmming codes
    circuit pdf link is http://www.journalagent.com/z4/downl...un=PAJES-58538
    two axis automatic solar sun tracking using pic ic and stepper motors,pleasesend program c codes

  21. #21
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: solar tracker controller

    One more and you are off the board...

    Ioannis

  22. #22
    Join Date
    Oct 2016
    Posts
    1


    Did you find this post helpful? Yes | No

    Default Re: solar tracker controller

    please send me circute...

  23. #23
    artckp's Avatar
    artckp Guest


    Did you find this post helpful? Yes | No

    Default Re: solar tracker controller

    please send circuit solar tracker

Similar Threads

  1. Microstepper controller
    By aratti in forum Schematics
    Replies: 14
    Last Post: - 3rd January 2015, 16:52
  2. Replies: 14
    Last Post: - 6th March 2011, 05:08
  3. Replies: 2
    Last Post: - 14th July 2008, 22:11
  4. Fridge controller
    By nomad in forum General
    Replies: 4
    Last Post: - 23rd February 2008, 07:13
  5. Dedicated LCD Controller question
    By chuckles in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th February 2006, 14:44

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts