gyroparams
Gyroscope sensor parameters
Description
The gyroparams
class creates a gyroscope sensor parameters
object. You can use this object to model a gyroscope when simulating an IMU with imuSensor
. See the
Algorithms section of imuSensor
for details
of gyroparams
modeling.
Creation
Description
returns an ideal
gyroscope sensor parameters object with default values.params
= gyroparams
configures params
= gyroparams(Name,Value
)gyroparams
object properties using
one or more Name,Value
pair arguments.
Name
is a property name and Value
is
the corresponding value. Name
must appear inside single
quotes (''
). You can specify several name-value pair
arguments in any order as Name1,Value1,...,NameN,ValueN
. Any
unspecified properties take default values.
Properties
MeasurementRange
— Maximum sensor reading (rad/s)
Inf
(default) | real positive scalar
Maximum sensor reading in rad/s, specified as a real positive scalar.
Data Types: single
| double
Resolution
— Resolution of sensor measurements ((rad/s)/LSB)
0
(default) | real nonnegative scalar
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
ConstantBias
— Constant sensor offset bias (rad/s)
[0 0 0]
(default) | real scalar | real 3-element row vector
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
AxesMisalignment
— Sensor axes skew (%)
diag([100 100 100])
(default) | scalar | 3-element row vector | 3-by-3 matrix
Sensor axes skew in percentage, specified as a scalar, a 3-element row vector, or a 3-by-3 matrix. 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 state vmeasure is obtained from the true state vtrue via the misalignment matrix as:
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 [a b c], then m21 = m31 = a, m12 = m32 = b, and m13 = m23 = c. All the diagonal elements are 100.
Data Types: single
| double
NoiseDensity
— Power spectral density of sensor noise ((rad/s)/√Hz)
[0 0 0]
(default) | real scalar | real 3-element row vector
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
BiasInstabilityCoefficients
— Filter coefficients for bias instability noise generation
fractalcoef
(default) | structure
Filter coefficients for bias instability noise generation, specified as a structure. The structure has these fields:
Numerator
— Numerator coefficients, specified as a real-valued vector.Denominator
— Denominator coefficients, specified as a real-valued vector.
To specify coefficients for fractal noise, use the fractalcoef
function.
Example: struct(Numerator=1,Denominator=[1 -0.5])
Data Types: struct
BiasInstability
— Instability of the bias offset (rad/s)
[0 0 0]
(default) | real scalar | real 3-element row vector
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
RandomWalk
— Integrated white noise of sensor ((rad/s)(√Hz))
[0 0 0]
(default) | real scalar | real 3-element row vector
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
NoiseType
— Type of random noise
"double-sided"
(default) | "single-sided"
Type of random noise, specified as:
"double-sided"
— Random noise coefficients have a scale factor of 2."single-sided"
— Random noise coefficients have a scale factor of 1.
Data Types: char
| string
TemperatureBias
— Sensor bias from temperature ((rad/s)/℃)
[0 0 0]
(default) | real scalar | real 3-element row vector
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
TemperatureScaleFactor
— Scale factor error from temperature (%/℃)
[0 0 0]
(default) | real scalar in the range [0,100] | real 3-element row vector in the range [0,100]
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
AccelerationBias
— Sensor bias from linear acceleration (rad/s)/(m/s2)
[0 0 0]
(default) | real scalar | real 3-element row vector
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
Generate Gyroscope Data from Stationary Inputs
Generate gyroscope data for an imuSensor object from stationary inputs.
Generate a gyroscope parameter object with a maximum sensor reading of 4.363 and a resolution of 1.332e-4 . The constant offset bias is 0.349 . The sensor has a power spectral density of 8.727e-4 . The bias from temperature is 0.349 . The scale factor error from temperature is 0.02%. The sensor axes are skewed by 2%. The sensor bias from linear acceleration is 0.178e-3
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')
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2018bR2023b: Specify bias instability noise coefficients and noise type
You can use the new BiasInstabilityCoefficients
property of the gyroparams
object to specify the coefficients of the transfer function used to generate the bias instability noise. Additionally, you can use the new NoiseType
property of this object to set the scale factor of the noise coefficients as 1
or 2
.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)