Hi everyone,
I am using the timed loop to control the DC motor with the PID vi. in the loop and the sampling time is set as 0.01s. However, after I added some other VIs into the loop, for instance, the write to measurement file.vi, to collect the errors between the desired angle and the practical angle of the motor during the time histroty of the motor's motion, it is found that the sampling time changed, not always 0.01s before the vi was added, but 0.01 or 0.02s. the whole program desinged to be fininshed with 7s now it is done at 9.4s, i.e., the time to run the loop is extended.
Another thing is, if the sampling time is set as 0.05s, the sampling time is always 0.05s and the time to run the loop is always 7s as predined, no matter the write to measurement file.vi is added into the loop or not.
Through this, I think if the complexity in the loop is incresead and the set sampling time is small, then the actual sampling time will be changed because of the computational burden of the things in the timed loop. Is this the reason? If so, are there some methods to solve it ?
An important thing is: the collection of the angular error of the motor in the time histrory is quite important, which will be used to demostrate the rightness of the KP, KI and KD parameters.
Some friend suggests to use the queue vi, but I am not quite sure how to use them. Can anyone gives some instrctions?
Thansk very much!
Cheers