<?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=3514" />

<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>2009-05-20T05:21:19+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=5&amp;t=3514</id>
<entry>
<author><name><![CDATA[Marmakoide]]></name></author>
<updated>2009-05-20T05:21:19+01:00</updated>
<published>2009-05-20T05:21:19+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=3514&amp;p=19919#p19919</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=3514&amp;p=19919#p19919"/>
<title type="html"><![CDATA[AX12 control oddities]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=3514&amp;p=19919#p19919"><![CDATA[
Hi, ok, so the following pseudo-code is performing the intended goal, meaning that a very naive approach works well enough  <img src="http://forum.robosavvy.com/images/smilies/icon_biggrin.gif" alt=":D" title="Very Happy" /> <br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>       lSamplingFreq = 0.05<br />   lUpdateDuration = 1 / lSamplingFreq // Rough initial estimate<br />   lPos = 0.0<br />   lGoalPos = 0.0<br />   lSpeed = 0.0<br />   lStartTime = lUpdateStartDate = lUpdateEndDate = getCurrentTime&#40;&#41;<br /><br />   while&#40;1&#41; &#123;<br />      // Compute the next pos<br />      lT = lUpdateStartDate - lStartTime + lUpdateDuration<br />      lGoalPos = 0.5 * Constantsf::PI * sin&#40;lT&#41;<br /><br />      // Read the current pos<br />      lPos = lServo.readPos&#40;&#41;<br /><br />      // Compute the speed<br />      lSpeed = abs&#40;lPos - lGoalPos&#41; / lUpdateDuration<br /><br />      // Send the command<br />      lServo.moveTo&#40;lGoalPos, lSpeed&#41;<br />      sleep&#40;1 / lSamplingFreq&#41;<br /><br />      // Compute update duration<br />      lUpdateEndDate = getCurrentTime&#40;&#41;;<br />      lUpdateDuration = lUpdateEndDate - lUpdateStartDate;<br />      swap&#40;lUpdateEndDate, lUpdateStartDate&#41;;<br />   &#125;<br /></code></dd></dl><br /><br />sleep =&gt; do nothing<br />Time =&gt; seconds<br />Angles =&gt; in radians<br />Speeds =&gt; in radians per second<br /><br />The precision obtained is really nice, and what is nice is that code is sampling frequency independent.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=544">Marmakoide</a> — Wed May 20, 2009 5:21 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Marmakoide]]></name></author>
<updated>2009-05-19T12:16:33+01:00</updated>
<published>2009-05-19T12:16:33+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=3514&amp;p=19912#p19912</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=3514&amp;p=19912#p19912"/>
<title type="html"><![CDATA[AX12 control oddities]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=3514&amp;p=19912#p19912"><![CDATA[
Hi,<br /><br />=== The intented goal ===<br />  I'm trying to understand how to have an accurate control of a AX-12 from a PC with an <span style="font-style: italic">USB2Dynamixel</span> interface. <br /><br />I want it to move as following<br /> x(t)=0.5 * pi * sin(t)<br />where x(t) is the angle  in radians and t is the time in seconds<br /><br />=== My approach ===<br />I use a very naive approach. I repeat in an infinite loop the following instructions<br />1) Compute XGoal = x(T+K)<br />2) Read the current position XCurrent of the AX12<br />3) Compute V=|Xcurrent - XGoal| / K<br />4) Write the AX12 register to move to XGoal at speed V<br />5) K = time elapsed to do step 1) to 4)<br /><br />When watching XGoal and XCurrent, XCurrent is always a bit late, being behind XGoal. A perfect control would achieve XGoal = XCurrent, up to a given error of course<br /><br />=== My question ===<br />How do you, ladies and gentlemen, would do that very simple task ? A less naive approach ? My approach is just broken ?<br /><br />[/i]<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=544">Marmakoide</a> — Tue May 19, 2009 12:16 pm</p><hr />
]]></content>
</entry>
</feed>