📄 testbcirobot3e_sim.mdl
字号:
Block {
BlockType From
Name "From6"
Position [75, 468, 140, 482]
BackgroundColor "red"
ShowName off
CloseFcn "tagdialog Close"
GotoTag "dir_right"
Port {
PortNumber 1
Name "dir right"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
DataLogging off
DataLoggingNameMode "SignalName"
DataLoggingDecimateData off
DataLoggingDecimation "2"
DataLoggingLimitDataPoints off
DataLoggingMaxPoints "5000"
}
}
Block {
BlockType Goto
Name "Goto1"
Position [725, 388, 790, 402]
BackgroundColor "red"
ShowName off
GotoTag "mot_ctrl"
TagVisibility "local"
}
Block {
BlockType Goto
Name "Goto2"
Position [725, 43, 790, 57]
BackgroundColor "red"
ShowName off
GotoTag "pulse_left"
TagVisibility "local"
}
Block {
BlockType Goto
Name "Goto3"
Position [725, 193, 790, 207]
BackgroundColor "red"
ShowName off
GotoTag "pulse_right"
TagVisibility "local"
}
Block {
BlockType Goto
Name "Goto5"
Position [725, 128, 790, 142]
BackgroundColor "red"
ShowName off
GotoTag "dir_left"
TagVisibility "local"
}
Block {
BlockType Goto
Name "Goto6"
Position [725, 278, 790, 292]
BackgroundColor "red"
ShowName off
GotoTag "dir_right"
TagVisibility "local"
}
Block {
BlockType Goto
Name "Goto7"
Position [725, 63, 790, 77]
BackgroundColor "red"
ShowName off
GotoTag "gate_left"
TagVisibility "local"
}
Block {
BlockType Goto
Name "Goto8"
Position [725, 213, 790, 227]
BackgroundColor "red"
ShowName off
GotoTag "gate_right"
TagVisibility "local"
}
Block {
BlockType SubSystem
Name "Motor Power\nControl"
Ports [2, 1]
Position [515, 354, 615, 436]
TreatAsAtomicUnit off
System {
Name "Motor Power\nControl"
Location [217, 336, 796, 652]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "Left Motor\nInstruction"
Position [105, 62, 135, 78]
BackgroundColor "orange"
}
Block {
BlockType Inport
Name "Right Motor \nInstruction"
Position [105, 232, 135, 248]
BackgroundColor "orange"
Port "2"
}
Block {
BlockType Ground
Name "Ground"
Position [160, 145, 180, 165]
}
Block {
BlockType Display
Name "Left Motor Pulse"
Ports [1]
Position [190, 16, 280, 44]
Decimation "1"
}
Block {
BlockType RelationalOperator
Name "Relational\nOperator"
Position [235, 152, 265, 183]
ShowName off
Operator "~="
InputSameDT off
}
Block {
BlockType RelationalOperator
Name "Relational\nOperator2"
Position [235, 107, 265, 138]
ShowName off
Operator "~="
InputSameDT off
}
Block {
BlockType Display
Name "Right Motor Pulse"
Ports [1]
Position [185, 261, 275, 289]
Decimation "1"
}
Block {
BlockType Display
Name "True=1, False=0"
Ports [1]
Position [335, 261, 425, 289]
Decimation "1"
}
Block {
BlockType Display
Name "True=1; False=0"
Ports [1]
Position [335, 16, 425, 44]
Decimation "1"
}
Block {
BlockType Logic
Name "switch off \nmotors in \nidle state\n(low a"
"ctive)"
Ports [2, 1]
Position [330, 132, 360, 163]
Operator "NOR"
AllPortsSameDT off
}
Block {
BlockType Outport
Name "Motor Control\nBit"
Position [510, 143, 540, 157]
BackgroundColor "orange"
}
Line {
Labels [0, 0]
SrcBlock "switch off \nmotors in \nidle state\n(low a"
"ctive)"
SrcPort 1
DstBlock "Motor Control\nBit"
DstPort 1
}
Line {
SrcBlock "Relational\nOperator"
SrcPort 1
Points [15, 0; 0, -15; 10, 0]
Branch {
Points [0, 120]
DstBlock "True=1, False=0"
DstPort 1
}
Branch {
DstBlock "switch off \nmotors in \nidle state\n(low"
" active)"
DstPort 2
}
}
Line {
SrcBlock "Relational\nOperator2"
SrcPort 1
Points [15, 0; 0, 15; 10, 0]
Branch {
Points [0, -110]
DstBlock "True=1; False=0"
DstPort 1
}
Branch {
DstBlock "switch off \nmotors in \nidle state\n(low"
" active)"
DstPort 1
}
}
Line {
SrcBlock "Ground"
SrcPort 1
Points [0, 0; 15, 0]
Branch {
Points [0, 20]
DstBlock "Relational\nOperator"
DstPort 2
}
Branch {
Points [0, -25]
DstBlock "Relational\nOperator2"
DstPort 2
}
}
Line {
SrcBlock "Left Motor\nInstruction"
SrcPort 1
Points [0, 0; 25, 0]
Branch {
Points [0, -40]
DstBlock "Left Motor Pulse"
DstPort 1
}
Branch {
Points [50, 0; 0, 45]
DstBlock "Relational\nOperator2"
DstPort 1
}
}
Line {
SrcBlock "Right Motor \nInstruction"
SrcPort 1
Points [0, 0; 25, 0]
Branch {
Points [0, 35]
DstBlock "Right Motor Pulse"
DstPort 1
}
Branch {
Points [50, 0; 0, -80]
DstBlock "Relational\nOperator"
DstPort 1
}
}
}
}
Block {
BlockType Scope
Name "Scope"
Ports [6]
Position [240, 384, 305, 506]
Location [471, 155, 971, 660]
Open off
NumInputPorts "6"
ZoomMode "xonly"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
axes2 "%<SignalLabel>"
axes3 "%<SignalLabel>"
axes4 "%<SignalLabel>"
axes5 "%<SignalLabel>"
axes6 "%<SignalLabel>"
}
List {
ListType SelectedSignals
axes1 ""
axes2 ""
axes3 ""
axes4 ""
axes5 ""
axes6 ""
}
TimeRange "10"
YMin "-1~-5~-5~-5~-5~-5"
YMax "4~5~5~5~5~5"
DataFormat "StructureWithTime"
LimitDataPoints off
}
Block {
BlockType SubSystem
Name "myGatedPulseTrain left"
Ports [1, 2]
Position [380, 39, 460, 81]
TreatAsAtomicUnit off
MaskPromptString "Sample time|Number of samples"
MaskStyleString "edit,edit"
MaskTunableValueString "on,on"
MaskCallbackString "|"
MaskEnableString "on,on"
MaskVisibilityString "on,on"
MaskToolTipString "on,on"
MaskVarAliasString ","
MaskVariables "Tcount=@1;Nsamp=@2;"
MaskInitialization "% each period has an on-phase and an off-phase"
"\nNcount = 2*Nsamp;\n"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "0.02|30"
System {
Name "myGatedPulseTrain left"
Location [43, 153, 968, 526]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "start"
Position [20, 98, 50, 112]
}
Block {
BlockType SubSystem
Name " latched high "
Ports [2, 1]
Position [550, 105, 615, 145]
TreatAsAtomicUnit off
System {
Name " latched high "
Location [181, 194, 702, 429]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "trig"
Position [40, 28, 70, 42]
}
Block {
BlockType Inport
Name "reset"
Position [40, 128, 70, 142]
Port "2"
}
Block {
BlockType Constant
Name "Constant1"
Position [40, 170, 70, 200]
ShowName off
}
Block {
BlockType Constant
Name "Constant4"
Position [265, 20, 295, 50]
Orientation "left"
ShowName off
}
Block {
BlockType Constant
Name "Constant5"
Position [40, 70, 70, 100]
ShowName off
}
Block {
BlockType DataTypeConversion
Name "Data Type Conversion"
Position [150, 166, 205, 194]
ShowName off
DataType "double"
}
Block {
BlockType Gain
Name "Gain"
Position [240, 165, 270, 195]
Gain "-1"
}
Block {
BlockType RelationalOperator
Name "Relational\nOperator2"
Position [90, 62, 120, 93]
ShowName off
Operator "=="
InputSameDT off
LogicOutDataTypeMode "Specify via dialog"
}
Block {
BlockType RelationalOperator
Name "Relational\nOperator3"
Position [90, 162, 120, 193]
ShowName off
Operator "=="
InputSameDT off
LogicOutDataTypeMode "Specify via dialog"
}
Block {
BlockType Sum
Name "Sum2"
Ports [2, 1]
Position [270, 105, 290, 125]
Orientation "left"
NamePlacement "alternate"
ShowName off
IconShape "round"
Inputs "|++"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Switch
Name "Switch"
Position [265, 55, 295, 85]
Criteria "u2 > Threshold"
InputSameDT off
SaturateOnIntegerOverflow off
}
Block {
BlockType UnitDelay
Name "Unit Delay2"
Position [315, 53, 350, 87]
ShowName off
SampleTime "-1"
}
Block {
BlockType Outport
Name "high"
Position [430, 63, 460, 77]
}
Line {
SrcBlock "Constant5"
SrcPort 1
DstBlock "Relational\nOperator2"
DstPort 2
}
Line {
SrcBlock "Relational\nOperator2"
SrcPort 1
DstBlock "Switch"
DstPort 3
}
Line {
SrcBlock "Unit Delay2"
SrcPort 1
Points [0, 0; 10, 0]
Branch {
Points [0, 45]
DstBlock "Sum2"
DstPort 1
}
Branch {
DstBlock "high"
DstPort 1
}
}
Line {
SrcBlock "Constant4"
SrcPort 1
Points [-25, 0; 0, 25]
DstBlock "Switch"
DstPort 1
}
Line {
SrcBlock "Switch"
SrcPort 1
DstBlock "Unit Delay2"
DstPort 1
}
Line {
SrcBlock "Sum2"
SrcPort 1
Points [-30, 0; 0, -45]
DstBlock "Switch"
DstPort 2
}
Line {
SrcBlock "Constant1"
SrcPort 1
DstBlock "Relational\nOperator3"
DstPort 2
}
Line {
SrcBlock "Relational\nOperator3"
SrcPort 1
DstBlock "Data Type Conversion"
DstPort 1
}
Line {
SrcBlock "Gain"
SrcPort 1
Points [5, 0]
DstBlock "Sum2"
DstPort 2
}
Line {
SrcBlock "Data Type Conversion"
SrcPort 1
DstBlock "Gain"
DstPort 1
}
Line {
SrcBlock "reset"
SrcPort 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -