Superposition Signal Generator
Generate superposition input signal for plant frequency response estimation
Since R2024b
Libraries:
Simulink Control Design /
Signal Generation
Description
Use this block to generate superimposed sinusoidal input perturbation signals. This block allows you to generate scalar or vector signals including three-phase sin, cos, or both (sincos) signals. Three-phase signals are helpful when you want to identify frequency response of three-phase AC power systems. For example, you can use the generated signal to measure impedance of a power inverter which connects renewable energy resources to three-phase AC power grids
This block is helpful when you want to generate perturbation signals to inject in your plant models in desktop simulation or on hardware through code generation. You can then collect the plant response data to the perturbation signal and perform custom processing to identify plant characteristics.
Examples
Use Superposition Signal Generator Block for Offline Frequency Response Estimation
Estimate frequency responses offline using the Superposition Signal Generator block.
- Since R2024b
- Open Live Script
Ports
Input
start/stop — Start and stop the signal generation
scalar
To start and stop the signal generation process, provide a signal at the start/stop port. When the value of the signal changes from:
Negative or zero to positive, the signal generation starts
Positive to negative or zero, the signal generation stops
Typically, you can use a signal that changes from 0 to 1 to start the experiment, and from 1 to 0 to stop it. When the experiment is not running, the block does not generate a perturbation at the output port.
Generate a perturbation signal which is long enough for the algorithm to collect sufficient data for a good estimate at all frequencies it probes. The block displays a recommended experiment length in the Signal Length section of the block parameters. This value is based on the block parameters you specify. The recommended experiment length is six times the longest period.
Data Types: single
| double
w — Frequencies for estimation experiment
vector
Supply a value for the Frequencies parameter. See the Frequencies parameter for information about how to choose frequencies.
When you supply frequencies via this port, specify the number of frequencies with the Number of frequencies parameter.
Dependencies
To enable this port, in Excitation Signal Source, select External ports.
Data Types: single
| double
amp — Perturbation amplitudes
scalar | vector
Supply a value for the Amplitudes parameter. See the Amplitudes parameter for details.
Dependencies
To enable this port, in Excitation Signal Source, select External Ports.
Data Types: single
| double
Output
sin, cos, sincos — Superposition perturbation signal
scalar | vector
Superimposed sinusoidal perturbation signal.
Data Types: single
| double
3ϕ-sin, 3ϕ-cos, 3ϕ-sincos — Three-phase superposition perturbation signal
vector
Three-phase superposition perturbation signal.
To extract each phase in the output signal, use a Demux block.
Dependencies
To enable this port, select Generate three-phase perturbation signal.
Data Types: single
| double
Parameters
To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.
Sample time (Ts) — Sample time
0.1 (default) | positive scalar | –1
The block is a discrete-time block that runs at a fixed sample time, specified with this parameter. The largest frequency that you can estimate is the Nyquist frequency, π/Ts rad/s. Best practice is to use a sample time at least five times faster than the Nyquist frequency.
Ts = π/(5ωmax) ≅ 0.6/ωmax or 0.1/fmax,
Here, ωmax is the highest frequency in the Frequencies parameter in rad/s, and fmax is the highest frequency in Hz. The sample time must be small enough to estimate the fastest desired frequency, but not so small as to introduce unnecessary computational burden.
If you set the sample time to –1, then the software determines the sample time on compilation, based on the sources outside the block. Setting sample time to –1 disables the internal checks in the block that ensure your estimation frequencies are below the Nyquist frequency.
Tip
If you want to run the deployed block with different sample times in your application, set this parameter to –1 and put the block in a Triggered Subsystem. Then, trigger the subsystem at the desired sample time. If you do not plan to change the sample time after deployment, specify a fixed and finite sample time.
Data Type — Floating point precision
double
(default) | single
Specify the floating-point precision based on simulation environment or hardware requirements.
Excitation signal source — Excitation signal source
Block parameters (default) | External ports
Specify whether to supply the frequencies and amplitudes of the experiment perturbation signal via block parameters or via external ports.
Block parameters — Select to enable the Frequencies and Amplitudes parameters.
External ports — Select to enable the w and amp input ports. Use this option if you want to change the frequencies and amplitudes of the perturbation signal after deployment.
Frequencies — Frequencies for estimation
[0.5 1 2] (default) | vector
Frequencies at which to estimate the frequency response of the plant. The block injects a perturbation at each of these frequencies. The highest frequency you can estimate is limited by the Nyquist frequency, π/Ts rad/s, where Ts is the value you set for the Sample time (Ts) parameter.
Tips
This parameter is not tunable. To provide frequencies after deployment, set Excitation Signal Source to External ports and use the w input port.
Dependencies
To enable this parameter, set Excitation Signal Source to Block parameters.
Amplitudes — Amplitudes of injected perturbations
1 (default) | scalar | vector
Specify the amplitudes of the perturbation signals injected into the plant. To use the same amplitude for all frequencies, specify a scalar value. If you know that the response changes significantly over range of frequencies to estimate, then you can use a vector to specify a different amplitude for each frequency. For instance, you can use a smaller value around known resonant frequencies and a larger value above the rolloff frequency. The vector must be the same length as the vector you provide for Frequencies.
The amplitudes must be:
Large enough that the perturbation overcomes any deadband in the plant actuator and generates a response above the noise level
Small enough to keep the plant running within the approximately linear region near the nominal operating point, and to avoid saturating the plant input or output
For superposition perturbation signals, the sinusoidal signals are superimposed with no phase shift. Thus, the maximum perturbation can exceed the amplitude of any individual component, up to the sum of all amplitudes. Make sure that the largest possible perturbation is within the range of your plant actuator. Saturating the actuator can introduce errors into the estimated frequency response.
Tip
This parameter is not tunable. To provide amplitudes after deployment, set Excitation Signal Source to External ports and use the amp input port.
Dependencies
To enable this parameter, set Excitation Signal Source to Block parameters.
Number of frequencies — Number of externally supplied frequencies
3 (default) | positive integer
When you provide the experiment frequencies via the external port w, specify the number of frequencies (the length of the vector signal at w) with this parameter.
Dependencies
To enable this parameter, set Excitation Signal Source to External ports.
Advanced Settings
Waveform Type — Waveform type
sine (default) | cosine | both
Specify the waveform type of the perturbation signal as either sine, cosine, or both (sincos) at the same time.
Phase Shift — Phase shift of the wave
0 (default) | scalar | vector
Specify the phase shift in the waveform.
Generate three-phase perturbation signal — Generate three-phase perturbation signal
off
(default) | on
Generate a balanced three-phase perturbation signal with a phase difference of 120° between waves. Three-phase signals are helpful when you want to identify frequency response of three-phase AC power systems.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced in R2024b
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 (한국어)