dlqr003.mdl
来自「关于固高科技有限公司一级倒立摆lqr算法的连续系统离散系统matlab源程序及仿」· MDL 代码 · 共 1,601 行 · 第 1/3 页
MDL
1,601 行
Block {
BlockType Gain
Name "Gain2"
Position [655, 250, 685, 280]
Gain "180/pi"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Mux
Name "Mux"
Ports [4, 1]
Position [555, 336, 560, 399]
Orientation "left"
NamePlacement "alternate"
ShowName off
DisplayOption "bar"
}
Block {
BlockType Scope
Name "Scope"
Ports [2]
Position [578, 70, 642, 115]
Orientation "up"
NamePlacement "alternate"
Floating off
Location [230, 183, 736, 497]
Open on
NumInputPorts "2"
List {
ListType AxesTitles
axes1 "position"
axes2 "angle"
}
TimeRange "10"
YMin "0.985~-0.4"
YMax "1.005~0.6"
SaveName "ScopeData3"
DataFormat "StructureWithTime"
SampleTime "0"
}
Block {
BlockType Scope
Name "Scope1"
Ports [2]
Position [705, 191, 750, 289]
Floating off
Location [5, 49, 1029, 743]
Open off
NumInputPorts "2"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
axes2 "%<SignalLabel>"
}
YMin "-5~-5"
YMax "5~5"
SaveName "ScopeData2"
DataFormat "StructureWithTime"
SampleTime "0"
}
Block {
BlockType Scope
Name "Scope2"
Ports [1]
Position [430, 129, 460, 161]
Floating off
Location [209, 423, 533, 662]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
DataFormat "StructureWithTime"
SampleTime "0"
}
Block {
BlockType Scope
Name "Scope3"
Ports [1]
Position [229, 355, 261, 385]
Orientation "down"
NamePlacement "alternate"
Floating off
Location [188, 390, 512, 629]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
YMin "-0.1"
YMax "0.1"
SaveName "ScopeData4"
DataFormat "StructureWithTime"
SampleTime "0"
}
Block {
BlockType Step
Name "Step"
Position [170, 205, 200, 255]
Time "0"
SampleTime "0.005"
}
Block {
BlockType SubSystem
Name "Subsystem1"
Ports [1, 4]
Position [490, 178, 540, 277]
ErrorFcn "1122"
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
MaskHideContents off
Port {
PortNumber 1
Description "POSITION"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
System {
Name "Subsystem1"
Location [2, 74, 1014, 724]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [160, 233, 190, 247]
IconDisplay "Port number"
}
Block {
BlockType Demux
Name "Demux"
Ports [1, 2]
Position [425, 161, 430, 319]
BackgroundColor "black"
ShowName off
Outputs "2"
}
Block {
BlockType Reference
Name "Difference"
Ports [1, 1]
Position [540, 302, 600, 338]
SourceBlock "simulink/Discrete/Difference"
SourceType "Difference"
ShowPortLabels on
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
ICPrevInput "0.0"
OutputDataTypeScalingMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^-10"
LockScale off
RndMeth "Floor"
DoSatur off
}
Block {
BlockType Reference
Name "Difference1"
Ports [1, 1]
Position [535, 182, 595, 218]
SourceBlock "simulink/Discrete/Difference"
SourceType "Difference"
ShowPortLabels on
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
ICPrevInput "0.0"
OutputDataTypeScalingMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^-10"
LockScale off
RndMeth "Floor"
DoSatur off
}
Block {
BlockType DiscreteStateSpace
Name "Discrete State-Space"
Position [250, 221, 360, 259]
A "A"
B "B"
C "C"
D "D"
SampleTime "0.005"
}
Block {
BlockType Gain
Name "Gain"
Position [615, 305, 645, 335]
Gain "1/T"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain1"
Position [610, 185, 640, 215]
Gain "1/T"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Outport
Name "position"
Position [670, 153, 700, 167]
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "posdot"
Position [670, 193, 700, 207]
Port "2"
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "angle"
Position [675, 273, 705, 287]
Port "3"
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "angdot"
Position [675, 313, 705, 327]
Port "4"
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Discrete State-Space"
SrcPort 1
DstBlock "Demux"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 1
Points [50, 0]
Branch {
Points [0, -40]
DstBlock "position"
DstPort 1
}
Branch {
DstBlock "Difference1"
DstPort 1
}
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "Discrete State-Space"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 2
Points [45, 0]
Branch {
Points [0, 40]
DstBlock "Difference"
DstPort 1
}
Branch {
DstBlock "angle"
DstPort 1
}
}
Line {
SrcBlock "Difference"
SrcPort 1
DstBlock "Gain"
DstPort 1
}
Line {
SrcBlock "Gain"
SrcPort 1
DstBlock "angdot"
DstPort 1
}
Line {
SrcBlock "Difference1"
SrcPort 1
DstBlock "Gain1"
DstPort 1
}
Line {
SrcBlock "Gain1"
SrcPort 1
DstBlock "posdot"
DstPort 1
}
Annotation {
Name "position"
Position [396, 189]
UseDisplayTextAsClickCallback off
}
Annotation {
Name "angle"
Position [400, 269]
UseDisplayTextAsClickCallback off
}
Annotation {
Name "Subsystem1"
Position [407, 344]
UseDisplayTextAsClickCallback off
}
}
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [330, 220, 350, 240]
ShowName off
IconShape "round"
Inputs "|+-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1]
Position [585, 130, 605, 150]
Orientation "up"
ShowName off
IconShape "round"
Inputs "++|"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType ToWorkspace
Name "To Workspace"
Position [170, 130, 230, 160]
Orientation "left"
VariableName "force"
MaxDataPoints "inf"
SampleTime "-1"
SaveFormat "Array"
}
Block {
BlockType Scope
Name "feedbackforce"
Ports [1]
Position [290, 354, 320, 386]
Orientation "left"
NamePlacement "alternate"
Floating off
Location [188, 390, 512, 629]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
TimeRange "20"
YMin "-100"
YMax "100"
SaveName "ScopeData1"
DataFormat "StructureWithTime"
SampleTime "0"
}
Line {
SrcBlock "Sum"
SrcPort 1
Points [5, 0]
Branch {
Points [0, -85]
Branch {
DstBlock "Scope2"
DstPort 1
}
Branch {
DstBlock "To Workspace"
DstPort 1
}
}
Branch {
Labels [0, 0]
DstBlock "Subsystem1"
DstPort 1
}
}
Line {
SrcBlock "Gain1"
SrcPort 1
Points [-100, 0; 0, -15]
Branch {
DstBlock "Sum"
DstPort 2
}
Branch {
Points [0, 15]
DstBlock "feedbackforce"
DstPort 1
}
}
Line {
SrcBlock "Subsystem1"
SrcPort 2
Points [65, 0]
Branch {
Points [0, 145]
DstBlock "Mux"
DstPort 2
}
Branch {
DstBlock "Scope1"
DstPort 1
}
}
Line {
SrcBlock "Subsystem1"
SrcPort 1
Points [50, 0]
Branch {
Points [0, 155]
DstBlock "Mux"
DstPort 1
}
Branch {
DstBlock "Sum1"
DstPort 2
}
}
Line {
SrcBlock "Subsystem1"
SrcPort 4
Points [95, 0]
Branch {
Points [0, 125]
DstBlock "Mux"
DstPort 4
}
Branch {
DstBlock "Gain2"
DstPort 1
}
}
Line {
SrcBlock "Subsystem1"
SrcPort 3
Points [80, 0]
Branch {
Points [0, 135]
DstBlock "Mux"
DstPort 3
}
Branch {
DstBlock "Gain"
DstPort 1
}
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Gain1"
DstPort 1
}
Line {
SrcBlock "Gain"
SrcPort 1
DstBlock "Scope"
DstPort 2
}
Line {
SrcBlock "Gain2"
SrcPort 1
DstBlock "Scope1"
DstPort 2
}
Line {
SrcBlock "Step"
SrcPort 1
Points [0, 0]
Branch {
DstBlock "Sum"
DstPort 1
}
Branch {
Points [40, 0]
DstBlock "Scope3"
DstPort 1
}
}
Line {
SrcBlock "Constant"
SrcPort 1
DstBlock "Sum1"
DstPort 1
}
Line {
SrcBlock "Sum1"
SrcPort 1
DstBlock "Scope"
DstPort 1
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?