Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Com between raspberry pi and arbotix m

  1. #1

    Com between raspberry pi and arbotix m

    Hello!

    So I've been looking at the communication "protocol" of the virtual commander for the arbotix and found it to be sending 8 bytes of data; a start byte, 6 bytes of info then a checksum for a rough error checking.

    I was wondering that for my own program if it was possible to do a similar thing but with 10 bit unsigned integers (18 AX12 servo positions). I'm thinking that to send a 10 bit, I would need 2 bytes. Then I could send 18 * 2 bytes plus a starting bytes(s) and error checking, similar to the virtual commander.

    The goal here is for the arbotix to simply act as a servo controller for the AX12s with the RPI doing all of my IK calculations.

    I was just wondering as to the feasibility of it as I have little experience with communication and have been using my hexapod as a learning platform (I love it to bits).

    Also, would it be possible for the arbotix to also read the servo positions from all the AX12s at the same 60Hz? This is where I am doubting its capabilities due to the baud rate but want a second opinion

    Thanks for any help!
    if (coffee.empty)
    {
    coffee.refill();
    }

  2. #2
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    860
    Images
    25
    Rep Power
    93

    Re: Com between raspberry pi and arbotix m

    You might want to look at how the USB2AX does it. I ended up using that for all my projects that have onboard computers.

  3. #3
    Join Date
    Jan 2008
    Location
    Norway, Stavanger
    Posts
    790
    Images
    276
    Rep Power
    85

    Re: Com between raspberry pi and arbotix m

    Hi,
    You forgot a ";" in your signature..
    Kåre Halvorsen aka Zenta
    ---------------------------------
    Zenta's YouTube channel
    Zenta's Blog
    Zenta's Instagram

  4. #4

    Re: Com between raspberry pi and arbotix m

    As Kevin mentioned you can look at how Linux boxes talk to the USB2AX. Likewise to the Arbotix Pro.

    Short answer is you are free to setup your communications however you like.

    General description of how these servo controllers work:

    they basically wait for standard dynamixel serial packets from the host, as described in the Robotis Manuals,
    Which look like: ff ff <id> <len> <instruction> <params...> <checksum>

    The servo controller has it's own id, which for example on the Arbotix Pro or CM-730 is 200. If the message has their ID, it directly responds back to the controller, again using a standard response packet. If the packet is not meant for them, it switches the serial port associated with the AX-Buss to write, echoes the packet out over this serial port, switches back to input and then if it receives any data back from the AX-BUSS, it send that data packet back to the host.

    So, if you want the RPI to tell all 18 servos to move to new positions, you can do it several ways, like doing individual writes to each of the 18 servos. Or you can use the SYNC_WRITE command, where you can tell many servos to write new values to some registers (in this case likely goal position) as one command. This is for example what the Phoenix code base uses.

    Now how to read in the current position for 18 servos?

    Short answer: is you issue Read commands to read the current position for each of the servos.

    Longer answer: The answer may depend on how you connect the RPI2 to the Arbotix-M.

    If you are doing this through some USB to serial adapter like the FTDI cable, then you run into USB latency issues. I won't go into too much here, but more details up on the Debugging RPI to Arbotix Pro thread. To help deal with this, several of these Servo controllers introduced a new packet SYNC_READ, where your RPI issues a request to the controller object, with which register to start retrieving data from and how many bytes, and a list of which servos. The controller issues a READ request to each of the servos in the list, and collects their answers and then responds back to the RPI2 with one USB packet (Actually internally USB may break this up into multiple internal USB packets). So this reduces the USB latency overhead for this...

    However if instead of using USB, on the RPI you use the Serial port who has pins on the expansion connector and you setup this Serial port for some high speed like: 1000000, then you may not gain anything using the SYNC_READ approach. I am currently experimenting with this approach for talking to the Arbotix Pro (with some firmware changes I am playing with). Again more details about this in the thread I linked to above.

    Not sure how much it would help here, but I am slowly working on an Arduino sketch, for one of my own custom boards, where I try to make a Teensy 3.2 act sort of like an Arbotix Pro. Some of the basics are working, like the communications and the like, but I don't have the IMU that I used on the last board setup yet to properly emulate the appropriate logical registers of the Arbotix Pro or CM-730.
    Also again I am using a Teensy here. There are parts of it that won't work for the Arbotix, but...

    Hope that helps

    Kurt

  5. #5

    Re: Com between raspberry pi and arbotix m

    Wow! thanks for the help! As for my setup, I am using the onboard serial on the RPI2 through a logic level converter. I do intend to also use the arbotix for interfacing sensors and the like, thus I may think up my own communication to make it easier to add functionality later. So from what Kurt said, can I use the RPI to 'talk' to the servos directly then? Because that sounds like the way to go to me

    Also, quick question, more to the electrical side but I'm curious about what voltage drops people are getting during load on the servos? I've found it difficult to make a nice "I'm low on power so I'll sit down now" for when the voltage gets low. perhaps the voltage drop is due to the small 2250mAh LiPos... they are 35c though...

    Thanks for the very detailed response! ... I always forget to add the ;... lots of headaches from it
    if (coffee.empty)
    {
    coffee.refill();
    }

  6. #6
    Join Date
    Sep 2010
    Location
    ಠ_ಠ
    Posts
    2,317
    Images
    27
    Rep Power
    283

    Re: Com between raspberry pi and arbotix m

    Quote Originally Posted by andyandy26 View Post
    Also, quick question, more to the electrical side but I'm curious about what voltage drops people are getting during load on the servos? I've found it difficult to make a nice "I'm low on power so I'll sit down now" for when the voltage gets low. perhaps the voltage drop is due to the small 2250mAh LiPos... they are 35c though...
    The wires connecting the servos are 20AWG at best and the molex connectors are rated 3A. The wires inside the dynamixels connecting the pins of the two connectors together are closer to 24AWG. Since the servos are connected in a daisy chain, the current powering the furthest servo has to pass through each previous cable and servo in the chain. The more servos in the chain, and the higher the load of each previous servo in the chain, then the greater the increase in voltage drop at the later servos. If you are having servo brownouts and/or ID resets, then decreasing the number of servos on the chain is probably your best bet. Can be accomplished by making more direct connections to the hubs (especially of the servos experiencing heaviest loading) and possibly splicing in heavier gauge wires into the standard cables.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    [git][mech][hack]
    gives free advice only on public threads

  7. #7

    Re: Com between raspberry pi and arbotix m

    Quote Originally Posted by andyandy26 View Post
    As for my setup, I am using the onboard serial on the RPI2 through a logic level converter. I do intend to also use the arbotix for interfacing sensors and the like, thus I may think up my own communication to make it easier to add functionality later. So from what Kurt said, can I use the RPI to 'talk' to the servos directly then? Because that sounds like the way to go to me
    I have not tried this and not sure how easy it would be to do. It may be possible, but there may be complications and the ability may be specific to each processor and/or maybe some external hardware. Others can maybe explain this better than I can, but will give a shot, to describe the things that I would look at:

    The AX-Buss is a Half Duplex protocol. So does the underlying USART on the RPI2 support half duplex?

    If Yes: how do I control when it is in TX mode and when it is in RX mode. You need it to switch to TX just as you are sending out bytes, and then switch back to RX mode when the last bit of the last byte has been output. Can you detect this? And update state? Can you do this at normal program level or more likely do you need a custom device driver for this? ...

    If No or some of the issues of Yes are too much of a pain: You can use external hardware. I believe DFRobot used to sell a unit to do, this, which I tried once. Again here you have several options: Something like shown on the AX or MX servo docs about building an interface, but again you need to control TX/RX lines. There are several places on the web which show how to do this, like:

    http://www.instructables.com/id/How-...spbe/?ALLSTEPS

    But again with the above you need to be able to control an IO pin to set the direction. Don't remember if wiringPi on RPI2 requires you to use sudo to do this (for memory mapped access) or if they have another user mode access...

    But if you are again going to external hardware, then maybe better off with a Microcontroller. Need one with at least 2 USARTS... Something like the processor in the Arbotix-M or Arbotix-Pro (or Teensy 3.2)

  8. #8

    Re: Com between raspberry pi and arbotix m

    does the underlying USART on the RPI2 support half duplex?
    You can do half duplex with a full duplex USART if you can turn the transmitter on or off -- OR if you add a selectable buffer chip, such as the 74HCT125, on the TX line. Most people go for the latter; turn on the buffer/driver (pull the enable low) when transmitting, and pull it back high again when transmission is done.

    If you wire the receive and the transmit together (perhaps through the buffer) then you will have to read back the data that you transmit, and you know you can disable the buffer when you've received all the bytes that you sent.

    You can also control the input/output and high/low state of GPIO pins on the Raspberry Pi using the sysfs gpio feature!

  9. #9
    Join Date
    Sep 2010
    Location
    ಠ_ಠ
    Posts
    2,317
    Images
    27
    Rep Power
    283

    Re: Com between raspberry pi and arbotix m

    Another very good reason to use a buffer IC for the full-duplex to half-duplex conversion is that the dynamixel buss is 5V, while the RPi pins are all 3.3V max. Connect the RPi pins directly to the dynamixel buss without any logic level conversion and you will destroy the pins.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    [git][mech][hack]
    gives free advice only on public threads

  10. #10

    Re: Com between raspberry pi and arbotix m

    Pffft! I love the smell of magic smoke! :-)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question(s) Moving more to the Raspberry Pi
    By CreedyNZ in forum Software and Programming
    Replies: 12
    Last Post: 09-10-2015, 01:27 PM
  2. Question(s) Raspberry Pi2 and USB Webcam
    By dmcman73 in forum Robot Computers
    Replies: 8
    Last Post: 05-29-2015, 10:57 AM
  3. Question(s) Raspberry Pi
    By Robonaut in forum Robot Computers
    Replies: 20
    Last Post: 07-07-2013, 11:46 AM
  4. About to give up on the Raspberry Pi
    By jwatte in forum Software and Programming
    Replies: 5
    Last Post: 01-14-2013, 11:57 AM
  5. Just For Fun My Raspberry PI
    By rebel in forum Arbotix, Microcontrollers, Arduino
    Replies: 0
    Last Post: 12-31-2012, 06:57 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •