📄 ex31_pid.mdl
字号:
LinearizePole "inf"
}
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 SignalConversion
OverrideOpt off
}
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 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 Mux
Inputs "4"
DisplayOption "none"
BusObject "BusObject"
NonVirtualBus off
}
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 Terminator
}
Block {
BlockType ToWorkspace
VariableName "simulink_output"
MaxDataPoints "1000"
Decimation "1"
SampleTime "0"
FixptAsFi off
}
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 "ex31_pid"
Location [314, 82, 793, 326]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Clock
Name "Clock"
Position [20, 15, 40, 35]
Decimation "10"
}
Block {
BlockType Derivative
Name "Derivative"
Position [125, 145, 155, 175]
}
Block {
BlockType Gain
Name "Gain"
Position [170, 100, 200, 130]
Gain "Ki"
}
Block {
BlockType Gain
Name "Gain1"
Position [170, 143, 215, 177]
Gain "Kd"
}
Block {
BlockType Gain
Name "Gain2"
Position [260, 68, 290, 102]
Gain "Kp"
}
Block {
BlockType Integrator
Name "Integrator"
Ports [1, 1]
Position [125, 100, 155, 130]
IgnoreLimit off
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [395, 66, 400, 104]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Scope
Name "Scope"
Ports [1]
Position [415, 69, 445, 101]
Location [7, 65, 302, 297]
Open on
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
TimeRange "4"
YMin "0"
YMax "1.5"
SaveToWorkspace on
SaveName "IO"
DataFormat "Array"
}
Block {
BlockType Reference
Name "Signal Constraint"
Ports [1]
Position [395, 131, 455, 199]
DropShadow on
SourceBlock "srolib/Signal Constraint"
SourceType "Signal Constraint"
ShowPortLabels on
DialogPosition "[0.00625 0.2705078125 0.45 0.3095703125]"
SaveIn "workspace"
LogID "SRO_DataLog_1"
}
Block {
BlockType Step
Name "Step"
Position [20, 70, 50, 100]
Time "0"
SampleTime "0"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [80, 75, 100, 95]
ShowName off
IconShape "round"
Inputs "|+-"
}
Block {
BlockType Sum
Name "Sum1"
Ports [3, 1]
Position [225, 75, 245, 95]
ShowName off
IconShape "round"
Inputs "|+++"
}
Block {
BlockType ToWorkspace
Name "To Workspace"
Position [80, 12, 100, 38]
VariableName "t"
MaxDataPoints "inf"
SampleTime "-1"
SaveFormat "Array"
}
Block {
BlockType ToWorkspace
Name "To Workspace1"
Position [145, 61, 165, 79]
VariableName "in"
MaxDataPoints "inf"
SampleTime "-1"
SaveFormat "Array"
}
Block {
BlockType ToWorkspace
Name "To Workspace2"
Position [285, 146, 305, 164]
VariableName "y"
MaxDataPoints "inf"
SampleTime "-1"
SaveFormat "Array"
}
Block {
BlockType TransferFcn
Name "Transfer Fcn"
Position [310, 67, 365, 103]
Numerator "[10]"
Denominator "[1 3 2]"
}
Line {
SrcBlock "Clock"
SrcPort 1
DstBlock "To Workspace"
DstPort 1
}
Line {
SrcBlock "Step"
SrcPort 1
Points [5, 0]
Branch {
DstBlock "Sum"
DstPort 1
}
Branch {
Points [0, -30; 65, 0]
Branch {
Points [255, 0]
DstBlock "Mux"
DstPort 1
}
Branch {
Points [0, 15]
DstBlock "To Workspace1"
DstPort 1
}
}
}
Line {
SrcBlock "Sum"
SrcPort 1
Points [5, 0]
Branch {
Points [104, 0]
DstBlock "Sum1"
DstPort 1
}
Branch {
Points [0, 30; 0, 0]
Branch {
DstBlock "Integrator"
DstPort 1
}
Branch {
DstBlock "Derivative"
DstPort 1
}
}
}
Line {
SrcBlock "Integrator"
SrcPort 1
DstBlock "Gain"
DstPort 1
}
Line {
SrcBlock "Derivative"
SrcPort 1
DstBlock "Gain1"
DstPort 1
}
Line {
SrcBlock "Gain1"
SrcPort 1
Points [15, 0]
DstBlock "Sum1"
DstPort 3
}
Line {
SrcBlock "Gain"
SrcPort 1
Points [0, -18]
DstBlock "Sum1"
DstPort 2
}
Line {
SrcBlock "Transfer Fcn"
SrcPort 1
Points [0, 10]
Branch {
DstBlock "Mux"
DstPort 2
}
Branch {
Points [0, 70]
Branch {
Points [0, 15; -120, 0]
Branch {
Points [-160, 0]
DstBlock "Sum"
DstPort 2
}
Branch {
Points [0, -25]
DstBlock "To Workspace2"
DstPort 1
}
}
Branch {
DstBlock "Signal Constraint"
DstPort 1
}
}
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Scope"
DstPort 1
}
Line {
SrcBlock "Gain2"
SrcPort 1
DstBlock "Transfer Fcn"
DstPort 1
}
Line {
SrcBlock "Sum1"
SrcPort 1
DstBlock "Gain2"
DstPort 1
}
Annotation {
Name "ex31_pid.mdl, 7-8-2001, 2005-5-3,\nversion 7.x"
"\nPenChen Chou"
Position [231, 26]
}
Annotation {
Name "\n"
Position [237, 241]
}
Annotation {
Name "Set Kp=10;Ki=0;Kd=0;\nbefore simulation.\nSee a"
" WORD file to find the result."
Position [180, 219]
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -