Found an issue with the book? Report it on Github.

DC 전원 공급장치(DC Power Supply)

DC 전원 공급장치(DC Power Supply)

이 섹션에서는 모델리카에서 DC 전원 공급 장치 모델을 구현하는 방법을 살펴보겠습니다.재사용 가능한 하위 시스템 모델을 사용하기 위해 플랫 시스템 모델을 리팩토링하는 방법을 다시 한 번 보여드리겠습니다.

수평적 전원 공급 모델(Flat Power Supply Model)

이 경우 플랫 시스템 모델은 여기에 표시된 DC 전원 공급 회로가 됩니다.

Flat switching power supply model

모델리카에서 구현된 이 모델은 다음과 같습니다.

within ModelicaByExample.Subsystems.PowerSupply.Examples;
model FlatCircuit "A model with power source, AC-DC conversion and load in one diagram"
  import Modelica.Electrical.Analog;
  Analog.Sources.SineVoltage wall_voltage(V=120, freqHz=60)
    annotation ...
  Analog.Ideal.IdealClosingSwitch switch(Goff=0)
    annotation ...
  Analog.Ideal.IdealTransformer transformer(Lm1=1, n=10, considerMagnetization=false)
    annotation ...
  Analog.Ideal.IdealDiode D1(Vknee=0, Ron=1e-5, Goff=1e-5)
    annotation ...
  Analog.Basic.Capacitor capacitor(C=1e-2)
    annotation ...
  Analog.Basic.Resistor load(R=100)
    annotation ...
  Modelica.Blocks.Sources.BooleanStep step(startTime=0.25)
    annotation ...
  Analog.Ideal.IdealDiode D2(Vknee=0, Ron=1e-5, Goff=1e-5)
    annotation ...
  Analog.Ideal.IdealDiode D3(Vknee=0, Ron=1e-5, Goff=1e-5)
    annotation ...
  Analog.Ideal.IdealDiode D4(Vknee=0, Ron=1e-5, Goff=1e-5)
    annotation ...
  Analog.Basic.Ground ground1
    annotation ...
equation
  connect(D1.p, D3.p) annotation ...
  connect(load.p, capacitor.p) annotation ...
  connect(load.p, D2.n) annotation ...
  connect(D1.n, D2.p) annotation ...
  connect(switch.p, wall_voltage.p) annotation ...
  connect(switch.n, transformer.p1) annotation ...
  connect(step.y, switch.control) annotation ...
  connect(D3.n, D4.p) annotation ...
  connect(D2.n, D4.n) annotation ...
  connect(transformer.p2, D1.n) annotation ...
  connect(D4.p, transformer.n2) annotation ...
  connect(wall_voltage.n, transformer.n1) annotation ...
  connect(wall_voltage.n, ground1.p) annotation ...
  connect(transformer.n2, ground1.p) annotation ...
  connect(D1.p, capacitor.n) annotation ...
  connect(load.n, capacitor.n) annotation ...
end FlatCircuit;

이러한 종류의 전원 공급 장치는 AC 입력 전압(60Hz에서 120V)을 취하여 정류한 다음 저역 통과 필터를 통과시키는 방식으로 작동합니다. 이 모델을 시뮬레이션하면 부하 저항에서 다음과 같은 전압을 볼 수 있습니다.

/static/_images/FC.svg

여기서 목표는 12볼트의 출력 전압입니다.그러나 전원 공급 장치의 부하가 클수록 출력 신호의 품질이 낮아집니다.이 특정 시뮬레이션에서 부하는 초기에 0입니다(전원 공급 장치에 대한 스위치가 열려 있기 때문). 그러나 스위치가 닫히고 전류가 부하(load 라는 저항)를 통해 흐르기 시작하면 부하가 미친 약간의 결과를 볼 수 있습니다.

계층적 전원 공급(Hierarchical Power Supply)

다시 한 번, 일부 구성 요소 모음을 가져와 하위 시스템 모델로 구성하여 시스템의 수평적 버전을 개선할 것입니다.그러면 시스템 레벨 회로는 다음과 같이 됩니다.

Hierarchical power supply model

이 모델은 다이어그램이 여기에 표시된 BasicPowerSupply 모델을 사용합니다:

Reusable power supply subsystem model

이 재사용 가능한 전원 공급 장치 하위 시스템 모델의 모델리카 소스 코드는 다음과 같습니다.

within ModelicaByExample.Subsystems.PowerSupply.Components;
model BasicPowerSupply "Power supply with transformer and rectifier"
  import Modelica.Electrical.Analog;
  parameter Modelica.SIunits.Capacitance C=1e-2
    "Filter capacitance"
    annotation ...
  parameter Modelica.SIunits.Conductance Goff=1e-5
    "Backward state-off conductance (opened diode conductance)"
    annotation ...
  parameter Modelica.SIunits.Resistance Ron=1e-5
    "Forward state-on differential resistance (closed diode resistance)"
    annotation ...
  parameter Real n=10
    "Turns ratio primary:secondary voltage"
    annotation ...
  parameter Boolean considerMagnetization=false
    "Choice of considering magnetization"
    annotation ...
  parameter Modelica.SIunits.Inductance Lm1=1e-2
    "Magnetization inductance w.r.t. primary side"
    annotation ...

  Analog.Interfaces.NegativePin gnd
    "Pin to ground power supply"
    annotation ...
  Analog.Interfaces.PositivePin p
    "Positive pin on supply side"
    annotation ...
  Analog.Interfaces.PositivePin p_load
    "Positive pin for load side"
    annotation ...
  Analog.Interfaces.NegativePin n_load
    "Negative pin for load side"
    annotation ...
protected
  Analog.Ideal.IdealTransformer transformer(
    final n=n, final considerMagnetization=considerMagnetization,
    final Lm1=Lm1)
    annotation ...
  Analog.Ideal.IdealDiode D1(final Vknee=0, final Ron=Ron, final Goff=Goff)
    annotation ...
  Analog.Basic.Capacitor capacitor(C=C)
    annotation ...
  Analog.Ideal.IdealDiode D2(final Vknee=0, final Ron=Ron, final Goff=Goff)
    annotation ...
  Analog.Ideal.IdealDiode D3(final Vknee=0, final Ron=Ron, final Goff=Goff)
    annotation ...
  Analog.Ideal.IdealDiode D4(final Vknee=0, final Ron=Ron, final Goff=Goff)
    annotation ...
equation
  connect(D1.p, capacitor.n) annotation ...
  connect(transformer.p2, D1.n) annotation ...
  connect(capacitor.p, D2.n) annotation ...
  connect(D2.n, D4.n) annotation ...
  connect(D1.p, D3.p) annotation ...
  connect(D3.n, D4.p) annotation ...
  connect(D1.n, D2.p) annotation ...
  connect(D4.p,transformer. n2) annotation ...
  connect(transformer.n1, gnd) annotation ...
  connect(transformer.n2, gnd) annotation ...
  connect(transformer.p1, p) annotation ...
  connect(capacitor.p, p_load) annotation ...
  connect(capacitor.n, n_load) annotation ...
end BasicPowerSupply;

이 모델에 대해 주목해야 할 몇 가지 흥미로운 사항이 있습니다. 먼저 파라미터와 커넥터는 public , 내부 구성 요소가 protected 로 구현되는 이전과 동일한 조직 구조를 가지고, Dialog 주석을 사용하여 파라미터를 개별 그룹(이 경우 "General""Transformer")으로 구성한 것을 알 수 있습니다.또한 considerMagnetization 파라미터와 함께 enable 주석을 사용하여 considerMagnetization 이 true인 경우에만 Lm1 파라미터를 선택적으로 노출하는 것을 볼 수 있습니다.

계층적 시스템 모델을 사용하여 예상한 대로 수평 버전에서 얻은 것과 정확히 동일한 결과를 얻습니다.

/static/_images/SSC.svg

추가 로드를 포함하도록 시스템 모델을 확장할 수 있습니다(일부 지연 후 온라인 상태가 됨).

Flat switching power supply model

이 경우 모델을 시뮬레이션하면 추가 부하가 전원 공급 장치 출력 품질에 미치는 영향을 확인할 수 있습니다.

/static/_images/SSC_AL.svg

전원 공급 장치의 커패시턴스를 증가시켜 전압 변동의 진폭을 줄일 수 있습니다.

/static/_images/SSC_ALC.svg

그러나 커패시턴스 수준을 너무 많이 높이면 전원 공급 장치 출력이 부하 변화에 응답하는 데 매우 느리다는 것을 알 수 있습니다. 예를 들면 아래와 같습니다.

/static/_images/SSC_ALC2.svg

결론(Conclusion)

이 예제는 구성 요소 모음을 재사용 가능한 하위 시스템 모델로 구성하는 방법을 다시 한 번 보여주고,``protected`` 섹션에 내부 구성 요소를 유지하면서 결과 서브시스템 모델의 public 섹션에 파라미터수와 커넥터를 배치하는 모범 사례를 만들고 있습니다.