Shop OBEX P1 Docs P2 Docs Learn Events
Prop to prop communications — Parallax Forums

Prop to prop communications

DiverBobDiverBob Posts: 1,110
edited 2014-03-02 08:53 in Propeller 1
I'm at the point where I'll be needing to add several additional props to my hexapod soon. There will be one prop per leg (6) and at least one master controller board. These could be setup in a star or ring network depending on the object used.

Since I haven't done any prop to prop communications, is there any recommended object out there that works well? I would prefer it not to require any more than a single cog ( since that's all I have available on the individual leg props) and should be written in Spin or PASM. I don't really want to learn a new language for this project. Data rates between the boards does not have to be super high speed but faster is good. The communications needs to be two way also. Those are the primary requirements that I can come up with at this time.

Thanks for your help again!

Bob

Comments

  • mindrobotsmindrobots Posts: 6,506
    edited 2014-02-28 06:39
    Bob,

    Try this thread that OBC started and also look in your "Similar Threads" section below.

    Um, just ignore anybody that might bring up Forth in any of those threads.....he was delirious at the time!
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-02-28 08:02
    PropForth has an interesting setup to extend it over multiple Propellers. Of course, it is all Forth. That may appeal to you or may not.

    Seems that some feel Forth is not a valid option. I do sympathize with having to learn a new language.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-02-28 08:37
    There's kind of a trade off with Prop to Prop communication. Do you want easy or do you want fast?
    The easier way is to use ASCII characters and use ASCII control characters to indicate the beginning and end of messages.
    The problem with ASCII, is to send the number "100" which would easily fit in a single byte of data, you need to send at least two bytes of data using ASCII characters. If you send it in its base ten format you send "1", "0", "0". You will also need to send some indicator to define the end of the number like a comma ",". If you send it as ASCII hex you send "6" and "4". If you know the number is only going to be a byte you can always use two hex digits per byte so you don't need a control character to indicate when its complete.

    IMO, in the long run, you'll be better off using raw data and not rely on ASCII control characters. This isn't to say you should do this now. It's also my opinion, ASCII is easier to deal with.

    With raw data, you need to indicate the size of the message as part of the header since any character you may want to use to indicate the end of the message could end up being data and not the end of message marker. I'm using a protocol similar to the Dynamixel communication protocol for my recent Prop to Prop projects. If you want to try the raw data technique, I'd suggest getting a single AX-12A to play with and and see how data is sent back and forth.
  • JonnyMacJonnyMac Posts: 9,107
    edited 2014-02-28 09:16
    To Duane's point, I did a little project using what I call "Human Friendly Control Protocol." Everything is ASCII so that you can type and receive commands from a simple terminal. HFCP is a protocol description that rides on what every serial comms you want to use. I've used it across RS-485, the demo uses standard serial through the programming port, and you could use a open-collector single-wire system, too -- the protocol is a master/slave setup that is half-duplex.
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-02-28 11:13
    How much I/O and what kind are you running to each leg to need a separate prop per leg?

    I've been thinking of making a hexapod bot, and currently I plan on three servos per leg, so I am curious why you would need so much prop-power :)

    Given that standard servos have a 20ms update rate, assuming three servos per leg, even 9600bps would be far more than needed (assuming separate serial link to each slave prop from the master).

    (FYI, I am just using FullDuplexSerial to communicate between a Raspberry Pi and my RoboPi controller - works great)
    DiverBob wrote: »
    I'm at the point where I'll be needing to add several additional props to my hexapod soon. There will be one prop per leg (6) and at least one master controller board. These could be setup in a star or ring network depending on the object used.

    Since I haven't done any prop to prop communications, is there any recommended object out there that works well? I would prefer it not to require any more than a single cog ( since that's all I have available on the individual leg props) and should be written in Spin or PASM. I don't really want to learn a new language for this project. Data rates between the boards does not have to be super high speed but faster is good. The communications needs to be two way also. Those are the primary requirements that I can come up with at this time.

    Thanks for your help again!

    Bob
  • DiverBobDiverBob Posts: 1,110
    edited 2014-02-28 18:28
    How much I/O and what kind are you running to each leg to need a separate prop per leg?

    I've been thinking of making a hexapod bot, and currently I plan on three servos per leg, so I am curious why you would need so much prop-power :)

    Given that standard servos have a 20ms update rate, assuming three servos per leg, even 9600bps would be far more than needed (assuming separate serial link to each slave prop from the master).

    (FYI, I am just using FullDuplexSerial to communicate between a Raspberry Pi and my RoboPi controller - works great)
    My hexapod weighs in at about 200 pounds and stands over 5 foot tall. No servos, each leg uses two DC linear actuators and a high power motor for movement. The leg props are just used to control the motor movements as if they were servos. HB25 motor controllers provide motor power, PWM from the prop controls direction and speed. Each motor is on its own cog and a mcp3208 ADC provides positional feedback. The motor functions are designed to accept a value in degrees and the move its portion of the leg to that position. Each leg uses up all 8 cogs to provide that capability. I need a master computer to perform the Inverse Kinematics and then transmitt the needed leg movements to the individual leg computers. If I was using regular servos then a single prop would have been more than adequate to control 18 servos.

    The data transfer speed doesn't have to be extremely fast but it has to be bi-directional. I'm looking for a control setup that is relatively simple but robust. There have been several great suggestions and I'm working my way through the related topics. I'm sure what I need is already out there. I'll do some experimenting this weekend with these suggestions and see how it goes
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-02-28 19:39
    Holy Cow! That's a big hexapod!

    Can't wait to see pics/video. Given the ADC, I am guessing you are using potentiometers for the positional feedback.

    Ok, now I see why you need a prop per leg, it makes sense now.

    Which Prop controller board are you using for the legs?

    FYI, I was doing some more testing today, 115.2kbps between the prop and linux worked like a charm. I plan to see how fast I can push it before I run into trouble - I think the limitation is going to be Spin (I have the packet send/receive/decode/encode on the prop side written in Spin for now)
    DiverBob wrote: »
    My hexapod weighs in at about 200 pounds and stands over 5 foot tall. No servos, each leg uses two DC linear actuators and a high power motor for movement. The leg props are just used to control the motor movements as if they were servos. HB25 motor controllers provide motor power, PWM from the prop controls direction and speed. Each motor is on its own cog and a mcp3208 ADC provides positional feedback. The motor functions are designed to accept a value in degrees and the move its portion of the leg to that position. Each leg uses up all 8 cogs to provide that capability. I need a master computer to perform the Inverse Kinematics and then transmitt the needed leg movements to the individual leg computers. If I was using regular servos then a single prop would have been more than adequate to control 18 servos.

    The data transfer speed doesn't have to be extremely fast but it has to be bi-directional. I'm looking for a control setup that is relatively simple but robust. There have been several great suggestions and I'm working my way through the related topics. I'm sure what I need is already out there. I'll do some experimenting this weekend with these suggestions and see how it goes
  • DiverBobDiverBob Posts: 1,110
    edited 2014-02-28 20:11
    I haven't found any existing prop boards that are set up the way I want/need so I'm most likely going to design one that does. I'd prefer to use something already developed and tested.
  • Clock LoopClock Loop Posts: 2,069
    edited 2014-02-28 20:11
    DiverBob wrote: »
    My hexapod weighs in at about 200 pounds and stands over 5 foot tall. No servos, each leg uses two DC linear actuators and a high power motor for movement. The leg props are just used to control the motor movements as if they were servos. HB25 motor controllers provide motor power, PWM from the prop controls direction and speed. Each motor is on its own cog and a mcp3208 ADC provides positional feedback. The motor functions are designed to accept a value in degrees and the move its portion of the leg to that position. Each leg uses up all 8 cogs to provide that capability. I need a master computer to perform the Inverse Kinematics and then transmitt the needed leg movements to the individual leg computers. If I was using regular servos then a single prop would have been more than adequate to control 18 servos.

    The data transfer speed doesn't have to be extremely fast but it has to be bi-directional. I'm looking for a control setup that is relatively simple but robust. There have been several great suggestions and I'm working my way through the related topics. I'm sure what I need is already out there. I'll do some experimenting this weekend with these suggestions and see how it goes

    FIBER OPTIC.

    That big of an object. That much Current. That much movement?, ...
    Dude. FIBER OPTIC.

    Buy 18 rx devices plus 18 tx devices from either pair1 or pair2. Plus a few extra each.

    Pair1- works with regular optical audio cables found at electronics retailers. (TOS)
    http://www.digikey.com/product-detail/en/PLR135%2FT/1080-1431-ND/
    http://www.digikey.com/product-detail/en/PLT133%2FT/1080-1428-ND/

    Pair2- works with regular optical audio cables found at electronics retailers. (TOS)
    http://www.digikey.com/product-detail/en/PLR135%2FT10/1080-1433-ND/
    http://www.digikey.com/product-detail/en/PLT133%2FT10W/1080-1430-ND/

    You want these not for the speed, but the stability, and most important, (THE ISOLATION).

    Ideally, the only METAL connection that should exist between these 6 leg props and the central prop is Power....

    And even more ideally, you want a central power that is stepped down AT THE PROP(i.e. 5volt central power distributed to all props that then ldo regulate it down to 3.3, locally on the leg pcb.

    DO NOT DISTRIBUTE 3.3v over long lengths. Keep it stepped up, and then knock it down locally.

    You will want a system that lets you also update firmware via a central prop.

    I have built such central propeller networks...

    In your situaton, I would design the central prop to accept two inputs, one for control(rc, 900mhz, etc) and one for programming the central prop, a bluetooth device(serial port mode), And then connect and upload code using laptop/pc with bluetooth dongle.

    **The prop to prop communication system should be a differential/optical system, no doubt, you are throwing amps into those legs.

    Personally, I would go fiber tx to fiber rx for communication from prop to prop. The emitter/recievers are fairly cheap these days.

    Fiber then allows you to skip the differential chips/protocol/extra wiring...

    You can just buy optical audio cable with these. (TOS, found at electronics stores.

    AT that point you would need 6 inputs and 6 outputs on the central prop. Plus either a single reset output from the central prop to each of the 6 legs.
    I would also send the reset signal to each prop in optical format.
    That means you would need 2 rx devices and one tx device per leg, 3 fiber cables per leg, and 6 rx devices plus 12 tx devices for the central prop.
    18 rx and 18 tx total.
    Thats about 75 bux. The optical cables would be the expensive part. But im sure cheap ones can be found online.
    If you could find the length of optical audio cable you need for 5$, the fiber backbone would cost around 170$, this gets you right up to the prop input/output.
    AT that point you need a board to mount the fibers, and then wire the fibers into the RES, TX and RX lines on the prop.

    Any cheap prototyping/design board in the parallax store would do, as long as you can hack into the tx,rx,and reset lines on the prop. (and you can right at the programming header)
    And like I said, then at that point you can program all 6 legs props from a central prop, but you must run the Reset lines also back to the central prop, you need to be able to reset a leg if it locks up, and you don't want the reset going long lengths, etc.. so fiber it also.

    I know getting a fiber backbone for the comms is expensive, these transmitters, and recievers, plus optical cable found at the store, is no doubt the cheapest way to get a fiber backbone for this beast.


    You would use standard TX/RX protocol from the obex FULLDUPLEXSERIAL, (or is that FASTfullduplexserial?)I have tested it to 300,000 baud. code in some crc error check in the transmission protocol,
    because this thing is very large and loss of comms could be dangerous.


    Get One each leg, plus a central unit. (Plus 1 for a backup)
    So if you don't already have the leg pcbs, you should order 8 of these pcbs.
    http://www.parallax.com/product/32212
    32212.png
    Plenty of pcb space. Large regulators(TO220). CAPS, xtal, eeprom... HAS MOUNTING HOLEs..
    Everything you need.

    If you already have the props on each leg, im curious as to what hardware/wiring situation do you have currently?
    Are you starting from scratch here or what?
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-02-28 20:28
    You might like this one:

    http://www.mikronauts.com/raspberry-pi/robopi/
    DiverBob wrote: »
    I haven't found any existing prop boards that are set up the way I want/need so I'm most likely going to design one that does. I'd prefer to use something already developed and tested.
  • Clock LoopClock Loop Posts: 2,069
    edited 2014-02-28 22:59
  • DiverBobDiverBob Posts: 1,110
    edited 2014-03-01 06:59
    That's some good information, hadn't thought much about the backbone piece yet. I like fiber but hadn't considered it as the boards are all going to be in close proximity to each other (no more than 14" apart). The power to the motors and computer are independent of each other and the computers are located away from the majority of the RF noise. I'll read up on your links and see the options there. Since you said you've linked multiple props together, what software are you using for comms and what type of configuration (ring, star, ?).

    I hadn't really thought about using the prop prototype boards before unless I am doing one offs, I tend to be partial to dedicated circuits when I need more than one of the same circuit board. Plus I like doing surface mount designs! I like to see how small I can make them! The board I need has to have a MCP3208 ADC and lots of 3 pin connectors for motors and sensor I/O.

    Since you've been to my robotics thread (http://forums.parallax.com/showthread.php/135857-Next-large-robot), you've seen the scale of the project so far. I'm in the 3rd year of work which the 'master' plan calls for it to be walking by the end of the year! I'll see if my skills and the help of the folks on this site can get it to that point!
    Bob
  • DiverBobDiverBob Posts: 1,110
    edited 2014-03-01 07:43

    I think I missed that one when I was looking. This looks like it just might have everything I need. I'm going to order one today to try out, if it works out then I only need 5 more! This could save me a lot of time, leaving more time for programming!

    Thanks for the heads up!
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-03-01 07:57
    Hi Bob,

    Thank you for the kind words! I am glad you like my design. You probably missed it because I only started mentioning it recently, as it is a new product.

    To order one, email me at mikronauts (at) gmail (dot) com, specifying the email address you use for PayPal and your snail mail address, and I can send you a PayPal invoice.

    Thanks to Clock Loop, I now know where the thread is for your large box, I'll read it from the beginning this weekend.
    DiverBob wrote: »
    I think I missed that one when I was looking. This looks like it just might have everything I need. I'm going to order one today to try out, if it works out then I only need 5 more! This could save me a lot of time, leaving more time for programming!

    Thanks for the heads up!
  • r.daneelr.daneel Posts: 96
    edited 2014-03-01 13:29
    DiverBob wrote: »
    I'm at the point where I'll be needing to add several additional props to my hexapod soon. There will be one prop per leg (6) and at least one master controller board. These could be setup in a star or ring network depending on the object used.

    Since I haven't done any prop to prop communications, is there any recommended object out there that works well? I would prefer it not to require any more than a single cog ( since that's all I have available on the individual leg props) and should be written in Spin or PASM. I don't really want to learn a new language for this project. Data rates between the boards does not have to be super high speed but faster is good. The communications needs to be two way also. Those are the primary requirements that I can come up with at this time.

    Thanks for your help again!

    Bob

    What about

    http://forums.parallax.com/showthread.php/134641-DEMO-High-Speed-Multi-Prop-to-Prop-Communication
  • DiverBobDiverBob Posts: 1,110
    edited 2014-03-01 15:10
    This is what I love about these forums, ask a question and get buried with great suggestions and ideas! This has required a lot of additional reading and figuring how each idea could be used. Unfortunatly I can't incorporate everything. I'm going to test a couple of the serial solutions, the one that interests me the most is the thread Beau has, lots of possibilities for future expansion there. I believe I'll skip on the fiber for a backbone, the short interconnects between boards shouldn't have too much induced noise.

    I'm going to go and order six of the Mikronauts RoboPi as leg controllers. That seems to be the best board for my purposes that I've seen.

    Time to hit the shop and get some programming time in!

    Bob
  • frank freedmanfrank freedman Posts: 1,983
    edited 2014-03-01 17:50
    What about using a CAN bus architecture. I have seen some threads here on that. Might be a couple objects as well. JonnyMac comes to mind on that one.
  • Clock LoopClock Loop Posts: 2,069
    edited 2014-03-01 18:05
    Since you have the pcbs close together, and you are doing smt, you are right, noise shouldn't be a problem.
    When I wrote that I figured you were building a pod as big as a car, and one that had the leg pcbs on the legs where vibration affects metal contacts.
    Optical dosen't care if the pin is juiggling in its socket, making a contact similar to a button that isn't debounced.

    Neat project, i would also do custom designed pcbs, it adds much more to the cost, but if you can afford it....

    I have worked with over 55 propellers in a big array that only used p31 and p30 on all the propellers to talk.
    I also used resistors to pull the tx/rx lines high, that way I could have the fullduplexserial program wait untill the line is high before transmitting reply.

    For your situation I wouldn't do my type of network, because timing and interference are issues that plague ring and one line comms.

    I would stay with using two I/O per leg from the central prop, and then run an obex serial object that can run multiple serial ports at once.
    Having all legs on the same communication lines adds a huge level of complication in programming and circuit tweaking.
    You don't have time for that.
    Run a RX/TX pair from each leg prop to a pair of I/O's on the central prop. This uses up 12 I/O on the central prop, and requires you to have six serial port programs running. Some objects let you run that many in one cog, since you don't need super speed. I would also run reset lines to the central prop, if you run all 6 reset lines into a single I/O on the central prop, you can then reset the legs at will, AND program all leg props using the central prop. (to program any leg from the central prop, you need p31,p30 and the reset lines run to the central prop. You can use one reset output on the central prop, this still lets you program each leg individually, but a single reset forces you to reset all legs at once, if one is frozen.

    You CAN put all leg props on the same tx/rx/reset lines using 200 ohm resistors on each tx/rx/reset line on each leg prop.
    But this configuration requires you to use pull up resistors because the tx on the legs would all pull up at once, preventing eachother from communicating.
    This also means you now need seriously managed communication methods.
    Basically you will need to name each leg, and then call each name, wait for its reply, and then transmit its data, and transmit the end of message crc.
    This adds a slow round robin process to the communication, of which you need to keep track of who is talking, with verification that you have the right leg talking etc..
    If you just use 12 i/o plus 1 i/o for reset, you eliminate any kind of addressing legs, and can burst comms as demand requires.
    Use the multi serial port object to do the hardwork of mitigating data collisions.

    With my work on multi-prop networks, I discovered the communication between 55 props is unreliable on the same tx/rx lines due to one prop screwing it up for all the others, and when that happens its usually random, and hard to determine which prop flipped out and commandeered the tx/rx lines.

    I would only use a single tx/rx network if you really really really can't afford the I/O.
    If thats the case, you can look at this thread on using 55 props with only 1tx wire and 1rx wire and 1 reset line.
    http://forums.parallax.com/showthread.php/127983-55-Parallax-Propeller-s-Parallells-Processing-of-Permanent-Perturbations.?highlight=perturbation
  • JonnyMacJonnyMac Posts: 9,107
    edited 2014-03-02 08:53
    What about using a CAN bus architecture. I have seen some threads here on that. Might be a couple objects as well. JonnyMac comes to mind on that one.


    I have done CAN but I don't think it's necessary for this app. I would use standard RS-485 over twisted pair for noise immunity and the simplicity of using any protocol one desires.
Sign In or Register to comment.