📄 pid_control.mdl
字号:
Model {
Name "chap1_4"
Version 3.00
SimParamPage "Solver"
SampleTimeColors off
InvariantConstants off
WideVectorLines off
ShowLineWidths off
ShowPortDataTypes off
StartTime "0.0"
StopTime "5"
SolverMode "Auto"
Solver "ode45"
RelTol "1e-3"
AbsTol "auto"
Refine "1"
MaxStep "auto"
InitialStep "auto"
FixedStep "auto"
MaxOrder 5
OutputOption "RefineOutputTimes"
OutputTimes "[]"
LoadExternalInput off
ExternalInput "[t, u]"
SaveTime on
TimeSaveName "tout"
SaveState off
StateSaveName "xout"
SaveOutput on
OutputSaveName "yout"
LoadInitialState off
InitialState "xInitial"
SaveFinalState off
FinalStateName "xFinal"
SaveFormat "Matrix"
LimitMaxRows off
MaxRows "1000"
Decimation "1"
AlgebraicLoopMsg "warning"
MinStepSizeMsg "warning"
UnconnectedInputMsg "warning"
UnconnectedOutputMsg "warning"
UnconnectedLineMsg "warning"
InheritedTsInSrcMsg "warning"
IntegerOverflowMsg "warning"
UnnecessaryDatatypeConvMsg "none"
Int32ToFloatConvMsg "warning"
SignalLabelMismatchMsg "none"
ConsistencyChecking "off"
ZeroCross on
SimulationMode "normal"
BlockDataTips on
BlockParametersDataTip on
BlockAttributesDataTip off
BlockPortWidthsDataTip off
BlockDescriptionStringDataTip off
BlockMaskParametersDataTip off
ToolBar on
StatusBar on
BrowserShowLibraryLinks off
BrowserLookUnderMasks off
OptimizeBlockIOStorage on
BufferReuse on
BooleanDataType off
RTWSystemTargetFile "grt.tlc"
RTWInlineParameters off
RTWRetainRTWFile off
RTWTemplateMakefile "grt_default_tmf"
RTWMakeCommand "make_rtw"
RTWGenerateCodeOnly off
ExtModeMexFile "ext_comm"
ExtModeBatchMode off
ExtModeTrigType "manual"
ExtModeTrigMode "oneshot"
ExtModeTrigPort "1"
ExtModeTrigElement "any"
ExtModeTrigDuration 1000
ExtModeTrigHoldOff 0
ExtModeTrigDelay 0
ExtModeTrigDirection "rising"
ExtModeTrigLevel 0
ExtModeArchiveMode "off"
ExtModeAutoIncOneShot off
ExtModeIncDirWhenArm off
ExtModeAddSuffixToVar off
ExtModeWriteAllDataToWs off
ExtModeArmWhenConnect off
Created "Sun Mar 16 08:58:06 2003"
UpdateHistory "UpdateHistoryNever"
ModifiedByFormat "%<Auto>"
ModifiedDateFormat "%<Auto>"
LastModifiedDate "Sun Jun 13 11:59:14 2004"
ModelVersionFormat "1.%<AutoIncrement:84>"
ConfigurationManager "none"
BlockDefaults {
Orientation "right"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
NamePlacement "normal"
FontName "Helvetica"
FontSize 10
FontWeight "normal"
FontAngle "normal"
ShowName on
}
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 "chap1_4"
Location [14, 74, 810, 555]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "automatic"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
AutoZoom on
ReportName "simulink-default.rpt"
Block {
BlockType Reference
Name "Manual Switch3"
Ports [2, 1, 0, 0, 0]
Position [405, 217, 435, 253]
ShowName off
SourceBlock "simulink3/Nonlinear/Manual Switch"
SourceType "Manual Switch"
sw "0"
action "0"
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1, 0, 0, 0]
Position [480, 204, 505, 246]
ShowName off
Inputs "2"
DisplayOption "none"
}
Block {
BlockType Reference
Name "PID Controller"
Ports [1, 1, 0, 0, 0]
Position [200, 207, 230, 283]
SourceBlock "simulink_extras/Additional\nLinear/PID Controll"
"er"
SourceType "PID Controller"
P "10"
I "0"
D "1"
}
Block {
BlockType Scope
Name "Scope"
Ports [1, 0, 0, 0, 0]
Position [550, 209, 580, 241]
Floating off
Location [245, 168, 632, 444]
Open on
NumInputPorts "1"
TickLabels "OneTimeTick"
ZoomMode "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
Grid "on"
TimeRange "auto"
YMin "-5"
YMax "5"
SaveToWorkspace off
SaveName "ScopeData"
DataFormat "StructureWithTime"
LimitMaxRows on
MaxRows "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType Sin
Name "Sine Wave1"
Position [70, 230, 100, 260]
Amplitude "0.50"
Frequency "1*2*pi"
Phase "0"
SampleTime "0"
}
Block {
BlockType SubSystem
Name "Subsystem"
Ports [1, 1, 0, 0, 0]
Position [290, 219, 350, 271]
ShowPortLabels on
System {
Name "Subsystem"
Location [24, 74, 820, 555]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "automatic"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
AutoZoom on
Block {
BlockType Inport
Name "In1"
Position [70, 198, 100, 212]
Port "1"
PortWidth "-1"
SampleTime "-1"
DataType "auto"
SignalType "auto"
Interpolate on
}
Block {
BlockType Integrator
Name " 1"
Ports [1, 1, 0, 0, 0]
Position [350, 184, 375, 226]
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Integrator
Name " 2"
Ports [1, 1, 0, 0, 0]
Position [225, 184, 250, 226]
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Clock
Name "Clock1"
Position [135, 100, 155, 120]
DisplayTime on
Decimation "1"
}
Block {
BlockType Clock
Name "Clock2"
Position [505, 325, 525, 345]
Orientation "left"
DisplayTime on
Decimation "1"
}
Block {
BlockType Constant
Name "Constant"
Position [255, 25, 285, 55]
Value "400"
}
Block {
BlockType Constant
Name "Constant1"
Position [330, 400, 360, 430]
Orientation "left"
NamePlacement "alternate"
Value "20"
}
Block {
BlockType Fcn
Name "Fcn "
Position [200, 91, 320, 129]
Expr "300*sin(1*2*pi*u)"
}
Block {
BlockType Fcn
Name "Fcn2"
Position [340, 315, 460, 355]
Orientation "left"
Expr "10*sin(3*2*pi*u)"
}
Block {
BlockType Gain
Name "Gain"
Position [225, 280, 255, 310]
Orientation "left"
NamePlacement "alternate"
Gain "1"
SaturateOnIntegerOverflow on
}
Block {
BlockType Product
Name "Product"
Ports [2, 1, 0, 0, 0]
Position [500, 133, 525, 182]
Inputs "2"
SaturateOnIntegerOverflow on
}
Block {
BlockType Product
Name "Product1"
Ports [2, 1, 0, 0, 0]
Position [165, 273, 195, 357]
Orientation "left"
NamePlacement "alternate"
Inputs "2"
SaturateOnIntegerOverflow on
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1, 0, 0, 0]
Position [125, 195, 145, 215]
ShowName off
IconShape "round"
Inputs "|+-"
SaturateOnIntegerOverflow on
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1, 0, 0, 0]
Position [380, 30, 400, 50]
ShowName off
IconShape "round"
Inputs "|++"
SaturateOnIntegerOverflow on
}
Block {
BlockType Sum
Name "Sum2"
Ports [2, 1, 0, 0, 0]
Position [260, 325, 280, 345]
Orientation "left"
NamePlacement "alternate"
ShowName off
IconShape "round"
Inputs "|++"
SaturateOnIntegerOverflow on
}
Block {
BlockType Outport
Name "Out1"
Position [550, 153, 580, 167]
Port "1"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock " 2"
DstPort 1
}
Line {
SrcBlock "Clock1"
SrcPort 1
DstBlock "Fcn "
DstPort 1
}
Line {
SrcBlock " 1"
SrcPort 1
Points [105, 0]
DstBlock "Product"
DstPort 2
}
Line {
SrcBlock " 2"
SrcPort 1
Points [40, 0]
Branch {
DstBlock " 1"
DstPort 1
}
Branch {
Points [0, 90]
DstBlock "Gain"
DstPort 1
}
}
Line {
SrcBlock "Clock2"
SrcPort 1
DstBlock "Fcn2"
DstPort 1
}
Line {
SrcBlock "Gain"
SrcPort 1
DstBlock "Product1"
DstPort 1
}
Line {
SrcBlock "Product1"
SrcPort 1
Points [-25, 0]
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Product"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Fcn "
SrcPort 1
Points [65, 0]
DstBlock "Sum1"
DstPort 2
}
Line {
SrcBlock "Constant"
SrcPort 1
DstBlock "Sum1"
DstPort 1
}
Line {
SrcBlock "Sum1"
SrcPort 1
Points [80, 0]
DstBlock "Product"
DstPort 1
}
Line {
SrcBlock "Fcn2"
SrcPort 1
DstBlock "Sum2"
DstPort 1
}
Line {
SrcBlock "Sum2"
SrcPort 1
DstBlock "Product1"
DstPort 2
}
Line {
SrcBlock "Constant1"
SrcPort 1
Points [-55, 0]
DstBlock "Sum2"
DstPort 2
}
}
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1, 0, 0, 0]
Position [150, 235, 170, 255]
ShowName off
IconShape "round"
Inputs "|+-"
SaturateOnIntegerOverflow on
}
Block {
BlockType TransferFcn
Name "Transfer Fcn"
Position [290, 137, 350, 173]
Numerator "[400]"
Denominator "[1 20 0]"
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "PID Controller"
DstPort 1
}
Line {
SrcBlock "Sine Wave1"
SrcPort 1
Points [15, 0]
Branch {
DstBlock "Sum"
DstPort 1
}
Branch {
Points [0, -150; 325, 0; 0, 120]
DstBlock "Mux"
DstPort 1
}
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Scope"
DstPort 1
}
Line {
SrcBlock "Subsystem"
SrcPort 1
DstBlock "Manual Switch3"
DstPort 2
}
Line {
SrcBlock "Transfer Fcn"
SrcPort 1
Points [35, 0]
DstBlock "Manual Switch3"
DstPort 1
}
Line {
SrcBlock "PID Controller"
SrcPort 1
Points [30, 0]
Branch {
DstBlock "Subsystem"
DstPort 1
}
Branch {
Points [0, -90]
DstBlock "Transfer Fcn"
DstPort 1
}
}
Line {
SrcBlock "Manual Switch3"
SrcPort 1
Points [5, 0]
Branch {
DstBlock "Mux"
DstPort 2
}
Branch {
Points [0, 95; -285, 0]
DstBlock "Sum"
DstPort 2
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -