adis16475.rst 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ================
  3. ADIS16475 driver
  4. ================
  5. This driver supports Analog Device's IMUs on SPI bus.
  6. 1. Supported devices
  7. ====================
  8. * `ADIS16465 <https://www.analog.com/ADIS16465>`_
  9. * `ADIS16467 <https://www.analog.com/ADIS16467>`_
  10. * `ADIS16470 <https://www.analog.com/ADIS16470>`_
  11. * `ADIS16475 <https://www.analog.com/ADIS16475>`_
  12. * `ADIS16477 <https://www.analog.com/ADIS16477>`_
  13. * `ADIS16500 <https://www.analog.com/ADIS16500>`_
  14. * `ADIS16505 <https://www.analog.com/ADIS16505>`_
  15. * `ADIS16507 <https://www.analog.com/ADIS16507>`_
  16. Each supported device is a precision, miniature microelectromechanical system
  17. (MEMS) inertial measurement unit (IMU) that includes a triaxial gyroscope and a
  18. triaxial accelerometer. Each inertial sensor in the IMU device combines with
  19. signal conditioning that optimizes dynamic performance. The factory calibration
  20. characterizes each sensor for sensitivity, bias, alignment, linear acceleration
  21. (gyroscope bias), and point of percussion (accelerometer location). As a result,
  22. each sensor has dynamic compensation formulas that provide accurate sensor
  23. measurements over a broad set of conditions.
  24. 2. Device attributes
  25. ====================
  26. Accelerometer, gyroscope measurements are always provided. Furthermore, the
  27. driver offers the capability to retrieve the delta angle and the delta velocity
  28. measurements computed by the device.
  29. The delta angle measurements represent a calculation of angular displacement
  30. between each sample update, while the delta velocity measurements represent a
  31. calculation of linear velocity change between each sample update.
  32. Finally, temperature data are provided which show a coarse measurement of
  33. the temperature inside of the IMU device. This data is most useful for
  34. monitoring relative changes in the thermal environment.
  35. The signal chain of each inertial sensor (accelerometers and gyroscopes)
  36. includes the application of unique correction formulas, which are derived from
  37. extensive characterization of bias, sensitivity, alignment, response to linear
  38. acceleration (gyroscopes), and point of percussion (accelerometer location)
  39. over a temperature range of −40°C to +85°C, for each ADIS device. These
  40. correction formulas are not accessible, but users do have the opportunity to
  41. adjust the bias for each sensor individually through the calibbias attribute.
  42. Each IIO device, has a device folder under ``/sys/bus/iio/devices/iio:deviceX``,
  43. where X is the IIO index of the device. Under these folders reside a set of
  44. device files, depending on the characteristics and features of the hardware
  45. device in questions. These files are consistently generalized and documented in
  46. the IIO ABI documentation.
  47. The following tables show the adis16475 related device files, found in the
  48. specific device folder path ``/sys/bus/iio/devices/iio:deviceX``.
  49. +-------------------------------------------+----------------------------------------------------------+
  50. | 3-Axis Accelerometer related device files | Description |
  51. +-------------------------------------------+----------------------------------------------------------+
  52. | in_accel_scale | Scale for the accelerometer channels. |
  53. +-------------------------------------------+----------------------------------------------------------+
  54. | in_accel_x_calibbias | Calibration offset for the X-axis accelerometer channel. |
  55. +-------------------------------------------+----------------------------------------------------------+
  56. | in_accel_x_raw | Raw X-axis accelerometer channel value. |
  57. +-------------------------------------------+----------------------------------------------------------+
  58. | in_accel_y_calibbias | Calibration offset for the Y-axis accelerometer channel. |
  59. +-------------------------------------------+----------------------------------------------------------+
  60. | in_accel_y_raw | Raw Y-axis accelerometer channel value. |
  61. +-------------------------------------------+----------------------------------------------------------+
  62. | in_accel_z_calibbias | Calibration offset for the Z-axis accelerometer channel. |
  63. +-------------------------------------------+----------------------------------------------------------+
  64. | in_accel_z_raw | Raw Z-axis accelerometer channel value. |
  65. +-------------------------------------------+----------------------------------------------------------+
  66. | in_deltavelocity_scale | Scale for delta velocity channels. |
  67. +-------------------------------------------+----------------------------------------------------------+
  68. | in_deltavelocity_x_raw | Raw X-axis delta velocity channel value. |
  69. +-------------------------------------------+----------------------------------------------------------+
  70. | in_deltavelocity_y_raw | Raw Y-axis delta velocity channel value. |
  71. +-------------------------------------------+----------------------------------------------------------+
  72. | in_deltavelocity_z_raw | Raw Z-axis delta velocity channel value. |
  73. +-------------------------------------------+----------------------------------------------------------+
  74. +---------------------------------------+------------------------------------------------------+
  75. | 3-Axis Gyroscope related device files | Description |
  76. +---------------------------------------+------------------------------------------------------+
  77. | in_anglvel_scale | Scale for the gyroscope channels. |
  78. +---------------------------------------+------------------------------------------------------+
  79. | in_anglvel_x_calibbias | Calibration offset for the X-axis gyroscope channel. |
  80. +---------------------------------------+------------------------------------------------------+
  81. | in_anglvel_x_raw | Raw X-axis gyroscope channel value. |
  82. +---------------------------------------+------------------------------------------------------+
  83. | in_anglvel_y_calibbias | Calibration offset for the Y-axis gyroscope channel. |
  84. +---------------------------------------+------------------------------------------------------+
  85. | in_anglvel_y_raw | Raw Y-axis gyroscope channel value. |
  86. +---------------------------------------+------------------------------------------------------+
  87. | in_anglvel_z_calibbias | Calibration offset for the Z-axis gyroscope channel. |
  88. +---------------------------------------+------------------------------------------------------+
  89. | in_anglvel_z_raw | Raw Z-axis gyroscope channel value. |
  90. +---------------------------------------+------------------------------------------------------+
  91. | in_deltaangl_scale | Scale for delta angle channels. |
  92. +---------------------------------------+------------------------------------------------------+
  93. | in_deltaangl_x_raw | Raw X-axis delta angle channel value. |
  94. +---------------------------------------+------------------------------------------------------+
  95. | in_deltaangl_y_raw | Raw Y-axis delta angle channel value. |
  96. +---------------------------------------+------------------------------------------------------+
  97. | in_deltaangl_z_raw | Raw Z-axis delta angle channel value. |
  98. +---------------------------------------+------------------------------------------------------+
  99. +----------------------------------+-------------------------------------------+
  100. | Temperature sensor related files | Description |
  101. +----------------------------------+-------------------------------------------+
  102. | in_temp0_raw | Raw temperature channel value. |
  103. +----------------------------------+-------------------------------------------+
  104. | in_temp0_scale | Scale for the temperature sensor channel. |
  105. +----------------------------------+-------------------------------------------+
  106. +-------------------------------+---------------------------------------------------------+
  107. | Miscellaneous device files | Description |
  108. +-------------------------------+---------------------------------------------------------+
  109. | name | Name of the IIO device. |
  110. +-------------------------------+---------------------------------------------------------+
  111. | sampling_frequency | Currently selected sample rate. |
  112. +-------------------------------+---------------------------------------------------------+
  113. | filter_low_pass_3db_frequency | Bandwidth for the accelerometer and gyroscope channels. |
  114. +-------------------------------+---------------------------------------------------------+
  115. The following table shows the adis16475 related device debug files, found in the
  116. specific device debug folder path ``/sys/kernel/debug/iio/iio:deviceX``.
  117. +----------------------+-------------------------------------------------------------------------+
  118. | Debugfs device files | Description |
  119. +----------------------+-------------------------------------------------------------------------+
  120. | serial_number | The serial number of the chip in hexadecimal format. |
  121. +----------------------+-------------------------------------------------------------------------+
  122. | product_id | Chip specific product id (e.g. 16475, 16500, 16505, etc.). |
  123. +----------------------+-------------------------------------------------------------------------+
  124. | flash_count | The number of flash writes performed on the device. |
  125. +----------------------+-------------------------------------------------------------------------+
  126. | firmware_revision | String containing the firmware revision in the following format ##.##. |
  127. +----------------------+-------------------------------------------------------------------------+
  128. | firmware_date | String containing the firmware date in the following format mm-dd-yyyy. |
  129. +----------------------+-------------------------------------------------------------------------+
  130. Channels processed values
  131. -------------------------
  132. A channel value can be read from its _raw attribute. The value returned is the
  133. raw value as reported by the devices. To get the processed value of the channel,
  134. apply the following formula:
  135. .. code-block:: bash
  136. processed value = (_raw + _offset) * _scale
  137. Where _offset and _scale are device attributes. If no _offset attribute is
  138. present, simply assume its value is 0.
  139. The adis16475 driver offers data for 5 types of channels, the table below shows
  140. the measurement units for the processed value, which are defined by the IIO
  141. framework:
  142. +-------------------------------------+---------------------------+
  143. | Channel type | Measurement unit |
  144. +-------------------------------------+---------------------------+
  145. | Acceleration on X, Y, and Z axis | Meters per Second squared |
  146. +-------------------------------------+---------------------------+
  147. | Angular velocity on X, Y and Z axis | Radians per second |
  148. +-------------------------------------+---------------------------+
  149. | Delta velocity on X. Y, and Z axis | Meters per Second |
  150. +-------------------------------------+---------------------------+
  151. | Delta angle on X, Y, and Z axis | Radians |
  152. +-------------------------------------+---------------------------+
  153. | Temperature | Millidegrees Celsius |
  154. +-------------------------------------+---------------------------+
  155. Usage examples
  156. --------------
  157. Show device name:
  158. .. code-block:: bash
  159. root:/sys/bus/iio/devices/iio:device0> cat name
  160. adis16505-2
  161. Show accelerometer channels value:
  162. .. code-block:: bash
  163. root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_raw
  164. -275924
  165. root:/sys/bus/iio/devices/iio:device0> cat in_accel_y_raw
  166. -30142222
  167. root:/sys/bus/iio/devices/iio:device0> cat in_accel_z_raw
  168. 261265769
  169. root:/sys/bus/iio/devices/iio:device0> cat in_accel_scale
  170. 0.000000037
  171. - X-axis acceleration = in_accel_x_raw * in_accel_scale = −0.010209188 m/s^2
  172. - Y-axis acceleration = in_accel_y_raw * in_accel_scale = −1.115262214 m/s^2
  173. - Z-axis acceleration = in_accel_z_raw * in_accel_scale = 9.666833453 m/s^2
  174. Show gyroscope channels value:
  175. .. code-block:: bash
  176. root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_x_raw
  177. -3324626
  178. root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_y_raw
  179. 1336980
  180. root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_z_raw
  181. -602983
  182. root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_scale
  183. 0.000000006
  184. - X-axis angular velocity = in_anglvel_x_raw * in_anglvel_scale = −0.019947756 rad/s
  185. - Y-axis angular velocity = in_anglvel_y_raw * in_anglvel_scale = 0.00802188 rad/s
  186. - Z-axis angular velocity = in_anglvel_z_raw * in_anglvel_scale = −0.003617898 rad/s
  187. Set calibration offset for accelerometer channels:
  188. .. code-block:: bash
  189. root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias
  190. 0
  191. root:/sys/bus/iio/devices/iio:device0> echo 5000 > in_accel_x_calibbias
  192. root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias
  193. 5000
  194. Set calibration offset for gyroscope channels:
  195. .. code-block:: bash
  196. root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_y_calibbias
  197. 0
  198. root:/sys/bus/iio/devices/iio:device0> echo -5000 > in_anglvel_y_calibbias
  199. root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_y_calibbias
  200. -5000
  201. Set sampling frequency:
  202. .. code-block:: bash
  203. root:/sys/bus/iio/devices/iio:device0> cat sampling_frequency
  204. 2000.000000
  205. root:/sys/bus/iio/devices/iio:device0> echo 1000 > sampling_frequency
  206. 1000.000000
  207. Set bandwidth for accelerometer and gyroscope:
  208. .. code-block:: bash
  209. root:/sys/bus/iio/devices/iio:device0> cat filter_low_pass_3db_frequency
  210. 720
  211. root:/sys/bus/iio/devices/iio:device0> echo 360 > filter_low_pass_3db_frequency
  212. root:/sys/bus/iio/devices/iio:device0> cat filter_low_pass_3db_frequency
  213. 360
  214. Show serial number:
  215. .. code-block:: bash
  216. root:/sys/kernel/debug/iio/iio:device0> cat serial_number
  217. 0x04f9
  218. Show product id:
  219. .. code-block:: bash
  220. root:/sys/kernel/debug/iio/iio:device0> cat product_id
  221. 16505
  222. Show flash count:
  223. .. code-block:: bash
  224. root:/sys/kernel/debug/iio/iio:device0> cat flash_count
  225. 150
  226. Show firmware revision:
  227. .. code-block:: bash
  228. root:/sys/kernel/debug/iio/iio:device0> cat firmware_revision
  229. 1.6
  230. Show firmware date:
  231. .. code-block:: bash
  232. root:/sys/kernel/debug/iio/iio:device0> cat firmware_date
  233. 06-27-2019
  234. 3. Device buffers
  235. =================
  236. This driver supports IIO buffers.
  237. All devices support retrieving the raw acceleration, gyroscope and temperature
  238. measurements using buffers.
  239. The following device families also support retrieving the delta velocity, delta
  240. angle and temperature measurements using buffers:
  241. - ADIS16477
  242. - ADIS16500
  243. - ADIS16505
  244. - ADIS16507
  245. However, when retrieving acceleration or gyroscope data using buffers, delta
  246. readings will not be available and vice versa.
  247. Usage examples
  248. --------------
  249. Set device trigger in current_trigger, if not already set:
  250. .. code-block:: bash
  251. root:/sys/bus/iio/devices/iio:device0> cat trigger/current_trigger
  252. root:/sys/bus/iio/devices/iio:device0> echo adis16505-2-dev0 > trigger/current_trigger
  253. root:/sys/bus/iio/devices/iio:device0> cat trigger/current_trigger
  254. adis16505-2-dev0
  255. Select channels for buffer read:
  256. .. code-block:: bash
  257. root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_deltavelocity_x_en
  258. root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_deltavelocity_y_en
  259. root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_deltavelocity_z_en
  260. root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_temp0_en
  261. Set the number of samples to be stored in the buffer:
  262. .. code-block:: bash
  263. root:/sys/bus/iio/devices/iio:device0> echo 10 > buffer/length
  264. Enable buffer readings:
  265. .. code-block:: bash
  266. root:/sys/bus/iio/devices/iio:device0> echo 1 > buffer/enable
  267. Obtain buffered data:
  268. .. code-block:: bash
  269. root:/sys/bus/iio/devices/iio:device0> hexdump -C /dev/iio\:device0
  270. ...
  271. 00001680 01 1f 00 00 ff ff fe ef 00 00 47 bf 00 03 35 55 |..........G...5U|
  272. 00001690 01 1f 00 00 ff ff ff d9 00 00 46 f1 00 03 35 35 |..........F...55|
  273. 000016a0 01 1f 00 00 ff ff fe fc 00 00 46 cb 00 03 35 7b |..........F...5{|
  274. 000016b0 01 1f 00 00 ff ff fe 41 00 00 47 0d 00 03 35 8b |.......A..G...5.|
  275. 000016c0 01 1f 00 00 ff ff fe 37 00 00 46 b4 00 03 35 90 |.......7..F...5.|
  276. 000016d0 01 1d 00 00 ff ff fe 5a 00 00 45 d7 00 03 36 08 |.......Z..E...6.|
  277. 000016e0 01 1b 00 00 ff ff fe fb 00 00 45 e7 00 03 36 60 |..........E...6`|
  278. 000016f0 01 1a 00 00 ff ff ff 17 00 00 46 bc 00 03 36 de |..........F...6.|
  279. 00001700 01 1a 00 00 ff ff fe 59 00 00 46 d7 00 03 37 b8 |.......Y..F...7.|
  280. 00001710 01 1a 00 00 ff ff fe ae 00 00 46 95 00 03 37 ba |..........F...7.|
  281. 00001720 01 1a 00 00 ff ff fe c5 00 00 46 63 00 03 37 9f |..........Fc..7.|
  282. 00001730 01 1a 00 00 ff ff fe 55 00 00 46 89 00 03 37 c1 |.......U..F...7.|
  283. 00001740 01 1a 00 00 ff ff fe 31 00 00 46 aa 00 03 37 f7 |.......1..F...7.|
  284. ...
  285. See ``Documentation/iio/iio_devbuf.rst`` for more information about how buffered
  286. data is structured.
  287. 4. IIO Interfacing Tools
  288. ========================
  289. See ``Documentation/iio/iio_tools.rst`` for the description of the available IIO
  290. interfacing tools.