Hi,
I am building a quadruped robot using 2 Dynamixel AX-12A per limb, so 8 in total, all daisy-chained on the same Serial line of my Teensy 3.6.
I am using the library developed of Savage Electronics (https://sourceforge.net/projects/dyn...?source=navbar) in which I added the function Sync Write in order to actuate multiple servos at the same time (and I don't need any Status Packets so it suits me more than to use the Reg Write and Action functions).
I am sending the instruction Sync Write every 10ms to 8 Dynamixel AX-12a.
Strange things start happening after I daisy chain more than 6 servos together:
- the servos stop altogether if I don't touch anything
- the servos move again but are very jittery at some times (not always) when I'm tweaking the wires
- after a while of tweaking and jittering, often one of the servos' ID is reset (in which case I have to set it again to the ID I want it to have)
- when I daisy chain 6 servos only (in which case it's supposed to work), but just for the sake of it decide to plug in an extra JST cable in one of these servos and let it hang (i.e. not connect it to another servo on the other end), the 6 servos just stop moving altogether
I suspected in the past this to be a wiring problem (because of the tweaking) so I ordered new, shorter, wires from Trossen Robotics, to no avail.
For some time I was using REG WRITE and ACTION to actuate multiple servos and I suspected the problem to come from that, so I added the new function Sync Write into Savage Electronics' Dynamixel Library, to no avail.
One last thing: when I daisy chain the servos directly by using the pins on the servos, the movements are jittery even with just 4 servos. However when I daisy chain them externally using a breadboard the movements are smooth. Do I need to change servos? Is this a servo issue? They are around 2 years old and have been used quite a lot. I don't have reason to suspect this is the real issue though.
Details on the power I'm using:
- 11.1V 3S 1100mAh 25C LiPo Battery -> goes in the 8 Dynamixel AX-12A
- 11.1V from the battery goes through a 5V Voltage regulator which goes in the 5V pin in the Teensy 3.6 (which has an internal 3.3V voltage regulator)
If anyone has had a similar issue, or might know what the cause of my problem could be, please post a comment!
Victor
For info, here is the Sync Write function I added:
Code:
void DynamixelClass2::syncWrite(unsigned char ID[8], int Position[8], int Speed[8])
{
int SYNC_WRITE_LENGTH = 44; //(4+1)*8 + 4 = 44
char Position_H[8], Position_L[8], Speed_H[8], Speed_L[8], Sum_Position, Sum_Speed;
Sum_Position = 0;
Sum_Speed = 0;
unsigned char Sum_ID = 0;
for(int i = 0; i<=7; i++){
Position_H[i] = Position[i] >> 8;
Position_L[i] = Position[i]; // 16 bits - 2 x 8 bits variables
Speed_H[i] = Speed[i] >> 8;
Speed_L[i] = Speed[i]; // 16 bits - 2 x 8 bits variables
Sum_Position += Position_H[i] + Position_L[i];
Sum_Speed += Speed_H[i] + Speed_L[i];
Sum_ID += ID[i];
}
Checksum = (~(BROADCAST_ID + SYNC_WRITE_LENGTH + AX_SYNC_WRITE + AX_GOAL_POSITION_L + AX_MOVING_LENGTH + Sum_Position + Sum_Speed + Sum_ID))&0xFF;
sendData(AX_START); // Send Instructions over Serial
sendData(AX_START);
sendData(BROADCAST_ID);
sendData(SYNC_WRITE_LENGTH);
sendData(AX_SYNC_WRITE);
sendData(AX_GOAL_POSITION_L);
sendData(AX_MOVING_LENGTH);
sendData(ID[0]);
sendData(Position_L[0]);
sendData(Position_H[0]);
sendData(Speed_L[0]);
sendData(Speed_H[0]);
sendData(ID[1]);
sendData(Position_L[1]);
sendData(Position_H[1]);
sendData(Speed_L[1]);
sendData(Speed_H[1]);
sendData(ID[2]);
sendData(Position_L[2]);
sendData(Position_H[2]);
sendData(Speed_L[2]);
sendData(Speed_H[2]);
sendData(ID[3]);
sendData(Position_L[3]);
sendData(Position_H[3]);
sendData(Speed_L[3]);
sendData(Speed_H[3]);
sendData(ID[4]);
sendData(Position_L[4]);
sendData(Position_H[4]);
sendData(Speed_L[4]);
sendData(Speed_H[4]);
sendData(ID[5]);
sendData(Position_L[5]);
sendData(Position_H[5]);
sendData(Speed_L[5]);
sendData(Speed_H[5]);
sendData(ID[6]);
sendData(Position_L[6]);
sendData(Position_H[6]);
sendData(Speed_L[6]);
sendData(Speed_H[6]);
sendData(ID[7]);
sendData(Position_L[7]);
sendData(Position_H[7]);
sendData(Speed_L[7]);
sendData(Speed_H[7]);
sendData(Checksum);
}
Bookmarks