Motorshield V2 & Multistepper - 3 steppers

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
s_stoetzer
 
Posts: 2
Joined: Sat Dec 31, 2016 2:32 pm

Motorshield V2 & Multistepper - 3 steppers

Post by s_stoetzer »

Hello everybody,
I am trying to get the Motorshield V2 running with 2 steppers (later 2 shields, 3 steppers) which should start and stop simultaneously but with different speeds to go to a desired position (like in CNC - axis control).
Both steppers work independently - but not with Multistepper. Motorshield V2 has it's own fork of AccelStepper (examples provided work) and the examples give accelaration as well, but MultiStepper does not support Acceleration and the newest Multistepper library does not support the V2 of the motorshield.

All I need is to start the steppers with stepper 1 having to do e.g. 780 steps while stepper 2 has to do 26. Both need to start and stop at the same time; later I'll extend that to three steppers.
Any ideas would be greatly appreciated... and btw: happy new year ;-)
Sergej

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

Re: Motorshield V2 & Multistepper - 3 steppers

Post by adafruit_support_bill »

Both steppers work independently - but not with Multistepper.
Not sure I understand the problem. The Accel_Multistepper example in the library shows how to do multiple steppers.
https://github.com/adafruit/Adafruit_Mo ... tepper.ino

User avatar
s_stoetzer
 
Posts: 2
Joined: Sat Dec 31, 2016 2:32 pm

Re: Motorshield V2 & Multistepper - 3 steppers

Post by s_stoetzer »

Hi and thanks for the fast reply!
The problem was not the 3 steppers, but them working together coordinated. The example only shows how to run 3 steppers at different speeds. To have coordinated movement, you have to wrap the AccelStepper-Objects into Multistepper-Objects.

But that only worked partly - after the first start the steppers start and stop together, but then run at different speeds if they have different targets.
After that, one of the second steppers is off by at least one second.
Meanwhile, I think I found a solution...

Working only first time strongly suggests it must have to do with settings in the void setup... (setting max speed for the steppers). If this happens in the main loop every time before setting new positions, steppers start&stop simultaneously while running at different speeds.

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

Re: Motorshield V2 & Multistepper - 3 steppers

Post by adafruit_support_bill »

OK. I'm not familiar with the multistepper library. But coordinating motion along a path using multiple motors with acceleration is a fairly complex problem. An Arduino would struggle to keep up with the math. I can understand why the author elected to stick to constant speed.

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

Return to “Arduino Shields from Adafruit”