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 and mechanical offset value.
Examples
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
Offset — Mechanical position offset
scalar
The deviation of the rotor's electrical zero 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
.Inputs must be of the same data type.
Data Types: single
| double
| fixed point
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
Number of pole pairs — Number of pole pairs available in motor
4
(default) | scalar
Number of pole pairs available in the motor.
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
The method you want to use to specify the mechanical position offset. Select
Input port
to enable and use the input port
Offset
. Select Specify via dialog
to
provide the offset value using the dialog box.
Mechanical offset — Value of mechanical position offset
0
(default) | scalar
The unit of the offset is identical to that of the unit of the mechanical position input.
Dependencies
To enable this parameter, set Specify offset via 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
The block runs faster, if you select either
fixdt(1,16,0)
or
fixdt(1,16,2^0,0)
input data type and provide fixed point
values to the input ports.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
HDL Code Generation
Generate Verilog and VHDL 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)