# some questions stepper motor and sd card!

hi…

I faced some problems with saving the last location of stepper motor. so someone told me to use an sd card to save my data on it … but still something is not clear… I didn’t get stepper motor yet and all that was just a thinks…

1-how much average steps motor usually take to reach 180? ?
2-and if I want to write this steps “need last step stepper.step(val - previous); eg. here (val - previous) on sd card and clear old data what instruction better to use?
3- if I want to read from file how much bytes I need to read value of step?
4- will that data be the same Base-n as the Base-n of written data?

I think you have the wrong concept of a stepper motor in your mind.

how much average steps motor usually take to reach 180

The whole point of a stepper motor is that it takes an exact number of steps to get to any position, not an average. If you mean 180 degrees then the number of steps depends on the motor you choose. Many motors take 200 steps to do 1 revolution.

Writing the position of a stepper motor to an SD card is unlikely to be useful because there is no obvious relationship between the starting position of a stepper motor and the position it was at when it was previously used. The usual arrangement is to have a limit switch that the Arduino can use to detect when the device controlled by the stepper reaches its home or zero position.

You can write data to an SD card in whatever style you want.

...R

Writing the position of a stepper motor to an SD card is unlikely to be useful because there is no obvious relationship between the starting position of a stepper motor and the position it was at when it was previously used. The usual arrangement is to have a limit switch that the Arduino can use to detect when the device controlled by the stepper reaches its home or zero position.

you are wrong I will prove you that… if you use it to control a curtain for example you need the last position of stepper motor because if it’s half opened and you rest the arduino then it will take the half position of stepper motor as zero… and it will rotate 360 degree to full open it which will make it burn out so I must save the last value to continue my calculation on it, that’s all so I should save it on sd card and load it again to subtract or add new value to it…

you are wrong I will prove you that.

Didn’t see anything that proved him wrong.

When a motor is not powered it can be physically moved then all your storage is for nought.
If you save every step you will soon burn out an SD card they have a limited number of write cycles.

fwrlfo:
and it will rotate 360 degree to full open it which will make it burn out so I must save the last value to continue my calculation on it,

How do you know it won't rotate to fully closed?
Stepper motors don't burn out unless you feed them too much current - they just miss steps so the counting becomes irrelevant.
That's why the normal approach is to have a limit switch (say at the fully open position) and when the program starts up it moves the motor one step at a time until it detects the limit switch. That position then becomes "zero" for future movements.
And if someone has moved the curtain manually your saved value would be irrelevant anyway, so best not approach the problem that way.

...R