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 / 27204
27203  |  27205
Subject: 
RE: NXTway DS powered by LEJOS OSEK
Newsgroups: 
lugnet.robotics
Date: 
Thu, 2 Aug 2007 15:36:57 GMT
Reply-To: 
<DICKSWAN@SBCGLOBAL.NETantispam>
Viewed: 
4160 times
  
Takashi Chikamasa wrote on  Wednesday, August 01, 2007 7:48 PM

Here is Yet Another NXTway powered by LEJOS OSEK.
<http://lejos-osek.sourceforge.net/videos.htm>

I named this version of NXTway "NXTway DS (Double light Sensors)".
It uses only LEGO standard hardware parts except for a plastic light
shade cover and control algorithm is executed every 1msec! (very
high speed)

A 1-msec scanning rate should be achievable with several of the
interpretative virtual machine environments for the NXT. I can confirm
that ROBOTC can easily execute at this rate for a PID loop with error
based on difference between two analog sensors.

However, a 1-msec rate may actually be too fast a choice. To
understand this hypothesis, some background knowledge is needed on how
the NXT controls sensors and motors.

On the NXT, the sensors and motors are controlled by an 8-bit AVR CPU.
The main ARM CPU communicates with the AVR via high speed serial
messages. The AVR CPU only scans sensors every 3-msec; this is a fixed
rate and can only be changed by rewriting the AVR memory which AFAIK
has not been done by anyone outside of LEGO. [Reprogramming the AVR
requires a special ATMEL programming device with a new connector
soldered by the end user onto the NXT motherboard.]

The LEGO supplied NXT firmware communicates with the AVR on a 1-msec
tick basis via a "handshaked" message. It alternates between sending a
motor update message or a read analog sensor value request.

Suppose you wanted to see the response from a motor adjustment. It
could take up to seven msec to see the first results.
o Up to 2 msec to send the motor command to the AVR
o Up to 3 msec for the next analog sensor scan
o Up to 2 msec to send the sensor values to the ARM.
It might even take longer if there are other internal task scheduling
delays in the NXT operating system.

Consider a PID algorithm where the error factor is a linear equation
based on one (or two) analog sensors. If the PID update loop is
running every millisecond and the sensors are only scanned every
3-msec then two thirds of the time the 'differential factor' will be
zero!

I've written a few PID implementations for the NXT where I've found
better performance where I've lengthened the delay time within a loop.
I suspect it is because the increased time actually allows the control
variable changes to have an effect before the next update interval.

Above comments are related to PID. You are using a different
technology which may mean my comments about very short intervals are
not relevant. I did look into some of the background theory and it
does appear that you algorithm calculates value at interval "N+1"
based on the interval "N" readings which I suppose would indicate
similar behavior.


NOTES:

1.  AFAIK, the RobotC firmware is the only available NXT firmware that

    reduces the lag time between changes in analog sensor value and
when they are received and processed by the ARM firmware. There are
several tricks in the ROBOTC firmware to reduce the 2-msec update
interval.

2.  Writing user programs using a 1-msec update interval require an
    operating system or virtual machine that ensures all user tasks
are capable of executing every msec. I think some of the various NXT
firmware implementation have a maximum time slice duration larger than
1-msec!

3.  NXT motor encoders are processed directly on the NXT ARM's CPU.
    Fortunately, they do not have the lag times described above for
analog sensors.



Message has 1 Reply:
  Re: NXTway DS powered by LEJOS OSEK
 
Hi Dick, At first, I really appreciate your comment because I live out of the NXT core community, so feedback from the experts are valuable for me! (...) I do not intend to compete with RobotC. I know some of the folks have developed high speed (...) (17 years ago, 3-Aug-07, to lugnet.robotics)

Message is in Reply To:
  NXTway DS powered by LEJOS OSEK
 
Here is Yet Another NXTway powered by LEJOS OSEK. (URL) I named this version of NXTway "NXTway DS (Double light Sensors)". It uses only LEGO standard hardware parts except for a plastic light shade cover and control algorithm is executed every (...) (17 years ago, 2-Aug-07, to lugnet.robotics)

10 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