Results 1 to 10 of 10

Thread: ArbotiX Pose Engine with CM9.04

  1. ArbotiX Pose Engine with CM9.04

    Hey guys,


    I've recently purchased a Darwin-Mini and am already tired of the Robotis functions and gait engine limitations.
    I've been having varying levels of success in getting the ArbotiX Pose Engine running on my bot, as well as converting MTNX (not MTN) files to RPM files that are compatible with the ArbotiX pose engine.


    Basically I'm at the point where I have MTNX files mostly converting, but some problems with pointing to next sequences.
    As for the Pose Engine I have been able to convert to writing the dynamixel protocol 2.0 (for XL320) but am having trouble with reading the pose. I also have a few issues with motion timing when converting from the MTNX files.


    I was wondering if anyone had already done any part of this and could save me the effort.




    Cheers.

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

    Re: ArbotiX Pose Engine with CM9.04

    I had pretty much everything ready for mtn and dxl1.0 (may still be for pre-dxl2.0 option), but brain issues continue to interfere with my expanding it for the Darwin-Minis in the lab (among many other things I need to do). The github repo should include a python script to convert mtn to three files for the expanded pypose library (still pre-dxl2.0?), but I have no idea how the mtnx file format works so cannot help with that at the moment.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    bleh

  3. Re: ArbotiX Pose Engine with CM9.04

    Interesting, I actually found the python file and some examples in the Robotis OpenCM download link via the Darwin-mini manual.
    I've basically hacked apart your python file to work for both file types, but it's not 100% successful for mtnx yet.
    All the examples in the OpenCM download are protocol 1.0, I haven't checked your repo. Might be something to look in to.

    What kind of brain issues are we talking about? Maybe you can help me from starting down a potential dead end

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

    Re: ArbotiX Pose Engine with CM9.04

    I think the only thing changed since the work was pulled into the OpenCM repo last year was added Doxygen descriptions to the header file in the pre-OpenCM repository, so the files you have are probably as up to date as you can get. The CM9_BC library uses very few dynamixel commands, so the biggest change would be in the writePose() function to replace the 'pDxl->...' lines with entries into a temporary buffer that gets passed along to the DynamixelPro library's sync_write() at the end of writePose(). Probably also need some changes to the 'COMM_SUCCESS' stuff in readPose().

    Rather severe anxiety and depression with all their associated byproducts, so the only dead end is being me. 'Tis a rather grim statement now that I read it, but it certainly feels accurate/appropriate.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    bleh

  5. Re: ArbotiX Pose Engine with CM9.04

    Yeah I've got writePose working correctly, but I just commented out readPose because I couldn't work out what it was supposed to be doing.
    Does it maybe wait for the servos to get into position before writing the next pose? That could potentially be why the gait engine wasnt working as I expected... I should look into that.

    I think I've fixed the mtnx converter now so should be easier to test the original poses made by Robotis and compare with the gait engine.

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

    Re: ArbotiX Pose Engine with CM9.04

    The readPose() function is to verify the initial servo position instead of assuming the servo starts out at its center point (512 for AX/RX, 2048 for MX), so there are no unfortunate jumps to the first pose in a sequence instead of a smooth interpolation. It is also used by the pypose.ino sketch to collect positions when using it with PyPose.py running on a pc.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    bleh

  7. Re: ArbotiX Pose Engine with CM9.04

    readPose() gives me very inconsistent results, each time it runs different servos appear to not be returning servo positions. It seems to run OK with the commented out so I might leave it alone for now.

    On the topic of MTNX to RPM, Robotis now use frames to determine pose transition time. I've calculated that the conversion from frames to whatever the RPM units is 7.8125. When I use this conversion the motions seem to be getting cut short
    I'm guessing the RPM number is probably milliseconds, so it will be based on clock speed. The ArbotiX-M board runs at 16MHz but the CM9.04-C runs at 72MHz so I've tried to adjust the RPM number to be 4.5 times greater than before which seems to be working OK.
    I'll have to look into a better way of doing this that is somehow automatically adjusted based on CPU speed

    Tician: did you ever notice this? Or did you design your motions in a way that you never would have noticed?

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

    Re: ArbotiX Pose Engine with CM9.04

    The old motions just use a time length for the pose-to-pose transition to occur (pretty sure the base unit for RoboPlus Motion was 1/8th second), and then the interpolation engine assumes some servo update rate to ensure smooth motions. The shorter the 'frame' time length, the smoother the motions when the servos are moving at high speeds (less jittery; shorter pause between interpolated poses). The default for the arbotix was ~33 ms between updates and when the interpolateStep() function was called then it would wait until that time had elapsed before sending the next interpolated pose. It should continue sending interpolated poses at the update rate (assuming you continue calling the functions, since there is not a call-back function) until all servos have been sent the final goal position of that pose. CM9_BC uses a default frameLength_ of 8 ms and there is a time modifier named timeModder_ to speed up or slow down the motions without modifying the poses saved in memory, but neither should cut short the motion unless the servos are moving too slowly or you are updating their position too quickly (DARwIn-OP framework updates at 125Hz for an 8ms frameLength_, so guessing 7.8125ms is the shortest possible frameLength_ value with a 128Hz control callback function in the servo). Only other reason I can think of that would cut short a motion is if the bc_pose_t and bc_seq_t and bc_page_t pointers are getting a bit mangled somewhere or an index is not counting as high as it should, so that it tries to play an invalid pose/page or the later poses/pages get dropped.


    The DynamixelPro library does not return any of the error codes I had added back to the Dynamixel library, so the readPose() line
    Code:
    if (Dxl.getResult()==(1<<COMM_RXSUCCESS))
    should simply be
    Code:
    if (Dxl.getResult()==1)
    . A better version for the DynamixelPro library would actually use the bulk_read function instead of individual read packets for each servo.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    bleh

  9. Re: ArbotiX Pose Engine with CM9.04

    Quote Originally Posted by tician View Post
    ... there is a time modifier named timeModder_ to speed up or slow down the motions without modifying the poses saved in memory
    Great tip, thanks. Works like a charm.


    Quote Originally Posted by tician View Post
    Only other reason I can think of that would cut short a motion is if the bc_pose_t and bc_seq_t and bc_page_t pointers are getting a bit mangled somewhere or an index is not counting as high as it should, so that it tries to play an invalid pose/page or the later poses/pages get dropped.
    I think you were right on this. Looks like I had some pointers to wrong motions pages/poses. I've cleaned this up and it seems to have gone away.


    Quote Originally Posted by tician View Post
    The DynamixelPro library does not return any of the error codes I had added back to the Dynamixel library, so the readPose() line
    Code:
    if (Dxl.getResult()==(1<<COMM_RXSUCCESS))
    should simply be
    Code:
    if (Dxl.getResult()==1)
    .
    I'm still not getting responses every time using this. Not sure what is going on.


    Quote Originally Posted by tician View Post
    A better version for the DynamixelPro library would actually use the bulk_read function instead of individual read packets for each servo.
    I agree, I will have to look into this when I get some time.


    Thanks for all the help tician. The biggest problem I'm struggling with right now is not being able to get the full performance out of my servos for reasons I don't understand. As soon as I nail this one I'll be happy to stick with the ArbotiX Pose Engine

  10. Re: ArbotiX Pose Engine with CM9.04

    I've cracked the case on why my servo performance was worse when using the embedded programming compared to the default Robotis firmware.

    The ArbotiX pose engine works great with the Darwin-mini. Now I can finally start messing around with dynamic adjustments, and hopefully steering him around on the fly.


    thanks for the help.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Add Pose Capabilities to USB2AX?
    By KurtEck in forum Arbotix, Microcontrollers, Arduino
    Replies: 41
    Last Post: 12-13-2013, 06:11 PM
  2. Pose Editing System
    By Robonaut in forum Arbotix, Microcontrollers, Arduino
    Replies: 2
    Last Post: 04-30-2010, 03:12 PM
  3. Question(s) Arbotix problems with pose servo position
    By muc in forum Arbotix, Microcontrollers, Arduino
    Replies: 9
    Last Post: 02-21-2010, 06:11 PM
  4. Project Compressed air engine
    By sam in forum Project Showcase
    Replies: 11
    Last Post: 09-04-2009, 12:06 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
  •