📄 c8mfzpid.mdl
字号:
Realization "auto"
}
Block {
BlockType Gain
Gain "1"
Multiplication "Element-wise(K.*u)"
ParameterDataTypeMode "Same as input"
ParameterDataType "sfix(16)"
ParameterScalingMode "Best Precision: Matrix-wise"
ParameterScaling "2^0"
OutDataTypeMode "Same as input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Inport
BusObject "BusObject"
BusOutputAsStruct off
PortDimensions "-1"
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
Interpolate on
}
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 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 "S-Function"
FunctionName "system"
SFunctionModules "''"
PortCounts "[]"
}
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 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 "c8mfzpid"
Location [256, 289, 920, 602]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "portrait"
PaperPositionMode "auto"
PaperType "a4letter"
PaperUnits "centimeters"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType SubSystem
Name "Fuzzy Logic\nPID Controller"
Ports [1, 2]
Position [275, 81, 355, 139]
AncestorBlock "pidblock/AI based\nPID Controllers/Fuzzy Logic"
"\nPID Controller"
FontName "Times New Roman"
FontSize 13
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskPromptString "Initial PID vector|Fuzzy Logic Object|Sampling "
"period T|gamma vector|Normalizing vector"
MaskStyleString "edit,edit,edit,edit,edit"
MaskTunableValueString "on,on,on,on,on"
MaskCallbackString "||||"
MaskEnableString "on,on,on,on,on"
MaskVisibilityString "on,on,on,on,on"
MaskToolTipString "on,on,on,on,on"
MaskVarAliasString ",,,,"
MaskVariables "fx0=@1;aFuz=@2;T=@3;gam=@4;K=@5;"
MaskDisplay "disp('Fuzzy PID\\nController')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "[0.4;0;1]|a|0.001|[0.1; 0.02; 1]|[1 1,1]"
MaskTabNameString ",,,,"
System {
Name "Fuzzy Logic\nPID Controller"
Location [257, 94, 922, 388]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "portrait"
PaperPositionMode "auto"
PaperType "a4letter"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "e(k)"
Position [25, 33, 55, 47]
ShowName off
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType DiscreteTransferFcn
Name "Delay"
Position [90, 65, 130, 95]
Numerator "K(2)"
Denominator "[1 0]"
SampleTime "T"
}
Block {
BlockType Demux
Name "Demux"
Ports [1, 2]
Position [280, 31, 285, 69]
BackgroundColor "black"
ShowName off
Outputs "[1,3]"
}
Block {
BlockType Gain
Name "Gain"
Position [85, 25, 130, 55]
ShowName off
Gain "K(1)"
}
Block {
BlockType Gain
Name "Gain1"
Position [300, 26, 340, 54]
ShowName off
Gain "K(3)"
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [165, 31, 170, 69]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType "S-Function"
Name "S-Function"
Ports [1, 1]
Position [185, 35, 245, 65]
FunctionName "fuz_pid"
Parameters "T,aFuz,fx0,gam"
}
Block {
BlockType Outport
Name "u(k)"
Position [355, 33, 385, 47]
ShowName off
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "PID parameters"
Position [350, 73, 380, 87]
ShowName off
Port "2"
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Demux"
SrcPort 2
Points [15, 0; 0, 20]
DstBlock "PID parameters"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 1
DstBlock "Gain1"
DstPort 1
}
Line {
SrcBlock "S-Function"
SrcPort 1
DstBlock "Demux"
DstPort 1
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "S-Function"
DstPort 1
}
Line {
SrcBlock "e(k)"
SrcPort 1
Points [0, 0; 15, 0]
Branch {
DstBlock "Delay"
DstPort 1
}
Branch {
DstBlock "Gain"
DstPort 1
}
}
Line {
SrcBlock "Delay"
SrcPort 1
Points [10, 0; 0, -20]
DstBlock "Mux"
DstPort 2
}
Line {
SrcBlock "Gain"
SrcPort 1
DstBlock "Mux"
DstPort 1
}
Line {
SrcBlock "Gain1"
SrcPort 1
DstBlock "u(k)"
DstPort 1
}
}
}
Block {
BlockType Scope
Name "Scope"
Ports [1]
Position [535, 79, 565, 111]
FontName "Times New Roman"
FontSize 13
Location [40, 202, 364, 440]
Open on
NumInputPorts "1"
ZoomMode "yonly"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
TimeRange "0.5"
YMin "0"
YMax "1.1"
SaveToWorkspace on
SaveName "yy"
DataFormat "Array"
LimitDataPoints off
}
Block {
BlockType Scope
Name "Scope1"
Ports [1]
Position [535, 19, 565, 51]
FontName "Times New Roman"
FontSize 13
Location [40, 202, 364, 440]
Open on
NumInputPorts "1"
ZoomMode "yonly"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
TimeRange "0.5"
YMin "-0.2"
YMax "1.2"
SaveToWorkspace on
SaveName "yy1"
DataFormat "Array"
LimitDataPoints off
}
Block {
BlockType Step
Name "Step"
Position [185, 95, 215, 125]
FontName "Times New Roman"
FontSize 13
Time "0"
SampleTime "0"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [230, 100, 250, 120]
ShowName off
FontName "Times New Roman"
FontSize 13
IconShape "round"
Inputs "|+-"
}
Block {
BlockType TransferFcn
Name "Transfer Fcn"
Position [385, 66, 505, 124]
FontName "Times New Roman"
FontSize 13
Numerator "523500"
Denominator "[1 87.35 10470 0]"
}
Line {
SrcBlock "Fuzzy Logic\nPID Controller"
SrcPort 1
DstBlock "Transfer Fcn"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "Fuzzy Logic\nPID Controller"
DstPort 1
}
Line {
SrcBlock "Transfer Fcn"
SrcPort 1
Points [-5, 0; 10, 0]
Branch {
Points [0, 85; -275, 0]
DstBlock "Sum"
DstPort 2
}
Branch {
DstBlock "Scope"
DstPort 1
}
}
Line {
SrcBlock "Step"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Fuzzy Logic\nPID Controller"
SrcPort 2
Points [10, 0; 0, -90]
DstBlock "Scope1"
DstPort 1
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -