How to control the motor velocity in position mode?

Hello,

I’m using MX-106T servos and OPENRB-150 control board, and I met some troubles when setting their velocities in position mode. As shown below, I changed the velocity to 10 or 30, but they still move very fast. Could you please help me check if there are any mistakes in my arduino code? Thank you!

const uint8_t DXL_ID2 = 2;
const float DXL_PROTOCOL_VERSION = 1.0;
Dynamixel2Arduino dxl(DXL_SERIAL, DXL_DIR_PIN);
using namespace ControlTableItem;
void setup() {

DEBUG_SERIAL.begin(115200);
while(!DEBUG_SERIAL);
dxl.begin(57600);
dxl.setPortProtocolVersion(DXL_PROTOCOL_VERSION);
dxl.ping(DXL_ID2);
dxl.torqueOff(DXL_ID2);
dxl.setOperatingMode(DXL_ID2, OP_POSITION);
dxl.torqueOn(DXL_ID2);
dxl.writeControlTableItem(MOVING_SPEED, DXL_ID2, 10);
}
void loop() {
dxl.setGoalPosition(DXL_ID2, 70);
Serial.println(dxl.readControlTableItem(PRESENT_SPEED, DXL_ID2));
delay(2000);
dxl.setGoalPosition(DXL_ID2, 330);
Serial.println(dxl.readControlTableItem(PRESENT_SPEED, DXL_ID2));
delay(2000);
}

In your case you would need to reduce the Position P gain to slow the rotational speed further

image

This value is defaulted to 850 I think.

How about trying to use parameters as below

case MX original firmware : Moving Speed(address 32), Goal Acceleration(address 73)
emanual : MX-64T/R/AT/AR

case MX(2.0) firmware : Profile Acceleration(address 108), Profile Velocity(address 112)
emanual : MX-28T/R/AT/AR(2.0)

Thanks, I have reduced the P gain, and it works better.

Thank you, I found that I mistook the operation mode, so that I couldn’t change the speed.

1 Like