Motors

The bioloid motors are accessed through the Motor objects and have the following carateristics :

Table 4.1. Motors characteristics

NameRangeminRangemaxDescription
motor__0-10231023motor with ID #0
motor__1-10231023motor with ID #1
...-10231023...
motor__x-10231023motor with ID #x


If your engine doesn't load any filename.u at start (declared in CLIENT.INI or in URBI.INI), by default no motors are created because of the structure of the bioloid, we don't know how many motors are in your robot. You must declare them before sending any command to them

motor[i] = new Motor(j);

This method can be used to create an array for all your motors. Remember the array begins at index 0. Moreover, the parameter you give to Motor is the ID of the motor you want to instanciate.

var i = 0;
for j in [10,12,16,18] {
 motor[i] = new Motor(j);
 i = i + 1;
};

or for a full automated creation of all available motors:

var i = 0;
for j in Bioloid.listAX12 {
 motor[i] = new Motor(j);
 i = i + 1;
};

this sample create the 4 motors of the bioloid car:

Motors are available by the motor__X, with X between 0 and your max_numbered_motor. You can (need to) adapt the #ID of motors in your scripts to the configuration of your robot (it's easier to rename each motor)!

Naming Standard: Depending the form of your bioloid robot (humanoid, car, quaduped, etc ...) *.u files exists for creating aliases and groups for this motors, to have a common naming standard for all robot. see Bioloid.data folder.

Not all config are already defined, don't hesitate to create and share your own .u files on www.urbiforge.org

A motor has the following attributes:

Table 4.2. AX-12 Motor attributes

NameRangeminRangemaxDescription
Movements   
load01(not 0x18) torque applied when 1 (position close-loop-control active)
reversedWheel0255Inverse rotation way in speed mode.Usefull for opposed wheels in a car robot
speed-102310230x20 Motor speed (ignored in position mode)
targetSpeed-10231023
torque010230x28 max torque
torqueLimit010230x0E / 0x22 Motor maximum torque. Motor won't move if torque is too weak.
val-102310230x24 Motor position (ignored in speed mode)
targetVal-10231023
cwAngleLimit010230x06 Position limits. Used to switch from speed mode to position mode
ccwAngleLimit010230x08 same as above
moving010x2E Read: is 1 when motor turn, 0 when motor stopped (only in position mode)
Temperature   
temperature02550x2B temperature
temperatureLimit01500x0B threshold of temperature to set overheating bit in status packet, if 1: set alarmLed
Power Supply   
voltage02550x2A read 10 x Voltage on dynamixel (100 is 10.0V)
lowVoltageLimit502500x0C set 10 x volatge threshold to set alarm
highVoltageLimit502500x0D set 10 x volatge threshold to set alarm
punch 010230x30 minimum current supplied to motor (32 is better as minimum)
LoopBack   
ccwAsservMargin02540x1B
cwAsservMargin02540x1A
cwAsservGain02540x1C
ccwAsservGain02540x1D
Led   
LED010x19 switch Off/On red led on this motor; 1 is ON
alarmLED01270x11 if set bits to 1 led blink: there is a selected error
alarmShutdown01270x12 if selected bit is set, torque is set to 0 on selected error(s)
Identifier   
ID02530x03 Read ID of AX-12 motor
firmwareVersion02550x02 Read firmware version
modelNumber0655350x00 Read always 12 for an AX-12
baudRate02540x04 Communication speed. refer bioloid AX-12 manual (1 is 1Mbps)
Other informations   
downCalibration0655350x14 ReadOnly: delta between potentiometer and position
upCalibration0655350x16 ReadOnly: delta between potentiometer and position
registeredInstruction010x2C ...
returnDelay02540x05 time delay for return status packet: 2us *returnDelay
returnStatus020x10 status of dynamixel, equal 2 in normal mode
lock110x2F if set to 1 only speed and val can be written, power down to disable


all this attributes are accessibled by calling myMotor.attribute like:

You can drive your motor in two modes, depending of the close-loop control you want:

To use this feature you need to set .cwAngleLimit and .ccwAngleLimit to adapted values:

Note that every descriptions beginning with a 0xNN address number is directly associated to AX-12 memory address, see dynamixel AX-12 manual for more informations on these functions : AX-12 Dynamixel or here