Main Content

gyroparams

陀螺仪传感器parameters

Description

Thegyroparamsclass creates a gyroscope sensor parameters object. You can use this object to model a gyroscope when simulating an IMU withimuSensor. See theAlgorithmssection ofimuSensorfor details ofgyroparamsmodeling.

Creation

Description

params= gyroparamsreturns an ideal gyroscope sensor parameters object with default values.

params= gyroparams(Name,Value)configuresgyroparamsobject properties using one or moreName,Valuepair arguments.Nameis a property name andValueis the corresponding value.Namemust appear inside single quotes (''). You can specify several name-value pair arguments in any order asName1,Value1,...,NameN,ValueN. Any unspecified properties take default values.

Properties

expand all

Maximum sensor reading in rad/s, specified as a real positive scalar.

Data Types:single|double

Resolution of sensor measurements in (rad/s)/LSB, specified as a real nonnegative scalar. Here, LSB is the acronym for least significant bit.

Data Types:single|double

Constant sensor offset bias in rad/s, specified as a real scalar or 3-element row vector. Any scalar input is converted into a real 3-element row vector where each element has the input scalar value.

Data Types:single|double

Sensor axes skew in percentage, specified as a scalar, a 3-element row vector, or a 3-by-3 matrix with values ranging from0to100. The diagonal elements of the matrix account for the misalignment effects for each axes. The off-diagonal elements account for the cross-axes misalignment effects. The measured statevmeasureis obtained from the true statevtruevia the misalignment matrix as:

v m e a s u r e = 1 100 M v t r u e = 1 100 [ m 11 m 12 m 13 m 21 m 22 m 23 m 31 m 32 m 33 ] v t r u e

  • If you specify the property as a scalar, then all the off-diagonal elements of the matrix take the value of the specified scalar and all the diagonal elements are 100.

  • If you specify the property as a vector [abc], thenm21=m31=a,m12=m32=b, andm13=m23=c. All the diagonal elements are 100.

Data Types:single|double

Power spectral density of sensor noise in (rad/s)/√Hz, specified as a real scalar or 3-element row vector. This property corresponds to the angle random walk (ARW). Any scalar input is converted into a real 3-element row vector where each element has the input scalar value.

Data Types:single|double

Instability of the bias offset in rad/s, specified as a real scalar or 3-element row vector. Any scalar input is converted into a real 3-element row vector where each element has the input scalar value.

Data Types:single|double

Integrated white noise of sensor in (rad/s)(√Hz), specified as a real scalar or 3-element row vector. Any scalar input is converted into a real 3-element row vector where each element has the input scalar value.

Data Types:single|double

Sensor bias from temperature in ((rad/s)/℃), specified as a real scalar or 3-element row vector. Any scalar input is converted into a real 3-element row vector where each element has the input scalar value.

Data Types:single|double

Scale factor error from temperature in (%/℃), specified as a real scalar or 3-element row vector with values ranging from 0 to 100. Any scalar input is converted into a real 3-element row vector where each element has the input scalar value.

Data Types:single|double

Sensor bias from linear acceleration in (rad/s)/(m/s2), specified as a real scalar or 3-element row vector. Any scalar input is converted into a real 3-element row vector where each element has the input scalar value.

Data Types:single|double

Examples

collapse all

Generate gyroscope data for an imuSensor object from stationary inputs.

Generate a gyroscope parameter object with a maximum sensor reading of 4.363 rad / s and a resolution of 1.332e-4 ( rad / s ) / LSB . The constant offset bias is 0.349 rad / s . The sensor has a power spectral density of 8.727e-4 r a d / s / H z . The bias from temperature is 0.349 r a d / s / 0 C . The bias from temperature is 0.349 ( rad / s 2 ) / 0 C . The scale factor error from temperature is 0.2% / 0 C . The sensor axes are skewed by 2%. The sensor bias from linear acceleration is 0.178e-3 ( r a d / s ) / ( m / s 2 )

params = gyroparams('MeasurementRange',4.363,'Resolution',1.332e-04,“ConstantBias”,0.349,'NoiseDensity',8.727e-4,'TemperatureBias',0.349,'TemperatureScaleFactor',0.02,'AxesMisalignment',2,'AccelerationBias',0.178e-3);

Use a sample rate of 100 Hz spaced out over 1000 samples. Create the imuSensor object using the gyroscope parameter object.

Fs = 100; numSamples = 1000; t = 0:1/Fs:(numSamples-1)/Fs; imu = imuSensor('accel-gyro','SampleRate', Fs,'Gyroscope', params);

Generate gyroscope data from the imuSensor object.

orient = quaternion.ones(numSamples, 1); acc = zeros(numSamples, 3); angvel = zeros(numSamples, 3); [~, gyroData] = imu(acc, angvel, orient);

Plot the resultant gyroscope data.

plot(t, gyroData) title('Gyroscope') xlabel('s') ylabel('rad/s')

Figure contains an axes object. The axes object with title Gyroscope contains 3 objects of type line.

Extended Capabilities

C / c++代码生成
Generate C and C++ code using MATLAB® Coder™.

版本历史

Introduced in R2018b