http://www.physik.uni-muenchen.de/~Otto.Schaile/howtos/h_sm32.html
Login to PC motor2: user: motor passwd: (MUCs tram) type: root and you should get a widget with options: Start Motor_1_3, l=50 Start Motor_2_3, l=50 .. The naming convention is: Motor_motornumber_pciboardnumber. NB:The numbering of pciboardnumbers is different for motherboards! Pressing the button should give a widget to control this motor (i.e. you get one widget / motor) Moving the slide is done by pressing "<<move" "move>>", the slide moves with maximum speed, while the button is pressed. N.B: the slide needs some distance to deaccelerate. The speed can be adjusteds with "MSpeed". "Break" can be pressed any time and stops the slide if it is moving. "<step" "step>" moves the the slide by the adjustable "Mstep" In the lower left corner the actual position is displayed, right of it the current state (e.g.: "Go Home"). Pressing this button prints a detailed status for this motor. At top a scale with a little arrow indicates the current position. NB: Before calibration this is meaningless. The calibration menu line and the line to enable synchronous are displayed alternatively. At startup the calibration menu is shown if the program thinks the motor is not calibrated.
To use the motor it must be calibrated and its internal step counter must be set to a well defined zero point. This is done by moving the slide / roundabout to the desired zero point and pressing "Set cur to zero", then moving it to a second well defined point and pressing "Set cur to value".. The user coordinate value (e.g. in mm) is requested. The calibration as other values like nominal positions and min- / maximum allowed values are remembered in a file "defaults.txt" in the current directory. For convenience buttons are provided to move the slide to the lower or other end of the scale. Watch out for obstacles in the complete range!! After a power down of the PC the step counter will be set to an arbitrary value. The calibration value in the file (i.e. the value CountsToUser) should be still valid. In this case it enough to move the slide / roundabout to the zero point and press "Set cur to zero" For simplification of this procedure see next section.
Since program version 2.00 the setting of of the position counter is stored to "defaults.txt" after each movement. After power cycling of the computer this setting is restored. No new calibration or setting of the zero point is required.Make sure that motors have not been moved in between!
Two motors may be moved synchronously: One motor is the master. In its control widget the fields M#, B# and Fac should be filled in, which correspond to the slaves MotorNumber, BoardNumber. Fac gives the relative velocity to the masters setting. Negative values obviously move the slave in the opposite direction. The slave must be powered and calibrated. Watch out if master and slave have big differences in the nominal velocities. The slave can still be moved seperately, this has no influence on its master. So the correlation is one way only. Off limits check are still active. This feature is activated / deactivated pressing the toggle button "Master / Not Master" Powering off the slave motor will deactivate this feature.
There are 2 programmable positions forseen which are remembered for each motor / board between sessions in a file: defaults.txt containing lines like: SM32Motor_1_3_NomPos_1: 37.799477 Pressing the value field asks for input [user scale e.g. mm]. As default the current position of the slide is offered. This allows e.g with the help of the "<<" ">>" keys the move the slide to a favorite position and remember this for later. Pressing "Goto" moves the slide to the desired position.
In case the slide / roundabout may not move to all positions between the end switches the limits may be set with the help of the commands "Set Min/Max Allowed" after moving the slide to the corresponding position. When these values are set as indicated by red bars in the scale display the program will check the position (4 times /second) and issue a break command if the slide moves outside. If this happens only moves towards inside will be allowed. These values may be reset by "Clear Min/Max Allowed".
To add other motors / boards in the startup widget just edit the file "config.txt and add / remove a line like: Linear 1 1 3.2 500 0 75 43 title, motor_#, board_#, voltage, max_velocity[Hz], user_range_low, user_range_up, switchmode. Be careful with the voltage value,the interface program has no means to read the nominal voltage of a given motor. At the moment the max voltage allowed is 3.2 Volts and the maximum velocity 500 Hz. Note: The value switchmode has been added 19.07.2006 to allow programming of the end switches. This needs extreme care to avoid damage of mechanics. Please consult page 44 of the OWIS PCI-SM32 User Manual.
The kernel drivers are delivered as source by Owis and are copied into /opt/sm A README is provided in that place. The following files are used: "SM32Motor.h",.cxx" implement the class SM2Motor "SM32MotorControl.h",.cxx" control window for 1 motor "GriTimer.h, .cxx" Timer classes. "gri.C" provides the graphical interface to the motors. "TMrbInputDialog.cxx", "TMrbTableOfLabels.cxx", "TPaveTextTC.cxx" provide some handsome widget classes. "libsm32.so" is the library provided by the manufacturer of the motors (Owis). "sm32_kernel_driver.tgz" contains the needed kernel driver It is installed under /opt, but could be anywhere Note: The device /dev/sm32 must be r/w for all. To make this persistent (after reboot): add to: /etc/udev/rules.d/50-udev.rules # sm32 Motor control cards access for all KERNEL=="sm32", MODE="0666" "start.C" reads the config file config.txt and builds the "Start Motor menu" "config.txt" defines the motors Format: Comment_____MotorN_BoardN_Voltage_MaxVel_RangeFrom_To____Switchmode Linear 1 1 3.2 500 0 75 43 Nota bene: Dont change first /comment line When root is started the macro "rootlogon.C" is executed. This automatically compiles (if needed) and loads the shared libraries and executes then the macro "start.C" "Makefile" provides the commands: "make clean" remove the user made shared libraries. This should be done after import on new source files. Never use: "rm *.so", this removes the libsm32.so !!! "make dist" produce a "sm32code.tgz", a tar file containing the source code. Use "tar -tzf sm32code.tgz" to list its contents, "tar -xzf sm32code.tgz" to unpack.
If motors dont respond as expected: Check for kernel module loaded: /sbin/lsmod | grep sm32 should give: sm32kernel 6664 0 Check for read/write permissions of device: ls -l /dev/sm32 crw-rw-rw- 1 root root 10, 235 Feb 1 18:58 /dev/sm32 if this reads: crw------- i.e. only allowed for root, do as root: chmod a+rw /dev/sm32 To make this persistent (after reboot): add to: /etc/udev/rules.d/50-udev.rules # sm32 Motor control cards access for all KERNEL=="sm32", MODE="0666"
Needed driver for camera: spca5xx contained in /opt/spca5xx-20051105.tar.gz TV program: kdetv Settings->"Configure kdetv" Image filters: No Deinterlacing Video: Configure selected plugin:(Autoconfigure off) Video4Linux2: Xvideo Video4Linux: X11 View: normal, make sure canvas is big enough to hold complete picture Devices used: /dev/video -> /dev/video0 or /dev/video1 kdetv cannot by itself switch between devices. A program : set-camera is used to switch devices if more than 1 camera is connected. It just moves the symbolic link /dev/video from video0 to 1 From the "Video" popup click on Video4linux: Z-star Vimicro to make kdetv aware of the switch If you dont login from the console you will not be owner of /dev/video0 (ls -l /dev/video0). In this case also run: set-camera 0, it will set the mode of /dev/video to rw (read/write) for everybody. Note: set-camera must be owned by root and have the "s" bit set: ls -l set-camera -rwsr-xr-x 1 root root 5277 Feb 16 17:33 set-camera if not do as root: chown root:root set-camera chmod 4755 set-camera From the "Video" popup click on Video4linux: Z-star Vimicro to make kdetv aware of the switch
If kdetv shows no (empty) picture: Check popup: "Video" Click to activate on: Video4Linux: Z-star Vimicro zc0302 if this device is not on display: check for driver loaded: /sbin/lsmod | grep spca should give: spca5xx 673200 1 videodev 9537 2 spca5xx if not, try as root: modprobe spca5xx check for device file: ls -l /dev/video0 crw-rw-rw- 1 root root 81, 0 Feb 2 15:36 /dev/video0 if this reads: crw-rw---- 1 root root 81, 0 Feb 2 15:36 /dev/video0 i.e. it is not read/write for all, try: set-camera this should change the permissions to "crw-rw-rw-" if this does not work: check if set-camera has the right permissions (see above): ls -l set-camera -rwsr-xr-x 1 root root 5277 Feb 16 17:33 set-camera check if usb "sees" the camera with the command: usbview If something looks wrong with usb, (no camera in usbview, no /dev/video0) try unplug - plug the usb cable. Warning: There are millions of other traps not listed here! Try not fall in one them.
In case an active connection to an ethernet and an IP-, Broadcast- and Gateway Address is available the corresponding fields in "/etc/sysconfig/network-scripts/ifcfg-eth0" must be adjusted accordingly. NB: Make sure the Netmask field is correct. This must be done as root, passwd (MUCs tram) To adjust screen size (TFT): edit /etc/X11/xorg.conf in Section "Monitor" VertRefresh 59.0 - 61.0 in Section "Screen" adjust pixel size: e.g. DefaultDepth 24 SubSection "Display" Viewport 0 0 Depth 16 Modes "1280x1024" "1024x768" EndSubSectionAuthor:
Otto Schaile, +49 89 2891 4070, mobil: 0160 1553598 email: Otto.Schaile@LMU.de Last update: 08.08.2007