08-16-2007 07:43 PM
08-17-2007 02:30 PM - edited 08-17-2007 02:30 PM
Message Edited by Jesse O on 08-17-2007 02:30 PM
08-19-2007 08:47 PM
Hi Jesse,
Thanks for your speedy reply. I wasn't too sure on what you meant in the last post so i tried a few tests out. You said connect a square wave to counter0 and Aio. I was a bit confused as the counter0 is two inputs A and B so here is what i did.
First i conected the motor encoder to Ctr0 A to Pfi0 and B to Pfi9
I then used the software which came with the motor to j the motor at 1 RPM from this i get ticks on both A and B 90degrees out of phase. Correct?
1) I then wired A=Pfi0 to analog input and excuted you vi. The pules are in Synch Please see image attached.
2) I repeted the same but this time on B=Pfi9 these are not in Synch???? I thought they should as its the same pulse train 90 out of phase???
3) Next i repeated the steps but this time used external square wave on the analog input generated by a frequency generator and the encoder conected as normal. Not in Synch
4) Finally I removed encoder completly and just sent the generated squarewave to both A and Analog input there in Synch.
Repeated for Ctr1 A=Pfi3 and B=Pfi10 same results
I then Spliced you code into mine as the trigger source but still no joy. I have sent some images for you to have a look
Thanks again for your help
Regards
Michael
08-19-2007 10:04 PM
just looking at your image again compared to mine when i said there in synch they seem to start at the same time but dont overlap like your image?
Michael
08-20-2007 09:03 AM
08-29-2007 04:38 PM
Hi Again
I am still having problems with my application. I have tried altering my code but end up with the data output each time?
I have attached a screen shot and my latest code of my new triggering setup.
In this I am using an external source for both the analog and encoder inputs. I have wired port 1 line 3 to pfi1. PFi1 is the trigger source for both. After initializing the line goes high and data acquisition commences. There for the first sample from both should be lined up and all them after that. Correct?
I have also placed the write digital output line in the while loop and manually controlled this with a push button. When i run the vi no data is acquired until I press the button sending the line high which is what i believe i should expect.
So both tasks don’t start until the trigger source is active high. So they should be in synch.
However I am still getting the same data every time. The encoder data trails the Analog by approx. 1100 samples each time. I am using a Brand New M series USB device so i am not sure whether this is a hardware or software issue.
I can’t see why its out of synch if Acquisitions starts at the same time?
Could you please have a look and see what you think
Kind regards
Michael
08-30-2007 01:21 PM
09-02-2007 08:20 PM
Hi
After some tests I have found that for some reason the encoder data always commences with rubbish data.
If my encoder reading is 6 degrees i get 1000 zeros before this data. If i change the no of recorded samples to 2000 i get 2000 zeros 100 = 100 and so on.
I jogged the motor so it was rotating and then started my vi hence the encoder reading should have no initial zeros? This explains the offset I have been receiving in my data
I reset the DAQ device at the very start of the vi so I don’t know why this is happening? Is there a way to flush the buffer so that this invalid data can be erased and the true values recorded?
Thanks again for your time and help
Regards
Michael
09-04-2007 02:36 PM
09-04-2007 04:49 PM