DYNAMIXEL MX-106T (2.0)+OpenCM9.04+Arduino IDE-Current-based Position Control Mode +Profile velocity

Hi everyone, I am using MX106T(2.0) connected to OpenCM904 and using Arduino IDE to upload the Dynamixel2Arduino library example codes.

I want to set/limit the velocity always constant, under the Current-based Position Control Mode. For that, Profile Velocity can be used. However the problem is; suppose using the compliant motion of DYNAMIXEL if I stop the servo rotation by an external force it stops which is great, but after removing that force the velocity varies and it exceeds the Profile Velocity to achieve the Goal Position.

The example code is attached here;

// Current Based Postion Contorl Mode in protocol2.0 (MX106)
  dxl.setOperatingMode(DXL_ID, OP_CURRENT_BASED_POSITION);
  dxl.writeControlTableItem(GOAL_CURRENT, DXL_ID, 20); //for Mx(2.0)
  dxl.writeControlTableItem(PROFILE_VELOCITY, DXL_ID, 20); //for Mx(2.0)
  if(dxl.setGoalPosition(DXL_ID, 8192)){
    DEBUG_SERIAL.print("Present Current Based Position : ");
    DEBUG_SERIAL.println(dxl.getPresentPosition(DXL_ID)); DEBUG_SERIAL.println();

Is it possible or is there any way to keep the velocity not exceeding the Profile Velocity under the Current-based Position Control Mode when the resisting/stopping force is removed from the DYNAMIXEL?

Thanks a lot.

Setting a Current Limit would likely be the simplest way to achieve this.

If you set your Current Limit to a current corresponding to the maximum velocity you would like the servo to be capable of, it will not exceed that limit when attempting to move back into position after being moved.

Hi @Jonathon , thank you for your suggestions

The Current limit was also used in the setup code unfortunately, I didn’t mention that in above code.

However, the Current limit doesn’t limit/set the Velocity. To limit the velocity the profile velocity can be used for Current-based Position control mode otherwise the servo will run on its maximum speed. I have tested DYNAMIXEL again, by varying the current values but it doesn’t seem any changes in the velocity.

1 Like

The reason Velocity of DYNAMIXEL has been updated is because your Present Position tried to follow the given trajectory at the time.

To simply achieve constant velocity in my thought, you could reupdate the Goal Position to update the trajectory when there is force detected (that is resulting in the Present Position left behind the Trajectory) or diffentiaiave between Present Position and Present Trajectory. This apporch is only solution when Profile Acceleration is ‘0’, which means Max acceleration in DYNAMIXEL.

Alternatively, using Time-based Profile, you should calculate the time.

For example, Setting 10 seconds in moving time, if 2 Sec stops > 8 Sec Updates.

But I guess, first advicing would be better option I guess.

The other solution is to use DYNAMIXEL-P series.

As you can see below, the P series can regulate velocity while it’s in motion.

1 Like

Thank you very much for this detailed description and suggestions.

1 Like

Update: here one problem was solved that is after forcefully stopping the servo for a while now the motor is not running to its maximum velocity after removing the force and it is following the profile velocity (advice helped i.e., “Reupdate the Goal Position to update the trajectory”).

However another challenge is in case if we turn the servo instead of just stopping using the compliant mode; MX comes back to its original position but with its maximum velocity, the same strategy can be used for this problem too. However, doing this will only allow us to change the position of the MX but it won’t comeback to its original position.

In both cases the compliant mode can be useful, however in the second case the changed position will be Present position of the dynamixel. That mean on any new command MX will continue its rotation (CW/CCW) from this changed position.

1 Like