Stepper motor position control

Would a driver be able to track the position of the stepper? Nema 17 is the motor. Start position can be different each time, (say 10-60 degrees) and then i require the motor to go 180 degrees. I do understand that they move in steps and not degrees, just saying degrees to try and paint a clearer picture. I’m trying to avoid using an encoder, what would your thoughts be for this?

The usual way to know the position of a stepper motor is to make it go to the ZERO or HOME position at startup and then keep a count of the steps moved from that zero position. At the ZERO position there will be some form of switch that is triggered by the motor. For example that's how most low cost 3D printers work.

The stepper driver does not know the position, it just causes the motor to move one step at a time in accordance with step pulses from the Arduino.

...R Stepper Motor Basics Simple Stepper Code

As Robin2 said, with the motor alone, there's no way of knowing the shaft position. If the motor loses steps for any reason, you'll lose track of position. You'll need some kind of feedback to know for certain where the motor and load are. It depends how critical your application is, how much safety margin you have, whether you ever power down or disable the motor drive etc. to decide whether you'll get away without feedback.

hmm, looks like ill have to use a button press to set to ZERO and from there i can do the rest. The speed of each revolution should be fairly slow so im not too worried about losing steps. This is all theory anyways, ill have a working prototype in a few days and then illl get a better picture Thanks for the help

A library like AccelStepper keeps track of the stepper position. You can command moves either to absolute or relative positions.

groundFungus: A library like AccelStepper keeps track of the stepper position. You can command moves either to absolute or relative positions.

Indeed, but the OP will still have to move the stepper to the HOME position at startup.

...R

Robin2: Indeed, but the OP will still have to move the stepper to the HOME position at startup.

...R

For this reason i think i might avoid this library, doesn’t provide a huge benefit

Indeed, but the OP will still have to move the stepper to the HOME position at startup.

Or not. They could call the setCurrentPosition() function to set the position to zero.

groundFungus: Or not. They could call the setCurrentPosition() function to set the position to zero.

But only after the motor has reached the ZERO position as determined by the ZERO limit switch.

The principal value of the AccelStepper library is when you need acceleration for a stepper motor and don't need very high step rates.

...R

OK, fine. I don't give a rats ass what he uses. I said "a library like AccelStapper".

groundFungus: OK, fine. I don't give a rats ass what he uses. I said "a library like AccelStapper".

The point I was trying to get across is that there will be a need for a ZERO limit switch whether the OP uses a library or writes his own code. No library gets around that requirement.

...R