Page 1 of 31 123451126 ... LastLast
Results 1 to 10 of 302

Thread: PhantomX using a Teensy 3.1

  1. #1

    PhantomX using a Teensy 3.1

    I know I keep jumping around, but I am having some fun!

    About a week or two ago, I purchased a Teensy 3.1 board as it looked like it could be fun to try out. I am not sure if anyone else will be interested, but just in case...

    So while taking a break from working with the BeagleBone Black (and waiting for my Odroid U3 to arrive tomorrow ), I started to play with this little guy.

    Hopefully sometime tomorrow I will have my PhantomX Hexapod running on this. I may not start off by fully mounting this guy, but may still simply power it using a wall wart or plugged into my PC (for now).

    Currently I have my AX-12 servo test program working with this board. (Actually this is the version of my test program that I converted to try out using standard Arduino Serial streams a few weeks ago).

    Some of the nice things about this board (other than being small include)
    cheap ($20), faster 72mhz (can push to 96?), Lots of memory (256K, 64K, 2K), Lots of IO pins including lots of analog pins, and while like the Teensy 3.0, it runs on 3.3v, but unlike the 3.0 the digital IO pins are 5v tolerant. 3 Uarts plus the USB.

    One thing I found out once I started playing with it, which is nice. The Serial ports have support for Half duplex built in. Once you turn this on, both RX and TX use the same IO pin.

    So I hacked up my AX12 serial code base, that at init time, I or in the appropriate bits to correct memory location and then in the SetRX and SetTx, I simply need to tell the system, the direction the TX pin should be used.

    So far I have verified by Logic Analyzer that I am generating the appropriate packets. I then hooked up the board to a powered AX bus where I only have one servo currently connected. At first my code was not picking up the responses, and I figured out that the time out loops were not long enough. I increased them and now, I can tell the servo to go to positions, ...

    So next step is to hook it up to the PhantomX. (Once I dig up another XBee adapter out of my stashes).

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

    Re: PhantomX using a Teensy 3.1

    Wow that came together fast!

  3. #3

    Re: PhantomX using a Teensy 3.1

    I've had real problems with electronics dying when connected to the TTL bus. And then the electronics protection (such as Zeners) dying when trying to protect the electronics. I think this is a design flaw in the Dynamixel servos I was using -- perhaps the AX-12 is better. Also, I was using 16V/4S batteries; with 12V/3S batteries I haven't had these problems. But, something to be aware of -- I'd much rather use a 74hct125 or similar buffer chip than rely on the protection of the raw MCU pins.

  4. #4
    Join Date
    Apr 2013
    Location
    Boston, MA
    Posts
    244
    Images
    11
    Rep Power
    21

    Re: PhantomX using a Teensy 3.1

    Wow the Teensy is pretty darn intriguing... It could probably run my hex's motion/TA/navigation no sweat. I'm getting sick of booting up the Pi and powering it down safely all the time. Getting back to microcontrollers would be kind of refreshing.


    DAC is cool too, i've been thinking about a synthesizer project.

  5. #5

    Re: PhantomX using a Teensy 3.1

    Thanks guys,

    jwatte, I have not had the issues that you have run into (so far). My quick and dirty wiring has a 150 ohm resistor inline with the signal, which I believe is about the same as the USB2AX device. Right now I am just jumper wiring. If I were going to do this much more, I would be tempted to do a quick and dirty board that I plug this board into and mount an XBee and have a real connection for the AX bus...

    But for now just having some fun!

  6. #6

    Re: PhantomX using a Teensy 3.1

    I think a 150 Ohm resistor is actually pretty good protection!

    I bought a Teensy 3.1 too (because, who can resist that!?) Then I found out that Robotis actually has the 9.04-A in the US, and sell direct for $9.90 each (plus shipping and perhaps tax.) The 9.04 is half the price, and has the necessary Dynamixel bus connectors (well, you have to solder in a SPOX female header) so it's even better for this particular use case :-)

    Finally: You don't need to power down the RPi "cleanly." Issue a "sync" command to make sure buffers are flushed to disk, and then yank power. As long as you're using EXT3 or a newer FS, the file system log will protect you from loss.
    Other fun file systems to try, too, also with power-off immunity, btw:
    - nilfs2
    - btrfs
    (and the good-old xfs, reiserfs, and zfs)
    It's pretty much only FAT and ext2 that really don't deal well with power-off.

  7. #7
    Join Date
    Apr 2013
    Location
    Boston, MA
    Posts
    244
    Images
    11
    Rep Power
    21

    Re: PhantomX using a Teensy 3.1

    Quote Originally Posted by jwatte View Post
    I think a 150 Ohm resistor is actually pretty good protection!

    I bought a Teensy 3.1 too (because, who can resist that!?) Then I found out that Robotis actually has the 9.04-A in the US, and sell direct for $9.90 each (plus shipping and perhaps tax.) The 9.04 is half the price, and has the necessary Dynamixel bus connectors (well, you have to solder in a SPOX female header) so it's even better for this particular use case :-)

    Finally: You don't need to power down the RPi "cleanly." Issue a "sync" command to make sure buffers are flushed to disk, and then yank power. As long as you're using EXT3 or a newer FS, the file system log will protect you from loss.
    Other fun file systems to try, too, also with power-off immunity, btw:
    - nilfs2
    - btrfs
    (and the good-old xfs, reiserfs, and zfs)
    It's pretty much only FAT and ext2 that really don't deal well with power-off.
    Wow, the 9.04-B would be even more perfect. Looks like robotis-shop has it for $19.90 (edit: and $50 shipping!):
    http://www.robotis-shop-en.com/shop/...hp?number=1008
    Looks like it beats the Arbotix in every way for my needs. Don't need the DC motor stuff on the old one and don't need hobby servo stuff on the new one.

    Thanks for for the filesystem info. Man, there's so much to know, i'm glad i have you guys around. Right now my Pi powered hex has a 16x2 LCD mounted on it and the Pi boots into a startup menu where i can see the IP address for wifi and/or lan and launch the hex robot code so i can run the robot without logging in if i don't want to. I was still trying to figure out how to shutdown gracefully, but it seems like that just got easier.
    Last edited by TXBDan; 01-16-2014 at 09:18 AM.

  8. #8

    Re: PhantomX using a Teensy 3.1

    Yep, the new Robotis board looks nice. May have to play with one of these as well...

    As for Linux stuff, me too, I am still learning. As I learn stuff, I try to remember to update my Readme file on my Raspberry PI project, which helps me when I set up a new board (or have to reset the software on an existing board).

    I still have not seriously addressed how I should startup and shutdown the robots with Linux boxes on them yet. For the most part I simply use putty to connect to them and do stuff, including shut them down. It is interesting on the new Odroid U3, they put a software power button on the board. However the documentation says something like when you press it, a popup dialog will prompt you for confirmation. Hopefully there will be a way to bypass this dialog on a headless system.

  9. #9
    Join Date
    Apr 2013
    Location
    Boston, MA
    Posts
    244
    Images
    11
    Rep Power
    21

    Re: PhantomX using a Teensy 3.1

    Well booting right into your program is easy enough, just call it in the /etc/rc.local. The trick is that since there is a minute or so boot up delay, you don't want your legs to activate automatically (for fear of the legs getting hung up and breaking things) or else you'll have to hold the robot for a minute until the legs come online and can then set it down. So i guess just have your program require a button press before the servos activate so you can be ready for it.

    Or make a graceful startup routine that reads current foot position and nicely steps the legs into formation so that it can start up from any orientation sitting on the ground . I've been thinking about doing that as well, it'd be slick.

    To shutdown, i think you could have a button just run: system("shutdown now"); then wait a minute or so and then cut power. But like jwatte said, that might even be a waste of time.

  10. #10

    Re: PhantomX using a Teensy 3.1

    If you mail the US Robotis office, I bet they also have 9.04-B boards (with headers soldered in already) for $19.90. And less cost for shipping.

    I think a simple 16-char LCD for the IP address sounds nice! My own solution for that was to build a little beacon that would respond to UDP broadcasts, so I'd have to first "ping" my network, and the beacon would reply, and I could snarf the address out of that. Worked great until I had two separate machines, and couldn't tell which one was which :-)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. PhantomX Hexapod Kit
    By SuperMiguel in forum Projects For Request and/or Sale
    Replies: 12
    Last Post: 12-29-2013, 10:36 PM
  2. Question(s) PhantomX AX Quadruped Mark II PhantomX Robot Turret Equipped??
    By hwan we in forum Robotics General Discussion
    Replies: 1
    Last Post: 03-11-2013, 03:09 PM
  3. Question(s) PhantomX Drawings?
    By phil0stine in forum Humanoids, Walkers & Crawlers
    Replies: 2
    Last Post: 01-03-2013, 03:09 PM
  4. For learning: PhantomX Hexapod vs PhantomX Quadruped
    By Leugim in forum Humanoids, Walkers & Crawlers
    Replies: 4
    Last Post: 10-26-2012, 09:50 AM
  5. My PhantomX Hexapod
    By Gilrock in forum Humanoids, Walkers & Crawlers
    Replies: 0
    Last Post: 09-26-2012, 03:23 PM

Posting Permissions

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