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 / 3107
3106  |  3108
Subject: 
Sensor Sampling; Progress?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sat, 18 Jan 2003 14:49:39 GMT
Viewed: 
3231 times
  
So far, I have reconfigured a copy of BrickOS in the following way:

1) Adjusted the clock_handler to improve the accuracy of the sys_time
variable.  Now running at very close (if not right on) 1 msec per tick.
2) Allowed the FRC (Free-Running Counter) to overflow instead of being
reset on OCRA
3) Adjusted the subsystem handler to run on OCRB, where OCRB is adjusted
by the interval time each run.  This is now independent of the OCRA
interrupt.
4) Adjusted the task_scheduler to run on OCRA, independent of OCRB (same
as #3)
5) Moved the code to start the A/D conversion to the OCRA handler.
6) Added a couple variables to adjust the timing for OCRA and OCRB.

Note: I believe this configuration now enables the use of the FRC
Overflow interrupt.  This will fire once every 131.072 msecs; roughly
7.63 times per second.  Anyone have an idea of what would work well at
this frequency?

The result is good; things are running smooth and seemingly efficient.
Here are the results from Mark Rileys cpu test program:
IDLE: 93
2ROT: 93
NOAD: 94
NIRQ: 99

One problem that I encountered: if I set the OCRA handler to run once
every 4 msec, the light sensor would flicker and give incorrect results.
  This makes sense, as the power would be cut off the the sensor for
quite some time between A/D conversion runs.

I currently am using these values:  OCRA = 500 (1 msec), task swapping
occurs every 10th pass.  OCRB = 1250 (2.25 msec), LCD updates are quick,
motors and sound seem OK so far.

I am going to test the outer limits of these values; and try to vary
some of the parameters (light sensor vs rotation sensor) to see what
ranges are appropriate.  Hope to have more soon.

Obviously there is a lot of clean up to be done (making variables
available to user programs, etc...) but progress is being made ... I think.

Anyone have any suggestions on configuration changes?  Mark, I know you
have suggested making more of the items in the subsystem handler into
tasks: which ones do you think should be?  (Autoshutoff?)

// Joe



Message has 1 Reply:
  Re: Sensor Sampling; Progress?
 
Joe, Great job on taking the bull by the horns! The following are my suggestions on a system configuration. Please note that the term "divider" is being used here to indicate the function should only be performed every Nth interrupt. OCRA interrupt (...) (22 years ago, 18-Jan-03, to lugnet.robotics.rcx.legos)

6 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