Mechanical to Electrical Position
Libraries:
Motor Control Blockset /
Sensor Decoders
Motor Control Blockset HDL Support /
Sensor Decoders
Description
The Mechanical to Electrical Position block computes the electrical position of rotor by using its mechanical position, mechanical offset value, and the number of pole-pairs.
Examples
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).
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).
Ports
Input
θm — Mechanical position of rotor
scalar
The mechanical position of rotor (as output by the rotor position sensor) in either radians (0 to 2), degrees (0 to 360), or per unit (0 to 1).
Data Types: single
| double
| fixed point
Npp — Number of pole pairs available in motor
scalar
Number of pole pairs available in the motor.
Dependencies
To enable this port, set the Pole pairs input parameter to
Input port
.
Data Types: single
| double
| fixed point
Offset — Mechanical position offset
scalar
The amount by which the electrical zero of the rotor deviates from the mechanical zero position. Unit of offset is identical to the unit of the mechanical position input.
Dependencies
To enable this port, set Specify offset via to
Input port
.
Data Types: single
| double
| fixed point
Note
The values that you specify at all the input ports should have the same data type.
Output
θe — Electrical position of rotor
scalar
The electrical position of the rotor with a range that is identical to that of the mechanical position input. Data type of the electrical position is identical to that of the input.
Data Types: single
| double
| fixed point
Parameters
Pole pairs input — Method to specify number of pole pairs available in motor
Specify via dialog
(default) | Input port
The method you want to use to specify the number of pole pairs available in the
motor. Select Input port
to enable and use the input port
Npp. Select Specify via
dialog
to provide the number of pole pairs using the dialog box.
Number of pole pairs — Number of pole pairs available in motor
4
(default) | scalar
Number of pole pairs available in the motor.
Dependencies
To enable this parameter, set the Pole pairs input parameter
to Specify via dialog
.
Input mechanical angle unit — Unit of mechanical position of rotor
Per unit
(default) | Radians
| Degrees
Unit of the mechanical position of the rotor.
Offset input type — Method to specify offset
Input port
(default) | Specify via dialog
Method to specify the mechanical position offset.
Select
Input port
to enable and use the input port Offset.Select
Specify via dialog
to enable the Mechanical offset parameter and provide the offset value.
Mechanical offset — Value of mechanical position offset
0
(default) | scalar
Specify the mechanical position offset value in this parameter. The unit of the offset must be identical to the unit of the mechanical position input.
Dependencies
To enable this parameter, set Offset input type to
Specify via dialog
.
Input data type — Data type of input ports
single
(default) | double
| fixed point
The data type that you want to use for the input ports.
Note
If you select fixed point input data type and provide fixed point values to the input ports, the block runs faster when deployed on hardware.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
HDL Code Generation
Generate VHDL, Verilog and SystemVerilog code for FPGA and ASIC designs using HDL Coder™.
HDL Coder™ provides additional configuration options that affect HDL implementation and synthesized logic.
This block has one 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
|
Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.
Version History
Introduced in R2020a
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 (한국어)