Sick LMS291 Configuration

 

Library

 

Olin Robotics Blockset/Sick/Utilities

 

 

Description

 

Configure the LMS sensor to transmit measurement data in the desired format. The block can also be used to save the configuration settings permanently so that the sensor retains its configuration even when power is cycled.

 

Check the tasks for which you want to send the telegrams to the sensor. The block will send the selected telegrams at pre-determined time-steps and record the sensor's response. The telegrams are sent in the same order as listed in this menu. The first selected telegram is sent at time t=0 and successive telegrams are sent with a time span specified in the parameters dialog.

 

You can also send any other telegrams via the “Send Custom Telegrams” option up to a maximum of 5 telegrams. Specify the exact telegram as a row vector in the edit box when entering a custom telegram. The telegrams must be of data-type uint16. The tasks listed in this dialog are the main configuration settings that you would need to perform on an out-of-box sensor to get started with recording data at different baud rates and data formats. However for a complete list of the telegrams that you can send to the sensor, refer to the following manual

Sick_LMS291_TelegramListing

 

The Success Flag indicates if the sensor has successfully acknowledged the receipt of a particular telegram.

 

The Sick LMS291 Configuration Setup 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.

 

 

Block Parameters:

 

Perform Status Check: To perform status check operation on the sensor.

 

Change Angular Resolution: To change the angular resolution and range format. Selecting this option enables you to choose the desired angular range and angular resolution values that the sensor supports.

 

Change Measurement Units: To change the measurement units of the data. This operation actually requires two telegrams to be sent.

 

Set Only Current Baud Rate as Permanent: To save the current baud-rate permanently so that the sensor would communicate in the future at the same baud-rate even when power is cycled. This operation requires two telegrams to be sent.

 

Send Custom Telegrams: To send custom telegrams to perform operations not specified in the block menu. You can send up to a maximum of 5 telegrams. Specify the exact telegram as a row vector in the edit box that is enabled once you check this option and select the number of custom telegrams you want to send. Note that the elements of the row-vector should be of decimal type and not hexadecimal type. You need to first convert the hexadecimal values to corresponding decimal values. For a complete list of the telegrams that you can send to the sensor, refer to the Sick_LMS291_TelegramListing document.

 

Save Current Configuration as Permanent: To save the configuration settings permanently so that the sensor retains its configuration even when power is cycled.

 

Change Baud Rate: To command the sensor to communicate at a different baud rate. Selecting this option enables you to select the desired baud rate from a list. Once this command is sent, the sensor responds back with an acknowledgement at the previous baud rate and thereafter only responds at the new baud rate. In order to further receive or transmit any data, you need to first change the baud rate of the Fastcom board to match with the baud rate of the sensor.

 

Fastcom Board Clock Frequency: Enter the clock generator frequency for the master clock on the Fastcom 422/2-PCI-335 board. The default value of 14.7456 MHz allows you to choose baud rates of 9600, 19200, 38,400. The possible baud rates for a given clock frequency with 16x sampling rate is given by the expression

 

 

 

In order to communicate with the Sick LMS291 sensor at its custom high-speed rate of 500,000, you need to set the clock frequency to be 8MHz.

 

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.

 

Fastcom Board Baud Rate: Enter the baud rate you wish to communicate with the Fastcom board. The Fastcom board the sensor would be able to communicate only when they are at the same baud rate.

 

Time span between consecutive telegrams: Enter the time interval that the block should wait between sending consecutive telegrams. The sensor may take up to 8 seconds to respond to certain commands. It would ignore any other command that it receives until it responds to the previous command. The default value of 5 seconds ensures that the sensor has enough time to respond to a telegram to perform any given operation listed in the block menu.

 

Sample Time: Sample time indicates the frequency (1/SampleTime) at which data is requested from or sent to the sensor.

 

 

Outputs with example output and format description:

 

1. Response: Outputs response from the sensor at each time-step. The output response starts with either:

6hex (6 decimal) indicating success that sensor acknowledged the command or,

15hex (21 decimal) indicating failure that the sensor failed to acknowledge the command.

 

Alternate way to check if the sensor acknowledged a command is through the Success Flag output.

 

The output is a 1-D vector (data-type uint8 null terminated).

 

For more information on the exact response to each telegram, refer to the Sick LMS291 TelegramListing document.

 

2. Success Flag: This value indicates if the sensor has successfully responded to a given command.

0 indicates that the sensor has successfully acknowledged the command or is idle

1 indicates that the sensor has received a command but has not acknowledged yet

>1 indicates the sensor has failed to acknowledge the command in the specified time span.

 

The command that failed to solicit response is the one sent at the time-step when the Success Flag parameter has a value of 1. The following figures illustrate through example scenarios how the Success Flag variable can be used to interpret if the sensor has acknowledged the command or not.

 

Scenario 1: The sensor successfully acknowledges all the commands. As shown in the scope, 6 commands were sent to the sensor starting from t=0 seconds with 5 seconds between consecutive commands. At the time instant when the sensor receives the command, the Success Flag variable becomes 1 and then drops to 0 after the sensor acknowledges the command.

 

Figure 1: Typical graph for the Success Flag variable on time axis when all the commands are acknowledged

 

Scenario 2: The sensor successfully acknowledges the first command but fails to acknowledge subsequent commands. Here you can see that at t=0, the sensor receives the command and acknowledges it back at t=0.5 seconds. It receives the second command at t=5 seconds but does not acknowledge this command within the next five seconds when a third command is sent at t=10 seconds.

 

Figure 2: Graph for the Success Flag variable on time axis when some of the commands are not acknowledged

 

Try to increase the time span between consecutive telegrams parameter as a first troubleshooting step.

 

 

Reference

 

http://tourbot.mit.edu/images/7/79/LMS_Guide.pdf

 

Sick_LMS291_TelegramListing