Stepper positioning

Hi everyone, I am currently trying to realize a sun tracking device. I already calculated all the neccessary angles and all the math stuff is done.

Now it comes to the steppers: I need to set the stepper to a specific angle BUT the suntracking device is repositionable in every way, which means I can't set an initial position, for example north, because of the repositionability (is that even a word?)

Does anyone know how I can get the position of the stepper like a resolver does it? Or do I have to set the initial position everytime I reposition the device? For example i manually turn it towards north and then set this position to step 0 in the code?

Thank you very much in advance -Breiti

I can post the code afterwards if anyone is interested

Breiti:
Hi everyone,
I am currently trying to realize a sun tracking device.
I already calculated all the neccessary angles and all the math stuff is done.

Now it comes to the steppers:
I need to set the stepper to a specific angle BUT the suntracking device is repositionable in every way, which means I can’t set an initial position, for example north, because of the repositionability (is that even a word?)

Does anyone know how I can get the position of the stepper like a resolver does it?
Or do I have to set the initial position everytime I reposition the device?
For example i manually turn it towards north and then set this position to step 0 in the code?

Thank you very much in advance
-Breiti

This is normally done with a limit switch that can be discovered by the program. Then that position is “zero” for all other positioning. Put the switch so North is where the switch is located. Then you don’t have to do the moving.

Paul

If I understand your question I think you are faced with two different issues.

On the one hand you need some means for the Arduino to establish the zero or home position for each stepper motor when the Arduino starts. That is usually done by driving the motors until they trigger a limit switch that marks the zero position. After that the Arduino can confidently move to motor to a position determined by a number of steps, and get back accurately to the zero position.

The other issue is finding the sun. That seems to require a systematic scan moving towards the point of brightest light - I presume you have Light Dependent Resistors (or similar sensors) for that purpose.

HOWEVER if the purpose of all this is to drive solar panels to gather the sun's energy then stepper motors are almost certainly a bad idea as they are very inefficient and may consume more energy than the solar panels produce. A simple DC motor with a non-reversible worm drive will old position without any power.

...R Stepper Motor Basics Simple Stepper Code

Robin2: The other issue is finding the sun. That seems to require a systematic scan moving towards the point of brightest light - I presume you have Light Dependent Resistors (or similar sensors) for that purpose.

HOWEVER if the purpose of all this is to drive solar panels to gather the sun's energy then stepper motors are almost certainly a bad idea as they are very inefficient and may consume more energy than the solar panels produce. A simple DC motor with a non-reversible worm drive will old position without any power.

As i said, the sun tracking is already done by calculating all the angles (because it's a mirror that has to reflect the sunlight onto another object, that's why direct tracking with the LDR is not possible. Mirror => Angle of entry = angle of reflection) That should also just be a little project so efficiency doesn't matter.

So the only issue that I currently have is setting this Zero or Home position for the steppers.

Paul_KD7HB: This is normally done with a limit switch that can be discovered by the program. Then that position is "zero" for all other positioning. Put the switch so North is where the switch is located. Then you don't have to do the moving.

Paul

I would have to mount the switch (if you mean a hardware switch) everytime I place the object down. As I said is the object placeable and rotatable in every way. So if I put it down and set the hardware switch to north and then i relocate the object, then I would have to remount the switch. That's why I wanted to solve that problem just with the software.

Thank you both for the quick response :)

If you want the unit to be portable/self-calibrating, you need to also add a compass to the home switch, for example https://www.pololu.com/product/2738

Breiti: (because it's a mirror that has to reflect the sunlight onto another object, that's why direct tracking with the LDR is not possible.

I would have to mount the switch (if you mean a hardware switch) everytime I place the object down.

Even if the LDR approach is not feasible for the mirror system (and I don't understand why not) it could provide a very simple system for identifying the orientation of the device when it is placed in position. The device could rotate until some part of it is facing the sun and then, presumably, your calculations could be brought into play.

...R

Robin2: Even if the LDR approach is not feasible for the mirror system (and I don't understand why not) quote]

The mirror has to be arranged so that he faces the middle between the Photovoltaic module and the sun, that's because of the two angles (entry and reflection) and due to the fact that the PV can theoretically be placed 360° in every direction around the mirror, there need to be calculations done. The LDR just give you the position of the brightest light but if you only use the LDR you wouldn't know where the PV is.

Thank you bobcousins, I will definitely try that.

Breiti: The mirror has to be arranged so that he faces the middle between the Photovoltaic module and the sun, that's because of the two angles (entry and reflection) and due to the fact that the PV can theoretically be placed 360° in every direction around the mirror, there need to be calculations done. The LDR just give you the position of the brightest light but if you only use the LDR you wouldn't know where the PV is.

You seem to have focused on the less important part of Reply #6.

...R