Connecting Arduinos?

Hi there, we are building a sort of modular display where each 'module' contains 4 stepper motors in a 5"x5" square. My plan is to use one Arduino for each module. We're doing an initial test with 9 modules but it will scale to much larger eventually.
So I will need to send the Arduino/Module ID and info for each of the four steppers in that module - in near realtime - the data will be driven by camera. So far using a RS485 serial bus seems to be my best option, but I just wanted to check here before I buy a bunch of RS485-TTL modules.

Thanks!

Is the data going to be travelling through slip rings?

mikb55:
Is the data going to be travelling through slip rings?

I don't see any mention that the stepper motors would be turning the controlling arduino, but with the lack of detail it is all speculation at this point.

For the OP, how fast does the communications need to be? "Near realtime" can be vastly different depending on exactly what you are doing, and we can only guess at the amount of data needed to control the stepper motors.

How big is "much larger"?
What are the physical distances involved?
How often are commands sent to the nodes, and how fast do you need them to react?

I think you are making a good choice. Some of the advantages inherent in your choice are: Balanced interface, Multipoint operation from a single 5-V supply, –7-V to +12-V bus common-mode range, Up to 32 unit loads, 10-Mbps maximum data rate (at 40 feet), 4000-foot maximum cable length (at 100 kbps). The hardware interface is inexpensive, and readily available. With some of the Maxim chips you can go to 128 nodes but I would not recommend it unless you have to, multiple buses would be much easier to debug. A few of the big gotchas are Stubs, it should be point to point. Proper termination, and this goes only at the two physical ends not each node. TI has some good information at: http://www.ti.com/lit/an/slla272c/slla272c.pdf also look at these two others: https://www.lammertbies.nl/comm/info/rs-485 and: RS485, RS232, RS422, RS423, Quick Reference Guide. Note: the protocol is up to you, RS-485 is just the physical layer.
This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

HI thanks for the replies! I'm not sure what slip rings are, and based on the next reply about the arduinos moving though, I kind of understand - so no. No slip rings, no movement of the arduinos. The data will be coming from a web cam taking video and then processed and fed to the display. So as realtime as possible though some delay is fine. If I could get 3 - 5 fps that would be fine.
As for scaling this thing - I'm not sure... what if I did 10x10 - so 100 nodes, 400 steppers... Is 100 nodes too many? I see in the message from @gilshultz he says up to 32 unit loads... I definitely need to be able to address more than 32 and I'd like to know I could do 100's with the agreed upon design of this.
Would rPI's be better for communication like this? I've never even used one.

Way to many unknowns.

What is the data you're going to send to the steppers?

What is even the fps of a stepper (node)?

You make it sound like those steppers are responsible for creating some kind of display. What exactly do you have in mind? Are you sure you want steppers for this, not servos?

Does communication even have to be wired? Wireless is a real option, and will make the physical build a lot easier. NRF24 nodes may work - you should be able to get about 1 Mbps; 10 kbps per node; about 1,000 bytes per second per node. That should be enough for simple addressed messages 3-5 times a second (the RadioHead library can help with this). This will do well as long as your "stepper display" isn't crazy big (like 100m across or so).

If you are considering using nRF24L01+ wireless transceivers then this Simple nRF24L01+ Tutorial may help.

As others have said you need to provide a much better description of your project so we can understand your questions in their proper context.

To start with describe the project requirement without concerning yourself with how it might be implemented.

...R

"To start with describe the project requirement without concerning yourself with how it might be implemented."

So, I don't have much control over these nodes - they are a 5"x5" block containing four bipolar steppers. Each stepper moves a rod in/out - so as to make a depth effect. The nodes will be connected to form a display that will mimic the depth info sent from the camera. I think there will be some fabric cover or something. I'm tasked with driving these nodes and figuring out how to communicate the depth data from the camera to each one.

So the communication definitely doesn't need to be wired, wireless sounds like it might be a nice solution.

Also, the data to the stepper would just be some value between 0-255 that would translate to how much the rod was in or out - so mapped into some 0" to 6" range or something like that. So basically I take a ROI from an image, resize it to the size of the display and map each pixel to it's corresponding stepper.

What you really need is some kind of linear actuator with location feedback, not a stepper. That's just complicating the whole thing, as for starters you'd need a home switch for every single stepper. Servos would also be very capable of doing this kind of back and forth movement, are dead easy to control (no homing or counting steps etc), and much faster than steppers.

Indeed a single byte value per servo; plus a few control bytes for your message. I'd reserve the value 0 for start of message, then you can send 6-byte messages.

Wireless should work fine as long as you have the bandwidth - just send out the messages continuously and as fast as you can. Wireless is of course lossy by nature, but in this application you don't bother with acknowledgements, if you miss one the next message is bound to do come through. No-one will notice a single missed transmission. An Arduino can happily read and parse that many messages, and set its servos to the new position. Doing the same with steppers is going to be much harder due to the Arduino having to do a lot more work.

Possible message protocol would be:
0x00 (start byte)
0x01-0xff (node address - 255 individual nodes possible)
4 bytes value 0x01-0xff (servo position).

Add a second address byte for even more nodes if you really want.

You will indeed need a RPi or something even more powerful to operate the thing; it's going to take some serious data crunching to go from a video image to servo position.

Just curious, how are you getting depth information from a camera image? Some type of stereo image comparison?

dmen:
So, I don't have much control over these nodes - they are a 5"x5" block containing four bipolar steppers. Each stepper moves a rod in/out - so as to make a depth effect.

I agree with Reply #9.

It would be straightforward to make a servo push a rod in a linear motion.

You have not said how far the rod needs to move, how heavy the rods will be or whether they will be subject to a load. However you can get large servos if significant force is required.

Servos have the additional advantage that the consume very little energy when stationary whereas a stepper motor needs its full current all the time to maintain position.

...R

Robin2:
You have not said how far the rod needs to move, how heavy the rods will be or whether they will be subject to a load.

Not clearly specfified but neither seem spectacular:

dmen:
I think there will be some fabric cover or something.
[...]
some 0" to 6" range or something like that.

Rod pushing some fabric up to 6"/15 cm back and forth.

wvmarle:
Rod pushing some fabric up to 6"/15 cm back and forth.

Thanks. I missed that bit.

I suspect fabric could impose some strange loads - including maybe some substantial sideways loads that could cause the rods to jam unless there was sufficient force. And fabrics can be heavy.

I'm guessing the rods will need to be connected to the fabric so they can pull it in to represent a valley - don't know if they will be heavy enough to do that by gravity alone.

I also suspect the fabric will need to be stretchy to keep everything smooth - so the rods will have to work against the elasticity.

An interesting challenge.

...R

"It would be straightforward to make a servo push a rod in a linear motion.

You have not said how far the rod needs to move, how heavy the rods will be or whether they will be subject to a load. However you can get large servos if significant force is required."

Agreed! I found a nice YT video on linear servo conversion and it's perfect. And the reduction in power while stationary is a boon as well. I am not positive what the load will be on these rods, there has been talk of a fabric covering, led's on the ends, lcd's on the ends etc... But I was trying to think with the fabric in mind since that will likely be the oddest one to control nicely.

"Just curious, how are you getting depth information from a camera image? Some type of stereo image comparison?"

Either Kinect or the newer Azure Kinect... have both of them, but haven't gotten that far yet. Will probably just grab depth buffer from camera, isolate the region at whatever depth(s) I need and then resize to the display so one pixel matches one servo. Probably will just use a laptop for this. For me this is the easier portion of this project, but I much enjoy trying to figure out the Arduino/Servo stuff.

If you convert the image to b/w and use the brightness of the pixels for how far to extend the rods, you may get a recognisable image. This, plus of course the downscaling, could be easily done by a laptop of Pi, the resulting low-res images streamed to the nodes which control the servos.

100 nodes with 4 servos each makes for a 20x20 "pixel" image. 256 nodes with 4 servos each makes for a 32x32 "pixel" image.

A single Arduino (Pro Mini would make the most sense) can control up to 12 servos - a 3x4 module. If going for servos, that'd be my choice. Build a custom PCB which holds the Arduino board, connectors for the servos, connector for power (you may want to separate Arduino and servo power supply for less interference - or place a lot of extra capacitance on the board to stabilise the Arduino's power supply), and a wireless module for communication. This would make for easiest installation and maintenance (very easy to swap out modules or servos if one fails).

No matter, that's gonna be a LOT of servos! Hope you have a healthy budget :slight_smile:

Thanks again for the guidance. So, I'm stuck here though:

""It would be straightforward to make a servo push a rod in a linear motion."

So, it is - but I need like 6" of travel which means I have to have a servo horn 3" long, or a 3" wide toothed gear. I see most of the horns are 25mm long - is 75mm going to be problematic with torque? So far I think moving the servo 0 - 180º and using a half scotch yoke mechanism seems about the simplest and most compact.

Is it true that the stepper motors take power even when not moving - ie to hold position? Why don't servos do the same?

Also, if we did use steppers - or continuous rotation servos in order to drive a rack and pinion how do we track revolutions in case of a power outage - ie how to reset everything back to zero when I don't know where everything is?

dmen:
So, it is - but I need like 6" of travel which means I have to have a servo horn 3" long, or a 3" wide toothed gear. I see most of the horns are 25mm long - is 75mm going to be problematic with torque? So far I think moving the servo 0 - 180º and using a half scotch yoke mechanism seems about the simplest and most compact.

Organize it in whatever way is convenient. Whatever the mechanical arrangement you will have the leverage of 6 : 1. I suggest you buy a cheap standard size servo and try it. You can get larger and smaller servos depending on your need.

In your mechanical design be aware that many servos cannot physically move a full 180° - maybe only 150° or 170°.

Is it true that the stepper motors take power even when not moving - ie to hold position? Why don't servos do the same?

It is true. Servos have a huge gear ratio between the motor and output shaft and the friction in the gears is generally sufficient to hold the load without motor power. Also, most hobby servos are not designed for the motor holding a stationary load for long periods - they are likely to overheat.

Also, if we did use steppers - or continuous rotation servos in order to drive a rack and pinion how do we track revolutions in case of a power outage - ie how to reset everything back to zero when I don't know where everything is?

The usual way is to have a limit switch and at startup drive the stepper motor until it triggers the switch. Then the Arduino knows the zero point and if the motor does not miss steps it will always know the motor position by counting the steps. You could use a limit switch with a continuous rotation servo but you have no means to know how far from the zero position the arm will have moved. With a continuous rotation servo you can only control speed and direction.

...R

With a continuous rotation servo you can only control speed and direction.

What about a servo with a built in encoder? I know Adafruit sells one so then I could just count revolutions and current angle to know position.
Here's the one I saw on Adafruit:

While it is a hobby servo, there must be bigger/stronger similar ones?

Thanks much for the response, it's very helpful.

Sounds kind of like a variant of a "wooden mirror" project.