Go Down

Topic: Stepper capabilities (Read 898 times) previous topic - next topic

Ardenuf

I have read much of what is one here on the use of a stepper motor with an arduino board, but I am still not altogether sure whether it can allow me to achieve my purpose "reasonably easily". Before I get stuck in I wondered whether in principle I could achieve the following:

1. I'd like to be able to rotate a stepper using external software, which will also be recording several over instruments, by a given total number of steps.

2. The stepper should do it's thing, count each step or n steps I set and spit out the total counts to a register that my program, when required, can read. The stepper will keep working till the total number of steps are made and the register will of course just continue updating if it is isn't queried.

3. Would prefer if the number in the register is a number relative to some value I initialise it to, this is not critical at this stage, but would be handy.

4. If I change my mind and decide that the rotation I set is heading me towards disaster, I would like to be able to stop/interrupt the on going rotation.

The questions relating to the points above:

1. How quickly can I communicate and get information like a simple integer number of steps from the board? 10 times/sec, 1 time/second etc?

2. I read somewhere that every time you connect to board it runs your script from the start, this would mess up my initialisation, why is this setup that way and is there a way around this default?

I have already ordered a board but trying read as much and understand as much as possible before getting it, so don't have any code or definite questions yet but would appreciate answers to these points to get a sense of the scope available to me.

Cheers!

Grumpy_Mike

Quote
1. How quickly can I communicate and get information like a simple integer number of steps from the board? 10 times/sec, 1 time/second etc?

More like hundreds of times a second.
Quote
2. I read somewhere that every time you connect to board it runs your script from the start, this would mess up my initialisation, why is this setup that way and is there a way around this default?

that is the way it works, you have to write your code to suite.


Ardenuf

Thanks for your response.

Quote
2. I read somewhere that every time you connect to board it runs your script from the start, this would mess up my initialisation, why is this setup that way and is there a way around this default?

that is the way it works, you have to write your code to suite.


So I see that I would have to initialise then do small step take value, read other instruments, and repeat. This, if you say I can communicate 100s of times per second, shouldn't be a problem. Would it be possible to keep a running count in non-volatile memory, is such a thing available?

It is just that if my external programme falls over then it might be very difficult for me to know the position of the stepper, I can't see or read it off anyway physically when I would have it running and that would be very problematic.

Cheers

Ardenuf


Thanks for your response.

Quote
2. I read somewhere that every time you connect to board it runs your script from the start, this would mess up my initialisation, why is this setup that way and is there a way around this default?

that is the way it works, you have to write your code to suite.


So I see that I would have to initialise then do small step take value, read other instruments, and repeat. This, if you say I can communicate 100s of times per second, shouldn't be a problem. Would it be possible to keep a running count in non-volatile memory, is such a thing available?

It is just that if my external programme falls over then it might be very difficult for me to know the position of the stepper, I can't see or read it off anyway physically when I would have it running and that would be very problematic.

Cheers


I found the answer to my question: http://arduino.cc/playground/Main/InterfacingWithHardware#Storage

Grumpy_Mike

You can't just keep a count and hope they will remain in step, you need to calibrate it every time the power is applied.
Remember you have a limit on the number of times you can write to an EEPROM location, it might be 100,000 times but if you are writing at the rate you are sending steps it will fail soon.

You need to reconsider what it is you are doing, you don't do stepping motors like you are suggesting, you need some form of feedback or absolute position indicator.

Go Up