Timer Objects - more precise alternative ?

3 visualizaciones (últimos 30 días)
Lucien Robinault
Lucien Robinault el 9 de Nov. de 2017
Comentada: Stephen23 el 15 de Nov. de 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.

Respuesta aceptada

Benjamin Kraus
Benjamin Kraus el 9 de Nov. de 2017
Editada: Benjamin Kraus el 9 de Nov. de 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 comentario
Stephen23
Stephen23 el 15 de Nov. de 2017
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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre General Applications en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by