Main Content

Mechanical to Electrical Position

Compute electrical position of rotor from mechanical position

Since R2020a

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

Ports

Input

expand all

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

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

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

expand all

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

expand all

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 available in the motor.

Dependencies

To enable this parameter, set the Pole pairs input parameter to Specify via dialog.

Unit of the mechanical position of the rotor.

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.

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.

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™.

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Version History

Introduced in R2020a