필터 지우기
필터 지우기

Timer Objects - more precise alternative ?

조회 수: 6 (최근 30일)
Lucien Robinault
Lucien Robinault 2017년 11월 9일
댓글: Stephen23 2017년 11월 15일
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.

채택된 답변

Benjamin Kraus
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
Stephen23 2017년 11월 15일
Lucien Robinault's "Answer" moved here:
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개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by