PinePhone Sensors and Navigation

From PINE64
Revision as of 16:39, 20 March 2021 by Xalius (talk | contribs) (→‎Drivers)
Jump to navigation Jump to search

DRAFT

Overview

The Pinephone contains various components that enable or aid orientation and navigation tasks.

  • Multi-GNSS Receiver as part of the cellular modem (GPS/Galileo/Glonass/BeiDou)
  • IMU (Inertial Measurment Unit), combined Accelerometer and Gyroscope sensor (MPU6050)
  • Magnetometer (LIS3MDL or AF8133J)

...

[TODO: add block diagram]

Hardware

Quectel EG25G Modem / GNSS Receiver

[TODO: add interfaces, constraints, antenna location]

Invensense/TDK MPU6050 IMU

Key features:

  • Digital-output X-, Y-, and Z-Axis angular rate sensors (gyroscopes) with selectable range of ±250, ±500, ±1000, and ±2000°/sec
  • Digital-output triple-axis accelerometer with a programmable full scale range of ±2g, ±4g, ±8g and ±16g
  • 400kHz Fast Mode I2C for communicating with all registers

ST LIS3MDL Magnetometer/Compass

Key features:

  • ±4/±8/±12/±16 gauss selectable magnetic full scale range
  • 16-bit data output
  • ...

VTC AF8133J Magnetometer/Compass

Key features:

  • ±12/±22 gauss selectable magnetic full scale range
  • 400Hz max. update rate
  • 16-bit data output


Sensor reference frames

The sensors are mounted on the Pinephone's main board in different positions and orientations, for the purpose of orientation and navigation it is important to know the relationship between the sensor coordinate frames and the body frame of the phone...

[TODO: add sensor mounting positions/orientation in respect to body frame, introduce coordinate systems]

As a basis for software development, a common body coordinate system has to be established along with it's relation to a world coordinate system...

[TODO: explain body reference choices, north-east-down world coordinates]

Software

Drivers

[TODO: i2cdev, linux-iio, support matrix]

  • MPU6050:inv_mpu6050, inv_mpu6050_i2C, industrialio
  • LIS3MDL: st_sensors, st_sensors_i2c, st_magn, st_magn_i2c, industrialio
	iio:device1: lis3mdl (buffer capable)
		4 channels found:
			magn_x:  (input, index: 0, format: le:S16/16>>0)
			3 channel-specific attributes found:
				attr  0: raw value: 6766
				attr  1: scale value: 0.000146
				attr  2: scale_available value: 0.000146 0.000292 0.000438 0.000584
			magn_y:  (input, index: 1, format: le:S16/16>>0)
			3 channel-specific attributes found:
				attr  0: raw value: -2046
				attr  1: scale value: 0.000146
				attr  2: scale_available value: 0.000146 0.000292 0.000438 0.000584
			magn_z:  (input, index: 2, format: le:S16/16>>0)
			3 channel-specific attributes found:
				attr  0: raw value: 12726
				attr  1: scale value: 0.000146
				attr  2: scale_available value: 0.000146 0.000292 0.000438 0.000584
			timestamp:  (input, index: 3, format: le:S64/64>>0)
		3 device-specific attributes found:
				attr  0: current_timestamp_clock value: realtime
				attr  1: sampling_frequency value: 1
				attr  2: sampling_frequency_available value: 1 2 3 5 10 20 40 80
		2 buffer-specific attributes found:
				attr  0: data_available value: 0
				attr  1: watermark value: 1
		Current trigger: trigger0(lis3mdl-trigger)

OS level services

[TOOD: modem manager, ofono, gpsd, iio-sensor-proxy, geoclue]

Tools/Utilities

[TODO: minicom, gpsmon, monitor-sensor, iio-utils...]

Applications

[TODO: pure-maps, navit, ...]

Development

[TODO: Open issues, tasks, projects]

  • AGPS integration
  • Raw magnetometer data + calibration in iio-sensor-proxy
  • Compass App