To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 3085
3084  |  3086
Subject: 
Re: Interesting BrickOS Timing Results
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 15 Jan 2003 04:19:05 GMT
Viewed: 
2941 times
  
Mark,

I retrieved the latest BrickOS from CVS, made clean and made the cpu
test program you listed.

I then made two small changes (to see what would happen); first the
results, then the changes:

IDLE: 89
2ROT: 87
NOAD: 91 (see below)
NIRQ: 98 (see below)

Ok, this looks promising, here is what I did.  This is the most simple
change I could think of on short notice  8-)

I commented out the line:
    bset #0x5,@_AD_CSR:8                ; go!
at the end of the ds_handler; so now the A/D convertion doesn't start up
again (yet)

Then I added the same line to the end of the systime_handler.  This
starts the A/D conversion every 1 msec.

OK, so this is not the end-all solution, but it is a good start IMO.
The interval should be user selectable (maybe) at run-time.  However,
the numbers are much higher with this simple change.  I would love to
test it with the rotation sensor at various speeds (motor x 1, motor x
2, x 3, etc..) to see how it performs in comparison with the original
method.  However, I don't have time right now.

// Joe


Mark Riley wrote:
Oops, found a little bug.  ;-)  Forgot to turn off the rotation
sensors.  Caused a wrong reading if you let the program
run through the readings more than once.  The rotation
sensor section should read like this:

    // with two rotation sensors enabled (23%)
    cputs("2rot"); msleep(100);
    ds_rotation_on(&SENSOR_1);
    ds_rotation_on(&SENSOR_2);
    cpu();
    ds_rotation_off(&SENSOR_1);
    ds_rotation_off(&SENSOR_2);
    sleep(3);

Mark






Message has 2 Replies:
  Re: Interesting BrickOS Timing Results
 
I did some "real world" tests with this update. I was Astounded at what a difference it makes. The bot I was testing with is a killough platform; which I had tried for hours previously, to get it to follow a line smoothly. I think BrickOS was giving (...) (21 years ago, 15-Jan-03, to lugnet.robotics.rcx.legos)
  Re: Interesting BrickOS Timing Results
 
Joe, That's definitely an improvement! So, that would be a 250 Hz sample rate for any given sensor. I just tried a modification similar to yours that did all 4 conversions every OCRA/B interrupt (or 1 KHz sample rate) and got: IDLE: 82 2ROT: 77 (...) (21 years ago, 15-Jan-03, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: Interesting BrickOS Timing Results
 
Oops, found a little bug. ;-) Forgot to turn off the rotation sensors. Caused a wrong reading if you let the program run through the readings more than once. The rotation sensor section should read like this: // with two rotation sensors enabled (...) (21 years ago, 14-Jan-03, to lugnet.robotics.rcx.legos)

19 Messages in This Thread:






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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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