HOWTO Read the laser in real time

From GlueXWiki
Revision as of 03:49, 13 June 2009 by Veilleux (Talk | contribs) (Technical Note)

Jump to: navigation, search

The laser measurement device, part of the FDC laser scanner system, is read via RS232 serial communication through the serial port on the Desktop computer located on the ground. The laser's default mode when powered on is to continuously read out depth measurements to this computer. Note that only one program can read from the serial port at a time so these instructions should only be followed if a full snake scan is not currently in progress.

To read the values reported by the laser device, perform the following:

  1. Make sure the laser is plugged in and is on. The plug is labeled and plugs into a power strip that sits on top of the granite rock, towards the right. If you do not see the laser reflecting off of whatever is directly in front of it, then unplug the laser and plug it back in to reset it.
  2. Open up an window on the Linux Desktop computer and type:
    minicom -o
    This should immediately start reading the laser with numbers scrolling up the screen. The values are in mm.

Troubleshooting

  • If you get an error message like:
    Device /dev/ttyS0 access failed: Permission denied.
The permissions are not set properly. To set them, just double click on the laser_permission icon in the Laser_Control folder on the desktop and enter the password.
  • If minicom refuses to make a connection, it is likely because another program has control of the serial port. Try killing the other process with the following:
    kill -9 `cat /var/lock/LCK..ttyS0`
  • If you still can't get access to the serial port, reboot the Linux Desktop. On rare occasions, the serial device on the computer side gets confused to the point that only a reboot will clear it to the point that communications can be established.
  • If minicom does not display any readings, check that the serial cable is plugged in tightly (both to the back of the computer, and on top of the granite rock where the extension cord meets the laser's cable).
  • If the laser is not reading properly (too fast or too slow) try unplugging and plugging it back it.
  • If the laser reads only zeros, it probably means the distance between the read head and the surface being measured is out of range. The device has a very limited range of only 6.35mm centered around 21mm. Try slipping in a piece of paper to see if you can get non-zero numbers to come up. If so, then the surface is too far away. If not, then try moving the laser further from the surface.

Technical Note

In order to set permissions on /dev/ttyS0 the following line is in /etc/rc.local:

chmod 664 /dev/ttyS0

There is also a file located in /etc/udev/permissions.d/micah.permissions containing:

#name:user:group:mode
ttyS0:root:root:664

This seems to have worked at least once. The program udev is supposed to read this file whenever configuring ports.

Also noteworthy, user laser was apparently removed from the group uucp at some point. The graphical tool showed that laser was a member of uucp, but running groups laser from the terminal indicated otherwise. I remedied this with usermod -G uucp laser. Also, the desktop icon laser_permissions runs the following command, which should allow permissions to be temporarily set so that laser does not have to be a member of uucp.

kdesu "chmod 666 /dev/ttyS0"

Contact

David Lawrence davidl@jlab.org x5567