Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Moving more to the Raspberry Pi

  1. #11
    Join Date
    Jul 2014
    Location
    New Zealand
    Posts
    70
    Images
    3
    Rep Power
    19

    Re: Moving more to the Raspberry Pi

    I've been running the Phoenix code on my Hexapod using two different configurations over the past three weeks. The first configuration is running both a Raspberry Pi2 and and Arbotix-M, the second with the Raspberry Pi2 alone. In both configurations Python code has been use to take information from a group of sensors and drive the Hexapod in a semi- autonomous manner. Both configurations worked reasonably well, but each had pros and cons that I thought I'd share below:

    Configuration One: RasperryPi2 running KurtE’s port of the Phoenix code and some custom Python code to read sensors and control the Hexapod movements.

    Pros
    · Only one controller to set up and maintain
    · Allows richer data flow between the Phoenix code and the controlling python code
    · Easier to debug c.f. having code still on the Arbotix-m
    · Small improvement in power consumption
    · Takes up less space
    Cons
    · Prone to occasional stutters and glitches in movement
    · Need to carefully consider the impact on the movement processes when running other threads or processes on the Pi2

    Configuration Two: Arbotix-M running KurtE’s port of the Phoenix code (slightly modified to run on servos numbered 2-19 as does the Raspberry Pi version) along with the RasperryPi2 running some custom Python code to read sensors and control the Hexapod movements. Communicating via a serial connection.

    Pros
    · Smother, more realistic movements
    · Generally don’t need to worry too much about timing on the Pi2
    Cons
    · Takes up more space
    · Need to establish physical link between the RPi2 and the Arbotix-m
    · Opposite of pros under configuration one

    Both configurations worked fine, but the good timing abilities of the Arbotix-m did result in a noticably smoother and less glitchy movement.
    Last edited by CreedyNZ; 09-10-2015 at 02:04 AM.

  2. #12

    Re: Moving more to the Raspberry Pi

    Sounds like you are having some fun! In the RPI only mode what are you using to talk to the actual servos?

    What my personal preference is to do something in between. That is I would like most of the code to run on the Linux box. I personally prefer all C/C++ but...

    I then like having the secondary processor (Arbotix, USB2AX, Teensy 3.1, ...) take more care of the timings as these processors are more setup to handle timing critical things...

    That was why for example most of the time earlier I used my updated firmware for the USB2AX, which moved the Interpolation code from the Linux box to the servo processor. You could tell it, to move these N servos to the new positions and do it in N milliseconds. It would then take care of deciding when to issue the serial outputs to the servos and how often... Also I had this code only output information for those servos who actually move with each interpolation step, and try to take into account how many bytes will be output for each servo transaction as to time when the checksum byte is output to be as exact as possible for the servo rate... I don't think you can do that type of timings, when you are going through USB where you may have other stuff going on with USB, let alone interaction with the scheduler...

    Again I had this working pretty well, but also want(ed) to take it one step farther and have it such that I can also queue up the next move while the servos are still moving on the previous move. That is the command would say, when you finish the current move, then move to these new positions. This would remove any delays during the transition from one step to next... I am hoping to experiment some more with this hopefully sometime soon, probably with a Teensy 3.1, where I may start off trying to emulate the Arbotix Pro and then add this level of support.

    Also another place the earlier code was getting into walking issues, is the timing interactions between doing things like trying to walk with the interpolation code issuing the SYNCWRITE and other code that may want to query information, like what the current battery voltage is. The current code tries to make sure to schedule these types of calls at times when it won't interfere, but could still be issues.

    Let me know if you find any bugs or have some enhancements that I can integrate back in.

    Nice write up!
    Kurt

  3. #13
    Join Date
    Jul 2014
    Location
    New Zealand
    Posts
    70
    Images
    3
    Rep Power
    19

    Re: Moving more to the Raspberry Pi

    In the RPI2 only mode I'm using the USB2AX to connect to the servos. I should have noted that in my post, so I've made a quick edit.

    Apart from changes to the Phoenix_Input_Commander code to read commands from the Python code, the RPI code is largely unchanged.

    My favourite recent enhancement was the change you made to renumber the servos 2-19, so I attempted to carry those changes through to the Arbotix-M version, so far this seems to be working but I've yet to fully test.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Question(s) Raspberry Pi
    By Robonaut in forum Robot Computers
    Replies: 20
    Last Post: 07-07-2013, 10:46 AM
  2. Just For Fun My Raspberry PI
    By rebel in forum Arbotix, Microcontrollers, Arduino
    Replies: 0
    Last Post: 12-31-2012, 05:57 PM
  3. 914 PC-BOT Moving Head Mod
    By Thracian in forum Mechanics / Construction
    Replies: 0
    Last Post: 10-02-2012, 02:39 PM
  4. C# code for moving servos!
    By bayyari in forum Software and Programming
    Replies: 3
    Last Post: 09-11-2010, 08:33 AM
  5. HSR-5990TG moving too slow?
    By curiousinventor in forum DYNAMIXEL & Robot Actuators
    Replies: 6
    Last Post: 04-15-2010, 03:29 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
  •