목차
1 원형 2차계 시스템의 모델링
2 제어 시스템의 출력응답특성
3 시스템의 출력응답 프로그래밍
2 제어 시스템의 출력응답특성
3 시스템의 출력응답 프로그래밍
본문내용
/////////////////////////////////////////////////////////////////////////
// CPrototypeView construction/destruction
CPrototypeView::CPrototypeView()
{
// TODO: add construction code here
}
CPrototypeView::~CPrototypeView()
{
}
BOOL CPrototypeView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CPrototypeView drawing
void CPrototypeView::OnDraw(CDC* pDC)
{
CPrototypeDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CClientDC dc(this);
int y_t = 0;
double K;
K = 187.17; // 제동비를 0.2로 초기화
// K = 17.17; // 제동비를 0.7로 초기화
double jeta, omega, root_jeta, theta ;
jeta= 0.0;
omega = 0.0;
root_jeta = 0.0;
theta = 0.0;
double exp_t, sin_t;
exp_t = 0.0;
sin_t = 0.0;
CPoint pt; // 출력응답파형 point
CRect rect; // View 윈도우
COLORREF color = RGB(0x00, 0x00, 0xff); // 출력함수파형 칼라
GetClientRect(rect);
// View 윈도우 좌표
dc.MoveTo(rect.left+70, rect.bottom-70);
dc.LineTo(rect.right-137, rect.bottom-70);
dc.MoveTo(rect.left+70, rect.bottom-70);
dc.LineTo(rect.left+70, rect.top+70);
dc.MoveTo(rect.left+70, rect.top+70);
dc.LineTo(rect.right-137, rect.top+70);
dc.MoveTo(rect.right-137, rect.top+70);
dc.LineTo(rect.right-137, rect.bottom-70);
// 출력응답파형 시간축 지정
dc.MoveTo(rect.left+70, rect.bottom-150);
dc.LineTo(rect.right-137, rect.bottom-150);
// 텍스트 스트링 출력
pDC->SetTextAlign(TA_LEFT);
pDC->TextOut(rect.left+270, rect.top+150, "Unit-Step Transient
Response");
// 제동비
omega = 67.08*sqrt(K);
jeta = 361.2/(2*omega);
root_jeta = sqrt(1-jeta*jeta);
theta = acos(jeta);
for (double t=0.0; t<=0.055; t+=0.0001) {
exp_t = exp(-jeta*omega*t);
sin_t = sin(omega*root_jeta*t + theta);
// 출력응답함수
y_t = (int)((1 - exp_t*sin_t/root_jeta)*100);
pt.x = (int)((rect.left+70.0) + t*10000.0);
pt.y = (rect.bottom-150) - y_t;
pDC->SetPixel(pt.x, pt.y, color);
}
}
/////////////////////////////////////////////////////////////////////////////
// CPrototypeView printing
BOOL CPrototypeView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CPrototypeView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CPrototypeView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CPrototypeView diagnostics
#ifdef _DEBUG
void CPrototypeView::AssertValid() const
{
CView::AssertValid();
}
void CPrototypeView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CPrototypeDoc* CPrototypeView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPrototypeDoc)));
return (CPrototypeDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CPrototypeView message handlers
// CPrototypeView construction/destruction
CPrototypeView::CPrototypeView()
{
// TODO: add construction code here
}
CPrototypeView::~CPrototypeView()
{
}
BOOL CPrototypeView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CPrototypeView drawing
void CPrototypeView::OnDraw(CDC* pDC)
{
CPrototypeDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CClientDC dc(this);
int y_t = 0;
double K;
K = 187.17; // 제동비를 0.2로 초기화
// K = 17.17; // 제동비를 0.7로 초기화
double jeta, omega, root_jeta, theta ;
jeta= 0.0;
omega = 0.0;
root_jeta = 0.0;
theta = 0.0;
double exp_t, sin_t;
exp_t = 0.0;
sin_t = 0.0;
CPoint pt; // 출력응답파형 point
CRect rect; // View 윈도우
COLORREF color = RGB(0x00, 0x00, 0xff); // 출력함수파형 칼라
GetClientRect(rect);
// View 윈도우 좌표
dc.MoveTo(rect.left+70, rect.bottom-70);
dc.LineTo(rect.right-137, rect.bottom-70);
dc.MoveTo(rect.left+70, rect.bottom-70);
dc.LineTo(rect.left+70, rect.top+70);
dc.MoveTo(rect.left+70, rect.top+70);
dc.LineTo(rect.right-137, rect.top+70);
dc.MoveTo(rect.right-137, rect.top+70);
dc.LineTo(rect.right-137, rect.bottom-70);
// 출력응답파형 시간축 지정
dc.MoveTo(rect.left+70, rect.bottom-150);
dc.LineTo(rect.right-137, rect.bottom-150);
// 텍스트 스트링 출력
pDC->SetTextAlign(TA_LEFT);
pDC->TextOut(rect.left+270, rect.top+150, "Unit-Step Transient
Response");
// 제동비
omega = 67.08*sqrt(K);
jeta = 361.2/(2*omega);
root_jeta = sqrt(1-jeta*jeta);
theta = acos(jeta);
for (double t=0.0; t<=0.055; t+=0.0001) {
exp_t = exp(-jeta*omega*t);
sin_t = sin(omega*root_jeta*t + theta);
// 출력응답함수
y_t = (int)((1 - exp_t*sin_t/root_jeta)*100);
pt.x = (int)((rect.left+70.0) + t*10000.0);
pt.y = (rect.bottom-150) - y_t;
pDC->SetPixel(pt.x, pt.y, color);
}
}
/////////////////////////////////////////////////////////////////////////////
// CPrototypeView printing
BOOL CPrototypeView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CPrototypeView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CPrototypeView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CPrototypeView diagnostics
#ifdef _DEBUG
void CPrototypeView::AssertValid() const
{
CView::AssertValid();
}
void CPrototypeView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CPrototypeDoc* CPrototypeView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPrototypeDoc)));
return (CPrototypeDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CPrototypeView message handlers
추천자료
퍼지제어이론
원격제어 프로그램 프로젝트 문서(방법론 적용한 전체 문서)
DC모터제어실험
PLC와시퀀스제어및자기유지회로에대한연구
제어공학 핵심Database
원격제어
자동제어의 실생활 활용 예
시퀀스제어이론
능동제어 실험 고찰
능동제어 실험( Piezo Natural Frequency Damping ratio)
공정제어 애플리2 시뮬레이션
자동제어 Modern Control and Systems CDP문제
DC모터제어실험
제어공학, PID Controller Design for the Dc motor position,Dc motor position, Root locus