The bioloid motors are accessed through the Motor objects
and have the following carateristics :
Table 4.1. Motors characteristics
| Name | Rangemin | Rangemax | Description |
|---|---|---|---|
| motor__0 | -1023 | 1023 | motor with ID #0 |
| motor__1 | -1023 | 1023 | motor with ID #1 |
| ... | -1023 | 1023 | ... |
| motor__x | -1023 | 1023 | motor 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
| Name | Rangemin | Rangemax | Description |
|---|---|---|---|
| Movements | |||
| load | 0 | 1 | (not 0x18) torque applied when 1 (position close-loop-control active) |
| reversedWheel | 0 | 255 | Inverse rotation way in speed mode.Usefull for opposed wheels in a car robot |
| speed | -1023 | 1023 | 0x20 Motor speed (ignored in position mode) |
| targetSpeed | -1023 | 1023 | |
| torque | 0 | 1023 | 0x28 max torque |
| torqueLimit | 0 | 1023 | 0x0E / 0x22 Motor maximum torque. Motor won't move if torque is too weak. |
| val | -1023 | 1023 | 0x24 Motor position (ignored in speed mode) |
| targetVal | -1023 | 1023 | |
| cwAngleLimit | 0 | 1023 | 0x06 Position limits. Used to switch from speed mode to position mode |
| ccwAngleLimit | 0 | 1023 | 0x08 same as above |
| moving | 0 | 1 | 0x2E Read: is 1 when motor turn, 0 when motor stopped (only in position mode) |
| Temperature | |||
| temperature | 0 | 255 | 0x2B temperature |
| temperatureLimit | 0 | 150 | 0x0B threshold of temperature to set overheating bit in status packet, if 1: set alarmLed |
| Power Supply | |||
| voltage | 0 | 255 | 0x2A read 10 x Voltage on dynamixel (100 is 10.0V) |
| lowVoltageLimit | 50 | 250 | 0x0C set 10 x volatge threshold to set alarm |
| highVoltageLimit | 50 | 250 | 0x0D set 10 x volatge threshold to set alarm |
| punch | 0 | 1023 | 0x30 minimum current supplied to motor (32 is better as minimum) |
| LoopBack | |||
| ccwAsservMargin | 0 | 254 | 0x1B |
| cwAsservMargin | 0 | 254 | 0x1A |
| cwAsservGain | 0 | 254 | 0x1C |
| ccwAsservGain | 0 | 254 | 0x1D |
| Led | |||
| LED | 0 | 1 | 0x19 switch Off/On red led on this motor; 1 is ON |
| alarmLED | 0 | 127 | 0x11 if set bits to 1 led blink: there is a selected error |
| alarmShutdown | 0 | 127 | 0x12 if selected bit is set, torque is set to 0 on selected error(s) |
| Identifier | |||
| ID | 0 | 253 | 0x03 Read ID of AX-12 motor |
| firmwareVersion | 0 | 255 | 0x02 Read firmware version |
| modelNumber | 0 | 65535 | 0x00 Read always 12 for an AX-12 |
| baudRate | 0 | 254 | 0x04 Communication speed. refer bioloid AX-12 manual (1 is 1Mbps) |
| Other informations | |||
| downCalibration | 0 | 65535 | 0x14 ReadOnly: delta between potentiometer and position |
| upCalibration | 0 | 65535 | 0x16 ReadOnly: delta between potentiometer and position |
| registeredInstruction | 0 | 1 | 0x2C ... |
| returnDelay | 0 | 254 | 0x05 time delay for return status packet: 2us *returnDelay |
| returnStatus | 0 | 2 | 0x10 status of dynamixel, equal 2 in normal mode |
| lock | 1 | 1 | 0x2F 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:
motor__1.load; to read the load attribute of motor[1] object.
motor__2.LED = 1; to write the LED attribute of motor[2] object.
motor[2].LED = 1; to write the LED attribute of motor[2] object.
You can drive your motor in two modes, depending of the close-loop control you want:
Position mode : with motor__X.val, the motor turn to a postion and stop
Speed mode : with motor__X.speed, the motor turn endless at this speed
To use this feature you need to set .cwAngleLimit and .ccwAngleLimit to adapted values:
Position mode : .cwAngleLimit and .ccwAngleLimit are limiting position values, clockwise and counter-clockwise.
Speed mode : .cwAngleLimit and .ccwAngleLimit equal to 0.
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