필터 지우기
필터 지우기

Applying limits in matlab

조회 수: 3 (최근 30일)
Tim
Tim 2011년 4월 3일
I have created a transfer function describing the movement of a piston in a cylinder. The piston can only move a max distance of 400mm. My mathematical model for the cylinder piston Q(s)=AsX(s) were Q is flow rate A is piston area and X is displacement, hence transfer function is X(s)/Q(s)=1/As (in matlab num=1, den=10 (when A is 10) function=tf(num, den). For step input step (function) gives a straight line inclined to the right. How do I tell matlab that the max displacement is 400mm so when the line gets to this limit it becomes flat?
I also need to apply PID tuning to this function, can anyone help with this?

채택된 답변

Matt Fig
Matt Fig 2011년 4월 3일
Displacement = min(400,X);
For example:
X = [1:20:800];
plot(min(X,400));
ylim([0 800])
  댓글 수: 1
Tim
Tim 2011년 4월 3일
Do I add this line after function=tf(num, den)before doing the step input? Sorry for asking these type of questions, but first time using matlab.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 PID Controller Tuning에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by