📄 sim38.mdl
字号:
BlockType "S-Function"
FunctionName "system"
PortCounts "[]"
SFunctionModules "''"
}
Block {
BlockType SignalGenerator
WaveForm "sine"
TimeSource "Use simulation time"
Amplitude "1"
Frequency "1"
Units "Hertz"
VectorParams1D on
}
Block {
BlockType StateSpace
A "1"
B "1"
C "1"
D "1"
X0 "0"
AbsoluteTolerance "auto"
Realization "auto"
}
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"
}
}
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 "sim38"
Location [2, 82, 1014, 721]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Scope
Name "Actual\nPosition"
Ports [1]
Position [690, 83, 730, 137]
BackgroundColor "[1.000000, 0.501961, 0.752941]"
Location [189, 243, 477, 475]
Open off
NumInputPorts "1"
TickLabels "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
TimeRange "40.000000"
YMin "-7"
YMax "7"
DataFormat "Array"
}
Block {
BlockType "S-Function"
Name "Animation\nfunction"
Ports [1]
Position [645, 222, 715, 258]
BackgroundColor "[0.000000, 1.000000, 0.250980]"
DeleteFcn "if ~isempty(findobj('type','figure','name','dbl"
"cart1 Animation'));close('dblcart1 Animation'); end;"
FunctionName "antsim38"
Parameters "0.1"
}
Block {
BlockType Demux
Name "Demux"
Ports [1, 2]
Position [405, 98, 455, 142]
BackgroundColor "[0.501961, 0.000000, 1.000000]"
ShowName off
Outputs "[2,1]"
}
Block {
BlockType Scope
Name "Estimated\nPosition"
Ports [1]
Position [530, 288, 575, 342]
BackgroundColor "[1.000000, 0.501961, 0.752941]"
Location [55, 225, 343, 457]
Open off
NumInputPorts "1"
TickLabels "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
TimeRange "40.000000"
YMin "-7"
YMax "7"
DataFormat "Array"
}
Block {
BlockType SubSystem
Name "Feedback\ngain using\nLQR design."
Ports [1, 1]
Position [165, 207, 230, 263]
Orientation "left"
BackgroundColor "magenta"
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskType "Regulator"
MaskDescription "Matrix Gain"
MaskHelp "Matrix Gain block"
MaskPromptString "K"
MaskStyleString "edit"
MaskTunableValueString "on"
MaskEnableString "on"
MaskVisibilityString "on"
MaskToolTipString "on"
MaskInitialization "k=@1;"
MaskDisplay "disp('K')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "K"
System {
Name "Feedback\ngain using\nLQR design."
Location [178, 421, 678, 681]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [80, 60, 100, 80]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType StateSpace
Name "Feedback\ngain using\nLQR design."
Position [150, 42, 215, 98]
BackgroundColor "magenta"
A "[]"
B "[]"
C "[]"
D "k"
}
Block {
BlockType Outport
Name "Out1"
Position [315, 60, 335, 80]
IconDisplay "Port number"
BusOutputAsStruct off
InitialOutput "0"
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "Feedback\ngain using\nLQR design."
DstPort 1
}
Line {
SrcBlock "Feedback\ngain using\nLQR design."
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Annotation {
Position [352, 98]
}
Annotation {
Position [355, 61]
}
}
}
Block {
BlockType SubSystem
Name "Inputs & \nSensors"
Ports [2, 1]
Position [410, 209, 470, 256]
Orientation "left"
BackgroundColor "[0.501961, 0.000000, 1.000000]"
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "Inputs & \nSensors"
Location [2, 82, 1014, 721]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [110, 75, 130, 95]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Inport
Name "In2"
Position [110, 130, 130, 150]
Port "2"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Mux
Name "Inputs & \nSensors"
Ports [2, 1]
Position [215, 90, 245, 125]
Inputs "2"
}
Block {
BlockType Outport
Name "Out1"
Position [320, 100, 340, 120]
IconDisplay "Port number"
BusOutputAsStruct off
InitialOutput "0"
}
Line {
SrcBlock "In2"
SrcPort 1
Points [50, 0; 0, -25]
DstBlock "Inputs & \nSensors"
DstPort 2
}
Line {
SrcBlock "Inputs & \nSensors"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Line {
SrcBlock "In1"
SrcPort 1
Points [45, 0; 0, 15]
DstBlock "Inputs & \nSensors"
DstPort 1
}
Annotation {
Position [295, 209]
}
}
}
Block {
BlockType Selector
Name "Inputs & \nSensors1"
Ports [1, 1]
Position [400, 291, 445, 339]
BackgroundColor "[0.501961, 0.000000, 1.000000]"
Elements "[1 3]"
InputPortWidth "4"
}
Block {
BlockType StateSpace
Name "Plant"
Position [285, 97, 365, 143]
BackgroundColor "magenta"
A "[0 1 0 0; -ka/m1 0 ka/m1 0; 0 0 0 1;ka/m2 0 -ka"
"/m2 0]"
B "[0; 1; 0; 0]"
C "[1 0 0 0;0 0 1 0;0 0 1 0]"
D "zeros(3,1)"
}
Block {
BlockType SignalGenerator
Name "Signal Gen"
Ports [0, 1]
Position [45, 81, 95, 129]
BackgroundColor "[0.501961, 1.000000, 1.000000]"
ShowName off
WaveForm "square"
Amplitude "15"
Frequency "0.300000"
Units "rad/sec"
}
Block {
BlockType SubSystem
Name "State\nestimator"
Ports [1, 1]
Position [285, 209, 360, 261]
Orientation "left"
BackgroundColor "magenta"
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "State\nestimator"
Location [2, 82, 1014, 721]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [140, 110, 160, 130]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType StateSpace
Name "State\nestimator"
Position [220, 92, 300, 148]
BackgroundColor "[1.000000, 0.000000, 1.000000]"
A "ae"
B "be"
C "ce"
D "de"
}
Block {
BlockType Outport
Name "Out1"
Position [350, 110, 370, 130]
IconDisplay "Port number"
BusOutputAsStruct off
InitialOutput "0"
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "State\nestimator"
DstPort 1
}
Line {
SrcBlock "State\nestimator"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
}
}
Block {
BlockType Sum
Name "Sum3"
Ports [2, 1]
Position [185, 91, 220, 144]
BackgroundColor "[1.000000, 0.000000, 0.501961]"
ShowName off
Inputs "+-"
}
Line {
SrcBlock "State\nestimator"
SrcPort 1
Points [-15, 0]
Branch {
Points [0, 80]
DstBlock "Inputs & \nSensors1"
DstPort 1
}
Branch {
DstBlock "Feedback\ngain using\nLQR design."
DstPort 1
}
}
Line {
SrcBlock "Inputs & \nSensors"
SrcPort 1
DstBlock "State\nestimator"
DstPort 1
}
Line {
SrcBlock "Sum3"
SrcPort 1
Points [10, 0; 20, 0]
Branch {
Labels [2, 0]
Points [0, 55; 255, 0; 0, 45]
DstBlock "Inputs & \nSensors"
DstPort 1
}
Branch {
DstBlock "Plant"
DstPort 1
}
}
Line {
SrcBlock "Demux"
SrcPort 1
Points [120, 0]
Branch {
DstBlock "Actual\nPosition"
DstPort 1
}
Branch {
Points [0, 130]
DstBlock "Animation\nfunction"
DstPort 1
}
}
Line {
SrcBlock "Feedback\ngain using\nLQR design."
SrcPort 1
Points [-20, 0; 0, -105]
DstBlock "Sum3"
DstPort 2
}
Line {
SrcBlock "Demux"
SrcPort 2
Points [65, 0; 0, 115]
DstBlock "Inputs & \nSensors"
DstPort 2
}
Line {
SrcBlock "Plant"
SrcPort 1
DstBlock "Demux"
DstPort 1
}
Line {
SrcBlock "Signal Gen"
SrcPort 1
DstBlock "Sum3"
DstPort 1
}
Line {
SrcBlock "Inputs & \nSensors1"
SrcPort 1
DstBlock "Estimated\nPosition"
DstPort 1
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -