about the heliostat,
after going through Gabriel's code from cerebralmeltdown, we noticed that most of the functions are used to allow several options that are not of interest in our solar concentrator: multiaxis, sun position calculation, multi-machine.
Further more, as we are looking for a precision of about 0,12 degrees, basing the main movement on the calculation of the sun position would require an added control point.
in agreement with Jean, I decided to start a new code with a slightly different logic.
Jean is preparing meantime a structure where to test the program earlier than the model that we will build on may.
the logic behind the code will be applicable to the "Demonstrateur" only as we decided for more flexibility giving to each mirror axis its own stepper motor.
each motor will be able to set against a dual sensor (L1 and L2) positioned on the edges of the collector (CPC).
the calibration process will start on the morning and will recheck for errors in the evening.
first it will find its zero point on the optical switch,
then will turn in the direction of the collector lighting up L1 and triggering a counter1
it will continue its path eventually lighting up L2 and turn L1 off (whichever event comes first). these events will trigger the counter2 and counter3.
Counters count the number of steps or microstep and will memorize the machine-state at each event.
counters and machine-states allow us to find the exact mid position of the reflected sun into the collector.
the calibration process is repeated for each mirror while all other mirrors are set off the collector and will remember their optimal working position.
at the end of the calibration cycle of all mirrors each mirror will take its working position reflecting toward the center of the collector.
throughout the day the microcontroller will move each mirror of 1 microstep (1/16 of 1.8degrees or 0.113 of a degree) every 54 seconds.
this 54 seconds are found by dividing the daily 86400 seconds by 3200 microsteps times 2 (86400/3200*2) in order to hold the sun reflection steady (instead by moving 1 microstep each 27 seconds it would follow the sun).
since this calculation is also an average and we need a real position, each evening the "demonstrateur" will redo a calibration process in order to determine the error and apply the correction to the delay time used the day after.
a first circuit and arduino code is https://github.com/osefrance/SolarConcentrator/