Compute Parameter
Libraries:
Motor Control Blockset /
Signal Management
Description
The Compute Parameter block extends the functionality of compatible blocks available in the current model. The block customizes itself according to the settings of a compatible block and provides the parameters needed by the compatible block through either an output bus or multiple output signals.
You can use the Compute Parameter block parameters dialog box to select a compatible block by providing its relative path. The dialog box can also list the relative paths of all compatible blocks available in the current model, which you can then copy to the Relative path of compatible block that needs functional extension field in the dialog box.
For example, when you configure the Compute Parameter block to connect with Flux Observer block, the Compute Parameter block provides an output in the form of a bus. You can then connect this bus to the additional input port ParameterBus available in the Flux Observer block.
For the other compatible blocks, you can connect the Compute Parameter output signals to the corresponding additional input ports available in the compatible blocks.
Therefore, the block provides a functional extension to the compatible blocks by enabling them to accept parameter values at run-time. The block supports these compatible blocks:
It is recommended that you run this block at a rate that is slower than the task rate of compatible block to minimize the computation load in hardware targets.
Examples
Swap Motors with Single Deployment of Sensorless FOC Algorithm
Run a permanent magnet synchronous motor (PMSM) in an industrial drive application setup using a sensorless field-oriented control (FOC) algorithm. The example uses a sensorless Flux Observer to estimate the motor position. Industrial drives enable you to replace a motor with a new one without repeated deployment of code. An industrial drive setup needs only nameplate parameters to adapt the software to the new motor.
Ports
Input
Npp — Number of pole pairs available in motor
scalar
Number of pole pairs available in the motor.
Dependencies
To enable this port, set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the Flux Observer block in the current model.
Data Types: single
| double
| fixed point
R — Stator winding resistance
scalar
Stator phase winding resistance of the motor (in ohms).
Dependencies
To enable this port, set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the Flux Observer block in the current model.
Data Types: single
| double
| fixed point
Ld — Stator winding inductance along d-axis
scalar
Stator winding inductance of the motor along the d-axis (in henries).
Dependencies
To enable this port:
Set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the Flux Observer block in the current model.
Set the Motor selection parameter of the Flux Observer block to
PMSM
.
Data Types: single
| double
| fixed point
Lls — Stator leakage inductance
scalar
Leakage inductance of the induction motor stator winding (in henries).
Dependencies
To enable this port:
Set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the Flux Observer block in the current model.
Set the Motor selection parameter of the Flux Observer block to
ACIM
.
Data Types: single
| double
| fixed point
Llr — Rotor leakage inductance
scalar
Leakage inductance of the induction motor rotor winding (in henries).
Dependencies
To enable this port:
Set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the Flux Observer block in the current model.
Set the Motor selection parameter of the Flux Observer block to
ACIM
.
Data Types: single
| double
| fixed point
Lm — Magnetizing inductance of induction motor
scalar
Magnetizing inductance of the induction motor (in henries).
Dependencies
To enable this port:
Set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the Flux Observer block in the current model.
Set the Motor selection parameter of the Flux Observer block to
ACIM
.
Data Types: single
| double
| fixed point
fcutoff — Cutoff frequency of internal highpass filter
scalar
Cutoff frequency (in hertz) of the internal highpass filter that filters noise.
The Flux Observer block uses an internal first-order IIR highpass filter. Specify a frequency at this port that is lower than the lowest frequency corresponding to the minimum speed of the motor. For example, you can enter a value that is one-tenth of the lowest electrical frequency of the stator voltages and currents. You can adjust the value you specify at this port to determine a more accurate cutoff frequency that generates the desired block output.
Dependencies
To enable this port, set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the Flux Observer block in the current model.
Data Types: single
| double
| fixed point
NumSlits — Number of slits per phase
scalar
The number of slits available in each phase of the quadrature encoder.
Dependencies
To enable this port, set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the Quadrature Decoder block in the current model.
Data Types: single
| double
| fixed point
CountsPerSlit — Number of counts generated for every slit
scalar
The number of counts that the quadrature encoder generates for every slit. A count indicates a slit position. For example, set this port to 4 (quadrature mode) if you want the encoder to generate four counts corresponding to 00, 10, 11, and 01 slit positions or values. If you select the quadrature mode:
Encoder counts per revolution (post-quadrature) = Encoder counts per slit ✖ Encoder slits
Dependencies
To enable this port, set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the Quadrature Decoder block in the current model.
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 Relative path of compatible block that needs functional extension parameter to indicate the relative path of the I-F Controller block in the current model.
Data Types: single
| double
| fixed point
ω1 (RPM) — Speed (after motor starts) at which I-F control stops
scalar
Speed (after motor starts) until which the I-F controller remains active (in RPM). When the motor speed exceeds this value, the I-F controller becomes inactive and the Status block output turns true.
Dependencies
To enable this port, set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the I-F Controller block in the current model.
Data Types: single
| double
| fixed point
ω2 (RPM) — Speed required to re-enter I-F control
scalar
After exiting I-F control (and entering closed-loop control), speed required to reactivate the I-F controller (in RPM). When the motor speed falls below this value, the I-F controller becomes active again and the Status block output turns false.
Dependencies
To enable this port, set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the I-F Controller block in the current model.
Data Types: single
| double
| fixed point
Imax (A) — Maximum motor current during I-F control
scalar
Maximum current (in amperes) that is supplied to the motor when I-F control is active.
Dependencies
To enable this port, set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the I-F Controller block in the current model.
Data Types: single
| double
| fixed point
Max(Δω/Δt) (RPM/s) — Maximum rate of speed change during I-F control
scalar
Maximum rate at which motor speed can change (in RPM/s) when I-F control is active.
Dependencies
To enable this port, set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the I-F Controller block in the current model.
Data Types: single
| double
| fixed point
IDecayRate (A/s) — Maximum rate of current decay during I-F control
scalar
Maximum rate at which motor current can decay (in amperes/s) when I-F control is active.
Dependencies
To enable this port, set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the I-F Controller block in the current model.
Data Types: single
| double
| fixed point
TIdle (s) — Time of constant speed and current
scalar
Time (in seconds) during which both motor speed and current remains constant when I-F control is active.
Dependencies
To enable this port, set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the I-F Controller block in the current model.
Data Types: single
| double
| fixed point
ζ — Speed oscillation damping coefficient value
scalar
Value of the speed oscillation damping coefficient that the I-F Controller block should use.
Dependencies
To enable this port, set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the I-F Controller block in the current model.
Data Types: single
| double
| fixed point
Output
ParameterBus — Computed parameters for flux observer and I-F controller
bus
Computed parameters for the Flux Observer and I-F Controller blocks.
Dependencies
To enable this port, set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of either the Flux Observer or the I-F Controller block in the current model.
Data Types: single
CountsPerRev — Number of counts per revolution
scalar
Number of counts the quadrature encoder generates for each revolution.
CountsPerRev = Encoder slits ⨯ Encoder counts per slit
Dependencies
To enable this port, set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the Quadrature Decoder block in the current model.
Data Types: single
1/CountsPerRev — Inverse of number of counts per revolution
scalar
The block outputs the inverse of the number of counts the quadrature encoder generates for each revolution at this port.
1/CountsPerRev = 1/(Encoder slits ⨯ Encoder counts per slit)
Dependencies
To enable this port, set the Relative path of compatible block that needs functional extension parameter to indicate the relative path of the Quadrature Decoder block in the current model.
Data Types: single
Parameters
Relative path of compatible block that needs functional extension — Relative path of compatible block
blank (default) | string
Relative path of the compatible block from the current model that needs functional extension.
Get a list of supported block paths in the model — Obtain list of compatible block paths
button
Click this button to obtain a list of relative paths of all compatible blocks in the current model. The block displays this list in the Supported block paths section.
Copy and paste the relevant path from the list in the Relative path of compatible block that needs functional extension parameter to configure this block.
Supported block paths — List of compatible block paths
display cell
This section displays the list of relative paths of the compatible blocks in the current model.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced in R2024a
See Also
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
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)