Main Content

脉冲发生器

Generate square wave pulses at regular intervals

  • 图书馆:
  • Simulink / Sources

  • 脉冲发生器块

Description

脉冲发生器block generates square wave pulses at regular intervals. The block waveform parameters,Amplitude,,,,脉冲宽度,,,,per一世od,,,,and相延迟,确定输出波形的形状。下图显示了每个参数如何影响波形。

脉冲发生器块可以发射任何实际数据类型的标量,向量或矩阵信号。要发出标量信号,请使用标量来指定波形参数。要发射向量或矩阵信号,请分别使用向量或矩阵来指定波形参数。波形参数的每个元素都会影响输出信号的相应元素。例如,向量振幅参数的第一个元素确定向量输出脉冲的第一个元素的幅度。标量扩展后,所有波形参数必须具有相同的维度。输出的数据类型与数据类型相同Amplitude范围。

可以以基于时间或样本的模式生成块输出,由p你lsetype范围。

基于时间的模式

In time-based mode, Simulink®computes the block output only at times when the output actually changes. This approach results in fewer computations for the block output over the simulation time period. Activate this mode by setting thep你lsetype参数为基于时间

这block does not support a time-based configuration that results in a constant output signal. Simulink returns an error if the parameters脉冲宽度andper一世odsatisfy either of these conditions:

p e r 一世 o d * p l s e w 一世 d t H 100 = 0 p e r 一世 o d * p l s e w 一世 d t H 100 = p e r 一世 o d

根据脉冲波形特性,块输出变化之间的间隔可能会有所不同。因此,基于时间的脉冲发生器块具有可变的样品时间。此类块的样品时间颜色为棕色(请参阅View Sample Time Information了解更多信息)。

Simulink cannot use a fixed-step solver to compute the output of a time-based pulse generator. If you specify a fixed-step solver for models that contain time-based pulse generators, Simulink computes a fixed sample time for the time-based pulse generators. Then the time-based pulse generators simulate as sample based.

如果您使用固定步骤求解器,p你lsetype一世s基于时间,选择步长以使周期,相延迟和脉冲宽度(以秒为单位)是求解器步长大小的整数倍数。例如,假设这个时期是4秒,脉冲宽度为75%(那是,3S),相位延迟是1s。在这种情况下,计算的样品时间为1s。这refore, choose a fixed-step size of1或分裂的数字1确切(例如,0.25)。为了确保此设置,请选择autoon theSolver配置参数对话框的窗格。

Sample-Based Mode

In sample-based mode, the block computes its outputs at fixed intervals that you specify. Activate this mode by setting thep你lsetype参数为Sample based

基于时间和基于样本的模式之间的一个重要区别是,在基于时间的模式下,块输出基于仿真时间,在基于样本的模式下,块输出仅取决于模拟启动,而不论经过多种多样模拟时间。

该块支持基于示例模式的金宝app重置语义。例如,如果脉冲发生器block is in a resettable subsystem that hits a reset trigger, the block output resets to its initial condition.

ports

输出

展开全部

由参数指定的生成平方波脉冲信号。

数据类型:单身的|do你ble|int8|一世nt16|一世nt32|int64|UINT8|你一世nt16|UINT32|Uint64|fixed point

参数

展开全部

Computational technique to generate the type of square wave that this block generates, either time- or sample-based. Some parameters in the dialog box appear depending on whether you select time-based or sample-based.

程序化使用

块参数Pulsetype
Type:角色向量
'Time based'|“基于样本”
Default'Time based'

Specifies whether to use simulation time or an external signal as the source of values for the output pulse's time variable. If you specify an external source, the block displays an input port for connecting the source. The output pulse differs as follows:

  • 使用仿真时间:这block generates an output pulse where the time variable equals the simulation time.

  • 使用外部信号:这block generates an output pulse where the time variable equals the value from the input port, which can differ from the simulation time.

程序化使用

块参数时间仪
Type:角色向量
“使用仿真时间”|'Use external signal'
Default“使用仿真时间”

Specify the amplitude of the signal.

程序化使用

块参数Amplitude
Type:角色向量
Value:标量
Default'1'

p你lseperiod specified in seconds if the pulse type is time-based. If the pulse type is sample-based, then the period is specified as the number of sample times.

程序化使用

块参数per一世od
Type:角色向量
Value:标量
Default'10'

Duty cycle specified as the percentage of the pulse period that the signal is on if time-based or as number of sample times if sample-based.

程序化使用

块参数脉搏宽
Type:角色向量
Value:标量
Default'5'

延迟脉冲生成之前,中指定seconds, if the pulse type is time-based or as number of sample times if the pulse type is sample-based.

程序化使用

块参数Phaseelay
Type:角色向量
Value:标量
Default'0'

该块的样品时间长度为几秒钟。仅当块的脉冲类型基于样本时,此参数才会出现。看指定样本时间

程序化使用

块参数采样时间
Type:角色向量
Value:标量
Default'0'

Select this check box to output a vector of lengthn如果是Amplitude,,,,per一世od,,,,脉冲宽度, 或者相延迟parameter evaluates to ann- 元素行或列向量。

  • wHen you select this check box, the block outputs a vector of lengthn如果任何值参数评估为n- 元素行或列向量。例如,块输出一个维度矩阵1-born-by-1

  • wHen you clear this check box, the block does not output a vector of lengthn如果任何值参数评估为n- 元素行或列向量。

For more information on how this parameter is used, seeDetermine the Output Dimensions of Source Blocks

程序化使用

块参数:VectorParams1D
类型:角色向量
值:'上'|'off'
默认:'上'

Block Characteristics

数据类型

Boolean|do你ble|fixed point|一世nteger|单身的

Direct Feedthrough

是的

Multidimensional Signals

no

可变大小信号

no

零交叉检测

no

扩展功能

PLC代码生成
Generate Structured Text code using Simulink® PLC Coder™.

定点转换
Design and simulate fixed-point systems using Fixed-Point Designer™.

版本历史记录

Introduced before R2006a