The Cerebral Forum

Solar Projects => Sun Tracking / Heliostat Program Discussion Board => Topic started by: Gabriel on September 02, 2015, 09:07:23 AM

Title: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: Gabriel on September 02, 2015, 09:07:23 AM
Hi all,

I have attached some updated versions of the Arduino Sun Harvester Program. There aren't any "exciting" changes in this particular version aside from a few bug fixes, but I have a lot of ideas for things that I hope to add.

Since there is probably going to be a lot posted under this topic, I went ahead and started this new thread to replace the old one here. http://cerebralmeltdown.com/forum/index.php?topic=325.0 (http://cerebralmeltdown.com/forum/index.php?topic=325.0)

This program (as always) is released under the [url = http://creativecommons.org/licenses/by-nc-sa/3.0/us/ (http://creativecommons.org/licenses/by-nc-sa/3.0/us/)]Creative Commons Attribution-NonCommercial-ShareAlike 3.0 license[/url].

Note that I haven't tested these programs much yet, but figured I would go ahead and post them to hurry up and get the ball rolling. This version only fixes a few bugs...

1. The program should now work with the latest version of the Arduino Software.
2. Fixed a bug which would cause the program to sometimes not go into wind protection mode.
3. Added a no potentiometer option which allows you to leave out the potentiometer when using a heliostat.

Like I said, I haven't tested this much yet, so keep an eye out for odd behavior. I haven't changed anything major though, so basic functions should still be fine.

Future Update Ideas!

Now that that's out of the way, it's time to think about what to add. Here are some ideas that I have heard or come up with since the last major update. Note that these are just ideas, so I'm not going to hold back. When it actually comes time to implement them, we will see what is actually doable. :)

In no particular order...

Find ways of simplifying the program so that it isn't so much of a pain to input custom settings.

Add simultaneous movement to the stepper motors instead of having them take turns.

Add calculations for heliostat designs with the mirror mounted away from the axes or rotation to make them more accurate.

Add options for trackers besides just the altitude and azimuth type machines currently supported.

Add better support for machines close to the equator. (Altitude angles greater than 90 degrees perhaps?).

Add code for GPS support.

Add code for Compass support.

Write Android app that sends lat, long, and time to Sun Harvester program using phone's GPS and time. (maybe)

Add standard settings for a heliostat / sun tracking machine so user doesn't have to input their own. (Will require a couple of good machine designs.

Try and get the program to play well with 32-bit Arduinos.

Try and get rid of libraries wherever possible so that newbies don't have to worry about installing them. (This was already mostly taken care of in the last update).

Maybe add a way to do data logging into the program.

Add the option to change settings through the Serial Monitor, or perhaps separate PC based program.

Write separate PC based program to interface with Arduino program. This has already been started to a degree. You can check out the attached Processing program if you wish. It is no where near finished, but you can still see where it's headed. I had already started the program under Visual C#, but have started porting over to Processing because it plays well with multiple platforms.

That's all I can think of at the moment. Although I'm sure there is probably more to add. Please post any ideas for the program that you may have.

Thanks!
Gabriel


Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: solardude on September 02, 2015, 02:48:58 PM
I'm so happy to see you still working on improving the code :D

I'll be digging in really soon and help with testing the latest version of the code.

Looking at your list of possible upgrades I'll list the ones that I think are most important for my goal of creating a really nice portable lightweight solar tracking device that is easy to use and as automatic as possible by the regular every day person.

Here is what I think is most important, with a person comment next to each one:

Add simultaneous movement to the stepper motors instead of having them take turns. - Code not jamming up is of most important, if this feature has the possibility to cause a MicroController to lock up then leave it out. The solar tracker is going to move minimally anyways. I do think the biggest benefit of having both motors move at the same time is that it would look cooler.


Add better support for machines close to the equator. (Altitude angles greater than 90 degrees perhaps?).  - As somebody who wants to build a low cost easy to use portable tracker I'm very interested in having the code and design work anywhere in the world. Needing altitudes greater than 90 degrees is something I never knew was needed but if it is then I think adding support for this would be beneficial.



Add code for GPS support.  -   Ideally I would like to not use a GPS receiver due to the cost of adding it and the fact that I'm looking to keep the cost to manufactuer as low as possible but I see a real benefit of having a GPS receiver on board to auto populate the GPS position. So maybe only use the GPS location data once it shows you have a 3D location fix. So adding GPS support that can or can not be used would be perfect.



Add code for Compass support.   -      Does the code right now not rely on a digital compass sensor? If not does the solar array have to be aligned manually to noon sun or what?  I have been using a different library with GPS & digital compass for position tracking but I have to admit that the digital compass can be easily thrown off by motor magnets or large metal objects.




Write Android app that sends lat, long, and time to Sun Harvester program using phone's GPS and time. (maybe)    -   I have also thought about this when it comes to making it easier to set the location coordinates. Everybody has a smartphone these days it seems and it would be a easy way to eliminate the need for a on board GPS sensor. My other thought was to just add a LCD screen and a couple cap touch buttons to make entering the GPS coordinates into the tracker. I figured that most people would use their smart phone to look up the coordinates anyways. Have you made a Android app before? I know its getting easier to do these days.


Try and get the program to play well with 32-bit Arduinos.  -   My micro processor of choice right now is the Teensy 3.1 which is a 32 bit ARM https://www.sparkfun.com/products/12646?gclid=CIO6q5mo2ccCFQGUaQodO6IMDw (https://www.sparkfun.com/products/12646?gclid=CIO6q5mo2ccCFQGUaQodO6IMDw) . I'm pretty sure it will run your current Arduino code but if running it at 32 bit is beneficial then I think adding that support would be good. Does 32 bit math allow more accurate tracking?


Just my 2 cents. I know not everybody is using this for solar panels but heliostats which is another great use of solar energy.

Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: ben on September 06, 2015, 04:50:18 AM
Hi All,

I have downloaded the version for the MEGA (Mega_Sun_Harvester_Program_V01.zip) and tried compiling with the Arduino IDE v1.0.6.

No compile errors, seems to download into the MEGA2560 board OK.

Not too sure how to verify if it works because I only have the MEGA board, and no steppers/shields/etc.

But when I start the (Tools -> Serial Monitor) within the IDE and press the reset button on the MEGA, I get the following output in the Serial Monitor window:

Code: [Select]
Time: 45:165:85  165/165/165  Day_of_week:165
Sun's Alt: -53.633
Sun's Az: 164.674
Number of Machines 1
Machine Number 0
Resetting

Maybe printing the version of SW within this output would be useful.

I dont have a Arduino UNO so have not downloaded the cut down version (Sun_Harvester_Program_V01.zip). Can I suggest you prefix this file with UNO or similar so that it is inline with the 'MEGA' prefix?
Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: ben on September 06, 2015, 04:51:57 AM
Two other comments:

The "Sun_Harvester_Shield_Interface4.zip" code looks interesting, but how is this compiled and used?
I have loaded it into the IDEv1.0.6 but get a heap of compile errors, a snippet below:
Code: [Select]
Sun_Harvester_Shield_Interface4:329: error: stray '#' in program
Sun_Harvester_Shield_Interface4:331: error: stray '#' in program
Sun_Harvester_Shield_Interface4.pde:331:11: error: invalid suffix "BB931" on integer constant
Sun_Harvester_Shield_Interface4:333: error: stray '#' in program
Sun_Harvester_Shield_Interface4.pde:333:11: error: invalid suffix "F08FF" on integer constant
Sun_Harvester_Shield_Interface4:349: error: stray '#' in program
Sun_Harvester_Shield_Interface4.pde:349:9: error: invalid suffix "CAF57" on integer constant

And the version numbering of this new release being v01 seems strange coming from v098.
Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: Paul L on September 06, 2015, 08:08:02 PM
Oooo, I love thinking of new ideas/suggestions!!

Here's what I think: a GPS and compass addition would be great - especially for a portable system.  Having a feature where it self levels (or maybe compensates for being off level) for  would also be dreamy, but hard/costly to setup.  As far as GPS modules go, cost really shouldn't be a concern - you can get them on ebay for 11.00, free shipping and they work super.  You could also remove the RTC if you had a GPS, so that would save some costs there.  If there was a set design, preferably with worm gears, the homing microswitch could be removed with the addition of an LDR/LED array.  Just turn the heliostat on, let it get the gps position.  The program will already know the position of the sun depending on the GPS location, so if the steppers are then programmed to move to the brightest location in the sky according to the LDR/LED array and then set that as the position of the sun, that's all it needs to know.  A self setting heliostat; no figuring angles or cardinal directions!  That's be great...
 
Any step that removes human input is a step in the right direction.

I like dual acting steppers - though not super important.  Agree with solardude, it would look cooler.
Not sure what the benefits would be with 32 bit mc's?  More accurate?

I'll think on this for a while and may add more later!

Cheers,

Paul   
Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: Gabriel on September 08, 2015, 06:49:01 PM
Hi All,

Wow that's a lot of input!

I haven't had a lot of time to work on much over the last few days, but I did experiment with a couple things. First, I played around with an Arduino Due for awhile. I have tried it in the past, and I still can't seem to get the RTC to work right on it. It's probably a code issue, but I also wonder if there might be something wrong with my DUE. I will still have to try a few things I guess. If anybody has a DUE and is able to get an external RTC to work on it let me know.

I also played around a little bit with making an Android app. It seems like it will probably be headache inducing. Not so much for writing an app for my phone, but for writing an app that works on everybody's phone. Things change so often with those things that even a lot of the older tutorials are out of date enough to make reverse engineering apps a pain. I'm just getting started though, so I may be being overly pessimistic.

I will probably miss some things, but here's my attempt at adding to everyone's input in more or less the order it was posted.

@Solar Dude

Add simultaneous movement to the stepper motors instead of having them take turns. -
I think I agree with everyone here in that the main motivation for this is that it would look cooler. It does have the practical application though for reducing the time it takes to move machines into position. This is especially good for large machines that take forever to get anywhere. There is a downside though in that doing this would basically halve the max possible "step frequency" for the stepper motors.


Add better support for machines close to the equator. (Altitude angles greater than 90 degrees perhaps?).  
This is mostly only an issue for especially large machine that take a long time to move, or that are incapable of turning a full 360 degrees along the azimuth. Small machines can basically just quickly whip around to face any direction that the program calculates for it, but the larger ones might take upwards of a half an hour to make such a move. It would make more sense to make the program a bit more intelligent to better utilize the full range of motion that a machine might be capable of moving.


Add code for GPS support.  - 
I honestly have never even used a GPS with an Arduino, but I suspect that it would probably only take maybe 10 minutes to add the code for it, so why not have it? The code may only exist as something that needs to be uncommented to work, but that would at least be good enough for some rough experimenting. Actually, if anyone has a GPS wired up maybe you can help me test the code.


Add code for Compass support.   -     
Realistically, there is a good chance this will never happen, but like the GPS code I might just stick it in the code commented out so that people can play around with it if they feel like it. It would definitely be cool, but I'm not sure if the compass modules are reliable enough or not.


Write Android app that sends lat, long, and time to Sun Harvester program using phone's GPS and time. (maybe)   
I've never written an app before, but I have recently considered learning how for this and other unrelated projects. I wouldn't be surprised if there are already Serial Monitor apps that could be made to modify the program using simple text commands. For example, it could ask What is your latitude? to which you might type 12.34 and have the program remember it.

Try and get the program to play well with 32-bit Arduinos.
It seems that things are headed towards 32-bit so it seems to make sense to try and adapt for them. Their real selling point though is that they are much cheaper than the Mega while being more powerful / faster than it. I was able to get the 8-bit Mega to be just as accurate as the 32-bit boards as far as math goes, but it wasn't easy. In general, the 32-bit boards are capable of double precision math which has about twice as many significant figures as the 8-bit boards which are only capable of single precision.

If you try the code on the Teensy, let me know what issues come up. I would be surprised if it worked perfectly without some changes.


@Ben

"The "Sun_Harvester_Shield_Interface4.zip" code looks interesting, but how is this compiled and used?"
Sorry, I forgot to mention that it runs in Processing, which looks very similar to the Arduino programming environment. It can be downloaded at processing.org.


"And the version numbering of this new release being v01 seems strange coming from v098."
I actually changed the name of the program and sort of arbitrarily decided to restart the counter because of the difference. This may have been a dumb idea on my part.

@Paul
Yeah having things be as hands free as possible would definitely be nice.

I have considered getting a fish eye lens webcam to basically watch the sky and log how much sun is available over the course of the year. I also thought that it would be cool to watch the trajectory of clouds and try to predict when they would block the sun. That way you could predict on a minute by minute basis whether you would have energy available for a long enough period of time to do a certain task. Baking a load of bread might be an example.

Anyway, I suppose that same webcam set up could be used to track the position of the sun and move the sun tracker or heliostat accordingly. That would get rid of the GPS altogether. I'm not sure how accurate it would be, but it's an idea.
Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: alobo on September 17, 2015, 10:21:56 PM
My suggestions:

While working with the ESP8266 (which I am really really hooked on right now, in case you can't tell), a couple things came up that I think you will find useful as you upgrade the program.
I'll put in other things as I come across them.
Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: Paul L on September 18, 2015, 09:51:46 AM
Quote
Anyway, I suppose that same webcam set up could be used to track the position of the sun and move the sun tracker or heliostat accordingly. That would get rid of the GPS altogether. I'm not sure how accurate it would be, but it's an idea.


It would, wouldn't it?!  All you'd need is a single board computer like a Raspberry Pi (or this $9 competitor - http://arstechnica.com/information-technology/2015/05/move-over-raspberry-pi-this-startup-is-building-a-9-computer/ (http://arstechnica.com/information-technology/2015/05/move-over-raspberry-pi-this-startup-is-building-a-9-computer/)) that can run openCV and a webcam.     

Here's a relevant paper if anyone wants to take a look - http://www.jmest.org/wp-content/uploads/JMESTN42350280.pdf (http://www.jmest.org/wp-content/uploads/JMESTN42350280.pdf)

Also, having it be able to track clouds and predict sun availability would be a really cool addition - great idea!

New to me and could be of interest to others: pcDuino.  It's a single board computer with arduino pinouts so you can just plug existing shields into it!   
Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: solardude on October 11, 2015, 09:47:03 AM
Hey Gabriel  :)

Below are my comments on your reply.

I know your a busy man like the rest of us so I say lets work on adding one new feature at a time and see how that goes. I know others have had the main code up and running for 2 years now with no problems so we know the base sun tracking code is working just fine.

I say forget about any Iphone & Android apps for now since I think your right about it probably driving you nuts when it comes to trying to get it working on all devices and software versions without issues. Plus as Alobo says Blynk is a software platform that has already created a Iphone and Android app that allows you to connect to Arduino boards as long as your Arduino is wirelessly connected to the net which is probably unlikely for a sun tracker but still it worth checking out.

I plan on just adding a low power Sharp Memory LCD to the tracker with a simple button interface that will allow you to enter the GPS coordinates which you can source from a phone, gps tracker, or the internet or a built in GPS receiver. I see no real big benefit of having a custom application for entering GPS coordinates when setting up the tracker but that's just my personal opinion.

What do you think?
---------------------------------------------------------------

Add code for GPS support.  -  
I honestly have never even used a GPS with an Arduino, but I suspect that it would probably only take maybe 10 minutes to add the code for it, so why not have it? The code may only exist as something that needs to be uncommented to work, but that would at least be good enough for some rough experimenting. Actually, if anyone has a GPS wired up maybe you can help me test the code.

I have a Adafruit Ultimate GPS receiver that I can use to help test your code. If it's really easy to add support for a GPS Receivers Data Output then lets add it for quick, automatic system GPS coordinate population.

I plan on making portable units that are not permanent so having automatic location entry via GPS would be really nice. Having the option to also enter it manually via a LCD screen and a couple capacities touch buttons is a good backup for the unlikely event that the GPS system fails. A lot preppers buy our systems just to be prepared for the collapse of the financial system, government, or electricity grid, and any of those situations could cause the loss of the GPS system for civilian use should the government want to shut it down. These situations would make renewable energy production even more valuable and important.

If you add GPS support to the code I can and will test it for you and provide detailed testing data for you to review. Let me know what you think.



Add code for Compass support.   -     
Realistically, there is a good chance this will never happen, but like the GPS code I might just stick it in the code commented out so that people can play around with it if they feel like it. It would definitely be cool, but I'm not sure if the compass modules are reliable enough or not.

I've been testing a digital compass with a different solar tracking setup and it can be tricky when you have them close to DC motor magnets since they will throw off the compass readings.

But what I find interesting is that they are using these digital compass chips in quad copters to provide the direction of the travel accuratly even though the compass is surround  by 4 heavy duty DC motors no more than 12 inches apart that are running at high RPM while the quad copter is flying around. So I think there is a digital compass solution that will probably work but more testing is required to find the right digital compass chip for the job.

I have been using a old Honeywell compass and its OK but have a newer compass on hand that I have not had the time to test yet. I picked this compass because guys are successfully using them in their custom quadcopter builds without problems. Here is the compass I have on hand along with a few Adafruit Ultimate GPS modules: https://www.adafruit.com/products/1746 (https://www.adafruit.com/products/1746)

If you add the code for compass support I will do testing on this also and provide detailed testing reports.   

-----------------------------------------------------------------------------

I'm using worm gear drive motors for the dual axis movement and they are very nice because they only require power when the motor is moving and zero power when stopped. This setup has tons of power and holding power when not moving. I see no backlash from my little testing.

I have attached some images of the prototype motor setup I'm testing and happy with so far.



 
Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: kenssurplus on October 21, 2015, 03:00:41 PM
Gabriel,

Congrats on the new updates and continued development. I have a thought about this idea:

Quote
Add simultaneous movement to the stepper motors instead of having them take turns. -
I think I agree with everyone here in that the main motivation for this is that it would look cooler. It does have the practical application though for reducing the time it takes to move machines into position. This is especially good for large machines that take forever to get anywhere. There is a downside though in that doing this would basically halve the max possible "step frequency" for the stepper motors.

While it does indeed reduce the time of travel, what it also would do is to double the current usage at movement time.  On some power limited installations,  this could cause a brown out in the supply voltage, potentially hanging the system in a voltage induced coma.
I don't know how many systems might have trouble of this sort, but it was a thought I had about possible unforseen effects.
Anyway, not trying to dissuade you about this idea, just stating a scenario that may come up.

Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: ben on October 22, 2015, 04:37:28 AM
Add simultaneous movement to the stepper motors instead of having them take turns.

i would like to see this, but not because it looks cooler, but for better accuracy.

DISCLAIMER: i have not got a working system yet, but I do understand electronics and programming.

firstly, I thought the hardware was incapable of real simultaneous movement
-> it moves motor-A, then moves motor-B, then rests, then repeats every 30-sec -or-so

i suggest modifying the algorithm to implement the following:

instead of waiting 30-sec -or-so between movement of motor-A then motor-B,
why not move the motors when they are due to be moved (allowing some minimal threshold).

by this, to describe what i mean, lets consider for example:
that after each 30-sec -or-so, motor-A needs to move 60 pulses, and motor-B needs to move 10 pulses,
then the algorithm could calculate and implement:
- motor-A is moved 2 pulses every second (resulting in the same 60 pulses in 30-sec), and
- motor-B is moved 1 pulse every 3 seconds (resulting in the same 10 pulses in 30-sec).
Get it?

From an observer, due to the very small movements, the machine would not seem to move at all, but would very slowly move and keep aligned to target better than the existing algorithm, in my opinion.
Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: ben on October 22, 2015, 04:44:53 AM
here is a crazy idea:

track the moon at nighttime

i would enjoy the moonlight shining into our windows, when we have a full-moon and clear-sky. :)
Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: Gabriel on October 22, 2015, 07:42:25 AM
@Solardude

I have experimented some with the GPS and Compass code, but it looks like it is probably a bit too complicated to learn to code for it without actually owning the devices. I still need to take another stab at it though.

@kenssurplus
That is a good point. I will probably end up giving the option for sychronized-ish motion, and not make it required. Another fact is that moving both motors at the same time basically halves the max speed of the stepper motor because there is a limit to how fast the Arduino can generate the pulses. With the newer, faster 32-bit Arduinos coming out though, it is less of an issue.

@Ben
"why not move the motors when they are due to be moved (allowing some minimal threshold)."
Now that I think of it, you can already do this in the program by turning the "updateEvery" value down to 1 second. This probably needs to be tested more though because I'm not sure if having small differences between the previous and present calculated sun's position leads to errors.

"track the moon at nighttime"
This has actually been on my mental list for a while now, but I didn't think to add it to the above list. I have looked into it before, and I actually have the calculations in the same book I used to get the sun position calculations. They are somewhat lengthy sense they require an entire table to be typed in, but it looks doable. I don't think it would all fit in the Arduino Uno (at least not with the complete Sun Harvester Program) but it should be fine on the Uno.
Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: ben on October 22, 2015, 09:52:13 PM
Quote
>> why not move the motors when they are due to be moved (allowing some minimal threshold).
Now that I think of it, you can already do this in the program by turning the "updateEvery" value down to 1 second. This probably needs to be tested more though because I'm not sure if having small differences between the previous and present calculated sun's position leads to errors.

Good idea. When I get my system up and going, I will probably work on this.

i would probably calculate the suns position every 30-sec or-so, and every 1-sec or-so drive the motors the required number of pulses (ie 2 for motor-A and 0.333 for motor-B as (in the above example))
Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: solardude on October 23, 2015, 12:48:45 PM
@Solardude

I have experimented some with the GPS and Compass code, but it looks like it is probably a bit too complicated to learn to code for it without actually owning the devices. I still need to take another stab at it though.


Give me your address and I'll ship over a Adafruit Ultimate GPS Module + good digital compass for you to play with. I'll also include a Teensy 3.1 micro controller so we will have the same setup to work with for testing into the future.

Here is some code I have been testing that uses the GPS & Compass to track the sun. There may be something in there that you can easily use. https://github.com/polyideas/Outdoor_Solar_Robot

--------------------------------------------------------------------------------

How hard is it to use your current code to power 2 separate worm gear driven 12v motors?

 
Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: Gabriel on October 23, 2015, 06:14:34 PM
"How hard is it to use your current code to power 2 separate worm gear driven 12v motors? "
I personally have never tried this but I know it's possible, although it would of course require some modification. To start, you would need to add a hall sensor or maybe an encoder to count the number of revolutions the motor has moved so that the program know the orientation of the machine and can move it accordingly. I know Bob101 on this forum built his machine and wrote his program to accomplish this task.
I think through some trickery you could make the program think that you are using stepper motors. For example, instead of telling the program that the stepper motor has say 1600 steps per revolution, you tell it that it has only 1 step per revolution.

You would then place your code in the moveToPosition function which takes the altsteps and azsteps input variables and moves the motors accordingly. So if altstep = 1, your code would know to move the alt stepper motor one revolution.

The searchForLimit function would also have to be modified.

This would be useful code to have around I think.
Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: Emmpunkt on May 05, 2016, 04:15:10 AM
Hi

Add simultaneous movement to the stepper motors instead of having them take turns 
I always read, that it looks cooler. But that is not why i could need it.

1. Speed
If both axis are driving simultaneous, they are reaching there endpoint faster. In "Normal-mode"  this may not be interesting. 
But in "Wind protection" it is important for me. My Solartracker is more than 4m high and it is really slow.
It is slow because i dont like making noise with it. Im living in the hills, so we don't have strong and constant winds here, but
we have strong Gusts here. If my Anemometer detects high wind, its better to move fast into windprotection!

2.Temperature and Current
If one axis is moving, the other axis is powerd too.
This causes sometimes an overheating of my altitude Driverboard. I'm driving my steppers near their limit, because i need
maximum power if it is windy.
While the azimuth is driving, the altitude board is powered but does no moving. This means that 2 of the Transistors inside
the altitude driver are on full current and have no chance to cool down, like in normal movement. And it is wasting energy too.

An Alternative (for me)  would be a third speed option. So i can drive the stepper much faster into the wind protection.

Thanks Michael
Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: Gabriel on May 15, 2016, 05:32:49 PM
Hi Emmpunkt,

I will definitely have to put synchronized motion up a lot higher on the list based on what you have mentioned.

I am used to dealing with small machines which only take less than a minute to move into position, but I know the larger ones can take much longer to do it.

Finding time to actually work on these things has been a big challenge lately, but I think that you should be able to hack the program pretty easily to do what you want.

We can cheat a little bit and reuse the joystick control code which already kind of synchronizes the motors. There won't be any acceleration, and the motors won't necessarily reach the end of their individual movements at the same time, but they won't be taking turns either.

If you open up the program and look at the very top of the functions tab, you will see what code to replace.


Replace this...
Code: [Select]


  if (AccelYesOrNo==1){//This code runs during normal operation
  moveMotorWithAccel(azsteps, azimuthStepPin, azimuthDirPin, azSpeed, azAccel);
  moveMotorWithAccel(altsteps, altitudeStepPin, altitudeDirPin, altSpeed, altAccel);
  }



with this...

Code: [Select]


  if (AccelYesOrNo==1){//This code runs during normal operation
    if (digitalRead(WindProtectionSwitch)==HIGH){
      joystickMoveMotors( altsteps, altitudeStepPin, altitudeDirPin, altManualSpeed, azsteps, azimuthStepPin, azimuthDirPin, azManualSpeed  );
    }else{
      moveMotorWithAccel(azsteps, azimuthStepPin, azimuthDirPin, azSpeed, azAccel);
      moveMotorWithAccel(altsteps, altitudeStepPin, altitudeDirPin, altSpeed, altAccel);
    }
  }



Note that I haven't actually tested this code, so let me know if you have any issues.

Hopefully it will tie you over until I have time to do some real work on the program. Maybe not this year, but hopefully the next. :)

Thanks,
Gabriel

Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: Boerekos on September 19, 2016, 08:23:54 PM
Hi Gabriel,
I am very interested in your project.
I've built my own Heliostat with the help of Mark, from http://heliostaat.nl/. (http://heliostaat.nl/.)
I bought dual axis gearboxes and Stepper as well as DC motors in the beginning (From China).
I struggled really hard to find someone to build the electronics, although I was prepared to pay a lot of money. The electronic engineers I approached, just did not seem interested, although I was going to pay for their time.

I designed my own hardware bits on Autocad in 3D. I had all the aluminium parts cut out on a waterjet cutter. That was quite interesting how accurate those machines are, and their power. Something like 1900 bar of water mixed with grit. Able to cut through 4 inches or more of solid steel. 
My heliostat is not 100% finished yet, but its been working for a few years. I still need to put the electronic switches for the horizontal and vertical stops in place, so that the motos wont run past certain points.

Unfortunately most of my fun stopped when I got divorced, and now I am renting my property out in S-Africa where the heliostat is, while I am living in Austria.
I had many trails done, and have sent my electronic parts back to Holland several times, so that Mark could make some changes as I wanted it.
My total costs were big, as I also mounted my heliostat on a long lamp post of steel, so that the sun could go into my bedroom on the second storey. Most of the pole is hidden, as it is inside/between the branches of trees. I've spent 1000's (yes, converted to Dollars)

For your project, just my thoughts:

1) GPS is a definite advantage for position AND time, and that was one of my requirements, as Mark only used a DCF time signal, which do not cover South Africa.

2) As I work offshore, and alongside ROV's (Remote operating vehicles) crew, which use fluxgate Compasses: I know that they are not that accurate, like the fibre optic Gyros we sometimes use. I am not sure about the Arduino unit's accuracy.
Point is, you dont need to calibrate the heliostat that often, so that it knows where 0 is. Mark has a simple way of calibrating: You put a cylinder (Tall empty spraypaint/beer can) on top of a piece of paper on the mirror's surface, aim the mirror electronically at the sun, until there is no shadow from the cylinder/can. When there is no shadow, you tell the electronics that "this is the sun's position"
 
3) I have some heavy winds in my area during Winter, and during my first Winter, I had to put my Heliostat to rest a lot of times, so that it wont blow away.. Rest position as you know is horizontal. The heliostat will restart its normal cycle the next morning at sunrise. I had to send my electronic parts back to Mark again, so that he could build an interface for an anemometer. It doesn't measure windspeed, but rotations, but I cant remember at which RPM it triggers the rest command.

I used to like it to get the sun on my bed at the exact sunrise time, or even to wake up, hearing my DC motors waking up.
Same for when the days get shorter. Every day you hear the motors start up in fast mode, to go to the sleep position.

Another nice feature I have, is my remote control, which I can select 3 targets, as well as a target straight to the sun, if you have solar panels.

I do like the idea of Ben, to be able to track the Moon as well :)

I am still looking to change my setup, so that I can set my mirror's angles individually, as I lose a lot of sunlight on the wall next to my windows.
Also, just for interest. Hope that all the fanatics wont drool too much. I saw some solar trackers in Austria. Have a look here:

https://www.smartflower.com/en (https://www.smartflower.com/en)
Title: Re: Arduino Sun Harvester Program: Next Generation Update and Ideas
Post by: Gabriel on September 21, 2016, 05:19:10 PM
Hi Boerekos,

I remember you posted a while back. :) Things have been a bit quiet on my end as I haven't had a lot of spare time recently, but have had the chance recently to work on some things.

I have been working on a design that can be printed with a 3D printer. It seems to be going alright, but I still have a ways to go. Plastic is OK for prototyping and playing around, but once I get the design down I think I'll try to make it out of metal. There is actually a place near me that has a laser cutter that I might try getting parts made at.

1) I have played around with a GPS as someone requested the feature for one of their projects. They basically bought me a GPS and I figured out the code. The fact that they keep track of time is definitely an advantage. It's not actually that hard to add as there is example code, but I haven't done anything official yet.

2) Like you mentioned, I'm not aware of an electronic compass that is especially accurate, probably more so with the cheap ones. I actually align mine the same way.

3) I haven't done much for wind protection aside from having a mode where it parks horizontal. There is no automation there. It would be worth adding, but I wonder what it would take to build one that is sturdy enough to hold up to very high winds.

I have built (attempted mostly) heliostats where I was able to focus the reflected light by angling the mirrors. I think I've pretty much decided that it is less work, and possibly even less money, to just rip a hole in the wall and put in a bigger window than it is to try and build a single heliostat that has mirrors that are adjustable. 

I think I'm going to focus on smaller sized heliostats for that reason. :)