0

Move Stepper to certain positions
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Move Stepper to certain positions

by RolloBeach on Mon Jul 15, 2019 7:16 am

Hi,

I am using the Arduino MEGA 2560 and the AF motor shield v2.3. My goal is to define a couple of positions in my sketch and then tell the stepper to go to these positions.
Is there a way to tell stepper the next position, no matter where it actually is? I have a defined starting point, so I can create kind of a table whitch contains the steps from "point zero" to point X.
My main problem is, that I only know the simple commands like "step(200,FORWARD,SINGLE)". Is the AccelStepper library compatible to the v2.3?

I would appreciate, if someone could tell me a function or a example code of how I can realize my idea with the AF motor shield v2.3.

Greetz

RolloBeach
 
Posts: 5
Joined: Wed Jul 03, 2019 4:44 am

Re: Move Stepper to certain positions

by adafruit_support_bill on Mon Jul 15, 2019 7:28 am

Is there a way to tell stepper the next position, no matter where it actually is?

The stepper motor has no feedback, so there is no way for it to know where it is - You need to start from a known position and track the number of steps in your code.

You will need to add code and/or a limit switch for homing the motor at startup. The AccelStepper library can track the position relative to that. See the MoveTo command: https://www.airspayce.com/mikem/arduino ... 5810ec9736

Is the AccelStepper library compatible to the v2.3?

Yes. There are examples included in the library.

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.