Shop OBEX P1 Docs P2 Docs Learn Events
Interfacing mutliple propeller boards to a PC — Parallax Forums

Interfacing mutliple propeller boards to a PC

RoboTyRoboTy Posts: 5
edited 2010-12-01 16:00 in Propeller 1
Hello,

I'm trying to figure out how to interface several propeller boards to a PC running ROS (www.ros.org/wiki) The PC is not decided yet, maybe Roboard, Fit-PC, or gumstix). There's already ROS implementation in the Roboard and gumstix that I'm aware of.

All in all I'll have at least 20 joints with a motor and encoder + additional sensors. This means I'll have multiple propellers. USB is one option, and probably the easiest to implement hardware wise since all SBC and most propeller boards already have USB. One question I had is how does USB fare near motors. I was thinking to connect the PC to a hub, then daisy chain the propellers down the arms and legs. I'm worried about latency though. I'd assume I need to update at at least 100Hz, I'd prefer to go faster than that though.

Other off the shelf solutions such as dynamixel servos use RS-485, which I know is good for noisy environments, but I don't know how speeds compare and ease of programming. Also, I don't know of any propeller boards with RS-485 built in.

Any ideas? Thanks in advance.

Comments

  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-11-29 18:58
    The cheapest might be RS232. You can buy USB to RS232 adapters for only a few dollars each on ebay. Put 10 of them or more on your computer, and buy a USB hub if you need to add more. They will appear in your PC as COM3, COM4 etc and you can use vb.net or terminal programs to talk to each port individually.

    If you keep the baud rate low then it will go long distances. Eg 19200 baud might go tens of metres, but 1200 will go kilometres.

    Then on each propeller, use a max3232 for RS232 to 3V propeller pins.

    One can debate the merits of RS485 vs RS232. It is quite a complex subject. For starters there are two sorts of RS485 - 4 wire + gnd, which is very simple to convert to and from RS232, and 2 wire + gnd, which is more complex as you have to be able to handle data clashes.

    Converting propeller pins to RS485 is as simple as a $3 chip but there are a few 'gotchas', so if you want to go down this road we can discuss those.
  • RoboTyRoboTy Posts: 5
    edited 2010-11-29 19:58
    I was thinking RS-485 is much faster than RS-232 correct? One of my big concerns was update rates and latency. Which makes me think I would definitely want RS-485 over RS-232. You're talking about a TTL to RS-485 chip correct?

    Could I use the usb connection with the actual usb protocol? I've seen posts on these forums talking about a 2+ MB/s connection to a PC. Does USB pick up motor noise over short runs, 3 inches or so? Is it simple to wire up the USB for daisy chaining?
  • StefanL38StefanL38 Posts: 2,292
    edited 2010-11-29 21:58
    Dr_Acula meant to use USB-to-RS232 serial converter-chips.
    So the converter-chip does all the high-speed USB protocol stuff.

    Using the software USB-solution inside the propeller will cost you 1 or 2 cogs per connection.

    Parallax uses FTDI-chips as USB-2-serial-adapters. Take a look into the
    specification of the chips how high you can raise the baudrate.

    Anyway the prop has to be that fast to.

    best regards

    Stefan
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2010-11-29 22:17
    In the 'old' days I would just build an ISA card to talk directly to the PC ports. Now days with PCI a standard, it's nearly impossible to find a motherboard with ISA slots.

    Has anyone tried to decode a PCI port address for simple read/write capability to from a PC port? I'd be very interested in the project.
  • Clock LoopClock Loop Posts: 2,069
    edited 2010-11-30 06:51
    I did designs of 3-phase ac 220v motor drives, plus dsp/fpga motion controller pcb design.

    Using fiber optic connections was the only way to avoid the noise. We also used wired differential communication methods.

    I designed a pcb that went from a pc's usb to a ftdi chip with a very short usb cable(6 inches) to my pcb, then to 5mbps fiber transmitter, which then traveled 10 feet over fiber to the motor drive. Im sure today you can find cheap fiber tx/rx pairs with optical wire.
  • RoboTyRoboTy Posts: 5
    edited 2010-11-30 19:58
    Clock Loop wrote: »
    I did designs of 3-phase ac 220v motor drives, plus dsp/fpga motion controller pcb design.

    Using fiber optic connections was the only way to avoid the noise. We also used wired differential communication methods.

    I designed a pcb that went from a pc's usb to a ftdi chip with a very short usb cable(6 inches) to my pcb, then to 5mbps fiber transmitter, which then traveled 10 feet over fiber to the motor drive. Im sure today you can find cheap fiber tx/rx pairs with optical wire.

    Most of my USB runs will only be 6" or so, but a few daisy chained could add up to 24". They also could end up going right next to a motor. They are smaller DC motors, 18.5 to 24v, Max 5A stall, probably closer to 3 but I'm not sure yet. Any guesses how bad this actually is?

    I was thinking of running USB all the way to the controller board where there's a FTDI chip (like Stefan said), unless there will be noise problems.

    If I did the optical wire method are you saying I could probably run optical wire all the way to the USB port on the PC then terminate in some sort of Fiber to USB connection (essentially a less than 1" USB cable at all hubs, and PC side)?

    Beau, has anyone come up with some sort of PC104 to propeller connection? That might be useful. (Is that the same thing as what you're talking about?) I'm definitely not the person to try that for the first time.
  • Clock LoopClock Loop Posts: 2,069
    edited 2010-12-01 16:00
    The length and size of the motor wires between the motor drive (h-bridge) and the motors is what generates much of the noise. If you can keep the motors very close to the motor drives, this will help on noise. The lower voltage and current helps also, along with what kind of pwm methods your using, some generate more noise than others, using notch filters, band filters would help with noise(this can be done in software)

    Or you could just use usb to fiber and not have to really worry about it.
    The fibers only transmit the serial signal, not the usb. The usb signal is converted to ttl serial first, then to fiber, this is done at 5v. The ftdi chip gets its power from the usb 5v bus, so do the fiber rx/tx) Because this method uses fiber, the prop side can directly interface with other side of the fiber without any worries about 5v to 3.3v issues.

    Also the benefit of fiber isolation keeps you from worrying about your motors and drive circuitry killing/messing with the pc if it were to blow up.

    A cheaper method would be differential. (rs-485)
    1792 x 858 - 1M
Sign In or Register to comment.