Page 7 of 24 FirstFirst ... 3456789101117 ... LastLast
Results 61 to 70 of 236

Thread: PhantomX controlled by a Raspberry Pi

  1. #61

    Re: PhantomX controlled by a Raspberry Pi

    I played around some more today and the mjpg streamer is working pretty well. It defaulted to 640x480 5fps, so I tried 320x240 20fps, checked with top and was taking about 10% CPU.

    Kurt

  2. #62
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    831
    Images
    25
    Rep Power
    80

    Re: PhantomX controlled by a Raspberry Pi

    That's nice! I need to check that out. By the way when you have a moment could you run top while you hex is walking? I'm curious what your cpu% is.

  3. #63

    Re: PhantomX controlled by a Raspberry Pi

    Looks like I probably need to do a little work on cpu usage. When walking I am getting maybe 85% of the CPU.

    My guess is that I have it in some hard loops, where it is waiting for something. Probably somthing like time to elapse, where I probably need to do a delay like function to release the thread...

    Edit: did a quick check and found a case where looping until a time was met without doing anything so added a delay call in here and knocked it down to maybe 65%. Also when the robot without anything else happening (controller turned off). Code is still doing lots of calcs... Will probably adjust this to only do those calcs when needed.. So idle is not so high...

    Kurt
    Last edited by KurtEck; 04-12-2013 at 10:38 AM.

  4. #64
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    831
    Images
    25
    Rep Power
    80

    Re: PhantomX controlled by a Raspberry Pi

    Yeah I'm in the same boat. I had this little gem at the bottom of my code that I'm embarrassed to have not caught.It was where the backgroundProcess function was. Since the servos handle their own intep I removed it a while ago.


    Code:
                    do
                    {
                    // Nothing now....
                    }
                    while ( Timer() < lTimeWaitEnd );

    how awesome was that... :P

  5. #65

    Re: PhantomX controlled by a Raspberry Pi

    Yep, that's the place :P Not an issue on other processors that are not doing anything else, but...

    Also I should rework some of the XBee stuff as well. That is I have it off as it's own thread, but then I also make the input from the XBee non-blocking. I do a query to see if I have data and use it, else I sleep, but probably not enough. So until I rework it slightly,

    You can increase the usleep time in the function Commander::XBeeThreadProc in commander.cpp to something like 250... It knocked the processor usage down to maybe 20% when the commander was turned off...

    Kurt

  6. #66
    Join Date
    Apr 2013
    Location
    Geneva, CH
    Posts
    59
    Rep Power
    16

    Re: PhantomX controlled by a Raspberry Pi

    This is a great thread on your journey so far with the crawler and Rpi.

    Im looking to purchase the full AX18 kit but at some point will put an rPi in, so just trying to establish what will be swapped out and what needs to be bought/put in. Im not quite clear on power and controller setup, grateful if you can clarify.

    1. Lipo to Bec to Smps2dynamixel.
    2. AX actuators daisy chained into smps2dynamixel. Single chain or through any sort of power hub?
    3. USB2AX into rPi.
    4. USB2AX to smps2dynamixel.
    5. May be wrong but there is no need for any other controller, so the std arbotix can come out, as the smps2dynamixel will provide the power and the usb2ax the control logic? I saw somewhere in the thread an ssc32 is slotted in, for what purpose, perhaps comms with the Xbee? I would like to eventually allow control via browser with some html5 and node js, so no need for any ssc-32/xbee?


    Is the above correct so far? Only bit I believe im missing is power to rpi (or usb hub as Im aware of usb ipower ssues rPi has), and would appreciate clarification here as I wouldnt know about using a single lipo to power both actuators and rpi/usb hub.

    Thanks again for wealth of info in the thread, tis a good read
    Last edited by Grumpybeard; 04-12-2013 at 01:46 PM.

  7. #67
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    831
    Images
    25
    Rep Power
    80

    Re: PhantomX controlled by a Raspberry Pi

    Kurt and I are working on this endevor together. He has his THex which is using the SSC-32 to control his servos with the Rpi as his brain. I'm using Xevel's USB2AX to control my servos. Kurt is running his Rpi Phoenix software which is still fixed point and I'm running a version which is float point. (mine is based off of his) Here is a quick layout of my setup. The only things I'm not showing is I have a USB2Xbee adapter so I can still use my Arbotix Commander to control movements and a wifi dongle so I can ssh into the hex from my pc. Last to note is I'm using the smps2dynamixel as a bridge between the two hubs.



    Click image for larger version. 

Name:	layout.jpg 
Views:	256 
Size:	192.2 KB 
ID:	4623

    I plan on switching out to Trossen's new AX hub they just released since it's smaller.
    Last edited by KevinO; 04-12-2013 at 03:18 PM.

  8. #68
    Join Date
    Apr 2013
    Location
    Geneva, CH
    Posts
    59
    Rep Power
    16

    Re: PhantomX controlled by a Raspberry Pi

    Kevin and Kurt thanks so much for your efforts.

    Kevin - that schematic helps. New to robotics/rc, but trying to learn fast - is there a recommended TIDY way of splitting the LIPO power to multiple components like perhaps using a JST power harness where lipo plugs into 1 end and harness offers several connectors for drawing devices, or do most just hack and splice!? Same for BEC to raspberry and hub, just solder and run two sets of wires or any kind of terminal block?

    Just bought my first soldering iron and multimeter tonight, about to get my hands dirty. Wallet quivering from the sight of these hexapods!

    Thanks.
    Last edited by Grumpybeard; 04-12-2013 at 05:09 PM.

  9. #69

    Re: PhantomX controlled by a Raspberry Pi

    Note: on my setups I have Bec going to power my USB hub. One of the ouputs from my Hub I plug into the RPI as well as the normal cable from the RPI to the HUB. This works fine on my cheap USB powered hubs, it does not work on some others as they detect a signal coming from the Host before coming out of power savings, so the PI does not get powered, so it does not supply the signal ...

    I have my batteries which has some form of connector. I then have a wiring harness that has the matching connector, where I then often split the power side into two wires, which often go to two different switches. One switch goes to power the servos. In Kevin's case that what be to the smpstodynamixel, in my case it goes to the SSC-32 servo controller (VS). The other switch goes to the BEC, which then powers up the logic side of the system (Raspberry Pi, SSC-32, USB-HUB, ...).

    Kurt

    P.S. - now back to doing some timings...

  10. #70

    Re: PhantomX controlled by a Raspberry Pi

    Quote Originally Posted by Grumpybeard View Post
    Kevin and Kurt thanks so much for your efforts.

    Kevin - that schematic helps. New to robotics/rc, but trying to learn fast - is there a recommended TIDY way of splitting the LIPO power to multiple components like perhaps using a JST power harness where lipo plugs into 1 end and harness offers several connectors for drawing devices, or do most just hack and splice!? Same for BEC to raspberry and hub, just solder and run two sets of wires or any kind of terminal block?

    Just bought my first soldering iron and multimeter tonight, about to get my hands dirty. Wallet quivering from the sight of these hexapods!

    Thanks.
    Generally the "tidiest" way is going to be to make your own power distribution setup. Keep in mind "tidy" doesn't always mean compact and small, which may be more of a concern. You can solder and splice wires, or you could use a terminal block. When space/weight was at a premium in combat bots I would crimp, solder and heat shrink ring terminals to wires and bolt them together. Fan the wires out into two groups and you can slip a larger piece of heat shrink over it. You could also use liquid electrical tape.
    If you are new to soldering and wiring, practice with scrap wires. Getting stuff to look neat is a matter of knowing what you want to do before you do it, which is always made better with practice. Take your time, plan things out and make sure you do things like allow enough slack to disassemble components without taking everything else apart (never happened to me I swear ). Heat shrink covers a lot too, and is much better looking and longer lasting than electrical tape.
    Check your currents as well, I would avoid using a JST connector for anything that requires significant power.

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, 11:46 AM
  2. Raspberry Pi Camera coming soon
    By sarendt in forum Robotics General Discussion
    Replies: 1
    Last Post: 03-16-2013, 11:15 PM
  3. 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
  4. Just For Fun My Raspberry PI
    By rebel in forum Arbotix, Microcontrollers, Arduino
    Replies: 0
    Last Post: 12-31-2012, 06:57 PM
  5. For learning: PhantomX Hexapod vs PhantomX Quadruped
    By Leugim in forum Humanoids, Walkers & Crawlers
    Replies: 4
    Last Post: 10-26-2012, 09:50 AM

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
  •