Main Content

ICM20948 IMU Sensor

Measure linear acceleration, angular velocity, magnetic field, and temperature from ICM20948 IMU sensor

Since R2022b

Add-On Required: This feature requires the Simulink Support Package for Raspberry Pi Hardware add-on.

  • block icon for ICM20948 IMU sensor

Libraries:
Simulink Support Package for Raspberry Pi Hardware / Sensors / IMU Sensors

Description

The ICM20948 IMU Sensor block outputs the values of linear acceleration, angular velocity, and magnetic field strength along x-, y- and z- axes as measured by the ICM20948 IMU sensor connected to Raspberry Pi® board. The block also outputs the temperature as read by the ICM20948 IMU sensor.

Ports

Output

expand all

The Acceleration port outputs acceleration in m/s2 along the x-, y-, and z- axes of the sensor as a 1-by-3 vector.

Dependencies

This output port appears only if you select the Acceleration (m/s2) parameter.

Data Types: single (default) | double

The Angular Rate port outputs angular velocity in radians per second (rad/s) along the x-, y-, and z- axes of the sensor as a 1-by-3 vector.

Dependencies

This output port appears only if you select the Angular Velocity (rad/s) parameter.

Data Types: single (default) | double

The Magnetic Field port outputs Magnetic field strength in µT along the x-, y-, and z- axes of the sensor as a 1-by-3 vector.

Dependencies

This output port appears only if you select the Magnetic Field (µT) parameter.

Data Types: single (default) | double

Temperature (in ℃) measured by ICM20948 IMU sensor connected to Raspberry Pi board.

Dependencies

This output port appears only if you select the Temperature (℃) parameter.

Data Types: single | double

Status of acceleration value, angular rate, magnetometer measurement, and temperature along the three axes, specified as a [1X2] vector of uint8 values. First element represents status of acceleration, angular rate, and temperature measurements and second element represents status of magnetometer measurements. Status indicates if the data read is the new value or not. 0 indicates that the data read is new and 1 indicates that the data read is not new.

Dependencies

This output port appears only if you select the Status parameter.

Note

Status parameter will not be available if you select Generate data ready interrupt parameter.

Data Types: uint8

Parameters

expand all

Specify the module on the board that you are using for I2C communication.

The I2C address of the ICM20948 IMU sensor from which the block reads the values. The ICM20948 sensor can have two I2C addresses depending on the logic level on pin AD0 of the sensor.

Pin NamePin StateI2C Address
AD0Low0x68
High0x69

If this option is selected, an interrupt is generated on pin INT1 of the sensor when data is ready. Using this option, you can trigger other subsystems to perform any action. For more information, see Estimate Orientation Using AHRS Filter and IMU Data in Simulink.

Select the logic level for INT1 pin as Active high or Active low.

Dependencies

This parameter appears only if you select the Generate data ready interrupt parameter.

Select this parameter to set Acceleration as one of the output ports.

Select this parameter to set Angular Rate as one of the output ports.

Select this parameter to set Magnetic Field as one of the output ports.

Select this parameter to set Temperature as one of the output ports.

Select this parameter to set Status as one of the output ports. This parameter will not be available if Generate data ready interrupt parameter is selected.

Specify the datatype for acceleration, angular rate, magnetic field, and temperature outputs.

Specify how often this block reads the data from the ICM20948 IMU sensor. When you set this parameter to -1, Simulink determines the best sample time for the block based on the block context within the model.

Accelerometer Settings

Select the range of acceleration that the accelerometer can measure.

Enter the output data rate between 0.3 Hz to 1125 Hz, at which accelerometer data is sampled.

Accelerometer data output rate in Hz is determined by the following calculation.

1125/(1+ACCEL_SMPLRT_DIV)Hz, where ACCEL_SMPLRT_DIV is 0,1,2,...4095.

Depending on the output data rate specified on the block mask, ACCEL_SMPLRT_DIV will be set on the sensor.

Specify the 3 dB bandwidth of accelerometer low pass filter.

Gyroscope Settings

Specify the maximum angular velocity that the gyroscope can measure per second.

Enter the output data rate between 4.4 Hz to 1125 Hz, at which gyroscope data is sampled.

Gyroscope data output rate in Hz is determined by the following calculation.

1125/(1+GYRO_SMPLRT_DIV)Hz, where GYRO_SMPLRT_DIV is 0,1,2,...255.

Depending on the output data rate specified on the block mask, GYRO_SMPLRT_DIV will be set on the sensor.

Specify the 3 dB bandwidth of gyroscope low pass filter.

Magnetometer Settings

Select the output data rate at which magnetometer data is sampled.

Temperature sensor Settings

Specify the noise bandwidth (NBW) of temperature low pass filter in Hz.

Version History

Introduced in R2022b