📄 ro.mdl
字号:
Points [135, 0]
DstBlock "Current Sensor"
DstPort RConn2
}
Branch {
ConnectType "SRC_DEST"
SrcBlock "Solver\nConfiguration"
SrcPort RConn1
Points [15, 0; 0, -30]
}
}
}
Line {
LineType "Connection"
SrcBlock "Simulink-PS\nConverter"
SrcPort RConn1
Points [40, 0]
DstBlock "Controlled Voltage\nSource"
DstPort RConn1
}
Line {
LineType "Connection"
SrcBlock "Controlled Voltage\nSource"
SrcPort LConn1
Points [0, -15]
DstBlock "Resistor"
DstPort LConn1
}
}
}
Block {
BlockType SubSystem
Name "Digital PID Controller"
Ports [1, 1]
Position [210, 167, 275, 223]
MinAlgLoopOccurrences off
PropExecContextOutsideSubsystem off
RTWSystemCode "Auto"
FunctionWithSeparateData off
Opaque off
RequestExecContextInheritance off
MaskHideContents off
MaskDisplay "disp('PID')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskPortRotate "default"
MaskIconUnits "autoscale"
Port {
PortNumber 1
Name "voltage"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
System {
Name "Digital PID Controller"
Location [93, 118, 772, 467]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "112"
Block {
BlockType Inport
Name "e"
Position [45, 90, 65, 110]
IconDisplay "Port number"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Block {
BlockType Gain
Name "Derivative"
Position [115, 183, 165, 207]
BackgroundColor "green"
Gain "Kd"
ParameterDataType "sfix(16)"
ParameterScaling "2^0"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Block {
BlockType Gain
Name "Derivative\nDivisor"
Position [305, 182, 350, 208]
Gain "N"
ParameterDataType "sfix(16)"
ParameterScaling "2^0"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Block {
BlockType DiscreteIntegrator
Name "Discrete-Time\nIntegrator"
Ports [1, 1]
Position [225, 84, 260, 116]
IntegratorMethod "Integration: Forward Euler"
ExternalReset "none"
InitialConditionSource "internal"
SampleTime "0.01"
OutDataType "sfix(16)"
OutScaling "2^0"
ICPrevOutput "DiscIntNeverNeededParam"
ICPrevScaledInput "DiscIntNeverNeededParam"
}
Block {
BlockType DiscreteIntegrator
Name "Discrete-Time\nIntegrator1"
Ports [1, 1]
Position [250, 254, 285, 286]
BlockMirror on
IntegratorMethod "Integration: Forward Euler"
ExternalReset "none"
InitialConditionSource "internal"
SampleTime "0.01"
OutDataType "sfix(16)"
OutScaling "2^0"
ICPrevOutput "DiscIntNeverNeededParam"
ICPrevScaledInput "DiscIntNeverNeededParam"
}
Block {
BlockType Gain
Name "Integral"
Position [115, 86, 170, 114]
BackgroundColor "green"
Gain "Ki"
ParameterDataType "sfix(16)"
ParameterScaling "2^0"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Block {
BlockType Gain
Name "Proportional"
Position [115, 26, 170, 54]
BackgroundColor "green"
Gain "Kp"
ParameterDataType "sfix(16)"
ParameterScaling "2^0"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Block {
BlockType Sum
Name "Sum"
Ports [3, 1]
Position [450, 82, 470, 118]
Inputs "+++"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Block {
BlockType Sum
Name "Sum2"
Ports [2, 1]
Position [195, 180, 225, 210]
ShowName off
IconShape "round"
Inputs "|+-"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Block {
BlockType Outport
Name "u"
Position [495, 90, 515, 110]
IconDisplay "Port number"
OutDataType "sfix(16)"
OutScaling "2^0"
InitialOutput "0"
}
Line {
SrcBlock "Discrete-Time\nIntegrator"
SrcPort 1
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "u"
DstPort 1
}
Line {
SrcBlock "e"
SrcPort 1
Points [20, 0]
Branch {
DstBlock "Integral"
DstPort 1
}
Branch {
Points [0, -60]
DstBlock "Proportional"
DstPort 1
}
Branch {
Points [0, 95]
DstBlock "Derivative"
DstPort 1
}
}
Line {
SrcBlock "Derivative\nDivisor"
SrcPort 1
Points [10, 0]
Branch {
Points [25, 0; 0, -85]
DstBlock "Sum"
DstPort 3
}
Branch {
Points [0, 75]
DstBlock "Discrete-Time\nIntegrator1"
DstPort 1
}
}
Line {
SrcBlock "Proportional"
SrcPort 1
Points [215, 0; 0, 50]
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Derivative"
SrcPort 1
DstBlock "Sum2"
DstPort 1
}
Line {
SrcBlock "Sum2"
SrcPort 1
DstBlock "Derivative\nDivisor"
DstPort 1
}
Line {
SrcBlock "Discrete-Time\nIntegrator1"
SrcPort 1
Points [-35, 0]
DstBlock "Sum2"
DstPort 2
}
Line {
SrcBlock "Integral"
SrcPort 1
DstBlock "Discrete-Time\nIntegrator"
DstPort 1
}
}
}
Block {
BlockType Reference
Name "Integer Delay"
Ports [1, 1]
Position [315, 313, 350, 347]
BlockMirror on
NamePlacement "alternate"
SourceBlock "simulink/Discrete/Integer Delay"
SourceType "Integer Delay"
vinit "0.0"
samptime "0.01"
NumDelays "1"
}
Block {
BlockType Reference
Name "Speed\n Constraint"
Ports [1]
Position [565, 181, 615, 209]
BackgroundColor "green"
DropShadow on
SourceBlock "sdolib/Signal Constraint"
SourceType "Signal Constraint"
ShowPortLabels "FromPortIcon"
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
DialogPosition "[0.05859375 0.169270833333333 0.4501953125 0.309895833333333]"
SaveIn "MAT file"
SaveAs "RO_optim.mat"
LogID "SRO_DataLog_1"
Ylim "[0 12]"
}
Block {
BlockType Step
Name "Speed\nSetpoint"
Position [30, 181, 55, 209]
After "10"
SampleTime "0"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [115, 185, 135, 205]
ShowName off
IconShape "round"
Inputs "|+-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
OutDataTypeStr "Inherit: Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Reference
Name "Voltage \nConstraint"
Ports [1]
Position [340, 46, 380, 74]
BackgroundColor "green"
DropShadow on
SourceBlock "sdolib/Signal Constraint"
SourceType "Signal Constraint"
ShowPortLabels "FromPortIcon"
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
DialogPosition "[0.470833333333333 0.5825 0.451041666666667 0.3075]"
SaveIn "MAT file"
SaveAs "RO_optim.mat"
LogID "SRO_DataLog_2"
Ylim "[-500 2500]"
}
Block {
BlockType SignalViewerScope
Name "Scope"
Ports []
Position [20, 15, 60, 55]
IOType "viewer"
List {
ListType IOSignalStrings
set0ParseKeys "17,11"
set0Sigs "Speed Setpoint:o1DC Motor:o1"
}
Location [1188, 288, 1512, 527]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
ShowDataMarkers on
ShowLegends on
TimeRange "10"
YMin "-1"
YMax "12"
DataFormat "Array"
MaxDataPoints "7500"
RefreshTime 0.035000
}
Block {
BlockType SignalViewerScope
Name "Scope1"
Ports []
Position [20, 15, 60, 55]
IOType "viewer"
List {
ListType IOSignalStrings
set0ParseKeys "25"
set0Sigs "Digital PID Controller:o1"
}
Location [188, 365, 512, 604]
Open off
NumInputPorts "1"
TickLabels "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
ShowDataMarkers on
ShowLegends off
TimeRange "0.163150483094937"
YMin "-193.4679513718988"
YMax "2304.574880499832"
SaveName "ScopeData1"
DataFormat "Array"
MaxDataPoints "7500"
RefreshTime 0.035000
}
Line {
SrcBlock "Speed\nSetpoint"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "Digital PID Controller"
DstPort 1
}
Line {
Name "voltage"
Labels [0, 0]
SrcBlock "Digital PID Controller"
SrcPort 1
DstBlock "DC Motor"
DstPort 1
}
Line {
Name "speed"
Labels [0, 0]
SrcBlock "DC Motor"
SrcPort 1
Points [45, 0]
Branch {
Points [0, 135]
DstBlock "Integer Delay"
DstPort 1
}
Branch {
DstBlock "Speed\n Constraint"
DstPort 1
}
}
Line {
SrcBlock "Integer Delay"
SrcPort 1
Points [-185, 0]
DstBlock "Sum"
DstPort 2
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -