📄 d_ss_controller.mdl
字号:
}
Block {
BlockType Sum
Name "Sum6"
Ports [2, 1]
Position [70, 170, 90, 190]
ShowName off
IconShape "round"
Inputs "|+-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Outport
Name "c_torque"
Position [45, 118, 75, 132]
IconDisplay "Port number"
BusOutputAsStruct off
PortDimensions "1"
}
Block {
BlockType Outport
Name "dth_l"
Position [295, 243, 325, 257]
Port "2"
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "th_l"
Position [480, 173, 510, 187]
Port "3"
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "th_m"
SrcPort 1
DstBlock "Sum4"
DstPort 1
}
Line {
SrcBlock "dth_m"
SrcPort 1
DstBlock "Sum2"
DstPort 1
}
Line {
SrcBlock "Spring \ndamping3"
SrcPort 1
Points [-90, 0]
DstBlock "Sum6"
DstPort 2
}
Line {
SrcBlock "Sum6"
SrcPort 1
DstBlock "Rotor inertia1"
DstPort 1
}
Line {
SrcBlock "Sum5"
SrcPort 1
Points [10, 0; 0, 195; -495, 0; 0, -130]
Branch {
DstBlock "c_torque"
DstPort 1
}
Branch {
DstBlock "Sum6"
DstPort 1
}
}
Line {
Name "torque_k"
Labels [0, 0]
SrcBlock "Spring \nconstant"
SrcPort 1
Points [50, 0]
DstBlock "Sum5"
DstPort 2
}
Line {
Name "torque_b"
Labels [0, 0]
SrcBlock "Spring \ndamping"
SrcPort 1
Points [160, 0]
DstBlock "Sum5"
DstPort 1
}
Line {
SrcBlock "Sum4"
SrcPort 1
DstBlock "Spring \nconstant"
DstPort 1
}
Line {
SrcBlock "Sum2"
SrcPort 1
DstBlock "Spring \ndamping"
DstPort 1
}
Line {
Name "ddth_l"
Labels [0, 0]
SrcBlock "Rotor inertia1"
SrcPort 1
DstBlock "Integrator3"
DstPort 1
}
Line {
Name "th_l"
Labels [0, 0]
SrcBlock "Integrator4"
SrcPort 1
Points [0, 0; 30, 0]
Branch {
DstBlock "th_l"
DstPort 1
}
Branch {
DstBlock "Sum4"
DstPort 2
}
}
Line {
Name "dth_l"
Labels [0, 0]
SrcBlock "Integrator3"
SrcPort 1
Points [0, 0; 30, 0]
Branch {
Points [0, 70]
Branch {
DstBlock "dth_l"
DstPort 1
}
Branch {
DstBlock "Spring \ndamping3"
DstPort 1
}
}
Branch {
DstBlock "Sum2"
DstPort 2
}
Branch {
DstBlock "Integrator4"
DstPort 1
}
}
}
}
Block {
BlockType Mux
Name "Mux"
Ports [4, 1]
Position [390, 327, 395, 483]
ShowName off
DisplayOption "bar"
Port {
PortNumber 1
PropagatedSignals "dth_m, th_m, dth_l, th_l"
ShowPropagatedSignals "on"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Terminator
Name "Terminator"
Position [300, 55, 320, 75]
ShowName off
}
Block {
BlockType Terminator
Name "Terminator1"
Position [325, 70, 345, 90]
ShowName off
}
Block {
BlockType Terminator
Name "Terminator2"
Position [235, 115, 255, 135]
ShowName off
}
Block {
BlockType Reference
Name "dc_motor_detailed3"
Ports [2, 7]
Position [80, 30, 205, 130]
BackgroundColor "lightBlue"
DropShadow on
SourceBlock "dc_motor_lib/dc_motor_detailed"
SourceType ""
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"
Rm "2.06"
Lm "0.000238"
Kb "1/((406*2*pi)/60)"
Kt "0.0235"
Jm "1.07e-6"
bm "12e-7"
Ktemp "14"
ttemp "910"
amb_temp "22"
Port {
PortNumber 1
Name "current"
PropagatedSignals "Current"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
Port {
PortNumber 5
Name "dth_m"
PropagatedSignals "dth_m"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
Port {
PortNumber 6
Name "th_m"
PropagatedSignals "th_m"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Outport
Name "states_X"
Position [560, 398, 590, 412]
IconDisplay "Port number"
BusOutputAsStruct off
PortDimensions "4"
}
Block {
BlockType Outport
Name "encoder"
Position [525, 238, 555, 252]
Port "2"
IconDisplay "Port number"
BusOutputAsStruct off
PortDimensions "1"
}
Block {
BlockType Outport
Name "Current"
Position [490, 28, 520, 42]
Port "3"
IconDisplay "Port number"
BusOutputAsStruct off
PortDimensions "1"
}
Block {
BlockType Outport
Name "back_emf"
Position [490, 63, 520, 77]
Port "4"
IconDisplay "Port number"
BusOutputAsStruct off
PortDimensions "1"
}
Line {
Name "dth_m"
SrcBlock "dc_motor_detailed3"
SrcPort 5
Points [65, 0]
Branch {
Labels [1, 1]
Points [0, 225]
DstBlock "Load"
DstPort 1
}
Branch {
Labels [3, 0]
Points [65, 0; 0, 250]
DstBlock "Mux"
DstPort 1
}
}
Line {
Name "th_m"
SrcBlock "dc_motor_detailed3"
SrcPort 6
Points [105, 0; 0, 135]
Branch {
Points [0, 110]
Branch {
Labels [1, 1]
DstBlock "Load"
DstPort 2
}
Branch {
Labels [2, 1]
Points [0, 30]
DstBlock "Mux"
DstPort 2
}
}
Branch {
DstBlock "encoder"
DstPort 1
}
}
Line {
Labels [0, 0]
SrcBlock "Mux"
SrcPort 1
Points [0, 0]
DstBlock "states_X"
DstPort 1
}
Line {
Name "dth_l"
Labels [-1, 1]
SrcBlock "Load"
SrcPort 2
Points [-25, 0; 0, 90]
DstBlock "Mux"
DstPort 3
}
Line {
SrcBlock "Load"
SrcPort 1
Points [-100, 0; 0, -205]
DstBlock "dc_motor_detailed3"
DstPort 2
}
Line {
SrcBlock "dc_motor_detailed3"
SrcPort 3
DstBlock "Terminator"
DstPort 1
}
Line {
SrcBlock "dc_motor_detailed3"
SrcPort 4
DstBlock "Terminator1"
DstPort 1
}
Line {
SrcBlock "dc_motor_detailed3"
SrcPort 7
DstBlock "Terminator2"
DstPort 1
}
Line {
SrcBlock "Vin"
SrcPort 1
DstBlock "dc_motor_detailed3"
DstPort 1
}
Line {
Name "current"
Labels [-1, 0]
SrcBlock "dc_motor_detailed3"
SrcPort 1
DstBlock "Current"
DstPort 1
}
Line {
SrcBlock "dc_motor_detailed3"
SrcPort 2
Points [145, 0; 0, 20]
DstBlock "back_emf"
DstPort 1
}
Line {
Name "th_l"
Labels [-1, 1]
SrcBlock "Load"
SrcPort 3
Points [0, 105]
DstBlock "Mux"
DstPort 4
}
}
}
Block {
BlockType Scope
Name "Scope1"
Ports [1]
Position [680, 104, 710, 136]
Floating off
Location [349, 643, 673, 882]
Open on
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
YMin "0.25"
YMax "0.25"
DataFormat "StructureWithTime"
LimitDataPoints off
SampleTime "0"
}
Block {
BlockType Scope
Name "Scope10"
Ports [1]
Position [465, 39, 495, 71]
Floating off
Location [13, 641, 337, 880]
Open on
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
YMin "-2.5e-008"
YMax "3.25e-007"
SaveName "ScopeData9"
DataFormat "StructureWithTime"
LimitDataPoints off
SampleTime "0"
}
Block {
BlockType Scope
Name "Scope2"
Ports [1]
Position [680, 184, 710, 216]
Floating off
Location [388, 741, 712, 980]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
YMin "-0.025"
YMax "0.25"
SaveName "ScopeData1"
DataFormat "StructureWithTime"
LimitDataPoints off
SampleTime "0"
}
Block {
BlockType Scope
Name "Scope8"
Ports [1]
Position [725, 74, 755, 106]
Floating off
Location [330, 284, 654, 523]
Open on
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
YMin "-400"
YMax "400"
SaveName "ScopeData7"
DataFormat "StructureWithTime"
LimitDataPoints off
SampleTime "0"
}
Block {
BlockType ZeroOrderHold
Name "Zero-Order\nHold1"
Position [85, 100, 120, 130]
ShowName off
SampleTime "Ts"
}
Line {
SrcBlock "Mechanics"
SrcPort 4
Points [10, 0; 0, 45; -255, 0; 0, -50]
DstBlock "Amplifier"
DstPort 3
}
Line {
SrcBlock "Mechanics"
SrcPort 3
Points [20, 0; 0, 85; -280, 0; 0, -95]
DstBlock "Amplifier"
DstPort 2
}
Line {
SrcBlock "Amplifier"
SrcPort 1
Points [0, 0; 15, 0]
Branch {
DstBlock "Mechanics"
DstPort 1
}
Branch {
Points [0, -90]
DstBlock "Scope10"
DstPort 1
}
}
Line {
SrcBlock "Demux"
SrcPort 4
Points [0, 0]
DstBlock "Scope1"
DstPort 1
}
Line {
SrcBlock "Mechanics"
SrcPort 1
Points [70, 0]
Branch {
DstBlock "Demux"
DstPort 1
}
Branch {
Points [0, 95]
DstBlock "Scope2"
DstPort 1
}
}
Line {
SrcBlock "Demux"
SrcPort 1
Points [0, 0]
DstBlock "Scope8"
DstPort 1
}
Line {
SrcBlock "Mechanics"
SrcPort 2
Points [35, 0; 0, 125; -535, 0; 0, -140]
DstBlock "Zero-Order\nHold1"
DstPort 1
}
Line {
SrcBlock "Zero-Order\nHold1"
SrcPort 1
DstBlock "Controller"
DstPort 1
}
Line {
SrcBlock "Controller"
SrcPort 1
DstBlock "Amplifier"
DstPort 1
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -