📄 d_ss_controller.mdl
字号:
SignalType "auto"
SamplingMode "auto"
LatchByDelayingOutsideSignal off
LatchByCopyingInsideSignal off
Interpolate on
}
Block {
BlockType Integrator
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
IgnoreLimit off
ZeroCross on
}
Block {
BlockType Mux
Inputs "4"
DisplayOption "none"
UseBusObject off
BusObject "BusObject"
NonVirtualBus off
}
Block {
BlockType Outport
Port "1"
UseBusObject off
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 Product
Inputs "2"
Multiplication "Element-wise(.*)"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Zero"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Saturate
UpperLimit "0.5"
LowerLimit "-0.5"
LinearizeAsGain on
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Scope
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 "-1"
}
Block {
BlockType SubSystem
ShowPortLabels on
Permissions "ReadWrite"
PermitHierarchicalResolution "All"
TreatAsAtomicUnit off
SystemSampleTime "-1"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
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 Terminator
}
Block {
BlockType ZeroOrderHold
SampleTime "1"
}
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "Arial"
FontSize 10
FontWeight "normal"
FontAngle "normal"
}
LineDefaults {
FontName "Arial"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}
System {
Name "d_ss_controller"
Location [466, 84, 1256, 378]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType SubSystem
Name "Amplifier"
Ports [3, 1]
Position [320, 101, 390, 189]
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
MaskHideContents off
System {
Name "Amplifier"
Location [565, 553, 1183, 870]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
Block {
BlockType Inport
Name "U"
Position [25, 88, 55, 102]
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "Im"
Position [25, 223, 55, 237]
Port "2"
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "Back_emf"
Position [30, 258, 60, 272]
Port "3"
IconDisplay "Port number"
PortDimensions "1"
}
Block {
BlockType Gain
Name "AmpGain"
Position [225, 80, 280, 110]
Gain "200"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
Port {
PortNumber 1
Name "voltage"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Saturate
Name "Saturation"
Position [435, 80, 465, 110]
UpperLimit "12"
LowerLimit "-12"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [165, 85, 185, 105]
ShowName off
IconShape "round"
Inputs "|+-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
Port {
PortNumber 1
Name "Ierr"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1]
Position [365, 85, 385, 105]
ShowName off
IconShape "round"
Inputs "|+-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Uref->Iref"
Position [95, 80, 125, 110]
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Outport
Name "Vamp"
Position [515, 88, 545, 102]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "U"
SrcPort 1
Points [0, 0]
DstBlock "Uref->Iref"
DstPort 1
}
Line {
SrcBlock "Uref->Iref"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Im"
SrcPort 1
Points [115, 0]
DstBlock "Sum"
DstPort 2
}
Line {
Name "Ierr"
Labels [0, 0]
SrcBlock "Sum"
SrcPort 1
DstBlock "AmpGain"
DstPort 1
}
Line {
Name "voltage"
Labels [0, 0]
SrcBlock "AmpGain"
SrcPort 1
DstBlock "Sum1"
DstPort 1
}
Line {
SrcBlock "Back_emf"
SrcPort 1
Points [310, 0]
DstBlock "Sum1"
DstPort 2
}
Line {
SrcBlock "Sum1"
SrcPort 1
DstBlock "Saturation"
DstPort 1
}
Line {
SrcBlock "Saturation"
SrcPort 1
DstBlock "Vamp"
DstPort 1
}
Annotation {
Name "Uref is the disired current, expressed as a"
" voltage\nfrom D/As. The gain gives it the corresponding current value. "
Position [164, 52]
UseDisplayTextAsClickCallback off
}
}
}
Block {
BlockType SubSystem
Name "Controller"
Ports [1, 1]
Position [165, 55, 250, 175]
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
MaskHideContents off
System {
Name "Controller"
Location [153, 354, 983, 837]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
Block {
BlockType Inport
Name "Encoder"
Position [25, 308, 55, 322]
IconDisplay "Port number"
PortDimensions "1"
Port {
PortNumber 1
Name "encoder_in"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType DiscreteIntegrator
Name "Discrete-Time\nIntegrator"
Ports [1, 1]
Position [325, 299, 360, 331]
IntegratorMethod "Integration: Forward Euler"
gainval "1"
ExternalReset "none"
InitialConditionSource "internal"
SampleTime "Ts"
IgnoreLimit off
ICPrevOutput "DiscIntNeverNeededParam"
ICPrevScaledInput "DiscIntNeverNeededParam"
Port {
PortNumber 1
Name "integrator"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Gain
Name "Integral Gain"
Position [220, 297, 280, 333]
Gain "L3(5)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
SampleTime "Ts"
}
Block {
BlockType SubSystem
Name "Inverse Process Model"
Ports [1, 1]
Position [450, 55, 490, 115]
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
MaskHideContents off
System {
Name "Inverse Process Model"
Location [518, 378, 873, 511]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [25, 40, 55, 54]
IconDisplay "Port number"
}
Block {
BlockType Gain
Name "Inverse model"
Position [110, 27, 170, 63]
Gain "Kinv"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
SampleTime "Ts"
Port {
PortNumber 1
Name "Feed Forward"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Outport
Name "Out1"
Position [280, 40, 310, 54]
IconDisplay "Port number"
}
Line {
SrcBlock "In1"
SrcPort 1
Points [35, 0]
DstBlock "Inverse model"
DstPort 1
}
Line {
Name "Feed Forward"
Labels [0, 0]
SrcBlock "Inverse model"
SrcPort 1
Points [90, 0]
DstBlock "Out1"
DstPort 1
}
}
}
Block {
BlockType Gain
Name "L3"
Position [485, 168, 545, 212]
Gain "L3(1:4)"
Multiplication "Matrix(K*u) (u vector)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
SampleTime "Ts"
Port {
PortNumber 1
Name "state feedback"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType SubSystem
Name "Model"
Ports [0, 3]
Position [40, 73, 95, 157]
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
MaskHideContents off
Port {
PortNumber 2
Name "Xm"
PropagatedSignals "velocity (dth), position (th), velocity ("
"dth), position (th)"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
Port {
PortNumber 3
Name "ym"
PropagatedSignals "position (th)"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
System {
Name "Model"
Location [143, 395, 758, 720]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
Block {
BlockType Demux
Name "Demux1"
Ports [1, 3]
Position [125, 26, 130, 124]
BackgroundColor "black"
ShowName off
Outputs "3"
DisplayOption "bar"
Port {
PortNumber 1
Name "acceleration (ddth)"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
Port {
PortNumber 2
Name "velocity (dth)"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
Port {
PortNumber 3
Name "position (th)"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType FromWorkspace
Name "From\nWorkspace"
Position [20, 63, 85, 87]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -