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

<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-02-13T11:51:40+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=15&amp;t=5813</id>
<entry>
<author><name><![CDATA[i-Bot]]></name></author>
<updated>2010-02-13T11:51:40+01:00</updated>
<published>2010-02-13T11:51:40+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25481#p25481</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25481#p25481"/>
<title type="html"><![CDATA[Robobuilder task scheduler]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25481#p25481"><![CDATA[
I have changed the code in the RBC many many times using RBCupgrade without any problems and always been able to restore original code and function.<br /><br />The only caution I have heard is if your new code overwrites the EEPROM. The EEPROM contains the RBC serial number. If you want to use the EEPROM in your program, read out the contents and restore them before reloading original Robobuilder code. The EEPROM should not be corrupted if you do not specifically write to it.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=159">i-Bot</a> — Sat Feb 13, 2010 11:51 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[l3v3rz]]></name></author>
<updated>2010-02-12T18:00:56+01:00</updated>
<published>2010-02-12T18:00:56+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25474#p25474</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25474#p25474"/>
<title type="html"><![CDATA[Robobuilder task scheduler]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25474#p25474"><![CDATA[
I think if you use the supplied RBCupgrade tool then you should always be able to recover,  the bootloader requires you write to a special area of Flash to overwrite. I've certainly used it (RBCupgrade) a lot in writing the homebrew OS and never had a problem reverting it back to standard build. If you do go for it I hope you'll post the source so others can try it (i.e. me !)<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1101">l3v3rz</a> — Fri Feb 12, 2010 6:00 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Felix]]></name></author>
<updated>2010-02-12T16:24:04+01:00</updated>
<published>2010-02-12T16:24:04+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25473#p25473</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25473#p25473"/>
<title type="html"><![CDATA[Robobuilder task scheduler]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25473#p25473"><![CDATA[
I am tempted to try putting FreeRTOS on my robobuilder, but does anyone know if it's possible for me to ruin the controller's ability to receive further downloads? If it's simply a case of putting the original code back on that's fine but I don't want to permanently damage my controller! :O<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1518">Felix</a> — Fri Feb 12, 2010 4:24 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[l3v3rz]]></name></author>
<updated>2010-01-30T14:48:18+01:00</updated>
<published>2010-01-30T14:48:18+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25210#p25210</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25210#p25210"/>
<title type="html"><![CDATA[Robobuilder task scheduler]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25210#p25210"><![CDATA[
See <!-- m --><a class="postlink" href="http://web.engr.oregonstate.edu/~traylor/ece473/lectures/interrupts.pdf">http://web.engr.oregonstate.edu/~traylo ... rrupts.pdf</a><!-- m --><br />interrupt priority is dependent on position in vector table.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1101">l3v3rz</a> — Sat Jan 30, 2010 2:48 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[badcommandorfilename]]></name></author>
<updated>2010-01-30T03:19:30+01:00</updated>
<published>2010-01-30T03:19:30+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25197#p25197</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25197#p25197"/>
<title type="html"><![CDATA[Robobuilder task scheduler]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25197#p25197"><![CDATA[
I might give that a try - if it's easy enough to use, then it will be less effort than trying to do the task scheduling myself. I think I could make it work pretty well, but it wouldn't be reliable if there was a heavy processor load.<br /><br />I was thinking about just allowing some tasks to run inside the interrupt - at the discretion of the user. That way higher priority tasks would still run when they were supposed to, but hopefully not hog the processor for too long. Does the AVR support priorities for interrupts? I know the PIC does.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1830">badcommandorfilename</a> — Sat Jan 30, 2010 3:19 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[l3v3rz]]></name></author>
<updated>2010-01-29T12:58:59+01:00</updated>
<published>2010-01-29T12:58:59+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25191#p25191</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25191#p25191"/>
<title type="html"><![CDATA[Robobuilder task scheduler]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25191#p25191"><![CDATA[
You might want to look at <!-- m --><a class="postlink" href="http://www.freertos.org/">http://www.freertos.org/</a><!-- m -->  I was thinking about trying to port to robobuilder myself. It has a simple task scheduler. Nice explanation of how it works as well.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1101">l3v3rz</a> — Fri Jan 29, 2010 12:58 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[badcommandorfilename]]></name></author>
<updated>2010-01-29T00:30:06+01:00</updated>
<published>2010-01-29T00:30:06+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25185#p25185</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25185#p25185"/>
<title type="html"><![CDATA[Robobuilder task scheduler]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=5813&amp;p=25185#p25185"><![CDATA[
I want to write an embedded system (AVR) task scheduler in C to handle the operation of a variety of non-critical tasks which my <a href="http://buildtherobot.blogspot.com/" class="postlink">robobuilder</a> needs to perform. I'm looking for some advice on how to implement it so that it adds the lowest amount of overhead while giving it the most flexibility.<br /><br />I'm also not trying to write a real time OS or anything - it just needs to be simple enough to keep a few core functions balanced. None of the tasks are time critical (I'm using interrupts for those), but I need a way to make sure that nothing is neglected for too long.<br /><br />1) It needs to be able to schedule tasks for execution at a specific time.<br /><br />This is mainly for scripted actions (it's a humanoid robot) like walking, etc as well as recharging the battery (which is trickle charged). Right now, I'm thinking of using an array of counters, which are decremented periodically, combined with a state machine in the main loop. This will simply switch the state to the overdue task when the current state expires.<br /><br />2) It would be nice to have a method of forcing the execution of WAAAY overdue tasks.<br /><br />Although it's no biggie if some actions are a few tens of milliseconds late, it would be nice if I could guarantee that a task would be executed in a reasonable time. I'm thinking of adding a watchdog interrupt which will perform the task if it's overdue.<br /><br />3) Some tasks might take a long time to finish.<br /><br />I'm trying to make this an extensible system, which allows for many tasks. However, if I use the state-machine system above I risk having long running tasks (like path planning/IK) postponing shorter and perhaps more critical tasks (like movement). Including the watchdog override would require the entire task to be run inside the interrupt, which is even worse.<br /><br />4) A priority system would also be desirable.<br /><br />In the case that a long task finishes and there are several overdue tasks to perform, the program should run the most critical ones first. Creative use of priorities could also help solve the problem of having a mix of long and short running functions.<br /><br />5) I'd like a way to pass arguments to functions when the task is scheduled (not executed).<br /><br />This is the one I really need help with. I'm almost certainly going to end up using function pointers, but unless all the functions take the same arguments I will have to have different data-types and handler functions. Also, how can I copy the argument(s) in their current state for execution later (in the generic case). I think I could do this in C using a sort of pseudo-stack if I can guarantee that each function will only end up in the task queue once, but I'm hoping a generic solution can be implemented if I am creative with assembly.<br /><br />Has anyone had to do something like this before? I'm looking for a balance between execution overhead, complexity and versatility, so it's OK if there's no good way to get all these features working together. Also, I'm using C now but C++ is also an option.<br /><br />Any input is appreciated. Thanks for your help!<br /><br />More detailed information is available at my <a href="http://buildtherobot.blogspot.com" class="postlink">blog</a>.<br />--------------<br /><!-- m --><a class="postlink" href="http://buildtherobot.blogspot.com">http://buildtherobot.blogspot.com</a><!-- m --> - for robot builders and enthusiasts<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1830">badcommandorfilename</a> — Fri Jan 29, 2010 12:30 am</p><hr />
]]></content>
</entry>
</feed>