ms: Motion Sensor |
Top Previous Next |
The latest generation of automotive NX32L devices offers a powerful set of inertial sensors that can be used for applications, such as driving behavior analysis, activity monitoring, indoor positioning, virtual ignition, and crash detection. By combining the inertial sensors with the GNSS sensor enhanced navigation and dead reckoning applications can be implemented.
The full 3-axis accelerometer, gyroscope, and magnetometer are tightly integrated into the RTCU M2M Platform with a uniform motion sensor interface and full support for power management for the most demanding applications.
The motion sensor interface gives the basic tools needed to use the embedded sensors and can thus be used to develop sensor fusion applications.
SensorsWith this interface comes access to simultaneous sets of accelerometer, gyroscope and magnetometer measurements.
Accelerometer: The accelerometer measures accelerations. This is useful to measure changes in velocity and changes in position (by integrating the signal). The interface delivers accelerometer data in units of gravity G (SI standard: 1.0 m/s2 [meters per second squared]), with a maximum range of [-16.0G : +16.0G]. The accelerometer measurements represents the resulting forces acting on the device. Static forces as the gravity pull can be observed, but it is also possible to get the relative measurements, thus representing the actual changes in velocity of the device in any given direction.
Gyroscope: The gyroscope measures changes in the orientation. The interface delivers gyroscope data in units of degrees per second (dps), with a maximum range of [-2000.0dps : +2000.0dps]. The gyroscope data represents the rotational changes of the device in any given direction. With no movement of the device, the gyroscope ideally measures zero on all axis. With calibration from knowing the direction of gravity with the accelerometer, it is thus possible to know the orientation of the device in 3-dimensional space (yaw, pitch and roll) with high precision.
Magnetometer: The magnetometer measures magnetic fields. Because the earth has a significant magnetic field, the magnetometer can be used as a compass. The interface delivers magnetometer data in units of gauss (SI standard: 1/10000 Tesla), with a maximum range of [-50.0gauss : +50.0gauss]. The magnetometer data represents the magnetic impact on the device from the surrounding environment. It is thus possible to measure the magnetic north in an area with low magnetic disturbances. Radar pulses with a time frame greater than the sampling frequency will also be detectable.
Architecture of the Motion Sensor InterfaceThe Motion Sensor interface is based on an asynchronous event-based model, where solicited as well as unsolicited events from the sensors are automatically queued and delivered to the user application. The function msWaitEvent is used to return information about the various events arriving from the sensors. This model eliminates the requirement for the application to continuously poll for messages, and it also encourages use of multithreading with the added benefits that comes with this. Events that are triggered by the application requesting various information from the sensors are therefore called solicited events, or alternatively they can be triggered by the sensors, and are therefore instead called unsolicited events. A solicited event is for example, when the application calls msLoggerStop and then msWaitEvent returns with event# 4. An unsolicited event works exactly the same way as a solicited event, except for the fact that msLoggerStop is no longer called by the application. Please consult msWaitEvent for detailed information about the various events and how they are handled.
The following functions and structures are used to access the Motion Sensor interface:
Interface and setupThe following functions are used to access the interface and set global motion sensor settings.
Data acquisitionThe following functions and structures are used to start various sensors and get data.
Data loggerThe following functions and structures are used to log sensor data to buffers and read the data.
Event handlingThe following functions and structures and used to manage and read sensor and logging related events.
Power managementThe following functions are used to add wake-up sources to power management.
Calculation functionsThe following functions are used to perform calculations on the sensor data.
For the acceleration and shock events to be detected, the accelerometer must be enabled with logger functionality running. See example under msEventRegister.
Only one acceleration event handler configuration and one shock event handler configuration can be active at a time. Only 8 loggers can be in the system at a time.
|