Shop OBEX P1 Docs P2 Docs Learn Events
Connecting multiple props together — Parallax Forums

Connecting multiple props together

I am in the process of connecting 6 individual RoboPi Propellor boards together along with a master propellor board. I have a seperate transmitt and receive wire coming off the master and then connecting to the same data pins on each board. So the master can transmitt a request ($,board#) and then waits for the response. The individual RoboPi boards will only respond if they are selected and then they should send a response back to the master.
The code works great if only one RoboPi board is connected to the master but as soon as I add another board the code no longer works. It doesn’t matter which RoboPi board is connected, it just can’t be more than one connected for it to work. The wire connections are made directly to the propellor pins designated for RX or TX. Based on the symptoms I believe the problem is the wiring setup. I verified the wires on the cable are not open or shorted. I did a search in the forum but was unable to find anything outside of single prop to prop communications. Do I need some type of termination on the line or not? I will continue to test and experiment but was hoping someone else has an idea.
«1

Comments

  • Cluso99Cluso99 Posts: 18,069
    Sounds like the slave props are all driving their output lines. You could try ORing their outputs with a gate, or series diodes with a pullup.
  • Cluso99 wrote: »
    Sounds like the slave props are all driving their output lines. You could try ORing their outputs with a gate, or series diodes with a pullup.
    I was wondering if it might be something like that. I thought long ago someone posted on how they overcame the problem but I can’t find that thread. I don’t remember if they used pull-up resistors at each pin or something else.
  • kwinnkwinn Posts: 8,697
    edited 2019-02-15 02:35
    Put ~ 100R resistors on the RX/TX pins for short protection and have the slaves set their TX pin as an input except when they are responding to a command /request from the master. As a matter of fact you only need one communication line between the master and the slaves for this type of comms.

    PS - Unless you want one slave to answer while the master is sending to another.

    Corrected "output" to "input"
  • jmgjmg Posts: 15,148
    DiverBob wrote: »
    Cluso99 wrote: »
    Sounds like the slave props are all driving their output lines. You could try ORing their outputs with a gate, or series diodes with a pullup.
    I was wondering if it might be something like that. I thought long ago someone posted on how they overcame the problem but I can’t find that thread. I don’t remember if they used pull-up resistors at each pin or something else.

    What you need to do, depends on how the driver was written.
    If it makes no effort to tristate or open drain the send data from the slaves, you will need some means to handle/avoid one slave's low trying to drive other slaves 'hi's.

    That cold be a schottky diode to each slave and a common pullup. Then only the sending slave pulls the master RX low and the one idling hi, have no effect.
  • The serial driver is FullDuplexSerial4Port.
  • In other words you have a hardware bus of one bit. Bussed signals either require arbitration logic to select
    which node drives or use open-drain/wired-and/wired-or. Or you can add resistors at each node and do collision
    detection (which needs some means of sensing voltages in the middle).
  • kwinn wrote: »
    Put ~ 100R resistors on the RX/TX pins for short protection and have the slaves set their TX pin as an input except when they are responding to a command /request from the master. As a matter of fact you only need one communication line between the master and the slaves for this type of comms.

    PS - Unless you want one slave to answer while the master is sending to another.

    Corrected "output" to "input"
    I hadn't thought about manually setting the tx pins to input until a leg is ready to transmit. I will try that out and see how it goes. I got some help over on the Robotics forum side where the receive is no longer hanging up if no signal is received. Still not perfect, I can't seem to get the rxtime command to actually release after a delay so I tried using rxcheck instead which does work and gives a -1 result if no signal is present. The transmit works fine just so long as only one leg transmit is connected, add a second leg and the transmission stops. So it makes sense that the tx pins connected together drag the signal down.
    I've been running with separate wires for rx and tx so I wouldn't need complex coding to prevent signal issues but in the course of fixing these issues I've essentially created the framework for full duplex operation over a single wire. Now the master polls for a specific leg, the leg responds, and then the master polls the next leg. So data collisions shouldn't happen with this setup anyway. Now if I can just figure out the rxtime command I'll be all set up!

    Bob
  • You could eliminate bus contention by setting the pin to zero and an input. With a pull up on the line you could modulate it by changing the output status. The line would be high when the pin was an input and low when it was an output.

    If two or more modules were inadvertantly set to output at the same time the net result would be zero and no harm done.

  • jmgjmg Posts: 15,148
    DiverBob wrote: »
    I hadn't thought about manually setting the tx pins to input until a leg is ready to transmit. I will try that out and see how it goes.
    You will also need a pullup, so that 'everyone waiting' has a stable idle state.
  • Nothing about open drain bus eliminates bus contention, it simply prevents damage to the chips when
    there is contention. The protocol you chose/contrive is what prevents contention. Some protocols
    don't even prevent contention, but snoop on the line to detect contention. There is clever use of
    contention in the OneWire device discovery protocol, for instance.

    The commonest bus arrangement is master/slaves, with the slaves only responding after a request
    from the master, and the master arranging to give commands and allow time for slave responses.
    This requires each slave to have a unique identifying number or address so only one replies at a
    time.
  • jmg wrote: »
    You will also need a pullup, so that 'everyone waiting' has a stable idle state.
    Should I put a pull-up on each slave end or is one at the master side sufficient?
    Mark_T wrote: »
    The commonest bus arrangement is master/slaves, with the slaves only responding after a request
    from the master, and the master arranging to give commands and allow time for slave responses.
    This requires each slave to have a unique identifying number or address so only one replies at a
    time.
    This is basically the protocol I am using now. It works, at least with a single slave so far!

    I’m going to give these ideas a try and see what happens.
  • jmgjmg Posts: 15,148
    DiverBob wrote: »
    jmg wrote: »
    You will also need a pullup, so that 'everyone waiting' has a stable idle state.
    Should I put a pull-up on each slave end or is one at the master side sufficient?

    Just one on the master side is fine.
    To help with scope probe testing, you can do a (eg) 3k3 pullup, and a 33k pulldown.
    That idles at Vcc - 0.3V, which is comfortably logic 1, but you can now easily see on a scope when the slave enables and disables the tristate drive with this scheme.


  • I use the HC-8+ (from EFX-TEK) in a lot of big displays, and often have to link them together (using the built-in RS-485 port). I prefer to define one as the master and the rest slaves; this makes the master appear as one, bigger controller in my apps.
  • Tachyon already has this master/slave network built-in that switches from rx to tx and also supports RS485 but either way works and tested up to 2M baud. What's more the network simulates full-duplex over half-duplex lines so you can be connected to a unit via the serial terminal and "chat" with any remote unit.
  • I put 10K pull-up resistors on the master side of the rx and tx wires. I configured 2 slaves so that their TX line is configured as an input until the slave is called. Then I change the port to an output and send the data. After the data is sent the port is reconfigured as an input.
    Unfortunately I am getting the same results where a single slave hooked up works great but as soon as I add a second slave, neither slave outputs back to the master.
    With this setup I essentially have a single slave as a transmitter and all the other slaves and master is an input (with only the master actually listening at this point), very similar to the setup where the master is transmitting to all the slaves at one time and the slaves just listen for a command that pertains to them before they react. This works fine on one port of the 4 port serial object but not on the other port.
  • jmgjmg Posts: 15,148
    DiverBob wrote: »
    ...
    Unfortunately I am getting the same results where a single slave hooked up works great but as soon as I add a second slave, neither slave outputs back to the master.
    ...
    Something must be awry - how can either of those slaves know the other is connected ?
    What does a scope say about the slave-RX side loading ? Can you parallel slaves ok, and have a clean slave-RX ?

  • Got some more testing in today. First I verified the wiring and the pin connections, no errors found. Here is a drawing of the master-leg configuration
    Hexapod%20Network.pdfHexapod%20Network.pdf
    Here is the master and leg code with the current changes in place.
    Hexapod%20Leg3.spinHexapod%20Leg3.spinHexapod%20Leg3.spin
    Master%20controller%20v8b.spinMaster%20controller%20v8b.spinMaster%20controller%20v8b.spin
    I added some debugging statements to the leg code where I could see the incoming requests from the master and the response from the leg. With this running, if I plug in another leg to the master transmit wire (pin 9 on master to pin 2 on leg), the results are that the leg that was working no longer works and the PST output no longer shows the data requests from the master. Removing the wire from pin2 restores the feed again.
    I'm at a loss to explain why this is happening with all the leg pin 2 being inputs and just waiting for their leg to be called.

    Bob
  • jmgjmg Posts: 15,148
    DiverBob wrote: »
    ....the results are that the leg that was working no longer works and the PST output no longer shows the data requests from the master. Removing the wire from pin2 restores the feed again.
    I'm at a loss to explain why this is happening with all the leg pin 2 being inputs and just waiting for their leg to be called.
    Maybe they are not really all inputs ? Hence my question of what does a scope show, on those Slave Input lines, for one, then two, slaves connected ?

  • jmg wrote: »
    Maybe they are not really all inputs ? Hence my question of what does a scope show, on those Slave Input lines, for one, then two, slaves connected ?

    I need to break the scope out again, haven’t used it for anything serious for quite awhile!
  • I put the scope on the master transmit line and with a single leg controller wired in I see the signal as 20.2 VPP according to the scope measure function (not sure how that comes about when I’m using 3.3v for the master and leg computers??). When I attach a 2nd leg controller the signal drops by 50%, apparently too low to be picked up anymore. I need to play some more with the scope, years ago I used to be pretty good with one but its been decades since I used one last (I was still in the navy then and using old Tektronics scopes, not these fancy new ones!). I’m going to read over the manual and see what I can learn.
    I’ve also been reading as many of the old threads on serial interfacing as I can find to see if I can get a hint on which direction to go next. If I can’t resolve this problem I may have to resort to putting in another 4port object and dedicate seperate pins on the master for each leg instead (I need to check if I still have and extra cog available). Going to keep researching and hopefully either find a solution or someone might have an idea.
  • jmgjmg Posts: 15,148
    DiverBob wrote: »
    I put the scope on the master transmit line and with a single leg controller wired in I see the signal as 20.2 VPP according to the scope measure function (not sure how that comes about when I’m using 3.3v for the master and leg computers??).

    The scope may think you have a x10 probe, when you actually do not... ? (often there is a tickbox for that)
    DiverBob wrote: »
    When I attach a 2nd leg controller the signal drops by 50%, apparently too low to be picked up anymore..... If I can’t resolve this problem I may have to resort to putting in another 4port object and dedicate seperate pins on the master for each leg instead (I need to check if I still have and extra cog available). ...
    Sounds like a simple loading issue.
    The Send side may have a deliberate large series resistor, and the receive sides may have already pullups or pulldowns. Trace the exact wiring.

    What baud rate is this ? - Slow it down during tests, then speed it up later.
  • kwinnkwinn Posts: 8,697
    I agree with jmg's assessment. No reason it should not work as long as the series resistors are low value and the pullup is high. Have had 5 props with 100R series resistors and a 10K pullup on the bus communicating reliably at one time.
  • DiverBob wrote: »
    I put 10K pull-up resistors on the master side of the rx and tx wires. I configured 2 slaves so that their TX line is configured as an input until the slave is called. Then I change the port to an output and send the data. After the data is sent the port is reconfigured as an input.
    Unfortunately I am getting the same results where a single slave hooked up works great but as soon as I add a second slave, neither slave outputs back to the master.
    With this setup I essentially have a single slave as a transmitter and all the other slaves and master is an input (with only the master actually listening at this point), very similar to the setup where the master is transmitting to all the slaves at one time and the slaves just listen for a command that pertains to them before they react. This works fine on one port of the 4 port serial object but not on the other port.
    If you're using open-collector/drain communications, you don't need to run multi-port serial. TX from the master connects to RX on all slaves. TX on all slaves connects to RX on the master. Master sends an addressed message and the target slave responds. Am I missing something?
  • he is not running open collector, I am not sure if 4 port serial supports this.

    Enjoy,

    Mike
  • JonnyMac wrote: »
    If you're using open-collector/drain communications, you don't need to run multi-port serial. TX from the master connects to RX on all slaves. TX on all slaves connects to RX on the master. Master sends an addressed message and the target slave responds. Am I missing something?

    I used the 4 port serial setup so port 0 is communications to the computer terminal (troubleshooting purposes), port 1 is a dedicated master transmit wire that puts out the leg movement commands to the leg computers.
    Port 2 is a feedback loop where the master queries the individual legs and then the leg sends back a response. When I was running the feedback loop in its own cog I needed the seperate port so it was independent of the movement. I still need to get all the movement commands out to the legs quickly but there is a delay between the movement request and completion of a mechanical movement. Now that the feedback and movement request commands are in the same main event loop I need to think this through and see if there is a better way to get the feedback information without delaying the movement requests.
    I uploaded a PDF of a drawing of the port configuration a couple of posts ago, the Master Tx (pin 11) is port 1, it works just great, no issues encountered with it. There are no resistors in series with the wires, only 10K pull-ups on Port2 rx and rx lines. Port 2 is where I have the problems, its got to be something in the code that is wrong, I’m just not seeing what it could be at this point. The wiring has been verified several times and if only one leg is connected (doesn’t matter which leg is connected) the code works. It’s only when I add the second leg computer that it stops working. Very confusing at this point for something that should be fairly simple.
  • msrobots wrote: »
    he is not running open collector, I am not sure if 4 port serial supports this.

    Enjoy,

    Mike
    I should try a simple serial connection using another serial object for that serial link then. Any suggestions on one that is open collector? I’m pretty sure I have one more cog available on the the master and leg computers still.

  • Sorry, I missed most of this and will now bow out as my suggestions don't match your hardware. Sorry to be a disruption.
  • JonnyMac wrote: »
    Sorry, I missed most of this and will now bow out as my suggestions don't match your hardware. Sorry to be a disruption.
    You have been extremely helpful in the past with your suggestions, I have several software routines and objects that you have provided in the past that have solved issues over the last few years I have been working on this project. Usually your code is very concise and easy to implement in my software/hardware setup and I look forward to your input!
  • Clock LoopClock Loop Posts: 2,069
    edited 2019-02-19 17:13
    When I figured out a way to connect 55 propellers in a master slave network, I found that when I did not use "protection" resistors on the rx/tx lines on all slaves, the props would malfunction.
    Probably not your problem, you could try my setup and see if you can get it to work.
    This would at least allow you to see conflicting props stomping on each other without the hardware fighting also.
    (one prop tries to pull the tx line high while another pulls it low, this causes serious hardware and software malfunctioning, from my experience, and required a full reset of all props to get the system working again)
    Also SLOW the baud speed wayyy down at first, till you get it right, 9600 or something.

    https://forums.parallax.com/uploads/attachments/43620/76285.pdf
    Link to the related forum post is in my signature.
  • jmgjmg Posts: 15,148
    DiverBob wrote: »
    .. There are no resistors in series with the wires, only 10K pull-ups on Port2 rx and rx lines. Port 2 is where I have the problems, its got to be something in the code that is wrong, I’m just not seeing what it could be at this point. The wiring has been verified several times and if only one leg is connected (doesn’t matter which leg is connected) the code works. It’s only when I add the second leg computer that it stops working. Very confusing at this point for something that should be fairly simple.
    Your scope shows a loading effect.
    Take a multimeter on 200 mA range, and connect to pull down the RX line(s) thru the meter for one and two connected boards. A 10k resistor alone will measure 330uA per load.
Sign In or Register to comment.