📄 fuzzy control.mdl
字号:
RndMeth "Floor"
SaturateOnIntegerOverflow on
ZeroCross on
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 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 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 Step
Time "1"
Before "0"
After "1"
SampleTime "-1"
VectorParams1D on
ZeroCross 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 TransferFcn
Numerator "[1]"
Denominator "[1 2 1]"
AbsoluteTolerance "auto"
Realization "auto"
}
Block {
BlockType TransportDelay
DelayTime "1"
InitialInput "0"
BufferSize "1024"
PadeOrder "0"
TransDelayFeedthrough off
}
Block {
BlockType UnitDelay
X0 "0"
SampleTime "1"
StateMustResolveToSignalObject off
RTWStateStorageClass "Auto"
}
Block {
BlockType ZeroOrderHold
SampleTime "1"
}
}
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 "haze"
Location [145, 181, 1124, 450]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Sum
Name "Add"
Ports [2, 1]
Position [540, 66, 550, 124]
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
}
Block {
BlockType Reference
Name "Difference"
Ports [1, 1]
Position [170, 82, 230, 118]
SourceBlock "simulink/Discrete/Difference"
SourceType "Difference"
ShowPortLabels on
ICPrevInput "0.0"
OutputDataTypeScalingMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^-10"
LockScale off
RndMeth "Floor"
DoSatur off
}
Block {
BlockType Reference
Name "Fuzzy Logic \nController"
Ports [1, 1]
Position [395, 56, 455, 104]
FontName "Arial"
SourceBlock "fuzblock/Fuzzy Logic \nController"
SourceType "FIS"
ShowPortLabels on
fis "star"
}
Block {
BlockType Integrator
Name "Integrator"
Ports [1, 1]
Position [395, 155, 425, 185]
}
Block {
BlockType Gain
Name "K1"
Position [270, 155, 300, 185]
Gain "0.563"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Ke\n"
Position [255, 40, 285, 70]
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Kec"
Position [255, 85, 285, 115]
Gain "0.1"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Ku\n"
Position [480, 65, 510, 95]
Gain "-0.68"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [370, 31, 375, 124]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Mux
Name "Mux1"
Ports [2, 1]
Position [845, 41, 850, 134]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Saturate
Name "Saturation"
Position [310, 40, 340, 70]
}
Block {
BlockType Saturate
Name "Saturation1"
Position [310, 85, 340, 115]
}
Block {
BlockType Saturate
Name "Saturation2"
Position [570, 80, 600, 110]
UpperLimit "20"
LowerLimit "-20"
}
Block {
BlockType Scope
Name "Scope"
Ports [1]
Position [890, 74, 920, 106]
Location [188, 390, 512, 629]
Open on
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
DataFormat "StructureWithTime"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [115, 45, 135, 65]
ShowName off
IconShape "round"
Inputs "|+-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType TransferFcn
Name "Transfer Fcn"
Position [680, 77, 740, 113]
Denominator "[3 1]"
}
Block {
BlockType TransportDelay
Name "Transport\nDelay"
Position [775, 80, 805, 110]
}
Block {
BlockType ZeroOrderHold
Name "Zero-Order\nHold"
Position [620, 80, 655, 110]
}
Block {
BlockType ZeroOrderHold
Name "Zero-Order\nHold1"
Position [595, 171, 635, 209]
}
Block {
BlockType Step
Name "t"
Position [70, 40, 100, 70]
Time "0.01"
SampleTime "0.01"
}
Line {
SrcBlock "t"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
Points [0, 0; 5, 0]
Branch {
Points [10, 0]
Branch {
DstBlock "Ke\n"
DstPort 1
}
Branch {
DstBlock "Difference"
DstPort 1
}
}
Branch {
Points [0, 115]
DstBlock "K1"
DstPort 1
}
}
Line {
SrcBlock "Difference"
SrcPort 1
DstBlock "Kec"
DstPort 1
}
Line {
SrcBlock "Ke\n"
SrcPort 1
DstBlock "Saturation"
DstPort 1
}
Line {
SrcBlock "Kec"
SrcPort 1
Points [10, 0]
DstBlock "Saturation1"
DstPort 1
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Fuzzy Logic \nController"
DstPort 1
}
Line {
SrcBlock "Saturation"
SrcPort 1
DstBlock "Mux"
DstPort 1
}
Line {
SrcBlock "Saturation1"
SrcPort 1
DstBlock "Mux"
DstPort 2
}
Line {
SrcBlock "K1"
SrcPort 1
DstBlock "Integrator"
DstPort 1
}
Line {
SrcBlock "Fuzzy Logic \nController"
SrcPort 1
DstBlock "Ku\n"
DstPort 1
}
Line {
SrcBlock "Ku\n"
SrcPort 1
DstBlock "Add"
DstPort 1
}
Line {
SrcBlock "Integrator"
SrcPort 1
Points [95, 0]
DstBlock "Add"
DstPort 2
}
Line {
SrcBlock "Add"
SrcPort 1
DstBlock "Saturation2"
DstPort 1
}
Line {
SrcBlock "Saturation2"
SrcPort 1
DstBlock "Zero-Order\nHold"
DstPort 1
}
Line {
SrcBlock "Zero-Order\nHold"
SrcPort 1
Points [0, 0; 5, 0]
Branch {
DstBlock "Transfer Fcn"
DstPort 1
}
Branch {
Points [0, -45; 165, 0]
DstBlock "Mux1"
DstPort 1
}
}
Line {
SrcBlock "Transfer Fcn"
SrcPort 1
DstBlock "Transport\nDelay"
DstPort 1
}
Line {
Labels [4, 0]
SrcBlock "Zero-Order\nHold1"
SrcPort 1
Points [180, 0; 0, 55; -695, 0]
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Transport\nDelay"
SrcPort 1
Points [15, 0; 0, 15]
Branch {
Points [0, 45; -245, 0]
DstBlock "Zero-Order\nHold1"
DstPort 1
}
Branch {
DstBlock "Mux1"
DstPort 2
}
}
Line {
SrcBlock "Mux1"
SrcPort 1
DstBlock "Scope"
DstPort 1
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -