Timer Objects - more precise alternative ?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Lucien Robinault
am 9 Nov. 2017
Kommentiert: Stephen23
am 15 Nov. 2017
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 Kommentare
Akzeptierte Antwort
Benjamin Kraus
am 9 Nov. 2017
Bearbeitet: Benjamin Kraus
am 9 Nov. 2017
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 Kommentar
Stephen23
am 15 Nov. 2017
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu General Applications finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!