📄 engine2.mdl
字号:
SaturateOnIntegerOverflow on
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [110, 55, 130, 75]
ShowName off
IconShape "round"
Inputs "+-"
SaturateOnIntegerOverflow on
}
Block {
BlockType Integrator
Name "w = T/J\nw0 = 209 rad/s"
Ports [1, 1]
Position [260, 46, 290, 84]
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "209.48"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Outport
Name "N"
Position [320, 55, 340, 75]
Port "1"
OutputWhenDisabled "held"
InitialOutput "0"
}
Line {
SrcBlock "Tload"
SrcPort 1
Points [55, 0]
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Teng"
SrcPort 1
Points [55, 0]
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "Inverse Inertia,\n1/J"
DstPort 1
}
Line {
SrcBlock "w = T/J\nw0 = 209 rad/s"
SrcPort 1
DstBlock "N"
DstPort 1
}
Line {
SrcBlock "Inverse Inertia,\n1/J"
SrcPort 1
DstBlock "w = T/J\nw0 = 209 rad/s"
DstPort 1
}
}
}
Block {
BlockType Gain
Name "rad/s\nto rpm"
Position [670, 181, 720, 219]
NamePlacement "alternate"
Gain "30/pi"
Multiplication "Element-wise(K.*u)"
SaturateOnIntegerOverflow on
}
Block {
BlockType Step
Name "speed\nset\npoint"
Position [15, 170, 35, 190]
Time "5"
Before "2000"
After "3000"
SampleTime "0"
VectorParams1D on
}
Block {
BlockType Scope
Name "throttle deg (purple)\nload torque Nm\n(yellow)"
Ports [1]
Position [725, 275, 755, 315]
NamePlacement "alternate"
Floating off
Location [384, 470, 758, 668]
Open off
NumInputPorts "1"
TickLabels "on"
ZoomMode "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
List {
ListType SelectedSignals
axes1 ""
}
Grid "on"
TimeRange "auto"
YMin "5"
YMax "30"
SaveToWorkspace on
SaveName "Tth"
DataFormat "Structure"
LimitDataPoints off
MaxDataPoints "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType SubSystem
Name "valve timing"
Ports [1, 1]
Position [560, 94, 625, 126]
Orientation "left"
NamePlacement "alternate"
ShowPortLabels on
TreatAsAtomicUnit off
RTWSystemCode "Auto"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
System {
Name "valve timing"
Location [413, 138, 831, 379]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "N"
Position [330, 50, 350, 70]
Orientation "left"
Port "1"
LatchInput off
Interpolate on
Port {
PortNumber 1
Name "rad/sec"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
}
}
Block {
BlockType SubSystem
Name "TDC and BDC detection"
Ports [1, 1]
Position [185, 37, 250, 83]
Orientation "left"
ShowPortLabels on
TreatAsAtomicUnit off
RTWSystemCode "Auto"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
System {
Name "TDC and BDC detection"
Location [106, 129, 499, 336]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "N"
Position [55, 103, 85, 117]
Port "1"
LatchInput off
Interpolate on
}
Block {
BlockType Constant
Name "Constant"
Position [50, 140, 80, 160]
ShowName off
Value "pi"
VectorParams1D on
}
Block {
BlockType Integrator
Name "Get Crank\nAngle\nIC 0"
Ports [2, 1, 0, 0, 1]
Position [215, 96, 250, 154]
NamePlacement "alternate"
ExternalReset "rising"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort on
AbsoluteTolerance "auto"
}
Block {
BlockType RelationalOperator
Name "Relational\nOperator"
Position [115, 113, 145, 162]
ShowName off
Operator ">="
}
Block {
BlockType Terminator
Name "Terminator"
Position [300, 105, 320, 125]
}
Block {
BlockType Outport
Name "trigger"
Position [310, 153, 340, 167]
Port "1"
OutputWhenDisabled "held"
InitialOutput "0"
}
Line {
SrcBlock "N"
SrcPort 1
DstBlock "Get Crank\nAngle\nIC 0"
DstPort 1
}
Line {
SrcBlock "Relational\nOperator"
SrcPort 1
Points [0, 0; 5, 0]
Branch {
Points [0, 20]
DstBlock "trigger"
DstPort 1
}
Branch {
DstBlock "Get Crank\nAngle\nIC 0"
DstPort 2
}
}
Line {
SrcBlock "Constant"
SrcPort 1
DstBlock "Relational\nOperator"
DstPort 2
}
Line {
SrcBlock "Get Crank\nAngle\nIC 0"
SrcPort state
Points [0, 16; -130, 0]
DstBlock "Relational\nOperator"
DstPort 1
}
Line {
SrcBlock "Get Crank\nAngle\nIC 0"
SrcPort 1
Points [0, -10]
DstBlock "Terminator"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "positive edge to\ndual edge conversion"
Ports [0, 1, 0, 1]
Position [100, 93, 155, 137]
Orientation "left"
ShowPortLabels on
TreatAsAtomicUnit on
RTWSystemCode "Auto"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
System {
Name "positive edge to\ndual edge conversion"
Location [679, 310, 939, 538]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType TriggerPort
Name "Trigger"
Ports []
Position [15, 60, 35, 80]
TriggerType "rising"
ShowOutputPort off
OutputDataType "auto"
}
Block {
BlockType Gain
Name "Gain"
Position [95, 85, 125, 115]
Orientation "left"
Gain "-1"
Multiplication "Element-wise(K.*u)"
SaturateOnIntegerOverflow on
}
Block {
BlockType UnitDelay
Name "Unit Delay"
Position [105, 25, 135, 55]
X0 "1"
SampleTime "-1"
RTWStateStorageClass "Auto"
}
Block {
BlockType Outport
Name "trigger"
Position [180, 34, 205, 46]
Port "1"
OutputWhenDisabled "held"
InitialOutput "-1"
}
Line {
SrcBlock "Unit Delay"
SrcPort 1
Points [0, 0; 10, 0]
Branch {
Points [0, 60]
DstBlock "Gain"
DstPort 1
}
Branch {
DstBlock "trigger"
DstPort 1
}
}
Line {
SrcBlock "Gain"
SrcPort 1
Points [-15, 0; 0, -60]
DstBlock "Unit Delay"
DstPort 1
}
}
}
Block {
BlockType Outport
Name "edge180"
Position [45, 105, 65, 125]
Orientation "left"
Port "1"
OutputWhenDisabled "held"
InitialOutput "-1"
}
Line {
Name "rad/sec"
Labels [1, 0]
SrcBlock "N"
SrcPort 1
DstBlock "TDC and BDC detection"
DstPort 1
}
Line {
SrcBlock "positive edge to\ndual edge conversion"
SrcPort 1
DstBlock "edge180"
DstPort 1
}
Line {
SrcBlock "TDC and BDC detection"
SrcPort 1
Points [-55, 0]
DstBlock "positive edge to\ndual edge conversion"
DstPort trigger
}
}
}
Block {
BlockType Outport
Name "crank speed\n(rpm)"
Position [745, 105, 765, 125]
NamePlacement "alternate"
Port "1"
OutputWhenDisabled "held"
InitialOutput "0"
}
Line {
SrcBlock "speed\nset\npoint"
SrcPort 1
DstBlock "Controller"
DstPort 1
}
Line {
SrcBlock "Drag Torque"
SrcPort 1
Points [15, 0]
Branch {
Points [0, 25]
DstBlock "Mux"
DstPort 1
}
Branch {
DstBlock "Vehicle\nDynamics"
DstPort 2
}
}
Line {
SrcBlock "Controller"
SrcPort 1
Points [10, 0]
Branch {
Points [0, 115]
DstBlock "Mux"
DstPort 2
}
Branch {
DstBlock "Throttle & Manifold"
DstPort 1
}
}
Line {
SrcBlock "Compression"
SrcPort 1
DstBlock "Combustion"
DstPort 1
}
Line {
SrcBlock "Throttle & Manifold"
SrcPort 1
DstBlock "Intake"
DstPort 1
}
Line {
SrcBlock "Intake"
SrcPort state
Points [0, -5]
DstBlock "Compression"
DstPort 1
}
Line {
SrcBlock "Compression"
SrcPort 2
Points [10, 0; 0, 70; -170, 0; 0, -35]
DstBlock "Intake"
DstPort 2
}
Line {
SrcBlock "valve timing"
SrcPort 1
Points [-125, 0]
Branch {
Points [-325, 0]
DstBlock "Controller"
DstPort trigger
}
Branch {
DstBlock "Compression"
DstPort trigger
}
}
Line {
SrcBlock "Combustion"
SrcPort 1
DstBlock "Vehicle\nDynamics"
DstPort 1
}
Line {
SrcBlock "Vehicle\nDynamics"
SrcPort 1
Points [10, 0]
Branch {
Points [0, 95; -165, 0]
Branch {
Points [-320, 0]
Branch {
Points [-125, 0; 0, -85]
DstBlock "Controller"
DstPort 2
}
Branch {
Points [0, -65]
DstBlock "Throttle & Manifold"
DstPort 2
}
}
Branch {
DstBlock "Combustion"
DstPort 2
}
}
Branch {
DstBlock "rad/s\nto rpm"
DstPort 1
}
Branch {
Points [0, -90]
DstBlock "valve timing"
DstPort 1
}
}
Line {
SrcBlock "rad/s\nto rpm"
SrcPort 1
Points [5, 0]
Branch {
DstBlock "Engine\nSpeed\n(rpm)"
DstPort 1
}
Branch {
DstBlock "crank speed\n(rpm)"
DstPort 1
}
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "throttle deg (purple)\nload torque Nm\n(yellow)"
DstPort 1
}
Line {
SrcBlock "Intake"
SrcPort 1
DstBlock "Terminator"
DstPort 1
}
Annotation {
Position [42, 118]
}
Annotation {
Position [55, 127]
Text "engine2.mdl"
FontName "Arial"
FontSize 12
FontWeight "bold"
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -