📄 buck.mdl
字号:
SamplingMode "auto"
Interpolate on
}
Block {
BlockType Integrator
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
IgnoreLimit off
ZeroCross on
}
Block {
BlockType Logic
Operator "AND"
Inputs "2"
AllPortsSameDT on
OutDataTypeMode "Logical (see Configuration Parameters: Optimiza"
"tion)"
LogicDataType "uint(8)"
SampleTime "-1"
}
Block {
BlockType Mux
Inputs "4"
DisplayOption "none"
BusObject "BusObject"
NonVirtualBus off
}
Block {
BlockType Outport
Port "1"
BusObject "BusObject"
BusOutputAsStruct off
PortDimensions "-1"
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Block {
BlockType PMComponent
SubClassName "unknown"
}
Block {
BlockType PMIOPort
}
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 Selector
InputType "Vector"
IndexMode "One-based"
ElementSrc "Internal"
Elements "1"
RowSrc "Internal"
Rows "1"
ColumnSrc "Internal"
Columns "1"
InputPortWidth "-1"
IndexIsStartValue off
OutputPortSize "1"
}
Block {
BlockType "S-Function"
FunctionName "system"
SFunctionModules "''"
PortCounts "[]"
}
Block {
BlockType SubSystem
ShowPortLabels on
Permissions "ReadWrite"
PermitHierarchicalResolution "All"
SystemSampleTime "-1"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
SimViewingDevice off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
}
Block {
BlockType Sum
IconShape "rectangular"
Inputs "++"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Switch
Criteria "u2 >= Threshold"
Threshold "0"
InputSameDT on
OutDataTypeMode "Inherit via internal rule"
RndMeth "Floor"
SaturateOnIntegerOverflow on
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Terminator
}
}
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 "buck"
Location [2, 82, 1014, 696]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Reference
Name "Current Measurement"
Ports [0, 1, 0, 0, 0, 1, 1]
Position [335, 193, 360, 217]
SourceBlock "powerlib/Measurements/Current Measurement"
SourceType "Current Measurement"
ShowPortLabels on
PhasorSimulation off
OutputType "Complex"
PSBequivalent "0"
}
Block {
BlockType Reference
Name "Current Measurement1"
Ports [0, 1, 0, 0, 0, 1, 1]
Position [605, 193, 630, 217]
SourceBlock "powerlib/Measurements/Current Measurement"
SourceType "Current Measurement"
ShowPortLabels on
PhasorSimulation off
OutputType "Complex"
PSBequivalent "0"
}
Block {
BlockType Reference
Name "Current Measurement2"
Ports [0, 1, 0, 0, 0, 1, 1]
Position [513, 260, 537, 285]
Orientation "down"
NamePlacement "alternate"
SourceBlock "powerlib/Measurements/Current Measurement"
SourceType "Current Measurement"
ShowPortLabels on
PhasorSimulation off
OutputType "Complex"
PSBequivalent "0"
}
Block {
BlockType Reference
Name "DC Voltage Source"
Ports [0, 0, 0, 0, 0, 1, 1]
Position [105, 275, 125, 310]
Orientation "up"
SourceBlock "powerlib/Electrical\nSources/DC Voltage Source"
SourceType "DC Voltage Source"
ShowPortLabels on
Amplitude "8"
Measurements "None"
}
Block {
BlockType Reference
Name "Diode"
Ports [0, 0, 0, 0, 0, 1, 1]
Position [245, 300, 285, 355]
Orientation "up"
SourceBlock "powerlib/Power\nElectronics/Diode"
SourceType "Diode"
ShowPortLabels on
Ron "0.001"
Lon "0"
Vf "0.8"
IC "0"
Rs "500"
Cs "250e-9"
Measurements off
}
Block {
BlockType Reference
Name "Ideal Switch"
Ports [1, 1, 0, 0, 0, 1, 1]
Position [235, 130, 275, 185]
Orientation "down"
NamePlacement "alternate"
SourceBlock "powerlib/Power\nElectronics/Ideal Switch"
SourceType "Ideal Switch"
ShowPortLabels on
Ron "0.001"
Lon "0"
IC "0"
Rs "1e5"
Cs "inf"
Measurements on
}
Block {
BlockType Reference
Name "Parallel RLC Branch"
Ports [0, 0, 0, 0, 0, 1, 1]
Position [504, 320, 556, 375]
Orientation "up"
AttributesFormatString "\\n"
SourceBlock "powerlib/Elements/Parallel RLC Branch"
SourceType "Parallel RLC Branch"
PhysicalDomain "powersysdomain"
SubClassName "unknown"
LeftPortType "p1"
RightPortType "p1"
LConnTagsString "a"
RConnTagsString "__new0"
Resistance "inf"
Inductance "inf"
Capacitance "100e-6"
Measurements "None"
}
Block {
BlockType Reference
Name "Parallel RLC Branch1"
Ports [0, 0, 0, 0, 0, 1, 1]
Position [669, 270, 721, 325]
Orientation "up"
AttributesFormatString "\\n"
SourceBlock "powerlib/Elements/Parallel RLC Branch"
SourceType "Parallel RLC Branch"
PhysicalDomain "powersysdomain"
SubClassName "unknown"
LeftPortType "p1"
RightPortType "p1"
LConnTagsString "a"
RConnTagsString "__new0"
Resistance ".5"
Inductance "inf"
Capacitance "0"
Measurements "None"
}
Block {
BlockType DiscretePulseGenerator
Name "Pulse\nGenerator"
Ports [0, 1]
Position [100, 38, 145, 72]
PulseType "Time based"
Period "1/(100000)"
PulseWidth "75"
}
Block {
BlockType Scope
Name "Scope1"
Ports [2]
Position [645, 35, 675, 70]
Location [6, 56, 1030, 741]
Open off
NumInputPorts "2"
ZoomMode "xonly"
List {
ListType AxesTitles
axes1 "Inductor voltage"
axes2 "Inductor current "
}
TimeRange "8.959999999999524e-005"
YMin "-6500~4"
YMax "500~16"
SaveName "ScopeData1"
DataFormat "StructureWithTime"
}
Block {
BlockType Scope
Name "Scope2"
Ports [1]
Position [400, 314, 430, 346]
Orientation "left"
NamePlacement "alternate"
Location [5, 56, 1029, 741]
Open off
NumInputPorts "1"
ZoomMode "xonly"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
TimeRange "0.000224000000000002"
SaveName "ScopeData2"
DataFormat "StructureWithTime"
}
Block {
BlockType Scope
Name "Scope4"
Ports [2]
Position [940, 260, 970, 295]
Location [6, 56, 1030, 741]
Open off
NumInputPorts "2"
ZoomMode "xonly"
List {
ListType AxesTitles
axes1 "Output voltage Vo"
axes2 "Output current Io"
}
TimeRange "8.959999999999524e-005"
YMin "3~6"
YMax "6~12"
DataFormat "StructureWithTime"
}
Block {
BlockType Reference
Name "Series RLC Branch"
Ports [0, 0, 0, 0, 0, 1, 1]
Position [410, 191, 480, 219]
SourceBlock "powerlib/Elements/Series RLC Branch"
SourceType "Series RLC Branch"
PhysicalDomain "powersysdomain"
SubClassName "unknown"
LeftPortType "p1"
RightPortType "p1"
LConnTagsString "__new0"
RConnTagsString "__new0"
Resistance "10e-3"
Inductance "5e-6"
Capacitance "inf"
Measurements "None"
}
Block {
BlockType Reference
Name "Voltage Measurement"
Ports [0, 1, 0, 0, 0, 2]
Position [850, 273, 875, 297]
SourceBlock "powerlib/Measurements/Voltage Measurement"
SourceType "Voltage Measurement"
ShowPortLabels on
PhasorSimulation off
OutputType "Complex"
PSBequivalent "0"
}
Block {
BlockType SubSystem
Name "Voltage Measurement1"
Ports [0, 1, 0, 0, 0, 2]
Position [433, 100, 457, 125]
Orientation "up"
AncestorBlock "powerlib/Measurements/Voltage Measurement"
CopyFcn "powericon('psbloadfunction',gcb,'Measurement Bl"
"ock','UpdateGotoTag');"
PreSaveFcn "if strcmp('inactive',get_param(gcb,'linkstatus'"
"));\n \nset_param(gcb,'Links"
"tatus','restore') \nend "
" "
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskType "Voltage Measurement"
MaskDescription "Ideal voltage measurement."
MaskHelp "web(psbhelp);"
MaskPromptString "Phasor simulation|Output signal :|Equivalent ci"
"rcuit"
MaskStyleString "checkbox,popup(Complex|Real-Imag|Magnitude-Angl"
"e|Magnitude),edit"
MaskTunableValueString "on,on,on"
MaskCallbackString "||"
MaskEnableString "off,off,off"
MaskVisibilityString "off,on,off"
MaskToolTipString "on,on,on"
MaskVarAliasString ",,"
MaskVariables "PhasorSimulation=@1;OutputType=@2;PSBequivalent"
"=@3;"
MaskInitialization "block = gcb;\npowericon('psbloadfunction',block"
",'Measurement Block','Initialize');\npowericon('MeasurementBlockInit',block);"
MaskSelfModifiable on
MaskIconFrame on
MaskIconOpaque off
MaskIconRotate "port"
MaskIconUnits "autoscale"
MaskValueString "off|Complex|1"
MaskTabNameString ",,"
System {
Name "Voltage Measurement1"
Location [206, 474, 503, 673]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType PMComponent
Name "VoltageMeasurement"
Ports [0, 0, 0, 0, 0, 1, 1]
Position [80, 21, 145, 49]
PhysicalDomain "powersysdomain"
LeftPortType "p1"
RightPortType "p1"
LConnTagsString "+"
RConnTagsString "-"
MaskType "InnerPowersysBlock"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
}
Block {
BlockType Reference
Name "model"
Ports [1, 1]
Position [125, 118, 160, 152]
SourceBlock "powerlib_models/Continuous/Measurement"
SourceType "SubSystem"
ShowPortLabels on
}
Block {
BlockType SubSystem
Name "source"
Ports [0, 1]
Position [25, 124, 95, 146]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskInitialization "Parent = get_param(gcb,'Parent'); "
" "
" \npss = get_param(Parent,'UserData'); "
" \nif isemp"
"ty(pss) "
" \n A=0;B=0;C=0;D=0;x0=0;Rswi"
"tch=0;TypeSwitch=0;Ts=1;YSwitchCurrent=-1; "
" \nelse "
" "
" \n A=pss.A;B=pss.B;C=pss.C;D=pss.D;x0=pss.x0;Rswitch=pss.Rswitch;TypeS"
"witch=pss.TypeSwitch;Ts=0;YSwitchCurrent=pss.YSwitchCurrent;\nend "
" "
" "
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -