LATEST VERSION 1.8 (04.03.2012)

 
dynamixel motors
 

Dynamixel is a robot-only Smart Actuator with a new concept integrating speed reducer, controller, driver, network function, etc. into one module. Manufacturer have Line up of several kinds of Dynamixel applicable numerously according to the kinds and characteristics of robots. Servo is built up with all-round combining structure and it is possible to connect one Structure another with various forms. You can design a robot easily as if assembling a block toy by using option frame for Dynamixel. Servos with a unique ID is controlled by Packet communication on a BUS and supports networks such as TTL, RS485, and CAN depending on the type of model.

More information here:
Manufacturer page: http://www.robotis.com/html/en.php
Servos page: http://www.robotis.com/xe/dynamixel_en
Robots page: http://www.robotis.com/xe/bioloid_en

Description:

Dynamixel URBI module allows to control of all Robotis Dynamixel Servos in network. All functions have got two representations. First one allows only on communication with one servo. Those functions access EEPROM memory of servos, so it requires only one time programing. All settings are be saved after powering off. Secound group of functions (ends on Mu in the f.name) allows for communication with group of servos and one as well. Those functions acces RAM area of memory. This part of the memory will not be saved after powering off.

Module functions:

Module control functions

Dynamixel.Open(PortName, BaudRate) - open port, returns 1 if success, 0 if any errors
Dynamixel.Close() - close port, returns 1 if success
Dynamixel.FindServos(ID_start,ID_end) - find all connected servos, returns vector with ID of found servos, you can run this function in background
Dynamixel.ForceAddServo(ID,RetLevel) - force add servo to the structure, set ID and ReturnLevel (see Dynamixel manual)
Dynamixel.RemoveServo(ID) - remove servo manually
Dynamixel.Ping(ID) - ping servo, returns 1 if servo exist, 0 if not

Access only one servo EEPROM controler memory

Dynamixel.SetID(ID,data) - Set new ID for servo, returns 1 if success 0 if any errors, note if you change ID you have to run FindServos function again
Dynamixel.SetBaudRate(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetReturnDelay(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetCWAngleLimit(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetCCWAngleLimit(ID,data)- returns 1 if success, 0 if any errors
Dynamixel.SetHighLimitTemp(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetLowLimitVolt(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetHighLimitVolt(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetMaxTorque(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetStatusReturnLevel(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetAlarmLED(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetAlarmShutdown(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.GetModelNumber(ID) - returns data if success, 9999 if any errors
Dynamixel.GetVersionFirmware(ID) - returns data if success, 9999 if any errors
Dynamixel.GetID(ID) - returns data if success, 9999 if any errors
Dynamixel.GetBaudRate(ID) - returns data if success, 9999 if any errors
Dynamixel.GetReturnDelay(ID) - returns data if success, 9999 if any errors
Dynamixel.GetCWAngleLimit(ID) - returns data if success, 9999 if any errors
Dynamixel.GetCCWAngleLimit(ID) - returns data if success, 9999 if any errors
Dynamixel.GetHighLimitTemp(ID) - returns data if success, 9999 if any errors
Dynamixel.GetLowLimitVolt(ID) - returns data if success, 9999 if any errors
Dynamixel.GetHighLimitVolt(ID) - returns data if success, 9999 if any errors
Dynamixel.GetMaxTorque(ID) - returns data if success, 9999 if any errors
Dynamixel.GetStatusReturnLevel(ID) - returns data if success 9999 if any errors
Dynamixel.GetAlarmLED(ID) - returns data if success, 9999 if any errors
Dynamixel.GetAlarmShutdown(ID) - returns data if success, 9999 if any errors

Access only one servo RAM controler memory

Dynamixel.SetTorque(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetLED(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetCWCompMargin(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetCCWCompMargin(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetCWCompSlope(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetCCWCompSlope(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetDGain(ID,data) - returns 1 if succes 0 if any errors
Dynamixel.SetIGain(ID,data) - returns 1 if succes 0 if any errors
Dynamixel.SetPGain(ID,data) - returns 1 if succes 0 if any errors
Dynamixel.SetMaxEncDiff(ID,data) - returns 1 if succes 0 if any errors (custom, not Dynamixel register)
Dynamixel.SetMovingSpeed(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetGoalPosition(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetTorqueLimit(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetRegInstruction(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetLock(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.SetPunch(ID,data) - returns 1 if success, 0 if any errors
Dynamixel.GetTorque(ID) - returns data if success, 9999 if any errors
Dynamixel.GetLED(ID) - returns data if success, 9999 if any errors
Dynamixel.GetCWCompMargin(ID) - returns data if success, 9999 if any errors
Dynamixel.GetCCWCompMargin(ID) - returns data if success, 9999 if any errors
Dynamixel.GetCWCompSlope(ID) - returns data if success, 9999 if any errors
Dynamixel.GetCCWCompSlope(ID) - returns data if success ,9999 if any errors
Dynamixel.GetDGain(ID) - returns data if succes 9999 if any errors
Dynamixel.GetIGain(ID) - returns data if succes 9999 if any errors
Dynamixel.GetPGain(ID) - returns data if succes 9999 if any errors
Dynamixel.GetMaxEncDiff(ID) - returns data if succes 9999 if any errors (custom, not Dynamixel register)
Dynamixel.GetGoalPosition(ID) - returns data if success, 9999 if any errors
Dynamixel.GetMovingSpeed(ID) - returns data if success, 9999 if any errors
Dynamixel.GetTorqueLimit(ID) - returns data if success, 9999 if any errors
Dynamixel.GetPresentPosition(ID) - returns data if success ,9999 if any errors
Dynamixel.GetPresentSpeed(ID) - returns data if success, 9999 if any errors
Dynamixel.GetPresentLoad(ID)- returns data if success, 9999 if any errors
Dynamixel.GetPresentVolt(ID) - returns data if success, 9999 if any errors
Dynamixel.GetPresentTemp(ID) - returns data if success, 9999 if any errors
Dynamixel.GetRegInstruction(ID) - returns data if success, 9999 if any errors
Dynamixel.GetMoving(ID) - returns data if success, 9999 if any errors
Dynamixel.GetLock(ID) - returns data if success, 9999 if any errors
Dynamixel.GetPunch(ID) - returns data if success, 9999 if any errors

Access only RAM controler memory of many connected servos

Dynamixel.SetTorqueMu([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if success, 0 if any errors
Dynamixel.SetLEDMu([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if success, 0 if any errors
Dynamixel.SetCWCompMarginMu([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if success, 0 if any errors
Dynamixel.SetCCWCompMarginMu([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if success, 0 if any errors
Dynamixel.SetCWCompSlopeMu([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if success, 0 if any errors
Dynamixel.SetCCWCompSlopeMu([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if success, 0 if any errors
Dynamixel.SetDGainMu([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if succes 0 if any errors
Dynamixel.SetIGain([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if succes 0 if any errors
Dynamixel.SetPGain([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if succes 0 if any errors
Dynamixel.SetMaxEncDiff([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if succes 0 if any errors (custom, not Dynamixel register)
Dynamixel.SetMovingSpeedMu([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if success, 0 if any errors
Dynamixel.SetGoalPositionMu([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if success, 0 if any errors
Dynamixel.SetTorqueLimitMu([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if success, 0 if any errors
Dynamixel.SetRegInstructionMu([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if success ,0 if any errors
Dynamixel.SetLockMu([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if success, 0 if any errors
Dynamixel.SetPunchMu([ID0,ID1,...IDn],[data0,data1,...datan]) - returns 1 if success, 0 if any errors
Dynamixel.GetTorqueMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetLEDMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetCWCompMarginMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetCCWCompMarginMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetCWCompSlopeMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetCCWCompSlopeMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetDGain([ID0,ID1,...IDn]) - returns data in vecotr or empty vector if any errors
Dynamixel.GetIGain([ID0,ID1,...IDn]) - returns data in vecotr or empty vector if any errors
Dynamixel.GetPGain([ID0,ID1,...IDn]) - returns data in vecotr or empty vector if any errors
Dynamixel.GetMaxEncDiff([ID0,ID1,...IDn]) - returns data in vecotr or empty vector if any errors (custom, not Dynamixel register)
Dynamixel.GetGoalPositionMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetMovingSpeedMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetTorqueLimitMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetPresentPositionMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetPresentSpeedMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetPresentLoadMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetPresentVoltMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetPresentTempMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetRegInstructionMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetMovingMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetLockMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors
Dynamixel.GetPunchMu([ID0,ID1,...IDn]) - returns data in vector or empty vector if any errors

Additional module functions

Dynamixel.SetPosVel(ID,position,velocity) - returns 1 if success 0 if any errors

How to use in urbiscript:

loadModule("Dynamixel");
var Global.dyn=Dynamixel.new();
dyn.Open("COM1",57600);
dyn.FindServos(0,10);
dyn.SetGoalPosition(0,100);
dyn.SetGoalPosition(1,200);
// do the same below
dyn.SetGoalPositionMu([0,1],[100,200]);

How to build own robots and use trajectory generators:

class Servo {
};
// servo 0
//
var servo0=Servo.new();
UVar.new(servo0, "position");
servo0.&position.notifyChange(closure() {
   dyn.SetGoalPosition(0,servo0.position);
});
// Add body element - leg
robot.body.newComponent("leg");
servo0.getSlot("position").copy(robot.body,"leg");
// Set leg parameters
do (robot.body) 
{ 
  leg->rangemax=800;
  leg->rangemin=320;
  leg = 512;
};
// Use trajectory
ex: robot.body.leg =512 sin:3s ampli:200,

How to read and write actual position

class Servo {
};
// servo 0
//
var servo0=Servo.new();
UVar.new(servo0, "position");
servo0.&position.owned=true;
servo0.&position.notifyAccess( closure() {
  servo0.&position.writeOwned(dyn.GetPresentPosition(0)); 
});
servo0.&position.notifyChangeOwned( closure() {
  dyn.SetGoalPosition(0,servo0.&position.val);
});
 

Download:

 

1.8 vs. 1.8.5

Present Position, CW Angle Limit, CCW Angle Limit

ver 1.8
The angle position is in the range of unsigned 0~1023 (RX series) or 0~4095 (MX series)

ver 1.8.5
Position range is in range of signed from -32768 to 32767.

Present Speed, Present Load

ver 1.8
Current moving speed is in 0~2047.
If a value is in the rage of 0~1023 then the motor rotates to the CCW direction.
If a value is in the rage of 1024~2047 then the motor rotates to the CW direction.
The 10th bit becomes the direction bit to control the direction; 0 and 1024 are equal.

ver 1.8.5
Present speed or load value is in signed range from -32768 to 32767.

Addresses 26 (0x1A) - 29 (0x1D)

ver 1.8
26 (0X1A) CW Compliance Margin
27 (0X1B) CCW Compliance Margin
28 (0X1C) CW Compliance Slope
29 (0X1D) CCW Compliance Slope

ver 1.8.5
26 (0X1A) D Gain
27 (0X1B) I Gain
28 (0X1C) P Gain
29 (0X1D) (custom, not Dynamixel register)

The less the P gain, The larger the back lash, and the weaker the amount of output near goal position. At some extent, it is like a combined concept of margine and slope. It does not exactly match the previous concept of compliance. So it is obvious if you see the difference in terms of motion.

 

 

 

EMYS and FLASH are Open Source and distributed according to the GPL v2.0 © Rev. 0.8.0, 27.04.2016

FLASH Documentation