📄 d_pend.mdl
字号:
Block {
BlockType Outport
Port "1"
BusObject "BusObject"
BusOutputAsStruct off
PortDimensions "-1"
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Block {
BlockType Quantizer
QuantizationInterval "0.5"
LinearizeAsGain on
SampleTime "-1"
}
Block {
BlockType Reference
}
Block {
BlockType Saturate
UpperLimit "0.5"
LowerLimit "-0.5"
LinearizeAsGain on
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Scope
Floating off
ModelBased off
TickLabels "OneTimeTick"
ZoomMode "on"
Grid "on"
TimeRange "auto"
YMin "-5"
YMax "5"
SaveToWorkspace off
SaveName "ScopeData"
LimitDataPoints on
MaxDataPoints "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType "S-Function"
FunctionName "system"
PortCounts "[]"
SFunctionModules "''"
}
Block {
BlockType Step
Time "1"
Before "0"
After "1"
SampleTime "-1"
VectorParams1D on
ZeroCross on
}
Block {
BlockType SubSystem
ShowPortLabels on
Permissions "ReadWrite"
PermitHierarchicalResolution "All"
SystemSampleTime "-1"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
SimViewingDevice off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
}
Block {
BlockType Sum
IconShape "rectangular"
Inputs "++"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType ToWorkspace
VariableName "simulink_output"
MaxDataPoints "1000"
Decimation "1"
SampleTime "0"
FixptAsFi off
}
Block {
BlockType TransferFcn
Numerator "[1]"
Denominator "[1 2 1]"
AbsoluteTolerance "auto"
Realization "auto"
}
Block {
BlockType ZeroOrderHold
SampleTime "1"
}
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "Helvetica"
FontSize 10
FontWeight "normal"
FontAngle "normal"
}
LineDefaults {
FontName "Helvetica"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}
System {
Name "d_pend"
Location [81, 82, 934, 612]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType SubSystem
Name "Actuators"
Ports [1, 1]
Position [405, 174, 485, 216]
BackgroundColor "lightBlue"
DropShadow on
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "Actuators"
Location [433, 403, 931, 703]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [55, 138, 85, 152]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType TransferFcn
Name "Actuator1"
Position [200, 92, 260, 128]
BackgroundColor "lightBlue"
DropShadow on
Numerator "[gd1]"
Denominator "[Td1 1]"
}
Block {
BlockType TransferFcn
Name "Actuator2"
Position [200, 162, 260, 198]
BackgroundColor "lightBlue"
DropShadow on
Numerator "[gd2]"
Denominator "[Td2 1]"
}
Block {
BlockType BusCreator
Name "Bus\nCreator"
Ports [2, 1]
Position [330, 126, 335, 164]
ShowName off
DialogController "Simulink.DDGSource_Bus"
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Demux
Name "Demux1"
Ports [1, 2]
Position [120, 126, 125, 164]
BackgroundColor "black"
ShowName off
Outputs "[1, 1]"
}
Block {
BlockType Outport
Name "Out1"
Position [385, 138, 415, 152]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "Demux1"
DstPort 1
}
Line {
SrcBlock "Demux1"
SrcPort 1
Points [30, 0; 0, -25]
DstBlock "Actuator1"
DstPort 1
}
Line {
SrcBlock "Demux1"
SrcPort 2
Points [30, 0; 0, 25]
DstBlock "Actuator2"
DstPort 1
}
Line {
SrcBlock "Actuator1"
SrcPort 1
Points [35, 0; 0, 25]
DstBlock "Bus\nCreator"
DstPort 1
}
Line {
SrcBlock "Actuator2"
SrcPort 1
Points [35, 0; 0, -25]
DstBlock "Bus\nCreator"
DstPort 2
}
Line {
SrcBlock "Bus\nCreator"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Annotation {
Name "Actuators"
Position [231, 31]
FontSize 12
FontWeight "bold"
}
}
}
Block {
BlockType BusCreator
Name "Bus\nCreator"
Ports [2, 1]
Position [550, 166, 555, 204]
ShowName off
DialogController "Simulink.DDGSource_Bus"
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType BusCreator
Name "Bus\nCreator1"
Ports [2, 1]
Position [205, 176, 210, 214]
ShowName off
DialogController "Simulink.DDGSource_Bus"
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Clock
Name "Clock"
Position [55, 420, 75, 440]
BackgroundColor "green"
Decimation "1"
}
Block {
BlockType SubSystem
Name "Controller"
Ports [1, 1]
Position [245, 174, 325, 216]
BackgroundColor "red"
DropShadow on
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Controller"
Location [161, 189, 801, 400]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [35, 93, 65, 107]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType DiscreteStateSpace
Name "Discrete-time Controller"
Position [255, 82, 375, 118]
BackgroundColor "red"
DropShadow on
A "Akd"
B "Bkd"
C "Ckd"
D "Dkd"
SampleTime "Ts"
}
Block {
BlockType Quantizer
Name "Quantizer1"
Position [205, 85, 235, 115]
BackgroundColor "orange"
DropShadow on
QuantizationInterval "2*u_adc/2^B_adc"
}
Block {
BlockType Quantizer
Name "Quantizer2"
Position [510, 85, 540, 115]
BackgroundColor "orange"
DropShadow on
QuantizationInterval "2*u_dac/2^B_dac"
}
Block {
BlockType Saturate
Name "Saturation1"
Position [150, 85, 180, 115]
BackgroundColor "green"
DropShadow on
UpperLimit "u_adc"
LowerLimit "-u_adc"
}
Block {
BlockType Saturate
Name "Saturation2"
Position [455, 84, 485, 116]
BackgroundColor "green"
DropShadow on
UpperLimit "u_dac"
LowerLimit "-u_dac"
}
Block {
BlockType ZeroOrderHold
Name "Zero-Order\nHold1"
Position [90, 81, 125, 119]
BackgroundColor "blue"
DropShadow on
SampleTime "Ts"
}
Block {
BlockType ZeroOrderHold
Name "Zero-Order\nHold2"
Position [400, 81, 435, 119]
BackgroundColor "blue"
DropShadow on
SampleTime "Ts"
}
Block {
BlockType Outport
Name "Out1"
Position [565, 93, 595, 107]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Zero-Order\nHold1"
SrcPort 1
DstBlock "Saturation1"
DstPort 1
}
Line {
SrcBlock "Quantizer1"
SrcPort 1
DstBlock "Discrete-time Controller"
DstPort 1
}
Line {
SrcBlock "Discrete-time Controller"
SrcPort 1
DstBlock "Zero-Order\nHold2"
DstPort 1
}
Line {
SrcBlock "Zero-Order\nHold2"
SrcPort 1
DstBlock "Saturation2"
DstPort 1
}
Line {
SrcBlock "Saturation1"
SrcPort 1
DstBlock "Quantizer1"
DstPort 1
}
Line {
SrcBlock "Saturation2"
SrcPort 1
DstBlock "Quantizer2"
DstPort 1
}
Line {
SrcBlock "Quantizer2"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Line {
SrcBlock "In1"
SrcPort 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -