Modules

Dynamixel Servomotors

LATEST VERSION 1.8 (04.03.2012)

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
See servos in action: http://emys.lirec.ict.pwr.wroc.pl and http://twingo.ict.pwr.wroc.pl/samuel

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.

Requirement:

Urbi SDK 2.7.5 or higher

Install:

1. Copy UDynamixel.dll to URBI folder.
2. Load module in URBI server
3. Connect all servos

Run:

After connecting servos, open the port, then run function
FindServos(ID_start,ID_stop) otherwise servos never communicate.

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.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.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.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.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 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(uobjects_handle, closure() {Dynamixel.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(Dynamixel.GetPresentPosition(0)); });
servo0.&position.notifyChangeOwned( closure() {Dynamixel.SetGoalPosition(0,servo0.&position.val);});


Download here:




WRUT

Options: