📄 chap4_7.mdl
字号:
StateMustResolveToSignalObject off
RTWStateStorageClass "Auto"
Realization "auto"
}
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 MATLABFcn
MATLABFcn "sin"
OutputDimensions "-1"
OutputSignalType "auto"
Output1D 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 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 SignalGenerator
WaveForm "sine"
TimeSource "Use simulation time"
Amplitude "1"
Frequency "1"
Units "Hertz"
VectorParams1D on
}
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"
}
}
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 "CHAP4_7"
Location [2, 78, 1022, 717]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "99"
ReportName "simulink-default.rpt"
Block {
BlockType MATLABFcn
Name " \n"
Position [430, 134, 495, 176]
MATLABFcn "chap4_7f2(u(1),u(2),u(3),u(4))"
OutputDimensions "1"
}
Block {
BlockType MATLABFcn
Name " \npid control"
Position [375, 213, 435, 257]
MATLABFcn "chap4_7f1(u(1),u(2),u(3))"
OutputDimensions "1"
}
Block {
BlockType Clock
Name "Clock"
Position [195, 241, 240, 269]
DisplayTime on
Decimation "10"
}
Block {
BlockType DiscreteTransferFcn
Name "Discrete\nTransfer Fcn"
Position [535, 139, 660, 171]
Numerator "[0.0008674 0.0008503]"
Denominator "[1 -1.94 0.9418]"
SampleTime "0.001"
}
Block {
BlockType Reference
Name "Manual Switch2"
Ports [2, 1]
Position [110, 185, 145, 220]
ShowName off
FontName "Arial"
FontSize 12
SourceBlock "simulink/Signal\nRouting/Manual Switch"
SourceType "Manual Switch"
ShowPortLabels on
sw "0"
action "0"
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [690, 119, 720, 166]
ShowName off
Inputs "2"
}
Block {
BlockType Mux
Name "Mux1"
Ports [3, 1]
Position [280, 135, 310, 175]
ShowName off
Inputs "3"
}
Block {
BlockType Mux
Name "Mux2"
Ports [2, 1]
Position [370, 135, 400, 175]
ShowName off
Inputs "2"
}
Block {
BlockType Scope
Name "Scope1"
Ports [1]
Position [740, 130, 770, 160]
NamePlacement "alternate"
Location [238, 200, 882, 665]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
TimeRange "0.2 "
YMin "2.77556e-017"
YMax "1"
DataFormat "StructureWithTime"
MaxDataPoints "50000"
Decimation "0.001"
SampleInput on
SampleTime "0.001"
}
Block {
BlockType Scope
Name "Scope2"
Ports [1]
Position [555, 325, 585, 355]
NamePlacement "alternate"
Location [6, 56, 650, 521]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
TimeRange "0.2 "
YMin "-0.00045"
YMax "-0.0004225"
DataFormat "StructureWithTime"
MaxDataPoints "50000"
Decimation "0.001"
SampleInput on
SampleTime "0.001"
}
Block {
BlockType Scope
Name "Scope3"
Ports [1]
Position [555, 225, 585, 255]
NamePlacement "alternate"
Location [6, 56, 650, 521]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
TimeRange "0.2 "
YMin "0.52382"
YMax "0.523925"
DataFormat "StructureWithTime"
MaxDataPoints "50000"
Decimation "0.001"
SampleInput on
SampleTime "0.001"
}
Block {
BlockType SignalGenerator
Name "Signal\nGenerator"
Ports [0, 1]
Position [15, 240, 45, 270]
WaveForm "square"
Amplitude "0.5"
Frequency "4"
}
Block {
BlockType Step
Name "Step"
Position [15, 180, 45, 210]
Time "0"
SampleTime "0.001"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [205, 186, 235, 224]
ShowName off
Inputs "|+-"
}
Line {
SrcBlock "Sum"
SrcPort 1
Points [10, 0; 0, -50]
DstBlock "Mux1"
DstPort 2
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Scope1"
DstPort 1
}
Line {
SrcBlock "Clock"
SrcPort 1
Points [0, -85]
DstBlock "Mux1"
DstPort 3
}
Line {
SrcBlock "Mux1"
SrcPort 1
Points [10, 0]
Branch {
Points [0, 80]
DstBlock " \npid control"
DstPort 1
}
Branch {
Labels [1, 0]
Points [0, -10]
DstBlock "Mux2"
DstPort 1
}
}
Line {
SrcBlock "Mux2"
SrcPort 1
DstBlock " \n"
DstPort 1
}
Line {
Labels [1, 0]
SrcBlock "Manual Switch2"
SrcPort 1
Points [15, 0]
Branch {
DstBlock "Sum"
DstPort 1
}
Branch {
Labels [1, 0]
Points [0, -65]
Branch {
DstBlock "Mux1"
DstPort 1
}
Branch {
Points [0, -10]
DstBlock "Mux"
DstPort 1
}
}
}
Line {
SrcBlock " \npid control"
SrcPort 1
Points [25, 0; 0, -20]
Branch {
Points [25, 0; 0, 125]
DstBlock "Scope2"
DstPort 1
}
Branch {
Labels [3, 0]
Points [0, -10; -125, 0; 0, -40]
DstBlock "Mux2"
DstPort 2
}
}
Line {
SrcBlock "Step"
SrcPort 1
DstBlock "Manual Switch2"
DstPort 1
}
Line {
SrcBlock "Signal\nGenerator"
SrcPort 1
Points [45, 0]
DstBlock "Manual Switch2"
DstPort 2
}
Line {
SrcBlock "Discrete\nTransfer Fcn"
SrcPort 1
Points [10, 0]
Branch {
Points [0, 140; -510, 0; 0, -80]
DstBlock "Sum"
DstPort 2
}
Branch {
DstBlock "Mux"
DstPort 2
}
}
Line {
SrcBlock " \n"
SrcPort 1
Points [20, 0]
Branch {
DstBlock "Discrete\nTransfer Fcn"
DstPort 1
}
Branch {
Points [0, 85]
DstBlock "Scope3"
DstPort 1
}
}
Annotation {
Name "cmac control"
Position [460, 188]
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -