04-24-2007 04:21 PM
04-24-2007 05:47 PM
04-25-2007 08:39 AM
04-25-2007 12:37 PM
04-27-2007 05:21 PM
Hello Milq,
I did spend some time to get a higher version labview to open your vi.
I read it and have a few questions.
1. The basic algorithm is to use PFI0 (connect to z index signal of encoder output) to trigger the 360 gauge measurements of ai1 (PFI5 is the external sampling clock, connect to 1 pulse per degree pin of encoder output) and this will happen every 10 ms. the frequency measurement is also taken as every time the gauge measurement is triggered as they are in same loop. Is my understanding right?
2. Which terminal are you measuring the frequency, ctr0 or PFI0? As the ctr0 is used to setup the frequency task but later you specify the PFI0 to be the frequency measurement terminal. So how do they work?
Thank you very much for taking time on my question. look forward to your answer
Feilong
04-27-2007 05:59 PM - edited 04-27-2007 05:59 PM
Message Edited by Milqman on 04-27-2007 06:04 PM
04-27-2007 07:21 PM
Thanks Milq,
I guess the reason about the 'missing rev' you mentioned when sample 360 points, may be the problem of last A signal pulse before next z pulse comes or the first A sample pulse after the z pulse passed when you set to sample 360 pioints. in the case of last A signal pulse before next Z, that pulse causes to sample 360th point and LV engine may not have enough time to finish all the vi before it gets ready to be triggered by the coming z pulse. Especially the stop task vi inside the loop takes some time to finish and the overhead of read.vi runs every time.
And same may happen to the first A pulse after just being triggered. If the start task vi takes too long time to finish, then you miss this A pulse. So the 360th data you sampled is actually the first 1 data of next rev. Thus next z pulse will be missed as it pasts already when you sample the 360th data.
and when you sample 359 data rather than 360 per rev, the LV engine has a little more time to finish the start or stop task vi.
I think the another way might be to use two triggers, one is the sampling trigger by A signal and read 1 data per trigger, also counting angle. And z signal trigger another process, which just check the angle counting or reset it if the angle counting appears missing teeth. Because you are continunously sampling data triggered by each A signal so you don't miss any data. But this will introduce a lot more overhead time thus require the LV engine runs very fast.
Does labview support triggering a process rather than a read.vi? such as a case only executes when a trigger happen. as we use it a lot in dSpace programming, which is useful for this encoder case.
looking forware to hearing your opinion.
Feilong