To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 23164
23163  |  23165
Subject: 
Re: Light seeker
Newsgroups: 
lugnet.robotics
Date: 
Tue, 14 Dec 2004 19:35:38 GMT
Viewed: 
919 times
  
Ahh- you missed something. In the seek task, I am altering an absolute position, not a relative or error code. It is then in the other task that I compare the position with the actual position and generate the error value.
Your fix would set the absolute position to 0, and the head would start to head for 0, and then return back because of the sensor difference- so it would cause it to jitter. Because of the time delay (or wait function), the tasks will sleep, allowing the other threads ample cpu time to their thing, and the real hardware to catch up. I suspect the seek task will have a longer period than the motor move task, as the light sensors may take a short while to stabilise.

I normally work with simple flows, but in my concept here I am treating the combination of motor output and rotation sensor as a servo- so I can feed it the desired position- and it will strive to be there - even when you manually rotate it away, it should return to its target.

My recent experiences with fpga/cpld devices has led me to designing programs a little more like hardware modules - its very neat, keeps each task simple and by linking them can build a modular complex whole. Think Rodney Brooks subsumption architecture and Oo.

http://orionrobots.co.uk/tiki-index.php?page=rodney+brooks

Cheers
Danny
--
http://orionrobots.co.uk - inspiring creativity and building robot communities

-----Original Message-----
From: "Ralph Toepper"<ralph.toepper@t-online.de>

in lugnet.robotics Danny Staple wrote:

global iPosition=0;
def task seek():
      while(true)
              wait suitable delay;
              if left_sensor < right_sensor:
                      iPosition += iAngleStep;
               else if left_sensor > right_sensor:
                      iPosition -= iAngleStep;

Wow, i guess i understand your robot. It seems to be a stationary light seeker.
Imagine, you point a pocketlamp between the light sensors, such, that it is in
the middle position between them. Such, that at the start condition

   left_sensor is equal to the right_sensor is true,

no motor movement of the light seeking head would result with the other task.

But if the pocketlamp is removed from that position, the initial iPosition=0,
causing no movement, is never reached again. So the motor will never be switched
off, after he had been switch on. And, third, there is no reason, to slow down
computer speed.

So i think, task seek should look like that:

def task seek():
         while(true)
               if left_sensor < right_sensor:
                       iPosition += iAngleStep;
               elsif left_sensor > right_sensor:
                       iPosition -= iAngleStep;
               else
                       iPosition = 0;

I think, your design pattern is very interresting. I did not use tasks with my
lighteye robot, as i think, there is no reason to use them. Of course, that is a
question of intelligent software design.

But the algorithm of a light seeking robot moving on the ground can be easily
expressed in an old fashiond procedural hierarchically structured program. One
task. As it is not a big program.

At first, you need a control program. Of course, a control program can be a
seperate task. In any case, you should use a state machine (automaton) to
describe the operation of the robot, and use separators, to communicate between
tasks (as you do).

Greetings
Ralph




1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR