Sick
LMS291 Read
Library
Olin Robotics Blockset/Sick
Description
Read output from Sick LMS291
sensor through RS-422 interface with the help of Commtech's Fastcom
422/2-PCI-335 board.
The block transmits the
“Send Continuous Data” telegram to the sensor at the specified time to read in
continuous data from the sensor. It then requests data from the sensor at the
specified frequency (1/SampleTime). The sensor outputs instantaneous distance
measurements in the appropriate format specified through angular
range/resolution and units. However, note that the sensor does not necessarily
send in new data at every sample time that the block requests it for. It can
only respond with a maximum frequency of 75 Hz and is also dependent on the
format of data requested. The New Data Flag output indicates whether the data
received is new or not at any given time-step.
Note that the block’s
parameters “Measurement Units” and “Angular Range/Resolution” are used only to
determine the length of data and other data header information expected from
the sensor. In order to change the actual format of the data that the sensor
transmits, you need to use the Sick LMS291 Configuration block from Olin
Robotics Blockset/Sick/Utilities library
The Sick LMS291 Data Read
Demo from the Olin Robotics Blockset/Demos library illustrates the use of this
block. The Quick Reference Guide for Sick LMS.doc gives detailed documentation
on interfacing the Sick LMS-291 sensor to The MathWorks tools including MATLAB
and Simulnk/ Olin Robotics Blockset.
For an example of how to
convert the raw measurement data to length of a double datatype, or a set of
length and angle data, see the Embedded MATLAB function inside of the LMS-291
Data Display block.
Block Parameters:
Send Data Time: A scalar specifying the time at which to send the “Send Continuous
Data” telegram to the sensor.
Stop Data Time: A scalar specifying the time at which to send the “Stop Continuous
Data” telegram to the sensor.
Measurement Units: Select the units of the measurement data expected from the sensor.
Angular Range/Resolution: Select the angular range and resolution of the
measurement data expected from the sensor.
Fastcom Board IRQ Number: Enter the number of the interrupt request line for
this board. If you do not know the interrupt request line number for this
board, at the MATLAB Command Window, enter getxpcpci after connecting to the
target machine. This command displays all the PCI interfaces currently attached
to the target PC. From that display, find the instance of the board controlled
by this block. Each board uses a unique interrupt request line number.
Sample Time: Sample time indicates the frequency (1/SampleTime) at which data is
requested from the sensor. However, note that the sensor does not necessarily
send in new data at every sample time that the block requests it for.
Outputs with example output and format
description:
1. Data:
Raw measurement data read from the sensor. The length of the data and the data
header depend on the format of the data being sent by the sensor. It is a 1-D
vector (data-type uint8 null terminated).
Table 1: Data Length
|
Data
Format |
Length of
Data vector (including the null
(0) element) |
|
Range 0º – 100 º Resolution 0.25 º |
813 |
|
Range 0º – 100 º Resolution 0.50 º |
413 |
|
Range 0º – 100 º Resolution 1 º |
213 |
|
Range 0º – 180 º Resolution 0.50 º |
733 |
|
Range 0º – 180 º Resolution 1 º |
373 |
For detailed information
regarding the data header and the format of data, refer to the following manual
For an example of how to
convert the raw measurement data to length of a double datatype, or a set of
length and angle data, see the Embedded MATLAB function inside of the LMS-291
Data Display block.
2. New Data Flag: A scalar value (data-type uint8) to indicate if the sensor has transmitted
new data at the current time-step. 1 indicates that the data is new while 0
indicates that the data is old.
References
http://tourbot.mit.edu/images/7/79/LMS_Guide.pdf