📄 pwm_8.mdl
字号:
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Block {
BlockType Quantizer
QuantizationInterval "0.5"
LinearizeAsGain on
SampleTime "-1"
}
Block {
BlockType RelationalOperator
Operator ">="
InputSameDT on
LogicOutDataTypeMode "Logical (see Configuration Parameters: Optimiza"
"tion)"
LogicDataType "uint(8)"
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Saturate
UpperLimit "0.5"
LowerLimit "-0.5"
LinearizeAsGain on
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Scope
Floating off
ModelBased off
TickLabels "OneTimeTick"
ZoomMode "on"
Grid "on"
TimeRange "auto"
YMin "-5"
YMax "5"
SaveToWorkspace off
SaveName "ScopeData"
LimitDataPoints on
MaxDataPoints "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType SubSystem
ShowPortLabels on
Permissions "ReadWrite"
PermitHierarchicalResolution "All"
SystemSampleTime "-1"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
SimViewingDevice off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
}
Block {
BlockType TransferFcn
Numerator "[1]"
Denominator "[1 2 1]"
AbsoluteTolerance "auto"
Realization "auto"
}
Block {
BlockType TriggerPort
TriggerType "rising"
StatesWhenEnabling "inherit"
ShowOutputPort off
OutputDataType "auto"
SampleTimeType "triggered"
SampleTime "1"
ZeroCross on
}
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "Helvetica"
FontSize 10
FontWeight "normal"
FontAngle "normal"
}
LineDefaults {
FontName "Helvetica"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}
System {
Name "pwm_8"
Location [29, 99, 679, 296]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Constant
Name "Constant"
Position [40, 110, 70, 140]
}
Block {
BlockType DiscretePulseGenerator
Name "Pulse\nGenerator"
Ports [0, 1]
Position [40, 18, 85, 52]
PulseType "Time based"
Period "1e-6"
PulseWidth "50"
}
Block {
BlockType SubSystem
Name "Quantize and Scale"
Ports [1, 1]
Position [205, 98, 305, 152]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Quantize and Scale"
Location [139, 179, 484, 271]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [25, 40, 55, 54]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Gain
Name "Gain1"
Position [200, 28, 265, 62]
Gain "1e-6"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Quantizer
Name "Quantizer"
Position [135, 25, 175, 65]
QuantizationInterval "1/256"
LinearizeAsGain off
}
Block {
BlockType Saturate
Name "Saturation"
Position [80, 30, 110, 60]
UpperLimit "1"
LowerLimit "0"
}
Block {
BlockType Outport
Name "Out1"
Position [290, 40, 320, 54]
IconDisplay "Port number"
}
Line {
SrcBlock "Saturation"
SrcPort 1
DstBlock "Quantizer"
DstPort 1
}
Line {
SrcBlock "Quantizer"
SrcPort 1
DstBlock "Gain1"
DstPort 1
}
Line {
SrcBlock "Gain1"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "Saturation"
DstPort 1
}
}
}
Block {
BlockType Scope
Name "Scope"
Ports [2]
Position [590, 71, 620, 104]
Location [338, 579, 662, 818]
Open on
NumInputPorts "2"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
axes2 "%<SignalLabel>"
}
TimeRange "1e-006"
YMin "-5~-5"
YMax "5~5"
DataFormat "StructureWithTime"
}
Block {
BlockType Reference
Name "Slider\nGain"
Ports [1, 1]
Position [110, 110, 140, 140]
SourceBlock "simulink/Math\nOperations/Slider\nGain"
SourceType "Slider Gain"
ShowPortLabels on
low "0"
gain "0.5"
high "1"
}
Block {
BlockType SubSystem
Name "Variable Duration One Shot"
Ports [2, 2]
Position [410, 78, 540, 142]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Variable Duration One Shot"
Location [201, 175, 904, 485]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "Trigger"
Position [15, 168, 45, 182]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Inport
Name "Ton"
Position [460, 198, 490, 212]
Port "2"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType SubSystem
Name "Comparitor"
Ports [2, 1]
Position [530, 160, 595, 220]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Comparitor"
Location [616, 315, 1117, 500]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "+"
Position [35, 55, 65, 69]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Inport
Name "-"
Position [40, 120, 70, 134]
Port "2"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Reference
Name "Compare and Invert "
Ports [1, 1]
Position [265, 56, 340, 84]
SourceBlock "simulink/Logic and Bit\nOperations/Comp"
"are\nTo Constant"
SourceType "Compare To Constant"
ShowPortLabels on
relop "<="
const ".5"
LogicOutDataTypeMode "uint8"
ZeroCross off
}
Block {
BlockType TransferFcn
Name "Delay"
Position [150, 52, 205, 88]
Denominator "[1e-9 1]"
}
Block {
BlockType RelationalOperator
Name "Relational\nOperator"
Position [90, 52, 120, 83]
NamePlacement "alternate"
}
Block {
BlockType Outport
Name "Out1"
Position [385, 65, 415, 79]
IconDisplay "Port number"
}
Line {
SrcBlock "Relational\nOperator"
SrcPort 1
DstBlock "Delay"
DstPort 1
}
Line {
SrcBlock "+"
SrcPort 1
DstBlock "Relational\nOperator"
DstPort 1
}
Line {
SrcBlock "Delay"
SrcPort 1
DstBlock "Compare and Invert "
DstPort 1
}
Line {
SrcBlock "-"
SrcPort 1
DstBlock "Relational\nOperator"
DstPort 2
}
Line {
SrcBlock "Compare and Invert "
SrcPort 1
DstBlock "Out1"
DstPort 1
}
}
}
Block {
BlockType Reference
Name "D Flip-Flop"
Ports [3, 2]
Position [220, 137, 265, 213]
SourceBlock "simulink_extras/Flip Flops/D Flip-Flop"
SourceType "DFlipFlop"
ShowPortLabels on
}
Block {
BlockType Integrator
Name "Integrator"
Ports [2, 1]
Position [335, 133, 425, 217]
ExternalReset "level"
IgnoreLimit off
}
Block {
BlockType Constant
Name "logic 1"
Position [165, 141, 185, 159]
}
Block {
BlockType Outport
Name "Pulse Out"
Position [665, 103, 695, 117]
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "Pulse Out Bar"
Position [620, 253, 650, 267]
Port "2"
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "D Flip-Flop"
SrcPort 2
Points [0, 0; 30, 0]
Branch {
DstBlock "Integrator"
DstPort 2
}
Branch {
Points [0, 65]
DstBlock "Pulse Out Bar"
DstPort 1
}
}
Line {
SrcBlock "logic 1"
SrcPort 1
DstBlock "D Flip-Flop"
DstPort 1
}
Line {
SrcBlock "Integrator"
SrcPort 1
DstBlock "Comparitor"
DstPort 1
}
Line {
SrcBlock "D Flip-Flop"
SrcPort 1
Points [0, 0; 30, 0]
Branch {
DstBlock "Integrator"
DstPort 1
}
Branch {
Points [0, -45]
DstBlock "Pulse Out"
DstPort 1
}
}
Line {
SrcBlock "Trigger"
SrcPort 1
DstBlock "D Flip-Flop"
DstPort 2
}
Line {
SrcBlock "Ton"
SrcPort 1
DstBlock "Comparitor"
DstPort 2
}
Line {
SrcBlock "Comparitor"
SrcPort 1
Points [40, 0; 0, -125; -560, 0; 0, 135]
DstBlock "D Flip-Flop"
DstPort 3
}
}
}
Line {
SrcBlock "Pulse\nGenerator"
SrcPort 1
Points [0, 0; 285, 0]
Branch {
Points [0, 60]
DstBlock "Variable Duration One Shot"
DstPort 1
}
Branch {
Points [175, 0; 0, 45]
DstBlock "Scope"
DstPort 1
}
}
Line {
SrcBlock "Slider\nGain"
SrcPort 1
DstBlock "Quantize and Scale"
DstPort 1
}
Line {
SrcBlock "Constant"
SrcPort 1
DstBlock "Slider\nGain"
DstPort 1
}
Line {
SrcBlock "Variable Duration One Shot"
SrcPort 1
DstBlock "Scope"
DstPort 2
}
Line {
SrcBlock "Quantize and Scale"
SrcPort 1
DstBlock "Variable Duration One Shot"
DstPort 2
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -