sincronizare stepper motors

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Delia
 
Posts: 15
Joined: Fri Jun 03, 2016 4:23 am

sincronizare stepper motors

Post by Delia »

Hi,

How can I synchronize 2 stepper motors with Shield V2 ?

User avatar
adafruit_support_bill
 
Posts: 88096
Joined: Sat Feb 07, 2009 10:11 am

Re: sincronizare stepper motors

Post by adafruit_support_bill »

To step the motors in sync, you need to do your own step timing and move each motor using the onestep() command.

Code: Select all

for (int i = 0; i < stepCount; i++)
{
    motor1->onestep(FORWARD, DOUBLE);
    motor2->onestep(FORWARD, DOUBLE);
    delaymicroseconds(stepInterval);
}

User avatar
Delia
 
Posts: 15
Joined: Fri Jun 03, 2016 4:23 am

Re: sincronizare stepper motors

Post by Delia »

Thanks.
But probably I did't ask corect, I want to start the motors in the same time but I don't want to stop them at the same time. More exactly I want to rotate one motor more than the other but I want to start them in the same time.

User avatar
adafruit_support_bill
 
Posts: 88096
Joined: Sat Feb 07, 2009 10:11 am

Re: sincronizare stepper motors

Post by adafruit_support_bill »

For that purpose, AccelStepper is probably your best choice. There are a couple examples using AccelStepper in the V2 motor shield library.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”