Stepper motors, TMC2208, multistepper

Hi,

I have an installation with 14 "Nema 17" stepper motors.
It is 7 units with 2 motors in each.
They are driven by TMC2208 stepper drivers with 24V

My initial plan was to use an Arduino Mega 2560 in a "hub" to control them all, but I am thinking that it's too much to handle.
There is also a PCA9685 board, MIDI IN function and 7 hall effect sensors.

From what I understand, the Multistepper library has a 10 motor limit.
I want to control them all individually and simultaneously.

Any suggestions for a better solution?

Cheers, Hal

We need to know more about how you want to control the motors. It's so much easier to help when you give a description of the whole project in which will motors will operate.

A key question is whether 2 or more motors need to start at the same time and stop at the same time even though they move different numbers of steps - like a 3D printer for example.

If the motors don't need to be coordinated like that then the coding can be simpler.

It is 7 units with 2 motors in each.
They are driven by TMC2208 stepper drivers with 24V

Does that mean that, from the Arduino's point of view there only needs to be code for 7 motors?

Again, a description of the whole project would probably have avoided the need for that question.

If it is the case that the MultiStepper library is not suitable then it is not all that difficult to control stepper motors without any library.

Be aware that the MultiStepper library does not do acceleration.

...R
Stepper Motor Basics
Simple Stepper Code

Hi again,

7 units.
Each unit has 2 stepper motors, Nema 17, 1,5A
One controls panning continuous rotation, 360 degrees
The other controls tilting 45 degrees.

I want to be able to control all 7 units individually, and both panning and tilting separate.
I want to be able to move all 14 motors at the same time to different positions and at different speed. So synchronized but individually.

I am not married to the Multistepper/Accelstepper library, so I'm open to other ways to control them.
I am using the TMC2208 driver

I was thinking that the Arduino Mega maybe is not powerful / fast enough to handle 14 motors simultaneously.
Maybe I should have one UNO /Nano in each unit, or maybe use the 32-bit Due in the hub?

Hal

eptheca:
7 units.
Each unit has 2 stepper motors, Nema 17, 1,5A
One controls panning continuous rotation, 360 degrees
The other controls tilting 45 degrees.

I can't visualise that. Why are there 7 units. Can you make a simple drawing that illustrates the whole machine and post a photo of the drawing?

Another very important question is how will the Arduino know how to move the motors? Will it be receiving instructions from another computer? If so you need to provide an example of the instructions it will have to deal with.

...R
Simple Image Posting Guide

It’s a pan/tilt head that can hold a camera and pan it 360 degrees and tilt it up and down 45 degrees.
I will have 7 of them next to each other and want to control them individually and simultaneously.
They will receive instructions from a computer over MIDI

eptheca:
It's a pan/tilt head that can hold a camera and pan it 360 degrees and tilt it up and down 45 degrees.
I will have 7 of them next to each other and want to control them individually and simultaneously.
They will receive instructions from a computer over MIDI

Pity you did not have that in your Original Post :slight_smile:
And there is still an awful lot you have not told us about what seems to be a complex project. Why the secrecy?

Why 7 cameras?

I'm not familiar with MIDI. I think I should also ask why MIDI?
Neither can I conceive of how the cameras will be required to move.

Can you provide an example of the sort of message that will be sent to the Arduino to indicate the next move. It is also very important to know how frequently those messages will be sent. We have to have hard facts in order to figure out how much work the Arduino will have to do.

Another complication (now that we know it involves multiple cameras) is how will you know what each camera is pointing at to start the process?

...R

Ha ha :), no secrecy, just trying to explain an abstract art idea.
I was trying to provide the necessary information for the question.

The MIDI and cameras is not part of the question.

The question is:
Can an Arduino Mega handle 14 stepper motors with TMC2208 drivers, that are all moving at the same time, but different amounts of steps and at different speeds?
If not, will it work best with 7 Arduino Uno/Nano or one 32-bit Arduino Due?

