by ASpiers » Thu Feb 07, 2013 3:01 pm
by ASpiers
Thu Feb 07, 2013 3:01 pm
Hey everyone,
I'm having a very strange problem with the Dynamixel SDK when used in Matlab. This only occurs when I run it on one particular laptop (Windows 7, 32bit). The process and code works perfectly fine on two other laptops (Windows 7 and Windows XP, both 32 bit)
Essentially I occasionally get false position readings from the moving servos that then persists on the false value until the servo is reset.
My code requestes that the servo move to the new position, and afterwards enteres a while loop, checking that the position has been achieved. Once the position has been achieved a new demand is given. Because a false reading is given, the code ends up getting stuck in the while loop.
This doesn't always happen, quite often a servo will return the correct value for awhile then suddenly give a false reading. If I check the servo in the dynamixel manager the values seem correct.
Eventually the servos have to be re-initialised to get correct values.
I thought it may be caused by latency on the COM port, but I've changed this to 1ms in the device manager and this doesn't help. The interesting thing is that if I do change the COM port setting on another laptop to 16ms (the default setting) then the error re-appears.
Here is my code if it is any use. As I say, the really strange thing is that this error only occurs on one of the three laptops I have tried this software on.
- Code: Select all
calllib('dynamixel','dxl_write_word',1,Goal_index,Goal_Encoder_Pos2) calllib('dynamixel','dxl_write_word',2,Goal_index,Goal_Encoder_Pos2)
Position1 = int32(calllib('dynamixel','dxl_read_word',1,36));
Position2 = int32(calllib('dynamixel','dxl_read_word',2,36));
error1 = abs(Goal_Encoder_Pos1 - Position1);
error2 = abs(Goal_Encoder_Pos2 - Position2);
while ((error1 > 5) || (error2 > 5))
Position1 = int32(calllib('dynamixel','dxl_read_word',1,36)); % Read Position % Read Movement
error1 = abs(Goal_Encoder_Pos1 - Position1);
Position2 = int32(calllib('dynamixel','dxl_read_word',2,36)); % Read Position % Read Movement
error2 = abs(Goal_Encoder_Pos2 - Position2);
error = [error1 error2]
end
Thanks for any suggestions, this thing is driving me nuts!
Ad
Hey everyone,
I'm having a very strange problem with the Dynamixel SDK when used in Matlab. This only occurs when I run it on one particular laptop (Windows 7, 32bit). The process and code works perfectly fine on two other laptops (Windows 7 and Windows XP, both 32 bit)
Essentially I occasionally get false position readings from the moving servos that then persists on the false value until the servo is reset.
My code requestes that the servo move to the new position, and afterwards enteres a while loop, checking that the position has been achieved. Once the position has been achieved a new demand is given. Because a false reading is given, the code ends up getting stuck in the while loop.
This doesn't always happen, quite often a servo will return the correct value for awhile then suddenly give a false reading. If I check the servo in the dynamixel manager the values seem correct.
Eventually the servos have to be re-initialised to get correct values.
I thought it may be caused by latency on the COM port, but I've changed this to 1ms in the device manager and this doesn't help. The interesting thing is that if I do change the COM port setting on another laptop to 16ms (the default setting) then the error re-appears.
Here is my code if it is any use. As I say, the really strange thing is that this error only occurs on one of the three laptops I have tried this software on.
- Code: Select all
calllib('dynamixel','dxl_write_word',1,Goal_index,Goal_Encoder_Pos2) calllib('dynamixel','dxl_write_word',2,Goal_index,Goal_Encoder_Pos2)
Position1 = int32(calllib('dynamixel','dxl_read_word',1,36));
Position2 = int32(calllib('dynamixel','dxl_read_word',2,36));
error1 = abs(Goal_Encoder_Pos1 - Position1);
error2 = abs(Goal_Encoder_Pos2 - Position2);
while ((error1 > 5) || (error2 > 5))
Position1 = int32(calllib('dynamixel','dxl_read_word',1,36)); % Read Position % Read Movement
error1 = abs(Goal_Encoder_Pos1 - Position1);
Position2 = int32(calllib('dynamixel','dxl_read_word',2,36)); % Read Position % Read Movement
error2 = abs(Goal_Encoder_Pos2 - Position2);
error = [error1 error2]
end
Thanks for any suggestions, this thing is driving me nuts!
Ad