Need to run 5 stepper motors with pololu driver with ONE board (Arduino Mega right now)

Hi,

Newbie wants to control 5 stepper motors with pololu driver with ONE board (Arduino Mega right now).

One stepper motor runs fine in Arduino (right now I’m using a copy of the Arduino Serial Speed Control library example, no problem with it.

TWO things are needed:

  1. To control 5 steppers, one after another, with their own power supply, with 5 pololu boards, off the same Arduino. Right now the one Pololu uses the TX and RX pins and there are no more of them.

  2. I need to know exactly how many steps are running in the program, and exactly how many turns of the stepper I am getting.

Please describe the project in detail, as it may not even be possible.

What steppers, and what stepper power supplies? Post links to the data sheets or product pages.

Which motor drivers do you have in mind?
.
What will the steppers be doing and how quickly must they step?

How many steppers will be active at the same time?

What is “one Pololu”?

uses the TX and RX pins and there are no more of them.

The Arduino Mega has four serial ports.

Jim_Remington
December 13

Please describe the project in detail, as it may not even be possible.

If it’s not possible we are getting a few more Arduinos and we’ll just have the operator push one button after another, it looks like that will be a fine Plan B.

What steppers, and what stepper power supplies?

I am using one Nema 17 now, I do not have its data sheet but it works great with the Pololu libray example download for a serial controller. Other steppers are on order with the actuators. Here is the sketch:

void resetCommandTimeout()
{
tic.resetCommandTimeout();
}

// Delays for the specified number of milliseconds while
// resetting the Tic's command timeout so that its movement does
// not get interrupted.
void delayWhileResettingCommandTimeout(uint32_t ms)
{
uint32_t start = millis();
do
{
resetCommandTimeout();
} while ((uint32_t)(millis() - start) <= ms);
}

void loop()
{
// Move forward at 200 steps per second for 2 seconds.
tic.setTargetVelocity(800000000); (I increased this number, it worked fine, I had to increase the "maximum" number on the Pololu Tic with the control panel)
delayWhileResettingCommandTimeout(9000); (I increased this number too)

// Decelerate to a stop.
tic.setTargetVelocity(0);
delayWhileResettingCommandTimeout(9000); (I disabled deceleration and acceleration, it is not suitable to my use)

// Move in reverse at 100 steps per second for 1 second.
tic.setTargetVelocity(-80000000);
delayWhileResettingCommandTimeout(9000);

// Decelerate to a stop.
tic.setTargetVelocity(0);
delayWhileResettingCommandTimeout(1000);

}

Which motor drivers do you have in mind?

I am using a Pololu Tic 500

.
What will the steppers be doing and how quickly must they step?

I need 2 or 3 revolutions per second. They will be driving a linear actuator, there seems to be plenty of power, I’ve already run it with the UBS control and it’s fine.

How many steppers will be active at the same time?

Only one

What is “one Pololu”?

Sorry, ONE Tic 500

uses the TX and RX pins and there are no more of them.

The Arduino Mega has four serial ports.

Yes, the info I said told me only to use the TX and RX pins, of which there are only 2.

PLEASE give me some information about what the setTargetVelocity and the
delayWhileResettingCommandTimeout commands actually do!

Thank you!
Aryeh

Check the library documentation and code for details on the function calls.

I can’t help design a functional system without data sheets. You need to first determine the mechanical requirements of the project (torque and power) and then choose motors and drivers.

Thank you.

It does not appear that Pololu is suitable for multiple motor control in a simple way, so I am just going to buy 5 Arduinos and have the operator push 5 buttons no big deal easier than programming that might not work.

Motor power is no problem, this stepper has already been run off the USB with the Tic 500 and it works great.

This tells how to connect multiple Tic’s to one board; I didn’t understand all of it but there it is (https://www.pololu.com/docs/0J71/4.6):
"

Controlling multiple Tics with I²C

I²C is designed so that you can control multiple slave devices on a single bus. Before attempting to do this, however, we recommend that you first get your system working with just one Tic as described above.

Next, make sure that the I²C master device and the Tics all share a common ground, for example by connecting a GND pin from the I²C master device to a GND pin on each of the Tics. Make sure that the SCL pins of all devices are connected and that the SDA pins of all devices are connected.

You should use the Tic Control Center to configure each Tic to have a different “Device number”, which specifies the 7-bit I²C address to use. Then you should change your code to use those addresses. If you are using our Tic Arduino library, you can declare one object for each Tic by writing code like this at the top of your sketch, which uses addresses 14 and 15:

?

Hi, aryeh.

Since you mentioned your current setup has the Tic connected to the Arduino Mega with the TX and RX pins, I want to point out that you can also connect multiple Tics to an Arduino through serial as well. The “Connecting a serial device to multiple Tics” heading in the “Setting up serial control” section of the Tic user’s guide describes how that can be done.

We also have examples for both serial and I2C communication in our Arduino library for the Tics.

If you have trouble with those examples or adapting them for your application and you post your most recent code, we would be happy to help.

-Claire

Wow thank you Claire I’ll get to work!
Aryeh