OptoForce sensors

Hardware info

  • OMD-20-SA-60N – 20mm, 60N sensor Datasheet
  • Serial protocoll based communication
  • Features frame rates of up to 1000Hz (In Matlab up to 260Hz are possible)
  • 16 diodes provide continuous readings within the range [0, 2^16-1], when no force is applied the values are 2^15.
  • The sensor readings are temperature compensated
  • We have an old version of the sensors, so most likely online found programs will use a different header, so please check with the structure listed below

Hardware usage

  • Check which USB device is used (e.g., by running dmesg). On most of our machines it is /dev/ttyACM0
  • Enable read/write permissions if necessary

check if it is necessary:

   cd /dev/
   ls -l ttyACM0

good (rights are existent):

   crw-rw-rw- 1 

bad (rights are non-existent):

   crw-rw---- 1

so set the rights:

   sudo chmod o+rw /dev/ttyACM0
  • Tell Matlab which serial ports to use: copy the java.opts file to your Matlab bin folder, e.g., to /usr/local/MATLAB/R2012a/bin/glnxa64/ or create one there (or in the folder you're usually starting Matlab in) containing the following line:
   -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyS1:/dev/USB0:/dev/ttyACM0

Fast Mex-file based Matlab Interface - max 260Hz

  • Install libserial-dev
  • Download the code from here
  • Compile the mex function with: mex OptoForceInterface.cpp -lserial
  • Run EventBasedOptoForceDemo.m
  • You can specify the frame rate (1000Hz, 333Hz, 100Hz or 30Hz) and the filter frequency (no filtering, 150Hz, 50Hz, 15Hz)

ROS interface

  • instructions for using the ROS interface can be found here
  • the original code is from here

Computing force vectors from raw diode readings

  • if S1,..., S4 are the raw diode readings for each sensor, the force values are calculated as follows:
   Fx1=S1(1)-S1(3); Fy1=S1(4)-S1(2); Fz1=(S1(1)+S1(2)+S1(3)+S1(4))/4;                        
   Fx2=S2(1)-S2(3); Fy2=S2(4)-S2(2); Fz2=(S2(1)+S2(2)+S2(3)+S2(4))/4; 
   Fx3=S3(1)-S3(3); Fy3=S3(4)-S3(2); Fz3=(S3(1)+S3(2)+S3(3)+S3(4))/4; 
   Fx4=S4(1)-S4(3); Fy4=S4(4)-S4(2); Fz4=(S4(1)+S4(2)+S4(3)+S4(4))/4;
  • message structure is as follows:
    1 55   % header byte
    2 95   % header byte 2
    3      % config,
    4      % Forcex MSB  
    5      % Forcex LSB
    6      % Forcey MSB 
    7      % Forcey LSB
    8      % Forcez MSB 
    9      % Forcez LSB
   10      % Torquex MSB 
   11      % Torquex LSB
   12      % Torquey MSB 
   13      % Torquey LSB
   14      % Torquez MSB 
   15      % Torquez LSB
   16      % Temperature1 MSB 
   17      % Temperature1 LSB
   18      % Temperature2 MSB 
   19      % Temperature2 LSB
   20      % Temperature3 MSB 
   21      % Temperature3 LSB
   22      % Temperature4 MSB 
   23      % Temperature4 LSB
   24      % Sensor 1, Diode1  MSB 
   25      % Sensor 1, Diode1  LSB
   26      % Sensor 1, Diode2  MSB 
   27      % Sensor 1, Diode2  LSB
   28      % Sensor 1, Diode3  MSB 
   29      % Sensor 1, Diode3  LSB
   30      % Sensor 1, Diode4  MSB 
   31      % Sensor 1, Diode4  LSB
   32      % Sensor 2, Diode1  MSB 
   33      % Sensor 2, Diode1  LSB
   34      % Sensor 2, Diode2  MSB 
   35      % Sensor 2, Diode2  LSB
   36      % Sensor 2, Diode3  MSB 
   37      % Sensor 2, Diode3  LSB
   38      % Sensor 2, Diode4  MSB 
   39      % Sensor 2, Diode4  LSB
   40      % Sensor 3, Diode1  MSB 
   41      % Sensor 3, Diode1  LSB
   42      % Sensor 3, Diode2  MSB 
   43      % Sensor 3, Diode2  LSB
   44      % Sensor 3, Diode3  MSB 
   45      % Sensor 3, Diode3  LSB
   46      % Sensor 3, Diode4  MSB 
   47      % Sensor 3, Diode4  LSB
   48      % Sensor 4, Diode1  MSB 
   49      % Sensor 4, Diode1  LSB
   50      % Sensor 4, Diode2  MSB 
   51      % Sensor 4, Diode2  LSB
   52      % Sensor 4, Diode3  MSB 
   53      % Sensor 4, Diode3  LSB
   54      % Sensor 4, Diode4  MSB 
   55      % Sensor 4, Diode4  LSB
   56      % checksum value 1
   57      % checksum value 2

  

zum Seitenanfang