multple (5) stepper motors controlled with arduino via android

Hey!

I'm rather new to this electronic world, so please forgive me if some of the questions may seem stupid...

What i want to do is a camera rig controll system.
One part is an android app where you will be able to create a timeline for all 5 motors (sideways motion on slider, left/right rotation, up/down rotation, zoom and focus), with option of adding key points and setting the smoothening factor in the near of this points. This app will output the "instructions" for each motor. For example motor 1 should accelerate from time 0 to time 1200 (1,2s) with acceleration 300(steps/s^2), then stay at this speed for another 2s and then decelerate for a second,...
this instructions would be sent via bluetooth and then at right times the parameters for motors changed.

I was thinking of using accelSteper library AccelStepper: AccelStepper library for Arduino because it has the support to have accelerations and it is nonblocking, so i can use it to control multiple steppers at the "same" time.

for now i have arduino UNO and i took the motor shield from adafruit and with one stepper it works fine with one or two steppers, but since that doesn't support more than 2 steppers (and it uses a lot of pins), i was thinking about this controllers: Pololu - A4983 Stepper Motor Driver Carrier with Voltage Regulators or it's newer version: http://www.pololu.com/catalog/product/1183 (that way i only use 10 pins for all motors).

as far as bluetooth communication goes i was thinking about using http://www.seeedstudio.com/depot/bluetooth-shield-p-866.html?cPath=132_134 this shield and amarino library.

my doubts/concerns:

  • will i be able to store all the "instructions" for the motors and all the other variables in the 2kB available ram? if not, i will have to send them at the right times and most likely bluetooth communication will block the motor control? or am i wrong?
  • is the atmega328 fast enough to handle sending steps to all 5 motors even at "higher" frequencies (e.g. 10k steps/s)
  • i was looking at the chipkit 32 uno http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,892,893&Prod=CHIPKIT-UNO32 that is supposed to be compatible with arduino libraries, does anyone have any experience with them? I was thinking about having the arduino as "communication" part that would recieve instructions via bluetooth and send them to this faster chip that would send the step signals to the motor drivers

thank you for your answers and help

EDIT: this is what i want to control with the 5 steppers.

  • will i be able to store all the "instructions" for the motors and all the other variables in the 2kB available ram?

Depends on how many "instructions" you want to store. One or two? No problem. 2000? No way.

  • is the atmega328 fast enough to handle sending steps to all 5 motors even at "higher" frequencies (e.g. 10k steps/s)

10,000 steps per year? No problem. 10,000 steps per second? I doubt that the steppers can step that fast.

  • i was looking at the chipkit 32 uno http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,892,893&Prod=CHIPKIT-UNO32 that is supposed to be compatible with arduino libraries, does anyone have any experience with them? I was thinking about having the arduino as "communication" part that would recieve instructions via bluetooth and send them to this faster chip that would send the step signals to the motor drivers

Far too many details are missing from your post to determine whether the other thing is even necessary.

Depends on how many "instructions" you want to store. One or two? No problem. 2000? No way.

ok, if i assume i'll have half of the memmory available for this data, that gives me about 200bytes per motor, which is not much at all (considering i need to store time in 4 bytes, then speed in 2, acceleration in 2). that means for anything usefull i'll need to implement sending of chunks of the instructions for the motors sometime before they are needed.

10,000 steps per year? No problem. 10,000 steps per second? I doubt that the steppers can step that fast.

10000 steps per second ofcourse :slight_smile: but that was already a number with microstepping so the actual speed of the stepper would be one eight (or maybe even one 16th of that), but i need to send 8 step signals for a motor to make one step (if i'm using 1/8 microstepping mode), right?

Far too many details are missing from your post to determine whether the other thing is even necessary.

the other thing here beeing the chipkit uno?
do you think i can use arduino uno for both, bluetooth communication and to control 5 steppers at the same time?

that means for anything usefull i'll need to implement sending of chunks of the instructions for the motors sometime before they are needed.

That's generally the way it's done.

but i need to send 8 step signals for a motor to make one step (if i'm using 1/8 microstepping mode), right?

Right. But, even with 8 steps per revolution, 10000 steps per second is 1,250 revolutions per second, which is 75000 rpm. Not a stepper on earth can turn that fast. Very few motors can. I really think you need to rework some of your numbers.

the other thing here beeing the...

Yes.

do you think i can use arduino uno for both, bluetooth communication and to control 5 steppers at the same time?

You can control 5 steppers at once, if the stepping is non-blocking. Generally, it isn't. But, you can't store enough data on the UNO for a complete program. So, you'll need a PC to store the programs. What is the BT for?

Right. But, even with 8 steps per revolution, 10000 steps per second is 1,250 revolutions per second, which is 75000 rpm. Not a stepper on earth can turn that fast. Very few motors can. I really think you need to rework some of your numbers.

not quite. if a motor has 400 steps per revolution then the math would be something like this:
if i send 10000 steps per second (microstep signals), that gives me 1250 "full" steps, which is 3.125rotations per second -> 187.5rpm. that's not THAT fast is it?
or am i understanding something completely wrong?

You can control 5 steppers at once, if the stepping is non-blocking. Generally, it isn't. But, you can't store enough data on the UNO for a complete program. So, you'll need a PC to store the programs. What is the BT for?

Easy Driver Examples here if you read under Example 4: Running multiple stepper motors it is writen that with arduino UNO it is already a bit of a problem if you take 2 steppers and set max speeds at 3000 and 1000 steps/s.
so if that is the case i guess i do need something a bit "faster" (or change my gearing system to be less precise and have less steps for the same lenght)

maybe it would help to show you what i'm trying to control with it :slight_smile: - YouTube
for now it's with a very low speed and it works fine and smooth, but withoud microstepping it's quite shaky and not so nice.

What is the BT for?

i will have an android app where i will have some presets already saved (for most common used shootings) and will also have an option to create a new set of instructions by adding some "keyframes" (a list of coordinates for motors at a certain point in time) and then the app will also calculate the appropriate accelerations to make the movement smooth and nice to watch since it's gonna be recording video. this instructions will then be sent via BT to arduino and then to the motors. The computer in this case will be the android tablet that will have the main app.

if i did not describe well enough what i want to do with it, please let me know and i will try to describe it in another way. the thing is i don't have all the drivers yet and was hoping that someone had already tried multiple steppers and would be able to tell me what are the speeds that it's running well and where the problematic zone begins.

Great little camera rig!

Which microcontroller did you use finally? I am putting together a cnc like machine - also has 5x nema 16 stepper motors, thinking of using Arduino Mega or ChipKit. Any suggestions?

I'm curious, too.

The Shapeoko2 CNC mill manages to control 3 steppers with an Uno. There are four steppers, but two are doing exactly the same thing. The firmware on the Uno is called GRBL and it is open source.

I just bought a RAMPS 1.4 board, it is a breakout for five A4988 based stepper drivers with some other handy things like temperature sensor input and output for heaters, it plugs into a Mega. Meant for 3D printers, it isn't usually called on to run more than four steppers at once. I bought it to see if I can redo GRBL to run it.

I notice the original poster has only posted here in this thread, once more in Aug 2012, and never again. So I don't know if we'll get an answer.