Code for multiple stepper motors and motor shields

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
mhc
 
Posts: 3
Joined: Mon Jul 21, 2014 10:01 pm

Code for multiple stepper motors and motor shields

Post by mhc »

Hi!

I'm planning to use 6 stepper motors, the NEMA-17 size 200 steps/rev, 12V 350mA (from here) with the motor shield, well with 3 motor shields. I want to use the motors to turns continuously in one direction but with different speed for each (at least at 300rpm). I'm ok with wire things and electronics but I am absolutely stupid when it comes to Arduino coding. I've looked at the Library and didn't find anything on controlling multiples stepper motors and I did a search on the forum but the questions didn't fit with my need. Before I buy all the stuff, I'd like to know if it's possible to find the code somewhere ? I wish to get a simple code where I can make some changes only on the speed for each motors.

Thanks in advance!
mhc

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Code for multiple stepper motors and motor shields

Post by adafruit_support_mike »

The Motor Shield v2 uses a PCA9685 to generate the PWM signals that control the half-bridges, which in turn control the motors.

The Arduino communicates with the PCA9685 using the I2C protocol. Every I2C device on a bus has a unique address, and the Arduino tells the bus which one it wants to talk to by starting a command with the appropriate address.

The Motor Shield has a row of five solderable jumper pads that you can use to set the address for each shield. Once each shield has its own address, you just need to create five AFMotorController objects with the addresses you've chosen.

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

Re: Code for multiple stepper motors and motor shields

Post by adafruit_support_bill »

I'm planning to use 6 stepper motors, the NEMA-17 size 200 steps/rev, 12V 350mA (from here) with the motor shield, well with 3 motor shields. I want to use the motors to turns continuously in one direction but with different speed for each (at least at 300rpm).
Those speeds are not achievable with the motors you plan to use - especially not if you want to drive 6 at the same time. These motors are designed more for precision than speed. For higher speeds, you should consider using motors with fewer steps per revolution.

User avatar
mhc
 
Posts: 3
Joined: Mon Jul 21, 2014 10:01 pm

Re: Code for multiple stepper motors and motor shields

Post by mhc »

Hi there!

Thank you so much for your fast reply! Ok, seems easy enough ... I'll give it a try.

"Those speeds are not achievable with the motors you plan to use - especially not if you want to drive 6 at the same time. These motors are designed more for precision than speed. For higher speeds, you should consider using motors with fewer steps per revolution."

Thanks for that. It looks like you don't have a motor with fewer steps. Sad, I would have like buying everything here ...

Many many thanks!
See ya!

mhc

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Code for multiple stepper motors and motor shields

Post by adafruit_support_mike »

Check over at http://pololu.com/

They focus on robotics, and have a whole range of higher-power motor controllers, chopper drives, etc. Lotsa good stuff. ;-)

User avatar
mhc
 
Posts: 3
Joined: Mon Jul 21, 2014 10:01 pm

Re: Code for multiple stepper motors and motor shields

Post by mhc »

Thanks a lot ! :)
Cheers,

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

Return to “Arduino Shields from Adafruit”