<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="http://forum.robosavvy.com/feed.php?f=5&amp;t=9077" />

<title>RoboSavvy Forum</title>
<subtitle>Robosavvy Forum: The largest online community of Humanoid Robot Builders</subtitle>
<link href="http://forum.robosavvy.com/index.php" />
<updated>2013-02-07T15:01:50+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=5&amp;t=9077</id>
<entry>
<author><name><![CDATA[ASpiers]]></name></author>
<updated>2013-02-07T15:01:50+01:00</updated>
<published>2013-02-07T15:01:50+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9077&amp;p=37131#p37131</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9077&amp;p=37131#p37131"/>
<title type="html"><![CDATA[False Position Readings in Dynamixel SDK]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9077&amp;p=37131#p37131"><![CDATA[
Hey everyone, <br /><br />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)<br /><br />Essentially I occasionally get false position readings from the moving servos that then persists on the false value until the servo is reset. <br /><br />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.<br /><br />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.<br /><br />Eventually the servos have to be re-initialised to get correct values.<br /><br />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.<br /><br />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.<br />     <dl class="codebox"><dt>Code: </dt><dd><code>calllib&#40;'dynamixel','dxl_write_word',1,Goal_index,Goal_Encoder_Pos2&#41;       calllib&#40;'dynamixel','dxl_write_word',2,Goal_index,Goal_Encoder_Pos2&#41;       <br /><br />  Position1 = int32&#40;calllib&#40;'dynamixel','dxl_read_word',1,36&#41;&#41;;<br />  Position2 = int32&#40;calllib&#40;'dynamixel','dxl_read_word',2,36&#41;&#41;; <br />  <br />  error1 = abs&#40;Goal_Encoder_Pos1 - Position1&#41;;<br />  error2 = abs&#40;Goal_Encoder_Pos2 - Position2&#41;;   <br /><br /><br /> while &#40;&#40;error1 &gt; 5&#41; || &#40;error2 &gt; 5&#41;&#41;<br />    Position1 = int32&#40;calllib&#40;'dynamixel','dxl_read_word',1,36&#41;&#41;;         % Read Position                  % Read Movement<br />    error1 = abs&#40;Goal_Encoder_Pos1 - Position1&#41;;   <br />    Position2 = int32&#40;calllib&#40;'dynamixel','dxl_read_word',2,36&#41;&#41;;         % Read Position                  % Read Movement<br />    error2 = abs&#40;Goal_Encoder_Pos2 - Position2&#41;;<br />    error = &#91;error1 error2&#93;<br />   end<br /></code></dd></dl> <br /><br />Thanks for any suggestions, this thing is driving me nuts!<br /><br />Ad<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=4181">ASpiers</a> — Thu Feb 07, 2013 3:01 pm</p><hr />
]]></content>
</entry>
</feed>