Hal

eptheca:
.The question is:
Can an Arduino Mega handle 14 stepper motors with TMC2208 drivers, that are all moving at the same time, but different amounts of steps and at different speeds?
If not, will it work best with 7 Arduino Uno/Nano or one 32-bit Arduino Due?

The MIDI and cameras is not part of the question

But they are almost certainly part of the answer.

Your call ...

...R

eptheca:
The question is:
Can an Arduino Mega handle 14 stepper motors with TMC2208 drivers, that are all moving at the same time, but different amounts of steps and at different speeds?

I expect so, it's just a matter of step and direction, although I see that there are other pins used for configuration - will you need to use them.

The more significant question is can it do it fast enough for your requirements, if not, perhaps the Due or one of the Teensy range would be a better choice.

The cameras are mobile phones or GoPro's
They are not connected to the Arduino
It doesn't matter where they are pointing at any time. The pan / tilt function from the stepper motors will point them in different and random positions.
I will look at and edit the footage later, so it will not affect the use of the Arduino or the motors in any way.

I am using MIDI to instruct the Arduino what to do, because I am familiar with MIDI, and will sync the movements to sound. I do this from a computer.
The arduino will run a MIDI IN function in the loop listening for MIDI messages
The baud rate for MIDI is 31250

For example, I will send a NoteOn message for a note like middle C, which is 60, and there will be a function for that case, like move motor_pan 200 steps to the right at a certain speed.

My concern is that it will be too much for the Arduino to do this for 14 motors at the same time.
The MIDI can handle it, and the Arduino can handle the MIDI, but maybe all this stepping information at different frequencies will be too much.

I hope this explains more why I am wondering if one Mega will handle this, or if there is a better solution.

Cheers, Hal

wildbill:
I expect so, it's just a matter of step and direction, although I see that there are other pins used for configuration - will you need to use them.

I use the TMC2208's in legacy mode, so no other pins for configuration.
The Enable is connected to Ground, and the MS1 and MS2 are not connected (full-step mode)
Other pins in use on the Arduino is RX and TX for MIDI, other than that it is only two pins, DIR and STEP, for each motor.

eptheca:
I am using MIDI to instruct the Arduino what to do, because I am familiar with MIDI, and will sync the movements to sound. I do this from a computer.
The arduino will run a MIDI IN function in the loop listening for MIDI messages
The baud rate for MIDI is 31250

For example, I will send a NoteOn message for a note like middle C, which is 60, and there will be a function for that case, like move motor_pan 200 steps to the right at a certain speed.

My concern is that it will be too much for the Arduino to do this for 14 motors at the same time.
The MIDI can handle it, and the Arduino can handle the MIDI, but maybe all this stepping information at different frequencies will be too much.

That’s exactly what I have been trying to get you to think about.

Now, perhaps you can respond to the request in Reply #5

Can you provide an example of the sort of message that will be sent to the Arduino to indicate the next move. It is also very important to know how frequently those messages will be sent. We have to have hard facts in order to figure out how much work the Arduino will have to do.

…R

Example:
The arduino will get a MIDI message with a Note On message for 14 notes.
Those 14 notes, like 60-73 will each have a function like: motor_pan_1, step right 200 steps at speed 5
They will be different for each motor, so they will reach their destination at different times.
Then there will be a new NoteOn message for maybe 8 of the motors to move to a different position, then maybe 3 etc
At the most all the 14 motors need to step at the same time for for maybe 30 seconds, and then there will be a new message for all 14.
The new messages will not come very frequently, but the arduino will have to step 14 motors at the same time, all the time.

Hal

eptheca:
The arduino will get a MIDI message with a Note On message for 14 notes.

That's a description of the message. Can you provide an example of an actual message and how it should be interpreted - in other words the exact data that the Arduino will receive.

...R

Not only that, but what does speed 5 mean in terms of how frequently the stepper must be stepped? What's the top speed? How often would you be stepping for that?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.