Main Content

Mechanical to Electrical Position

Compute electrical position of rotor from mechanical position

  • Library:
  • Motor Control Blockset / Sensor Decoders

Description

The Mechanical to Electrical Position block computes the electrical position of rotor by using its mechanical position and mechanical offset value.

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

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

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

Number of pole pairs available in the motor.

Unit of the mechanical position of the rotor.

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.

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.

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

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

Introduced in R2020a