📄 sltank2.mdl
字号:
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
IgnoreLimit off
ZeroCross on
}
Block {
BlockType Merge
Inputs "2"
InitialOutput "[]"
AllowUnequalInputPortWidths off
InputPortOffsets "[]"
}
Block {
BlockType MinMax
Function "min"
Inputs "1"
InputSameDT on
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Mux
Inputs "4"
DisplayOption "none"
UseBusObject off
BusObject "BusObject"
NonVirtualBus off
}
Block {
BlockType Outport
Port "1"
UseBusObject off
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 Product
Inputs "2"
Multiplication "Element-wise(.*)"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Zero"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Relay
OnSwitchValue "eps"
OffSwitchValue "eps"
OnOutputValue "1"
OffOutputValue "0"
OutputDataTypeScalingMode "All ports same datatype"
OutDataType "sfix(16)"
OutScaling "2^0"
ConRadixGroup "Use specified scaling"
ZeroCross 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
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 "-1"
}
Block {
BlockType "S-Function"
FunctionName "system"
SFunctionModules "''"
PortCounts "[]"
}
Block {
BlockType SignalGenerator
WaveForm "sine"
TimeSource "Use simulation time"
Amplitude "1"
Frequency "1"
Units "Hertz"
VectorParams1D on
}
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
}
Block {
BlockType TransferFcn
Numerator "[1]"
Denominator "[1 2 1]"
AbsoluteTolerance "auto"
Realization "auto"
}
}
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 "sltank2"
Location [297, 143, 891, 444]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType SubSystem
Name "Animation"
Ports [2]
Position [45, 184, 85, 226]
Orientation "left"
ShowPortLabels off
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "Animation"
Location [528, 313, 866, 519]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "in_1"
Position [20, 25, 40, 45]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Inport
Name "in_2"
Position [20, 85, 40, 105]
Port "2"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Mux
Name "Mux2"
Ports [2, 1]
Position [95, 50, 125, 85]
Inputs "2"
}
Block {
BlockType "S-Function"
Name "S-Function"
Ports [1]
Position [165, 46, 220, 94]
FunctionName "animtank"
Parameters "1"
}
Block {
BlockType Scope
Name "Scope1"
Ports [1]
Position [180, 115, 210, 145]
Floating off
Location [68, 146, 342, 467]
Open off
NumInputPorts "1"
TickLabels "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
TimeRange "200.000000"
YMin "-2.000000"
YMax "2.000000"
DataFormat "Array"
SampleTime "0"
}
Line {
SrcBlock "in_2"
SrcPort 1
DstBlock "Mux2"
DstPort 2
}
Line {
SrcBlock "in_1"
SrcPort 1
DstBlock "Mux2"
DstPort 1
}
Line {
SrcBlock "Mux2"
SrcPort 1
Points [0, 0]
Branch {
DstBlock "S-Function"
DstPort 1
}
Branch {
Points [0, 60]
DstBlock "Scope1"
DstPort 1
}
}
}
}
Block {
BlockType SubSystem
Name "Derivative"
Ports [1, 1]
Position [165, 116, 205, 154]
ShowPortLabels off
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Derivative"
Location [234, 567, 500, 708]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "in_1"
Position [15, 45, 35, 65]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Derivative
Name "Derivative"
Position [60, 39, 110, 71]
}
Block {
BlockType Saturate
Name "level\nchange"
Position [135, 39, 170, 71]
UpperLimit "0.1"
LowerLimit "-0.1"
}
Block {
BlockType Outport
Name "out_1"
Position [200, 45, 220, 65]
IconDisplay "Port number"
}
Line {
SrcBlock "in_1"
SrcPort 1
DstBlock "Derivative"
DstPort 1
}
Line {
SrcBlock "level\nchange"
SrcPort 1
DstBlock "out_1"
DstPort 1
}
Line {
SrcBlock "Derivative"
SrcPort 1
DstBlock "level\nchange"
DstPort 1
}
}
}
Block {
BlockType Reference
Name "Fuzzy Logic\nController"
Ports [1, 1]
Position [300, 50, 360, 100]
FontName "Arial"
SourceBlock "fuzblock/Fuzzy Logic \nController"
SourceType "FIS"
ShowPortLabels on
fis "tank2"
}
Block {
BlockType Mux
Name "Mux1"
Ports [2, 1]
Position [245, 56, 275, 89]
Inputs "2"
}
Block {
BlockType Reference
Name "PID \nController"
Ports [1, 1]
Position [310, 185, 350, 225]
SourceBlock "simulink_extras/Additional\nLinear/PID Controll"
"er"
SourceType "PID Controller"
ShowPortLabels on
P "2"
I "0"
D "1"
}
Block {
BlockType SubSystem
Name "Set Point"
Ports [0, 1]
Position [45, 32, 85, 78]
ShowPortLabels off
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Set Point"
Location [228, 242, 439, 430]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Constant
Name "Constant"
Position [45, 31, 70, 59]
}
Block {
BlockType SignalGenerator
Name "Signal\nGenerator"
Ports [0, 1]
Position [35, 108, 80, 142]
WaveForm "square"
Amplitude "0.500000"
Frequency "0.250000"
Units "rad/sec"
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1]
Position [115, 60, 135, 100]
Inputs "+-"
}
Block {
BlockType Outport
Name "out_1"
Position [165, 70, 185, 90]
IconDisplay "Port number"
}
Line {
SrcBlock "Sum1"
SrcPort 1
DstBlock "out_1"
DstPort 1
}
Line {
SrcBlock "Constant"
SrcPort 1
Points [15, 0; 0, 25]
DstBlock "Sum1"
DstPort 1
}
Line {
SrcBlock "Signal\nGenerator"
SrcPort 1
Points [10, 0; 0, -35]
DstBlock "Sum1"
DstPort 2
}
}
}
Block {
BlockType SubSystem
Name "Switch"
Ports [2, 1]
Position [400, 114, 445, 161]
ShowPortLabels off
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Switch"
Location [300, 134, 545, 301]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "in_1"
Position [30, 15, 50, 35]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Inport
Name "in_2"
Position [35, 110, 55, 130]
Port "2"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Switch
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -