<?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=15&amp;t=6119" />

<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>2010-05-08T14:20:01+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=15&amp;t=6119</id>
<entry>
<author><name><![CDATA[pepep]]></name></author>
<updated>2010-05-08T14:20:01+01:00</updated>
<published>2010-05-08T14:20:01+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26682#p26682</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26682#p26682"/>
<title type="html"><![CDATA[Auto balance for Robobuilder in Lisp / L# - custom firmware]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26682#p26682"><![CDATA[
Perfect!<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=2044">pepep</a> — Sat May 08, 2010 2:20 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[l3v3rz]]></name></author>
<updated>2010-05-08T14:15:35+01:00</updated>
<published>2010-05-08T14:15:35+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26681#p26681</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26681#p26681"/>
<title type="html"><![CDATA[Auto balance for Robobuilder in Lisp / L# - custom firmware]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26681#p26681"><![CDATA[
[Edit]<br /><br />just noticed - my boot loader - loads utilities.lisp by default which includes at the top:<br /><br /><br />(reference &quot;System.Windows.Forms&quot;<br />           &quot;System.Drawing&quot;)<br /><br />(using     &quot;System.Drawing&quot;<br />           &quot;System.Windows.Forms&quot;)<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1101">l3v3rz</a> — Sat May 08, 2010 2:15 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[pepep]]></name></author>
<updated>2010-05-08T14:09:36+01:00</updated>
<published>2010-05-08T14:09:36+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26680#p26680</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26680#p26680"/>
<title type="html"><![CDATA[Auto balance for Robobuilder in Lisp / L# - custom firmware]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26680#p26680"><![CDATA[
I get this:<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>&gt; &#40;reference &quot;System.Windows.Forms&quot;&#41;<br />System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089<br />&gt; &#40;using &quot;System.Windows.Forms&quot;&#41;<br />null<br />&gt; &#40;load &quot;balance.lisp&quot;&#41;<br />.*** redefining mapcar<br />.*** redefining setl<br />...*** redefining rmatch<br />.*** redefining calibrateXYZ<br />.can't find type = Color<br />Exception : Se produjo una excepción de tipo 'System.Exception'.<br />&gt;<br /></code></dd></dl><br /><br />???<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=2044">pepep</a> — Sat May 08, 2010 2:09 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[l3v3rz]]></name></author>
<updated>2010-05-08T14:04:06+01:00</updated>
<published>2010-05-08T14:04:06+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26678#p26678</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26678#p26678"/>
<title type="html"><![CDATA[Auto balance for Robobuilder in Lisp / L# - custom firmware]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26678#p26678"><![CDATA[
Sorry not sure I understand question?<br /><br />If you're having problems with<br />(= p1 (new &quot;Pen&quot; (Color.FromName &quot;Black&quot;)))<br /><br />then make sure you have <br /><br />(reference &quot;System.Windows.Forms&quot;)<br />(using  &quot;System.Windows.Forms&quot;)<br /><br />Its for the graphic display - which you only need if DISPLAY is true.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1101">l3v3rz</a> — Sat May 08, 2010 2:04 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[pepep]]></name></author>
<updated>2010-05-08T13:50:57+01:00</updated>
<published>2010-05-08T13:50:57+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26677#p26677</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26677#p26677"/>
<title type="html"><![CDATA[Auto balance for Robobuilder in Lisp / L# - custom firmware]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26677#p26677"><![CDATA[
And Color method?<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=2044">pepep</a> — Sat May 08, 2010 1:50 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[l3v3rz]]></name></author>
<updated>2010-05-08T10:49:31+01:00</updated>
<published>2010-05-08T10:49:31+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26673#p26673</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26673#p26673"/>
<title type="html"><![CDATA[Auto balance for Robobuilder in Lisp / L# - custom firmware]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26673#p26673"><![CDATA[
Did you try downloading this version ? <br /><br /><!-- m --><a class="postlink" href="http://code.google.com/p/robobuildervc/source/browse/trunk/Lisp/balance.lisp">http://code.google.com/p/robobuildervc/ ... lance.lisp</a><!-- m --><br /><br />(its the full code including Z2 etc) - gz is a global set by calibrateXYZ (which is missing in the code snippet above - oops)<br /><br />And get same problem ?<br /><br />Incidentally is the problem that it just drops straight through ?  I think Ive seen that - I just restart the console and that seems fix - I think it gets characters buffered and so immediately detects a key and stops. I think there's a .NET function to clear keyboard buffer - must look it up sometime<br /><br />If its generating an exception - what message do you get - type *e at the console prompt to print last exception.<br /><br />cheers<br /><br />[edit: BTW - just added the missing lines to the post above <img src="http://forum.robosavvy.com/images/smilies/icon_smile.gif" alt=":)" title="Smile" /> ]<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1101">l3v3rz</a> — Sat May 08, 2010 10:49 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[pepep]]></name></author>
<updated>2010-05-08T10:04:10+01:00</updated>
<published>2010-05-08T10:04:10+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26672#p26672</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26672#p26672"/>
<title type="html"><![CDATA[Auto balance for Robobuilder in Lisp / L# - custom firmware]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26672#p26672"><![CDATA[
Hi,<br /><br />I try your (bt4) function, but I have somes problems with it ..<br />1.  I don't know why but the Console.KeyAvailable method don't work properly inside this function ...<br />2. and the valors of gz, Z2, ...<br /><br />Thanks,<br /><br />Btw, your firmware works great, I comment in the other post!<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=2044">pepep</a> — Sat May 08, 2010 10:04 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[pepep]]></name></author>
<updated>2010-05-04T18:29:46+01:00</updated>
<published>2010-05-04T18:29:46+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26629#p26629</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26629#p26629"/>
<title type="html"><![CDATA[Auto balance for Robobuilder in Lisp / L# - custom firmware]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26629#p26629"><![CDATA[
Great! Great! Great!<br /><br />ASAP I load in my RB and try it!!!<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=2044">pepep</a> — Tue May 04, 2010 6:29 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[l3v3rz]]></name></author>
<updated>2010-05-04T09:11:37+01:00</updated>
<published>2010-05-04T09:11:37+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26620#p26620</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26620#p26620"/>
<title type="html"><![CDATA[Auto balance for Robobuilder in Lisp / L# - custom firmware]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26620#p26620"><![CDATA[
The customer firmware - can be found here :<br /><br /><!-- m --><a class="postlink" href="http://robobuilderlib.googlecode.com/files/DCMP_r111.hex">http://robobuilderlib.googlecode.com/fi ... P_r111.hex</a><!-- m --><br /><br />Load on to Robobuilder - and on power on, its automatically in Direct control mode. Only this mode exists. Gain access to accelerometer and PSD using read position commands against servo 30. <br /><br />RobobuilderLib.dll still works - although an update is required to pass parameter information to readServo command. (v.1.9.9)<br /><br /><!-- m --><a class="postlink" href="http://robobuildervc.googlecode.com/files/RobobuilderLib.dll">http://robobuildervc.googlecode.com/fil ... derLib.dll</a><!-- m --><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1101">l3v3rz</a> — Tue May 04, 2010 9:11 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[l3v3rz]]></name></author>
<updated>2010-05-08T10:56:18+01:00</updated>
<published>2010-05-04T00:25:50+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26618#p26618</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26618#p26618"/>
<title type="html"><![CDATA[Auto balance for Robobuilder in Lisp / L# - custom firmware]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6119&amp;p=26618#p26618"><![CDATA[
I have a demo of auto-balance written in Lisp work - albeit very simple. It moves the arms to counteract the force being applied, but it can easily be extended as its data driven, to move any combination of servos. It requires custom firmware to get a reasonable speed.<br /><br />When running on the standard firmware you have to switch between the two modes, PC remote and Direct control (DC) mode. In DC mode you can control the servos and in PC mode you can read the sensors, but to switch between the modes takes time. What's worse is that if you switch too early you get bad data sent, or it misses requests. It takes around 100 ms to switch modes reliably and you need to to twice each cycle i.e. (read sensor,  switch,  update servos, switch) So the fast cycle time is around 200-250ms or 5 Hz.  I have written a custom piece of firmware called DC mode plus that enable the sensors to be read without switching modes. It does this by hijacking servo 30. read positions on that servo will return various sensor data. Its speed is around 40-50ms or 20-22Hz Hz<br /><br /><span style="color: green">[Edit: the speed is limited by L# - writing in C# improves the speed of the loop to sub 10ms/+100Hz]</span><br /><br />I have a dynamic balance demo working.  The LISP code is quite straight forward, details and links at the end<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code><br />(def calibrateXYZ () <br /> (= xyz (readAcc))<br /> (= x (car xyz)) (= y (cadr xyz)) (= z (car (cddr xyz)))<br />   (= gx x)<br />   (= gy y)<br />   (= gz z)<br />   (prn &quot;Calibrated: &quot; gx &quot; &quot; gy &quot; &quot; gz)<br />)<br /><br />;reading Z value - by reading position of Servo 30 (with parameter &quot;1&quot;)<br />(def getZ () <br />   &quot;DCMP - quicker if we just want Z&quot;<br />   (.wckReadPos wck 30 1)                   ; get y &amp; Z<br />   (with (z (nth (.respnse wck) 1))<br />   (= z (if (&gt; z 127) (- z 256) z))<br />   )<br />)<br /><br />(def bt4 ()   &quot;dcm plus mode - high speed&quot;<br /><br />  (if (not (bound 'DCMODEPLUS)) (err &quot;load DCMP.lisp&quot;))<br />  (standup)<br />  (calibrateXYZ)<br /><br />  (= base (getallServos 15))<br />  (pause)<br />  <br />  (try    <br />  (while (not (Console.keyavailable))<br /><br />   (= c1 (- (getZ) gz))<br />     <br />   (= dz (rmatch c1 Z2))<br />   (if (or dz) <br />    (do<br />      (= nxt (mapcar + base dz))<br /> <br />      (try (.SyncPosSend wck 15 4 (toarray nxt) 0) (do (pr &quot;overflow&quot;) (prl nxt)) null)<br /><br />      (= base nxt)<br />     )<br />    )<br /> )<br /> (prn &quot;Exception caught&quot;)<br /> null<br /> )<br /> (standup)<br />)<br /></code></dd></dl><br /><br /><span style="font-style: italic">Note: This is only some of the code - the rest will be posted on line. It only works with customer firmware</span><br /><br />How it works: Its extending the arms based on the offset of the Z value. The amount of offset is determined by rmatch - which looks for ranges and returns an array which is then added to the current position. SynchPosSend then updates the servo.<br /><br /><span style="color: green">Edit:  Latest version of balance code - available here<br /><!-- m --><a class="postlink" href="http://code.google.com/p/robobuildervc/source/browse/trunk/Lisp/balance.lisp">http://code.google.com/p/robobuildervc/ ... lance.lisp</a><!-- m --><br /><br />Download stable version: <br /><!-- m --><a class="postlink" href="http://robobuildervc.googlecode.com/files/balance.lisp">http://robobuildervc.googlecode.com/files/balance.lisp</a><!-- m --><br /><br />Function to call is (bt4)<br /></span><br /><br /><div class='bbmedia' data-url='http://www.youtube.com/watch?v=uO10vA6Y6Yw&amp;hl=en_GB&amp;fs=1&amp;color1=0x234900&amp;color2=0x4e9e00&amp;border=1' style='margin: 1px; display: inline-block; vertical-align: bottom;'><div style='width: 200px; height: 40px; border: 1px solid #999; display: table-cell; text-align: center; vertical-align: middle; font: 10px/10px Verdana; color: #555; opacity: 0.5;'><a style='color: #105289; text-decoration: none;' href='http://phpbbex.com/' target='_blank'>phpBB</a> &#91;media&#93;</div><script>if (typeof bbmedia == 'undefined') { bbmedia = true; var e = document.createElement('script'); e.async = true; e.src = 'js/bbmedia.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s); }</script></div><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1101">l3v3rz</a> — Tue May 04, 2010 12:25 am</p><hr />
]]></content>
</entry>
</feed>