📄 d_ss_controller.mdl
字号:
VariableName "trajectory"
SampleTime "Ts"
ZeroCross on
Port {
PortNumber 1
Name "trajectory"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Mux
Name "Mux"
Ports [4, 1]
Position [290, 105, 295, 195]
ShowName off
DisplayOption "bar"
}
Block {
BlockType Outport
Name "acc"
Position [310, 40, 340, 54]
IconDisplay "Port number"
}
Block {
BlockType Outport
Name "Xm"
Position [320, 145, 350, 159]
Port "2"
IconDisplay "Port number"
}
Block {
BlockType Outport
Name "ym"
Position [130, 210, 160, 225]
Orientation "down"
Port "3"
IconDisplay "Port number"
}
Line {
Name "position (th)"
Labels [0, 0]
SrcBlock "Demux1"
SrcPort 3
Points [10, 0; 0, 35]
Branch {
Points [40, 0]
Branch {
Points [90, 0]
DstBlock "Mux"
DstPort 2
}
Branch {
Points [0, 40]
DstBlock "Mux"
DstPort 4
}
}
Branch {
DstBlock "ym"
DstPort 1
}
}
Line {
Name "trajectory"
Labels [0, 0]
SrcBlock "From\nWorkspace"
SrcPort 1
DstBlock "Demux1"
DstPort 1
}
Line {
Name "velocity (dth)"
Labels [0, 0]
SrcBlock "Demux1"
SrcPort 2
Points [85, 0; 0, 45]
Branch {
Points [55, 0]
DstBlock "Mux"
DstPort 1
}
Branch {
Points [0, 40]
DstBlock "Mux"
DstPort 3
}
}
Line {
Name "acceleration (ddth)"
Labels [0, 0]
SrcBlock "Demux1"
SrcPort 1
Points [160, 0]
DstBlock "acc"
DstPort 1
}
Line {
SrcBlock "Mux"
SrcPort 1
Points [0, 0]
DstBlock "Xm"
DstPort 1
}
Annotation {
Name "model"
Position [108, 144]
UseDisplayTextAsClickCallback off
}
}
}
Block {
BlockType Mux
Name "Mux2"
Ports [2, 1]
Position [670, 361, 675, 399]
Orientation "left"
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType DiscreteStateSpace
Name "Observer"
Position [510, 361, 620, 399]
Orientation "left"
A "Aobs"
B "Bobs"
C "Cobs"
D "Dobs"
SampleTime "Ts"
Port {
PortNumber 1
Name "^X"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Sum
Name "Sum1"
Ports [3, 1]
Position [680, 180, 700, 200]
ShowName off
IconShape "round"
Inputs "+++"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
Port {
PortNumber 1
Name "U"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Sum
Name "Sum2"
Ports [2, 1]
Position [125, 305, 145, 325]
ShowName off
IconShape "round"
Inputs "+-|"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
Port {
PortNumber 1
Name "position error"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Sum
Name "Sum3"
Ports [2, 1]
Position [410, 180, 430, 200]
ShowName off
IconShape "round"
Inputs "|+-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Outport
Name "U"
Position [780, 183, 810, 197]
IconDisplay "Port number"
BusOutputAsStruct off
PortDimensions "1"
}
Line {
Name "position error"
Labels [0, 0]
SrcBlock "Sum2"
SrcPort 1
DstBlock "Integral Gain"
DstPort 1
}
Line {
SrcBlock "Integral Gain"
SrcPort 1
DstBlock "Discrete-Time\nIntegrator"
DstPort 1
}
Line {
SrcBlock "Model"
SrcPort 1
DstBlock "Inverse Process Model"
DstPort 1
}
Line {
Name "Xm"
Labels [-1, 1]
SrcBlock "Model"
SrcPort 2
Points [190, 0; 0, 75]
DstBlock "Sum3"
DstPort 1
}
Line {
SrcBlock "Sum3"
SrcPort 1
DstBlock "L3"
DstPort 1
}
Line {
Name "U"
Labels [0, 0]
SrcBlock "Sum1"
SrcPort 1
Points [45, 0]
Branch {
Labels [2, 0]
Points [0, 180]
DstBlock "Mux2"
DstPort 1
}
Branch {
DstBlock "U"
DstPort 1
}
}
Line {
Name "encoder_in"
SrcBlock "Encoder"
SrcPort 1
Points [0, 0; 10, 0]
Branch {
Labels [-1, 1]
DstBlock "Sum2"
DstPort 2
}
Branch {
Labels [-1, 1]
Points [0, 130; 680, 0; 0, -55]
DstBlock "Mux2"
DstPort 2
}
}
Line {
Name "state feedback"
Labels [-1, 0]
SrcBlock "L3"
SrcPort 1
DstBlock "Sum1"
DstPort 2
}
Line {
SrcBlock "Mux2"
SrcPort 1
DstBlock "Observer"
DstPort 1
}
Line {
SrcBlock "Inverse Process Model"
SrcPort 1
Points [195, 0]
DstBlock "Sum1"
DstPort 1
}
Line {
Name "integrator"
Labels [0, 0]
SrcBlock "Discrete-Time\nIntegrator"
SrcPort 1
Points [325, 0]
DstBlock "Sum1"
DstPort 3
}
Line {
Name "^X"
Labels [-1, 0]
SrcBlock "Observer"
SrcPort 1
Points [-85, 0]
DstBlock "Sum3"
DstPort 2
}
Line {
Name "ym"
Labels [2, 0]
SrcBlock "Model"
SrcPort 3
Points [35, 0]
DstBlock "Sum2"
DstPort 1
}
Annotation {
Name "State Feedback Controller with Observer and"
" Feed Forward Gain"
Position [406, 29]
UseDisplayTextAsClickCallback off
FontSize 16
FontWeight "bold"
}
Annotation {
Name "Observer"
Position [563, 344]
UseDisplayTextAsClickCallback off
FontSize 16
FontWeight "bold"
FontAngle "italic"
}
Annotation {
Name "State Feedback"
Position [461, 150]
UseDisplayTextAsClickCallback off
FontSize 16
FontWeight "bold"
FontAngle "italic"
}
Annotation {
Name "Integral Action"
Position [290, 281]
UseDisplayTextAsClickCallback off
FontSize 16
FontWeight "bold"
FontAngle "italic"
}
}
}
Block {
BlockType Demux
Name "Demux"
Ports [1, 4]
Position [645, 86, 650, 124]
BackgroundColor "black"
ShowName off
DisplayOption "bar"
}
Block {
BlockType SubSystem
Name "Mechanics"
Ports [1, 4]
Position [455, 93, 540, 192]
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
MaskHideContents off
System {
Name "Mechanics"
Location [566, 351, 1181, 858]
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 "Vin"
Position [25, 48, 55, 62]
IconDisplay "Port number"
PortDimensions "1"
}
Block {
BlockType SubSystem
Name "Load"
Ports [2, 3]
Position [145, 298, 225, 372]
Orientation "left"
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
MaskHideContents off
Port {
PortNumber 2
Name "dth_l"
PropagatedSignals "dth_l"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
Port {
PortNumber 3
Name "th_l"
PropagatedSignals "th_l"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
System {
Name "Load"
Location [54, 146, 605, 484]
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 "dth_m"
Position [260, 25, 290, 40]
Orientation "down"
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "th_m"
Position [350, 105, 380, 120]
Orientation "down"
Port "2"
IconDisplay "Port number"
}
Block {
BlockType Integrator
Name "Integrator3"
Ports [1, 1]
Position [210, 165, 240, 195]
IgnoreLimit off
Port {
PortNumber 1
Name "dth_l"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Integrator
Name "Integrator4"
Ports [1, 1]
Position [300, 165, 330, 195]
IgnoreLimit off
Port {
PortNumber 1
Name "th_l"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Gain
Name "Rotor inertia1"
Position [115, 164, 160, 196]
Gain "1/Jl"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
Port {
PortNumber 1
Name "ddth_l"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Gain
Name "Spring \nconstant"
Position [415, 135, 445, 165]
Gain "Ks"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
Port {
PortNumber 1
Name "torque_k"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Gain
Name "Spring \ndamping"
Position [305, 70, 335, 100]
Gain "b"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
Port {
PortNumber 1
Name "torque_b"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Gain
Name "Spring \ndamping3"
Position [175, 233, 255, 267]
Orientation "left"
Gain "12e-6"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum2"
Ports [2, 1]
Position [265, 75, 285, 95]
ShowName off
IconShape "round"
Inputs "+-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum4"
Ports [2, 1]
Position [355, 140, 375, 160]
ShowName off
IconShape "round"
Inputs "+-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum5"
Ports [2, 1]
Position [490, 105, 510, 125]
ShowName off
IconShape "round"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -