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 / 13662
13661  |  13663
Subject: 
Message transmission speeds.
Newsgroups: 
lugnet.robotics
Date: 
Sun, 31 Dec 2000 05:31:09 GMT
Original-From: 
Steve Baker <sjbaker1@airmail#Spamless#.net>
Reply-To: 
sjbaker1@airmail.net+nomorespam+
Viewed: 
709 times
  
I'm thinking about building a robot with three Scouts acting as slaves to a single
RCX - nine motors and a dozen sensors in all!  I'm not quite sure what they are all
going to do yet - but I want to plan the communications mechanisms first.

What I'm doing is to run a task in the RCX that sends a single byte motor on/off
message to a Scout - and then waits for the scout to return a message containing
it's sensor status.  By putting two identification bits in each message saying
which Scout (or RCX) the message is intended for, I can loop through all the
scouts updating their motors and reading their sensors.  Each scout only
transmits it's status after it's read a motor command addressed to it - this
avoids the problem of two or more of them trying to transmit at the same time,
thus garbling the IR link.

All of this is done in NQC and the program running in the scout is (by
necessity) very simple.  In particular, it sends its sensor status
the very moment it gets a motor command from the RCX with virtually
no intervening code beyond the time to read the two touch sensors and
it's internal light sensor.

This all works - and I've had a program that allows you to drive all nine
motors and read all twelve sensors.

It's all VERY cool - but the problem is that it's VERY slow.

The problem seems to be the time taken to do:

  RCX                   |      Scout
  ----------------------+-----------------------------------------
  SetTimer(0,0)         |
  SendMessage(xxx)   ------>   xxx=Message()
  yyy=Message()      <------   SendMessage(SENSOR_1+SENSOR_2*2+SENSOR_3*4+128)
  tim=FastTimer(0)      |

...plus a few loops waiting for the messages to arrive.

The best-case time seems to be more than ~100msec and the worst case
something less than ~500msec.

That seems VERY long.  I was under the impression that the IR link ran at
4800 baud - which ought to be 480 bytes/sec - which is about 2ms to send a
message and another 2ms to get the reply back - plus the time to read the
three sensors on the Scout and a little software overhead.

It doesn't seem reasonable that this should take more than about 10msec - not
100ms!

In practice, this means that the time to poll the sensors on all three scouts
is about a second - which is nowhere near fast enough for what I have in mind.

Can anyone suggest what's going wrong here?

Should I be using the newer SetSerial stuff in NQC?  None of that works on the
Scout - and it's a lot less convenient than the Message/SendMessage mechanism.

--
Steve Baker   HomeEmail: <sjbaker1@airmail.net>
              WorkEmail: <sjbaker@link.com>
              HomePage : http://web2.airmail.net/sjbaker1
              Projects : http://plib.sourceforge.net
                         http://tuxaqfh.sourceforge.net
                         http://tuxkart.sourceforge.net
                         http://prettypoly.sourceforge.net



Message has 1 Reply:
  Re: Message transmission speeds.
 
(...) (snip) (...) The data rate is 2400bps, and each packet of N bytes of data has 5 + N bytes of overhead. So the more realistic time to send a 1 byte message is 24ms. Here is an excerpt from the Communication section of (URL) Did you check the (...) (24 years ago, 31-Dec-00, to lugnet.robotics)

5 Messages 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