Balloon Collaboration
November 13, 2018, 08:59:59 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: DaddyB, Larry and Dan are your administrators...Private message for any problems or issues with the Forum//barntekadmin
 
   Home   Help Search gallery Calendar Login Register  
Pages: 1 [2]
  Print  
Author Topic: SunTracker 2.2  (Read 6360 times)
DaddyB
Administrator
Full Member
*****
Posts: 144



View Profile
« Reply #15 on: September 12, 2009, 11:42:42 PM »

That new code did the trick!  It doesn't try to flip all the way West.  I only incorporated the code in the SunDown subRoutine.  I haven't used the new numbers yet for Duty Cycle. 
Now, to keep up with the Jonses, I guess I am gonna have to make the change you did, using direct drive.  I have been thinking of just putting the photo sensors on a small board and rotating it and leave the rest of the circuit on the proto board.  It would only need 3 wires to connect.  But that is next week's projects.
Logged
Larry
Administrator
Hero Member
*****
Posts: 1167



View Profile
« Reply #16 on: September 13, 2009, 12:48:57 AM »

Good, I am glad that worked for ya...  The new duty cycle numbers are only because I went to direct drive.  You will probably need to modify them for however you wind up building yours.  I also added an If...Then... statement so that if the tracker drives all the way west (like missing the sun), instead of just sitting there trying to drive more, it jumps to the SunDown routine, which will drive it all the way east and, if there is enough light, wil start searching for the light again. 

' Drive Servo
  Pwm_Change_Duty(DuCy+190)
  if DuCy=55 then
    goto SunDown
  end if


* code in red is new
Logged
DaddyB
Administrator
Full Member
*****
Posts: 144



View Profile
« Reply #17 on: September 13, 2009, 01:36:10 AM »

I will try that added code.

Here is a 15 second video showing going in the sundown mode.  It has been edited to reduce the file size.  I was wondering if yours acts this way.

                         Sundown Video
Logged
Larry
Administrator
Hero Member
*****
Posts: 1167



View Profile
« Reply #18 on: September 13, 2009, 02:22:52 AM »

Mine used to act like that, but when I added the extra code (in red) to the SunDown routine that zeros out some of the variables, then it started working better...  It quit driving so far west after waking up.
  *** Keep in mind - Duty cycle of 135 if full east for me.  It may be 80 for you ***

SunDown:
  Pwm_Change_Duty(135)
  delay_ms(1000)
  Pwm_Stop
  CurPos=-55
  PrevIerr=0
  PrevKerr=0
  PrevPos=CurPos

SDLoop:
  v2=adc_read(3) div 5
  if v2 > 130 then
    Pwm_Start
    Goto loop
  end if
  portb.0=0               'Turns off Both LEDs to
  portb.1=0               'indicate Sun Down, Shutdown mode
goto SDLoop
Logged
Larry
Administrator
Hero Member
*****
Posts: 1167



View Profile
« Reply #19 on: September 13, 2009, 02:44:03 AM »

Here is a video of mine doing the sundown routine.  TURN THE VOLUME DOWN.  Had the race going in the background and it is kinda loud.  hehe

Mine turns so far when it goes to sleep that the ambiant light sensor doesn't allow it to wake up just by turning then light back on, so I had to use a flahlight to wake it back up.  Notice how it drives straight to the light without overshooting when it wakes up.

SunTracker Clip

« Last Edit: September 13, 2009, 02:47:30 AM by Larry » Logged
DaddyB
Administrator
Full Member
*****
Posts: 144



View Profile
« Reply #20 on: September 15, 2009, 08:23:13 PM »

Here's my version of the Direct Drive.  Just finished it so with the cloudy weather haven't had a chance to try it in the sun.  It does, however, work very well inside ( using the 10k resistors, of course).
I am using your code for 180 deg rotation there seems to be no problems except the one you had with having to restart it with a flashlight.

Here is my picture:  Direct Drive
Logged
Larry
Administrator
Hero Member
*****
Posts: 1167



View Profile
« Reply #21 on: September 15, 2009, 09:11:01 PM »

I haven't done it with mine yet, but I believe if you were to mount you ambiant light sensor on your proto board so it doesn't move with the servo, you probably won't have the trouble of haveing to use the flashlight to wake it back up.  Since the program set ComLin=130 (or what ever yours is equal to) you are not comparing the two semsors anymore. the ambiam=nt light sensor is only used to detect sun/cloud/dark.
BTW, nice job on the tracker Wink
Logged
DaddyB
Administrator
Full Member
*****
Posts: 144



View Profile
« Reply #22 on: September 15, 2009, 11:02:50 PM »

I moved the ambient sensor back down to the board and that fixed the problem.  I haven't put the extra pot on it yet, I think I will try to lower the number in software just to see what that does.  Anyway, tanks fer da info!!
Logged
Larry
Administrator
Hero Member
*****
Posts: 1167



View Profile
« Reply #23 on: September 19, 2009, 12:48:03 PM »

Well, my time playing with this SunTracker is officially over, now.  My new goodies came in yesterday, and I am moving on to Accelerometer projects.  I am leaving my code and pics and stuff posted here in case I come back to this some day.

BTW, DaddyB, I also got my caps in and installed them in my TV and they worked like a champ.  Thanks for the advice on that.  I am once again a hero in my wife's eyes. Grin
Logged
DaddyB
Administrator
Full Member
*****
Posts: 144



View Profile
« Reply #24 on: September 19, 2009, 01:50:42 PM »

I, like Dale, am proud of you.
'way to go!! Wink
Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!