Speed Measurement
Compute speed from rotor angular position
Libraries:
Motor Control Blockset /
Sensor Decoders
Motor Control Blockset HDL Support /
Sensor Decoders
Description
The Speed Measurement block calculates the angular speed from the angular position of the rotor by calculating the change in the angular position with respect to time.
Examples
Field-Oriented Control of Induction Motor Using Speed Sensor
Implements the field-oriented control (FOC) technique to control the speed of a three-phase AC induction motor (ACIM). The FOC algorithm requires rotor speed feedback, which is obtained in this example by using a quadrature encoder sensor. For details about FOC, see Field-Oriented Control (FOC).
Field-Weakening Control (with MTPA) of PMSM
Implements the field-oriented control (FOC) technique to control the torque and speed of a three-phase permanent magnet synchronous motor (PMSM). The FOC algorithm requires rotor position feedback, which is obtained by a quadrature encoder sensor. For details about FOC, see Field-Oriented Control (FOC).
Field-Oriented Control of PMSM Using Hall Sensor
Implements the field-oriented control (FOC) technique to control the speed of a three-phase permanent magnet synchronous motor (PMSM). The FOC algorithm requires rotor position feedback, which is obtained by a Hall sensor. For details about FOC, see Field-Oriented Control (FOC).
Field-Oriented Control of PMSM Using Quadrature Encoder
Implements the field-oriented control (FOC) technique to control the speed of a three-phase permanent magnet synchronous motor (PMSM). The FOC algorithm requires rotor position feedback, which is obtained by a quadrature encoder sensor. For details about FOC, see Field-Oriented Control (FOC).
Ports
Input
Angular position of the rotor specified in either radians, degrees, or per-unit.
Data Types: single
| double
| fixed point
The fixed time interval (in seconds) between every two consecutive instances of block execution.
Dependencies
To enable this port, select the Advanced Options > Use input port for Discrete step size parameter.
Data Types: single
| double
| fixed point
Output
Angular speed that the block computes based on the angular position input.
Data Types: single
| double
| fixed point
Parameters
The unit of the angular position θ
.
Range used to map input position internally to fit in the unsigned integer datatype.
For example, the block scales an input in the range (0 - 2π)
to
(0 - (232-1))
for uint32
datatype.
The speed calculation method used in the block. The selected method determines the range of the rotor speed that the block can measure.
These parameters change values according to the Speed calculation criteria parameter:
Parameter name | Maximum application speed | Speed Resolution | Time interval for speed calculation |
---|---|---|---|
Delays for speed calculation (number of samples) |
| 28 | 28 |
Maximum measurable speed (RPM) |
| 10344.8276 | 10713.2857 |
Measurable speed resolution (RPM) |
| 4.9892e-06 | 4.9892e-06 |
The fixed time interval (in seconds) between every two consecutive instances of block execution.
These parameters change values according to the Discrete step size (s) parameter value:
Delays for speed calculation (number of samples)
Maximum measurable speed (RPM)
Measurable speed resolution (RPM)
Dependencies
To enable this parameter, clear the Advanced Options > Use input port for Discrete step size parameter.
The maximum rotor speed (in rotations per minute) that the block can measure.
These parameters change values according to the Maximum application speed (RPM) parameter value:
Delays for speed calculation (number of samples)
Maximum measurable speed (RPM)
Measurable speed resolution (RPM)
Dependencies
To enable this parameter, set Speed calculation criteria to
Maximum application speed
.
The minimum value of change in the θ
input per unit time that the
block can detect.
These parameters change values according to the Speed Resolution (RPM) parameter value:
Delays for speed calculation (number of samples)
Maximum measurable speed (RPM)
Measurable speed resolution (RPM)
Dependencies
To enable this parameter, set Speed calculation criteria to
Speed resolution
.
The number of samples of the angular position input that the block measures to compute the average position value.
These parameters change values according to the Delays for speed calculation (number of samples) parameter value:
Maximum measurable speed (RPM)
Measurable speed resolution (RPM)
Note
The maximum limit for Delays for speed calculation (number of samples) parameter is set at 2^30 (or 1073741824). This limit affects the values of Maximum measurable speed (RPM) and Measurable speed resolution (RPM) parameters, and they may not always match the desired values.
Dependencies
To enable this parameter, set Speed calculation criteria to
Time interval for speed calculation
.
The absolute maximum speed that the block can measure.
This parameter is not configurable and uses a value that is internally computed using other parameters.
The minimum speed resolution that the block uses for speed computation. It is always less than or equal to Speed Resolution (RPM).
This parameter is not configurable and uses a value that is internally computed using other parameters.
Unit of the angular speed output.
Specify the speed in RPM for per-unit calculation.
Dependencies
This parameter appears only if Per unit based on dialog
is selected for Speed unit.
The data type of the angular speed output ⍵
.
Note
The Speed Measurement block may occasionally display the warning message
'Wrap on overflow detected
.'
Select this parameter if you want to specify the sample step size using an input port.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
HDL Coder™ provides additional configuration options that affect HDL implementation and synthesized logic.
This block has a single, default HDL architecture.
ConstrainedOutputPipeline | Number of registers to place at
the outputs by moving existing delays within your design. Distributed
pipelining does not redistribute these registers. The default is
|
InputPipeline | Number of input pipeline stages
to insert in the generated code. Distributed pipelining and constrained
output pipelining can move these registers. The default is
|
OutputPipeline | Number of output pipeline stages
to insert in the generated code. Distributed pipelining and constrained
output pipelining can move these registers. The default is
|
SharingFactor | Number of functionally equivalent resources to map to a single shared resource. The default is 0. See also Resource Sharing (HDL Coder). |
Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.
Version History
Introduced in R2020aThe Block Parameters dialog box now includes the Use input port for Discrete step size parameter for you to specify a discrete step size from a separate input port Ts.
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)