imvecv_hz.mdl
来自「关于电机的.m程序」· MDL 代码 · 共 1,939 行 · 第 1/4 页
MDL
1,939 行
Annotation {
Position [335, 294]
Text "fr"
}
Annotation {
Position [520, 105]
Text "is"
}
Annotation {
Position [490, 120]
Text "is"
}
}
}
Block {
BlockType Integrator
Name "Integrator2"
Ports [1, 1]
Position [870, 145, 900, 175]
ShowName off
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
Port {
PortNumber 1
Name "wm"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
}
}
Block {
BlockType Integrator
Name "Integrator3"
Ports [1, 1]
Position [570, 335, 600, 365]
ShowName off
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Mux
Name "Mux"
Ports [3, 1]
Position [765, 299, 770, 361]
ShowName off
Inputs "3"
DisplayOption "bar"
}
Block {
BlockType Mux
Name "Mux6"
Ports [2, 1]
Position [805, 56, 810, 109]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Mux
Name "Mux7"
Ports [2, 1]
Position [890, 261, 895, 314]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Mux
Name "Mux8"
Ports [2, 1]
Position [160, 275, 165, 350]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Mux
Name "Mux9"
Ports [2, 1]
Position [435, 104, 440, 186]
ShowName off
Inputs "2"
DisplayOption "bar"
Port {
PortNumber 1
Name "vt"
PropagatedSignals "vds, vqs"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
}
}
Block {
BlockType Scope
Name "SPEED"
Ports [1]
Position [195, 277, 250, 353]
ForegroundColor "green"
Floating off
Location [13, 53, 503, 370]
Open on
NumInputPorts "1"
TickLabels "on"
ZoomMode "on"
List {
ListType AxesTitles
axes1 "Speed [pu]"
}
List {
ListType SelectedSignals
axes1 ""
}
Grid "on"
TimeRange "4"
YMin "0"
YMax "1.1"
SaveToWorkspace off
SaveName "ScopeData"
DataFormat "Array"
LimitDataPoints on
MaxDataPoints "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType Saturate
Name "Saturation"
Position [375, 115, 400, 135]
ShowName off
UpperLimit "1"
LowerLimit "-1"
LinearizeAsGain on
Port {
PortNumber 1
Name "vds"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
}
}
Block {
BlockType SubSystem
Name "Speed controller"
Ports [1, 1]
Position [185, 168, 265, 222]
BackgroundColor "yellow"
NamePlacement "alternate"
ShowPortLabels on
TreatAsAtomicUnit off
RTWSystemCode "Auto"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
MaskDescription "Proportional-Integral Speed Controller"
MaskPromptString "Proportional gain (Kp)|Integral gain (Ki)|Satur"
"ation limit [pu]"
MaskStyleString "edit,edit,edit"
MaskTunableValueString "on,on,on"
MaskCallbackString "||"
MaskEnableString "on,on,on"
MaskVisibilityString "on,on,on"
MaskToolTipString "on,on,on"
MaskVariables "Kp=@1;Ki=@2;sat=@3;"
MaskDisplay "disp('PI')"
MaskIconFrame on
MaskIconOpaque off
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "0.6|5.6|0.03"
MaskVariableAliases ",,"
System {
Name "Speed controller"
Location [646, 568, 959, 697]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "we"
Position [20, 78, 50, 92]
Port "1"
LatchInput off
Interpolate on
}
Block {
BlockType Gain
Name "Gain"
Position [85, 71, 110, 99]
ShowName off
Gain "Ki"
Multiplication "Element-wise(K.*u)"
SaturateOnIntegerOverflow on
}
Block {
BlockType Gain
Name "Gain1"
Position [120, 16, 150, 44]
ShowName off
Gain "Kp"
Multiplication "Element-wise(K.*u)"
SaturateOnIntegerOverflow on
}
Block {
BlockType Integrator
Name "Integrator"
Ports [1, 1]
Position [130, 70, 155, 100]
ShowName off
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput on
UpperSaturationLimit "sat"
LowerSaturationLimit "-sat"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Saturate
Name "Saturation"
Position [220, 50, 240, 70]
ShowName off
UpperLimit "sat"
LowerLimit "-sat"
LinearizeAsGain on
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [175, 50, 195, 70]
ShowName off
IconShape "round"
Inputs "++"
SaturateOnIntegerOverflow on
}
Block {
BlockType Outport
Name "wr"
Position [265, 53, 295, 67]
Port "1"
OutputWhenDisabled "held"
InitialOutput "0"
}
Line {
SrcBlock "Saturation"
SrcPort 1
DstBlock "wr"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "Saturation"
DstPort 1
}
Line {
SrcBlock "Integrator"
SrcPort 1
Points [0, 0]
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "we"
SrcPort 1
Points [10, 0]
Branch {
Points [0, -55]
DstBlock "Gain1"
DstPort 1
}
Branch {
DstBlock "Gain"
DstPort 1
}
}
Line {
SrcBlock "Gain"
SrcPort 1
DstBlock "Integrator"
DstPort 1
}
Line {
SrcBlock "Gain1"
SrcPort 1
Points [30, 0]
DstBlock "Sum"
DstPort 1
}
}
}
Block {
BlockType Step
Name "Step load"
Position [705, 52, 740, 88]
ForegroundColor "red"
NamePlacement "alternate"
Time "2"
Before "0.0"
After "1"
SampleTime "0"
VectorParams1D on
Port {
PortNumber 1
Name "Tl"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
}
}
Block {
BlockType Sum
Name "Sum2"
Ports [3, 1]
Position [745, 150, 765, 170]
ShowName off
IconShape "round"
Inputs "-+-"
SaturateOnIntegerOverflow on
}
Block {
BlockType Sum
Name "Sum3"
Ports [2, 1]
Position [295, 185, 315, 205]
NamePlacement "alternate"
ShowName off
IconShape "round"
Inputs "|++"
SaturateOnIntegerOverflow on
Port {
PortNumber 1
Name "ws"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
}
}
Block {
BlockType Sum
Name "Sum4"
Ports [2, 1]
Position [125, 185, 145, 205]
ShowName off
IconShape "round"
Inputs "|+-"
SaturateOnIntegerOverflow on
}
Block {
BlockType Scope
Name "currents"
Ports [1]
Position [925, 268, 955, 312]
ForegroundColor "green"
NamePlacement "alternate"
Floating off
Location [643, 420, 1005, 717]
Open on
NumInputPorts "1"
TickLabels "OneTimeTick"
ZoomMode "on"
List {
ListType AxesTitles
axes1 "Stator current [pu]"
}
List {
ListType SelectedSignals
axes1 ""
}
Grid "on"
TimeRange "4"
YMin "-2"
YMax "2"
SaveToWorkspace off
SaveName "ScopeData"
DataFormat "StructureWithTime"
LimitDataPoints on
MaxDataPoints "8000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType Fcn
Name "ias"
Position [795, 315, 835, 345]
Expr "u(1)*cos(u(3))-u(2)*sin(u(3))"
Port {
PortNumber 1
Name "ias"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
}
}
Block {
BlockType SubSystem
Name "info"
Ports []
Position [22, 34, 94, 103]
ForegroundColor "darkGreen"
DropShadow on
ShowName off
ShowPortLabels on
TreatAsAtomicUnit off
RTWSystemCode "Auto"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
MaskDisplay "plot(-1.5,-1.5,1.5,1.5,cos(0:.01:7),sin(0:.01:7"
") )\ndisp('Info')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "info"
Location [23, 225, 471, 340]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "103"
Annotation {
Position [218, 17]
Text "Volts/Hz closed-loop speed control\nof an i"
"nduction motor"
FontSize 12
FontWeight "bold"
}
Annotation {
Position [15, 55]
HorizontalAlignment "left"
VerticalAlignment "top"
Text "To modify the machine parameters, double cl"
"ick the induction motor block. \nTo adjust the speed controller, double clic"
"k the PI block. "
FontSize 12
}
}
}
Block {
BlockType Fcn
Name "mag"
Position [790, 219, 830, 251]
Expr "sqrt(u(1)^2+u(2)^2)"
Port {
PortNumber 1
Name "Is_mag"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?