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 / 1245
1244  |  1246
Subject: 
SPIRIT SetSensorMode "slope" parameter
Newsgroups: 
lugnet.robotics
Date: 
Wed, 9 Dec 1998 15:47:48 GMT
Viewed: 
920 times
  
Hi all-

I've been writing an article about programming the RCX using Delphi and the
SPIRIT OCX, to appear in MicroComputer Journal Magazine in my Delphi in the
Laboratory series.  I've written an example program, to be published with
source code, which I call RCXplore.  I wrote this program to make it as easy
as possible to set and measure the electrical interfaces to outputs and
sensors.  The program mostly sends immediate commands and reads values from
the RCX, so it's sort of like a souped-up version of the MindStorms test
panel.

In particular, the program is designed to make it very easy to set different
sensor types and modes, so I could measure the effects of some of the more
obscure parameters of the SetSensorMode command, measure calibration curves
for temperature sensors, measure electrical waveforms and output impedances of
the sensor and motor interfaces, etc.

One particular parameter of the SetSensorMode command is somewhat obscure: the
"Slope" parameter.  The Lego SDK doesn't explain this very well in my view,
and I haven't been able to get it to do anything particularly useful yet.  I'm
posting this message to see if anyone here has a good explanation of how this
parameter is supposed to work, and how you are supposed to use it.

The SDK says that Slope pertains to Boolean mode only.   If you set Slope=0,
Boolean mode acts in the normal way, like the Touch sensor: 1=(RAW<45%of1023),
0=(RAW>55%of1023).  If you set Slope to a value in range of 1..31, the SDK
implies that this value of slope is the increment needed to get a change in
the Boolean state.   I sort of expected that if you set Slope=10, then a
change of 10 in the value of RAW would change Boolean from a 1 to a 0 or a 0
to a 1.  However, I don't actually see behavior like that.

I tried this with the sensor type set to Touch and with a pot connected to the
sensor port, so I could change the input easily and continuously as needed.
When I change the Slope parameter while polling the sensor value continuously,
small values of Slope like 1 or 2 seem to cause the Boolean value to bounce
between 0 and 1 with the pot unchanged, apparently due to the usual noise that
you would see in RAW values.  When I change the pot, I have to change it a lot
to make the Boolean value change to a new steady value: the change I have to
make is equivalent to the kind of change you would need if Slope were set to
0.  Larger values of Slope, around 10, seem to make the Boolean value steady,
but the overall behavior seems just like Slope=0.

Anybody know what's going on here?

        Best regards,

        Dr. Bob



Message has 4 Replies:
  Re: SPIRIT SetSensorMode "slope" parameter
 
I'm sure that the best persons to decode the use of that function are the guys that disassembled the firmware... Laurentino Martins (...) (26 years ago, 9-Dec-98, to lugnet.robotics)
  Re: SPIRIT SetSensorMode "slope" parameter
 
(...) Well, I don't have my RCX yet, but I'd hazard a guess that the slope parameter sets a hysteresis for the boolean. So: instead of the boolean value changing every time it passes the halfway point, it needs to actually be (slope) away from the (...) (26 years ago, 9-Dec-98, to lugnet.robotics)
  Re: SPIRIT SetSensorMode "slope" parameter
 
(...) It sounds like you understand the general idea of how the slope parameter works, although I don't think that a slope of 10 implies that the transition happens when the raw value changes by 10. For slopes in 1..31, I believe the raw value (...) (26 years ago, 9-Dec-98, to lugnet.robotics)
  Re: SPIRIT SetSensorMode "slope" parameter
 
(...) the (...) I'm (...) this (...) 1=(RAW<45%of1023), (...) My understanding of "slope" is that it is the approximation of derivative of the function "raw value"= f(t), i.e. it is the value for df/dt. This means that if you set the slope to 10, (...) (26 years ago, 9-Dec-98, to lugnet.robotics)

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