roboticslab-uc3m / jr3pci-linux

Imported from https://sourceforge.net/projects/jr3pci-linux/
https://sourceforge.net/projects/jr3pci-linux/
GNU Lesser General Public License v3.0
1 stars 3 forks source link

Check units on different connectors #1

Open jgvictores opened 7 years ago

jgvictores commented 7 years ago

Check units (dmesg output) when connected to different connectors.

follower commented 6 years ago

For anyone else looking at this issue: it turns out each JR3 device is factory configured[0] to return values expressed in a particular set of engineering units (e.g. pounds or Newtons).

The driver currently outputs the unit set used when a sensor is found and this message[1] can be found in the dmesg output, e.g.:

 jr3pci(0): DSP Software updated day 327, year 2001. Units: lbs 

However the jr3mon and other example code doesn't appear to have access to the unit set used and hard codes the units displayed.

Until the unit set is exposed via the driver this situation needs to be handled manually.

[0] From "5907E - Legacy PCI Receiver Manual" (Page 16) (_5907e_rec_man.pdf a.k.a "Legacy PCI Receiver Driver Manual" a.k.a "JR3 DSP Based PCI Device Manual" via):

Units is an enumerated read only value defining the engineering units used in the sensor fulls cale. The meanings of particular values are discussed in the section detailing the force_units structure on page 22.[2] The engineering units are set to customer specifications during sensor manufacture and cannot be changed by writing to Units.

[1] This is the driver code that detects the unit set used:

https://github.com/roboticslab-uc3m/jr3pci-linux/blob/daef0c23044e4137881024cf1269c47e88ada100/jr3pci-driver.c#L84-L94

[2] From "5907E - Legacy PCI Receiver Manual" (Page 22):

FORCE_UNITS

Force_units is an enumerated value defining the different possible engineering units used.

0 - lbs_in-lbs_mils:        lbs, inches * lbs, and inches * 1000
1 - N_dNm_mmX10:            Newtons, Newtons * meters * 10, and mm * 10
2 - dkgF_kgFcm_mmX10:       kilograms-force*10, kilograms-Force*cm, and mm*10
3 - klbs_kin-lbs_mils:      1000 lbs, 1000 inches * lbs, and inches * 1000