Root Locus · 학습
실행 준비
Python 경로는 python-control을 사용합니다. 모듈이 없으면 Colab·Jupyter의 코드 셀에서 %pip install control==0.10.2를 실행하세요.
이번에 배울 내용
Gain 하나를 고르는 문제가 Pole 위치와 Time Response에 어떻게 이어지는지 확인합니다.
전체 흐름
열린 고리 모델 → Gain 후보 → Closed-loop Pole → Time Response
Gain이 바뀔 때 Pole이 움직이는 경로
단위 Feedback의 Closed-loop Pole은 1+K L(s)=0의 근입니다. Root Locus는 K에 따라 그 근들이 이동하는 경로를 보여 줍니다.
K 하나를 고를 때는 그 K에 해당하는 모든 Pole을 함께 봅니다.
Pole 선택을 응답으로 확인하기
실수부가 양수인 Pole이 있으면 안정한 Step 지표를 계산할 수 없습니다. 안정한 후보라도 Zero·잔차·입력이 응답에 영향을 줍니다. Pole에서 예상한 감쇠·속도를 실제 곡선과 대조한 뒤 Gain을 선택합니다.
Gain으로 달라지는 Closed-loop Pole
에 를 적용합니다. Pole 지도와 Step 응답을 함께 봅니다.
import numpy as np
import matplotlib.pyplot as plt
import control as ctl
s=ctl.tf('s')
G=1/(s*(s+2));t=np.linspace(0,10,1001)
fig,axes=plt.subplots(1,2,figsize=(9,3))
for gain in [1,4,9]:
closed=ctl.feedback(gain*G,1);poles=ctl.poles(closed)
axes[0].scatter(poles.real,poles.imag,marker='x',label=f'K={gain}')
tm,y=ctl.step_response(closed,t);axes[1].plot(tm,y,label=f'K={gain}')
axes[0].set(xlabel='Real',ylabel='Imaginary');axes[1].set(xlabel='Time [s]',ylabel='Output')
for ax in axes:ax.grid();ax.legend()
fig.tight_layout()