Results 1 to 5 of 5

Thread: Acceleration implementation on OpenCM?

  1. Acceleration implementation on OpenCM?

    Hi there
    I can't seem to get acceleration/deceleration using the apparently available GOAL_ACCELERATION function (control adress 73 on the MX 28AR).
    I'm using Open CM 1.0.2 IDE on a Mac and the OpenCM9.04 board together with the 485EXP extension board.
    The Dynamixel turns at the specified speed but no acceleration and decelleration.
    The documentation is a bit sparse for my liking - I need everything spelled out so I'm not sure if I have the correct parameters in the correct order.
    I adapted an example to test the acceleration function - could someone look at it to tell me what I'm doing wrong?
    Thanks!
    jomo

    Code:
    /* Dynamixel setPosition Example
    
     Turns left the dynamixel , then turn right for one second,
     repeatedly with different velocity.
     
                   Compatibility
     CM900                  O
     OpenCM9.04             O
     
                    Dynamixel Compatibility
                   AX     MX      RX    XL-320    Pro
     CM900          O      O      O        O      X
     OpenCM9.04     O      O      O        O      X
     **** OpenCM 485 EXP board is needed to use 4 pin Dynamixel and Pro Series **** 
     
     created 16 Nov 2012
     by ROBOTIS CO,.LTD.
    */
    //Adapted by Jomo from example software
    /* Serial device defines for dxl bus */
    #define DXL_BUS_SERIAL1 1  //Dynamixel on Serial1(USART1)  <-OpenCM9.04
    #define DXL_BUS_SERIAL2 2  //Dynamixel on Serial2(USART2)  <-LN101,BT210
    #define DXL_BUS_SERIAL3 3  //Dynamixel on Serial3(USART3)  <-OpenCM 485EXP
    /* Dynamixel ID definitions */
    #define Feet 1             //ID 1 for rotation of Feet
    #define Waist 2            // ID 2 for rotation of Waist
    
    #define GOAL_POSITION 30    // 30 is Goal Position control address
    #define MOVING 46           // 46 is moving control adress
    #define GOAL_ACCEL 73       // 73 is goal acceleration control address
    
    Dynamixel Dxl(DXL_BUS_SERIAL3);    // We use this port because we're on the 485EXP board
    ///////////////////////////////////////////////////////////////////////////////////////
    //VARIABLES
    byte isMoving = 0;
    int goalPosition = 0;
    ///////////////////////////////////////////////////////////////////////////////////////
    
    void setup() {
      
      Dxl.begin(3);              // Dynamixel 2.0 Baudrate -> 0: 9600, 1: 57600, 2: 115200, 3: 1Mbps 
      SerialUSB.begin();         // Open the serial USB port for debugging messages
      
      // All Dynamixels are used in the joint mode
      
      Dxl.jointMode(Feet);       //jointMode() is to use position mode
      Dxl.jointMode(Waist);
    }
    
    ///////////////////////////////////////////////////////////////////////////////////////
    
    void loop() {
      isMoving = Dxl.readByte(Feet, MOVING);  // Check if Feet are still moving
      if(isMoving == 0){
        Dxl.writeWord(Feet, GOAL_ACCEL, 10);
        Dxl.writeWord(Feet, GOAL_POSITION, goalPosition);
         //toggle the position if goalPosition is 1000, set to 0, if 0, set to 1000
        if(goalPosition == 4000)
          goalPosition = 0;
        else
          goalPosition = 4000;
      }     
    }

  2. Re: Acceleration implementation on OpenCM?

    Hi there
    I finally figured out how to obtain acceleration/decelleration ramps in OpenCM using the GOAL_ACCELERATION control.
    I was trying to get it to apply to GOAL_POSITION but that control doesn't have a velocity parameter so the servo runs at full speed. From my trials - if the motor is running full speed then there's no accel ramp.
    If you use a different method - I tried this code and it works perfectly.

    Dxl.setPosition(ID, Position, Velocity);
    Dxl.writeByte(ID, GOAL_ACCELERATION, Value);

    It doesn't work if the velocity is set to it's maximum value.
    Great news for me as I was working on a software routine to calculate and implement the acceleration/deceleration ramps...
    Cheers

  3. #3
    Join Date
    May 2016
    Location
    USA
    Posts
    145
    Images
    12
    Rep Power
    11

    Re: Acceleration implementation on OpenCM?

    Does it work with any other value other than max? Thanks for posting about it, might save me some headache.

    Why are you using acceleration? Just to make the movements look more realistic?

  4. Re: Acceleration implementation on OpenCM?

    I think you misread me there - it does NOT work with maximum velocity - all other values work fine so you can choose from 1 to 1023.
    The lower the value chosen for GOAL_ACCELERATION the longer the ramp it produces so between these 2 parameters there's plenty of scope for adjusting things to your needs.
    I need to use acceleration for several reasons:
    Realistic movements (it's for a moving space suit automatum)
    Lower wear on the gears
    Less noise
    The acceleration ramps iron out a lot if inertia related problems

  5. #5
    Join Date
    May 2016
    Location
    USA
    Posts
    145
    Images
    12
    Rep Power
    11

    Re: Acceleration implementation on OpenCM?

    I didn't misread, but thanks for the clarification and explanation. It sounds like a great idea, and I will have to implement acceleration as well.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. HR-OS1 angular velocity and linear acceleration estimate
    By kira in forum HR-OS1 Development and Discussion
    Replies: 1
    Last Post: 02-22-2016, 10:31 PM
  2. Question(s) Gait implementation for hexapod + roll/pitch problem
    By teh_dot in forum Humanoids, Walkers & Crawlers
    Replies: 3
    Last Post: 08-19-2015, 11:23 AM
  3. Hummanoid Torso Z Acceleration Max
    By RoboTy in forum Humanoids, Walkers & Crawlers
    Replies: 2
    Last Post: 12-12-2010, 02:07 PM
  4. Neural network implementation?
    By ScuD in forum Software and Programming
    Replies: 15
    Last Post: 12-10-2008, 02:50 PM
  5. kondo acceleration sensor
    By plingboot in forum Humanoids, Walkers & Crawlers
    Replies: 2
    Last Post: 12-03-2007, 12:03 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
  •