Timer Objects - more precise alternative ?
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello,
First of all I am using the Matlab 2011a version.
The Timer Objects are only precise to the second so is there any more precise alternative to them ?
I use them to start function at a certain time and need to be precise at least at the milliseconds or more.
I was thinking about a loop looking at the value of Toc as I didn't find any native function doing this.
Thanks for your time.
댓글 수: 0
채택된 답변
Benjamin Kraus
2017년 11월 9일
편집: Benjamin Kraus
2017년 11월 9일
You are going to have trouble getting millisecond precision with any application that isn't running with special priority in the operating system, because the operating system itself may interrupt MATLAB at any time. Can you give more details about your application? Maybe there is another approach that you can consider.
댓글 수: 1
Stephen23
2017년 11월 15일
Sorry for the delay. The timer is used to stop a linear actuator. Some potentiometer are bond to it but I first need to get a view of their behaviour on the full range of motion of the actuator to use them to monitor it. I used a TIC-TOC loop, it block the execution of the script but it work for what I need : i get enough precision not to block the actuator and to stop it with enough precision.
if true
tic;
while true
if toc > delay
putdata(obj,[0;10]);
start(obj);
break
end
end
stop(analIn);
end
end
with delay : time needed to full ROM (i can estimate it fairly precisely given the length and speed of the actuator) obj : it is the analog output who send command to the actuator. It goes through a NIDAQ - USB 6229.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 General Applications에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!