UART communication with 60 devices

Go To Last Post
19 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I recently found out about serial servos and I am trying to understand how they work. The basic idea is you connect a bunch of them in series, and connect the first one to a device with a UART and you can control all of them based on their ids. I am wondering though, how this works from an electrical perspective. Lets say you have 60 or more of these servos. There is a power line, a ground, and a data line to communicate with the servos. I am pretty sure all the devices must be connected in parallel to  each of the lines; otherwise if one servo died the whole chain would die. The question then becomes, how far can a serial communication signal be sourced? The theoretical limit of number of servos in a chain is 254, since thats the max number of ids, but is it even possible to communicate with that many? What  is the best way to figure it out? I understand how the power can reach all 60 of the servos as long as the power supply is strong enough, but the data line is driven by either some microcontroller or a PC,  which can only source so much current

This topic has a solution.
Last Edited: Thu. May 6, 2021 - 03:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

testdrone wrote:
The theoretical limit of number of servos in a chain is 254, since thats the max number of ids, but is it even possible to communicate with that many?
Yes by MPCM though don't know if MPCM is available for one-wire UART; maybe so as LIN is one-wire.

Multiprocessor Communication | AVR® DB Family due to AVR® Dx Additional Features | USART | Migration from the megaAVR® to AVR® Dx Microcontroller Families

AVR DD Product Brief

 

LIN - Local Interconnect Network

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Will that allow the signal to reach the farthest servo?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You will need RS458 for up to 4,000ft.  MPCM can handle 255 addresses.

 

What kind of comms do the servo have? You may have to add something else to the RS485 comms.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What's the distance?

Reason : LIN is in cars and light trucks; don't know if LIN is in medium trucks and semi-tractors with trailers.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 I am pretty sure all the devices must be connected in parallel to  each of the lines; otherwise if one servo died the whole chain would die.

The WS2812B digital LEDs with their 16M possible colors use the serial approach.

The micro sends the data pulse stream to the first LED.

It strips its data off the data string and then sends the remaining data on down the line.

Each LED has its own "line driver" data output to drive the line to the next LED in the string.

Hence the furthest distance for any driver is simply the distance betwen the two most separated LEDs, not the distance of the entire string.

 

Which approach one uses, serial or parallel, (or star...), obviously depends upon the project and the probability and consequences of encountering a failure, (and cost, and, and, and...).

 

JC

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You say that a PC or microcontroller can only source so much current. That is true but there is absolutely no limit to what that current, and voltage, could be. There is nothing to stop you amplifying the logic signal up to whatever is required.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What you have is an input impedance question.  If (for example) each servo has a 100k ohm input impedance, then 100 servos in parallel would have a 1k ohm input impedance.  This, for most serial drivers, is trivial - they're designed to run into more like 50 ohms, not 1,000 ohms.  There are other issues.  S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The common serial servos appear to have a 3-wire connection, to use half-duplex communications, and work at TTL levels.

 

In other words the communications is in one direction only from the controller to the motor, and uses 0V and +5V as logic 0 and 1. Achieving this over hundreds of metres is trivial.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:
half-duplex communications ... In other words the communications is in one direction only

One direction only would be Simplex.

 

Half-Duplex means both directions, but only one at a time.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

 

 

 

testdrone wrote:
I recently found out about serial servos

Please give a link to the type of thing you're talking about

 

testdrone wrote:
I am trying to understand how they work

Is there no documentation for the one(s) you found?

 

testdrone wrote:
The basic idea is you connect a bunch of them in series

Is it?

 

Doesn't seem to be the case with this one: 

https://www.sparkfun.com/product...

 

It has an output for each servo:

https://www.sparkfun.com/datasheets/Robotics/ssc03a_guide.pdf

 

gchapman wrote:
MPCM

You don't necessarily need MPCM - just a protocol with an address (ID) in it.

 

That would work with all the receivers in parallel.

 

DocJC wrote:
WS2812B digital LEDs

They do, indeed, work in series - each LED "drops" the data that it uses (consumes), and then re-generates the bitstream to the next device in the chain.

 

testdrone wrote:
I am pretty sure all the devices must be connected in parallel

But previously, you said series ?

 

testdrone wrote:
otherwise if one servo died the whole chain would die.

Yes - as would happen with the WS2812B type LEDs

 

is it even possible to communicate with that many? What  is the best way to figure it out?

You look at the output specs of the driver, and the input specs of the receivers - the driver needs to be able to supply enough for the sum of all receivers.

 

I understand how the power can reach all 60 of the servos as long as the power supply is strong enough, but the data line is driven by either some microcontroller or a PC,  which can only source so much current

It's just a matter of ensuring that "so much" is sufficient - exactly as for the power supply.

 

 

EDIT

 

A thread on MPCM (Multi-Processor Comms Mode) here: https://www.avrfreaks.net/forum/mpcm-mode-send-data-slave-master - that's talking about 2-way comms; not sure if that's the case here?

 

From the  ATmega640/V-1280/V-1281/V-2560/V-2561/V datasheet:

 

https://ww1.microchip.com/downloads/en/DeviceDoc/ATmega640-1280-1281-2560-2561-Datasheet-DS40002211A.pdf

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. May 6, 2021 - 09:42 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How would MPCM help in this? Surely it would need a micro on the back of each servo (in addition to the one already there!) to understand the 9 bit addressing thing?

 

Rather than serial servos what one might do is just use "normal" servos but put the smallest/cheapest micro on each one that can act as a client in some kind of one-to-many networking protocol (be it RS485, CAN, Ethernet, I2C, etc, etc,  or whatever).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Surely it would need a micro on the back of each servo (in addition to the one already there!) to understand the 9 bit addressing thing?

Yes, indeed.

 

But the OP seems to be talking about some product which has this already built-in?

 

Is/are there any standard(s) for "serial servos" - or do we really need to know the specific devices the OP is talking about?

 

As I said, it wouldn't need MPCM - but, if you do already happen to be using such a micro anyhow, you might want to take advantage of it.

 

One big disadvantage is that PC COM ports typically do not support it.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You see this is what happens when threads are needlessly split. I think anyone reading this thread needs to read the previous thread: https://www.avrfreaks.net/forum/... first - the suggestion of using serial servos only appeared at #11 in that thread.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So from the Hackaday post https://hackaday.com/2018/07/05/wrangling-rc-servos-becoming-a-hassle-try-serial-bus-servos/ it does seem that there is not one single standard for "serial servos"  - just various proprietary offerings?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1. There only seem to be a few companies that make these things. Here is one that I am considering

https://www.kickstarter.com/proj...

 

2. There is documentation, but it is on how to use them, not on the physics behind how it is possible for it to work. My main question I guess was how to source a digital signal across a long distance in parallel to many receivers

 

3. That sparkfun product is different than what I was referring to

 

4. When I said in series, what I meant was they are arranged similar to christmas lights, physically all in a row, but I believe internally, the servos are all connected to the data bus in parallel. Sorry for the confusion

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That is what I found as well. The crux of my question was how the technology behind such a product works

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

testdrone wrote:
The crux of my question was how the technology behind such a product works

I think that's been covered now?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes it has, thank you. I just wanted to clarify. I will mark the solution