Quick Reference Guide for Sick LMS

download Quick Reference Guide for Sick LMS

of 13

Transcript of Quick Reference Guide for Sick LMS

  • 8/10/2019 Quick Reference Guide for Sick LMS

    1/13

    Quick Reference Guide forInterfacing Sick LMS-291 Sensor To

    MathWorks Tools

    Produced for Olin College by The MathWorks, Inc. ConsultingServices Grou!ril "", #$$%

    Consulting ServicesThe MathWorks, Inc.

    & !le 'ill (rive)atick, M! $"%*$Tel. + -$/ *0%1%$$$2a3 + -$/ *0%1%$$"e4ail + consulting54ath6orks.co46eb + 666.4ath6orks.co47services7consulting

    mailto:[email protected]://www.mathworks.com/services/consulting%0Dmailto:[email protected]://www.mathworks.com/services/consulting%0D
  • 8/10/2019 Quick Reference Guide for Sick LMS

    2/13

    Table of ontents

    1 Overview......................................................................................................................3

    2 Initial Setup Using MATLAB......................................................................................3

    2.1 Communication setup via MATLAB an !S"22 #or $%%&'ps operation...........3

    2.2 (ermanent Con#iguration Setup...........................................................................$

    3 Common Setup an Use tas)s in Simulin)*+(C Target...............................................,

    3.1 Con#iguring t-e LMS2/1 to communicate at $%%)'ps #rom +(C w-en starting

    at #actor0 setting /,%%'ps................................................................................................,

    3.2 !euire LMS2/1 Con#iguration C-anges via +(C Target w-en LMS2/1 is

    Communicating at $%%)'ps...........................................................................................123.3 +ample o# ata Collection #rom LMS2/1.....................................................13

    " Appeni+....................................................................................................................1"

    ".1 Ot-er Telegram In#ormation..............................................................................1"".2 Communication setup via MATLAB an !S232 4Optional5............................1$

    ".3 etails on ata Collection #rom LMS2/1.......................................................1$

  • 8/10/2019 Quick Reference Guide for Sick LMS

    3/13

  • 8/10/2019 Quick Reference Guide for Sick LMS

    4/13

    !+ 2 4 T+

    T+ 3 8 !+

    T+ 4 9 !+

    > $ 1 >

    >C , 2 >C

    >C 8 3 >C>C 9 , >C

    >C / 8 >C

    > rounD >C >ot Connecte

    3 COMMON SETUP AND USE TASKS IN SIMULINK/XPC TARGET

    T-e LMS2/1 unit will nee to -ave a num'er o# #actor0 so#tware settings c-ange towor) properl0 at t-e esire $%%&'ps an 8$;< upate rate. T-ese settings nee to 'e

    c-ange onl0 once per LMS2/1 unit6 as it can 'e set to save t-e c-anges in its non

    volatile memor0 w-en it is powere own.

    >ote= T-e Simulin) moels #or t-e LMS2/1 4!BemoELMS2/1ECon#igSetup.ml an

    !BemoELMS2/1Eata!ea.ml5 are esigne to 'e use to communicate wit- a LMS

    2/1 via +(C Target using a :astcom "22*2(CI33$ car. T-e0 will not wor) in aSimulin) simulation or using a i##erent car.

    3.1 Configuring the LMS-291 to communicate at 500kbp from !"C #hen tarting

    at factor$ etting 9%00bp

    I# one esires to c-ange t-e 'au rate on t-e LMS2/1 #rom t-e e#ault #actor0 setting o#

    /,%%'ps to $%%)'ps using +(C Target6 one woul use t-e!BemoELMS2/1ECon#igSetup.ml 4availa'le #rom t-e emos part o# t-e li'rar05.

    Con#igure t-e ialogue 'o+ on t-e FSic)LMS2/1 Con#igurationG 'loc) to 'e as s-own'elow.

  • 8/10/2019 Quick Reference Guide for Sick LMS

    5/13

    >ow 'uil an run t-e moel on +(C Target wit- t-e LMS2/1 running wit- its status

    L s-owing green. I# 0ou see pulses t-at come 'ac) to

  • 8/10/2019 Quick Reference Guide for Sick LMS

    6/13

    >ow 'uil an run t-e moel on +(C Target wit- t-e LMS2/1 running wit- its statusL s-owing green.

    H-en t-is -as 'een complete success#ull06 t-e LMS2/1 will communicate at $%%)'psan sta0 at $%%)'ps w-en its power is c0cle.

  • 8/10/2019 Quick Reference Guide for Sick LMS

    7/13

    3.2 &e'uire( LMS-291 Configuration Change )ia !"C *arget #hen LMS-291 i

    Communicating at 500kbp

    T-e E!BemoELMS2/1ECon#igSetup.ml is esigne to sen various telegrams to t-esensor neee to con#igure t-e sensor to sen ata in i##erent #ormats suc- as angular

    range6 angular resolution6 measurement units an 'aurates. ?ou can select t-e

    con#iguration 0ou nee '0 selecting t-e appropriate tas)s in t-e LMS Con#ig Telegramialog 'o+.

    T-e e#ault state o# t-e 'loc) con#igures an LMS2/1 running at $%%)'ps to use 19%

    range6 1 resolution6 mm units an saves t-at con#iguration so w-en t-e power is c0cleon t-e LMS2/16 t-e con#iguration remains t-e same. T-e e#ault state is s-own 'elow.

    Buil an run t-e moel on +(C wit- t-e LMS2/1 running an s-owing green on t-e

    status L. H-en t-is success#ull0 completes6 t-e LMS2/1 is rea0 #or ata acuisition#rom t-e !BemoELMS2/1Eata!ea.ml.

  • 8/10/2019 Quick Reference Guide for Sick LMS

    8/13

    3.3 +!amp,e of ata Co,,ection from LMS-291

    Once t-e LMS2/1 is properl0 con#igure6 t-e #ollowing steps will allow 0ou to collect

    ata o## t-e LMS2/1 via t-e +(C Target (C6 sen it to t-e -ost an ispla0 it inMATLAB on t-e -ost (C.

    1. Attac- t-e LMS2/1 to t-e !S"22 car in t-e +(C Target (C.

  • 8/10/2019 Quick Reference Guide for Sick LMS

    9/13

    2. Start Simulin) an esta'lis- connection wit- +(C Target (C via et-ernet.

    3. Open !BemoELMS2/1Eata!ea.ml an 'uil it #or +(C Target. 4CtrlB5T-e 'uil processs will conclue '0 loaing t-e e+ecuta'le #ile onto t-e +(C

    Target mac-ine.

    ". Open !BemoELMS2/1E;ostataispla0.ml.

    $. T0pe tg.start at t-e MATLAB comman prompt.

    ,. Clic) run on t-e !BemoELMS2/1E;ostataispla0 moel winow.

    8. Jiew range measurements #rom LMS2/1 on -ost mac-ine in t-e #igure winowt-at pops up.

    T-e ata in t-e +(C Target moel can 'e use #or an0 algorit-m esire. In t-is case6 it is

    'eing sent out via U( pac)ets #or ispla0 on t-e -ost mac-ine instea o# 'eing use inan algorit-m.

    4 INITIAL SETUP USING MATLAB

    4.1 Communication etup )ia M*L/ an( &S422 for 500bp operation

    T-e :astcom 'oar is setup to run at /,%% 'ps '0 e#ault wit- a 'ase cloc) rate o#

    1".8"$, M;ote t-at %,-e+ 4,

    ecimal5 inicates ac)nowlegement o# t-e comman '0 t-e sensor an 1$-e+

    421 ecimal5 inicates t-at t-e sensor #aile to ac)nowlege t-e comman.

    $. Sen t-e telegram to c-ange t-e 'aurate to $%%&.

    ,. Close t-e serial o'7ect in MATLAB using t-e :CLOS #unction.

  • 8/10/2019 Quick Reference Guide for Sick LMS

    10/13

    8. C-ange t-e cloc) #reuenc0 o# t-e :astcom 'oar to 9 M;ote= :astcom@s river gives cr0ptic errors w-en t-e port settings are

    c-ange an t-e port is alrea0 open. Con#irm t-e port is close i# 0ou get errorsw-en appl0ing settings to t-e :astcom 'oar.

    9. !eopen t-e serial o'7ect in MATLAB using t-e :O(> #unction.

    /. Sen t-e telegram to c-ange to LMS2/1@s Installation Moe.

    1%. Sen t-e telegram to c-ange to (ermanent Bau!ate moe.

    11. T-e Sensor is now rea0 to communicate at $%%&'ps an will remem'er t-is

    'au rate even w-en t-e power is turne o##.

    4.2 "ermanent Configuration Setup

    Using t-e instructions #rom previous section 42.156 0ou can setup t-e sensor to remem'er

    its 'aurate w-en powere own. ;owever6 t-e sensor e#aults to its e#ault measuring

    con#iguration 4e#ault settings #or LMS2/1 measurement units are mm6 angular range is% 19%6 angular resolution is %.$5 w-en powere 'ac) on. In orer to save a i##erent set

    o# con#iguration settings6 per#orm t-e #ollowing steps. T-ese steps correspon to t-e

    coe in t-e LMS2/1E(ermanentCon#igurationSetup.m M#ile.

    1. Con#irm t-e :astcom@s Hinows river is set to t-e e#ault 'ase cloc) rate6

    1".8"$,M;

  • 8/10/2019 Quick Reference Guide for Sick LMS

    11/13

    9. Sen t-e telegram to c-ange t-e 'aurate to $%%&.

    /. Close t-e serial o'7ect in MATLAB using t-e :CLOS #unction.

    1%. C-ange t-e cloc) #reuenc0 o# t-e :astcom 'oar to 9 M;ote= :astcom@s river gives cr0ptic errors w-en t-e port settings are

    c-ange an t-e port is alrea0 open. Con#irm t-e port is close i# 0ou get errorsw-en appl0ing settings to t-e :astcom 'oar.

    11. !eopen t-e serial o'7ect in MATLAB using t-e :O(> #unction.

    12. Sen t-e telegram to c-ange to LMS2/1@s Installation Moe.

    13. Sen t-e telegram to set t-is con#iguration to 'e permanent.

    1". T-e Sensor is now rea0 to communicate at $%%&'ps wit- an angular range o# %K

    19%K an resolution o# 1K. It will remem'er t-is con#iguration even w-en t-epower is turne o##.

    5 APPENDIX

    5.1 ther *e,egram nformation

    ?ou can also sen custom telegrams using t-e Sen Custom Telegrams option in!BemoELMS2/1ECon#igSetup.ml. Speci#0 t-e e+act telegram as a row vector in t-eeit 'o+. T-e elements o# t-e telegram must 'e o# atat0pe uint1,. T-e new

    con#iguration can 'e set as permanent 4sensor memoriote t-at in t-is moel6 t-e secon c-annel o# t-e :astcom 'oar is not connecte an

    -ence t-e0 are groune in t-e moel. I# -owever6 anot-er sensor is connecte to t-isc-annel6 t-e moel can 'e moi#ie.

  • 8/10/2019 Quick Reference Guide for Sick LMS

    12/13

    T-is moel uses t-e :astcom "22*2(CI33$ : 'loc) wit- t-e serial rivers #or t-e 'oar.

    T-e ialog 'o+ #or t-e 'oar -as various setup parameters to speci#0 t-e cloc) rate o# t-e

    'oar6 'u##er space6 'aurate etc. :or more in#ormation on t-is 'loc)6 re#er to t-eocumentation using t-e ;elp 'utton in t-e ialog 'o+.

    5.2 Communication etup )ia M*L/ an( &S232 ptiona,

    :or communication setup via !S2326 per#orm t-e #ollowing steps=

    1. !emove t-e 7umper connection 'etween t-e pins 8 an 9 on t-e LMS sie insie

    t-e ca'le connector

    2. Buil an aapter wit- t-e #ollowing pin connections. >ote= t-e / pin !S232 port

    t0pical on (C@s -as a stanari >o= (I> >o= Signal esignation>C 1 1 >C

    !+ 2 3 T+

    T+ 3 2 !+

    >C " " >C

    > $ $ >

    >C , , >C

    >C 8 8 >C

    >C 9 9 >C

    >C / / >C

    > rounD >C >ot Connecte

    >ow 0ou can switc- on t-e sensor an communicate wit- it t-roug- MATLAB using astanar serial o'7ect wit- t-e S!IAL #unction. >ote t-at in t-is moe6 t-e ma+imum

    'aurate t-at can 'e ac-ieve is onl0 39"%%. !e#er to t-e LMS2/1ETelegramList.m M

    #ile #or t-e mcoe wit- t-e rig-t s0nta+ an telegram listing to communicate an e+tract

    ata #rom t-e sensor.

    5.3 etai, on ata Co,,ection from LMS-291

    T-e !BemoELMS2/1Eata!ea.ml is esigne to sen t-e Continuous ata Trans#er

    telegram at t-e start o# t-e simulation an sen t-e Stop ata telegram at t-e speci#ie

    time 4LMS ata Telegram 'loc)5. It will continuousl0 rea ata #rom t-e LMS2/1w-ile t-e evice is ta)ing measurements. T-e ata t-at is rea can 'e use in an0

    algorit-m t-at can 'e #urt-er implemente in t-e moel. In t-is case6 t-e ata t-at is

    'eing sent out via U( pac)ets #or ispla0 on t-e -ost mac-ine instea o# 'eing use inan algorit-m.

    T-e LMS Sensor ata 'loc) reas t-e ata #rom t-e LMS2/1 an uses t-e ata -eaerto separate t-e ata #or eac- complete c0cle 4#or instance6 %19% wit- 1 resolution will

  • 8/10/2019 Quick Reference Guide for Sick LMS

    13/13

    -ave 191 points wit- 2 '0tes #or eac- point an t-at woul result in 3,2 ata values5.

    Select t-e appropriate con#iguration 4measurement units an angular range5 o# t-e sensor

    in t-e LMS Sensor ata 'loc). >ote t-at t-e -eaers are i##erent #or i##erentresolution*unit settings an selecting t-e rig-t con#iguration in w-ic- t-e sensor is

    sening ata is important #or t-is 'loc) to recogni