speed regulation loop; how to start from non zero value?
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a speed regulation loop with the PID and a transfer function. I generated the profile speed input from the "signal builder" and I need to start the loop from the non-zero value. How can I accomplish it?
댓글 수: 1
Fangjun Jiang
2018년 9월 21일
non-zero value of what, desired speed, controller output, or current speed?
답변 (1개)
Adam Danz
2018년 9월 21일
편집: Adam Danz
2018년 9월 21일
The question is vague but I think this is what you're looking for.
values = [-10 : 10]; %Here are the negative and positive values you need in the loop
myVariable = nan(size(values)); %allocate loop variable
for i = 1:length(values) %Loop through each value of 'values'
myVariable = doSomething(values(i)); % Here is your code that references 'values'
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!