07-29-2009 04:32 AM
Dear Mark,
Thank you very much for your reply.
I followed your advice. I used the default connections. In this case, I have got the values which are decreased, for example: -10, -12, -14, . . . These values are quite strange. Actually, I do not understand what is happening.
Can you help me to explain about this ?
Thanks so much for your helps and supports.
Best regards,
Duy
07-29-2009 05:08 AM
Hello,
Are you using a quadrature rotary encoder?
Do the specifications of your rotary encoder match what is setup in the DAQmx Task?
07-29-2009 06:10 AM
Dear Mark,
Thank you very much for your reply.
I am using a quadrate rotary encoder and DAQ Assistant with the default signal connections. I am sure that the situation of my encoder is well. I tried to use the digital input function of LabVIEW for measuring the signal channels A, B, and Z of this encoder and the result is as the following figure.
Actually, with this figure, we can count the pulse number and calculate the motor speed.
For example: With the above figure, I can analysis as follows:
I am using British Encoder, No. 39549, Mod. 735 TP, PPR. 2500.
We know that the encoder is 2500ppr.
We can see that approximately 10.5 pulses are measured in 100 seconds.
The motor will turn one full revolution in 2500/10.5 X 100 seconds = 23809 seconds = 397minutes.
So the motor is spinning at 1/397 rpm ~ 0.025 rpm. This value will be multiplied with the scaling factor and then we can have the motor speed.
But the above method has been done by hand. And we cannot use this value to do other works during a run.
I hope that my presentation is clear.
In summary, I think that maybe there are some problems which are happening as we use input counter of LabVIEW. If you have any idea about this, please help me.
Thanks so much for your helps and supports.
Best regards,
Duy
07-29-2009 07:37 AM
A very good screenshot, that proves that your signal is perfectly fine!
It seems to me that you are only interested in the frequency of the pulses, to determine RPM? You could do a DAQ Assistant Frequency measurement:
Connect Phase A of the encoder to the recommended PFI line in the DAQ Assistant. The issue with this method is that you won't be able to detect direction of rotation, please indicate if this is a problem!
07-29-2009 09:22 AM
Dear Mark,
Thank you very much for your idea.
But it is obvious that we could not know the direction of rotation in this idea. This can also be a problem which we need to consider.
Once again, thanks so much for your helps and supports.
Best regards,
Duy
07-29-2009 10:58 AM
Hello,
This example uses the Pulse Count DAQ Assistant with Count Direction set to External, converted to a task, then example code generated. Then I insert a property node to change the assignment of the Counter Direction Pin to one of the PFI lines (PFI9 in example). Phase A of the encoder is connected to what the DAQ Task suggests (PFI8 in my case) and Phase B is connected to the Counter Direction Pin that you set with the property node.
The example works for me, and gives me speed, and speed is positive in one direction, and negative in the other so you can detect direction.
There is a bug if the counter goes below 0, it underflows to the maximum counter value, which makes speed jump very high for 1 loop.
07-29-2009 12:06 PM
Dear Mark,
Thank you very much for your idea.
I followed your idea. But I do not understand why my code does not work. I send my code to you. Can you help me to have a look at it ?
Thanks so much for this.
Best regards,
Duy
07-30-2009 03:05 AM
Hello,
Your VI works for me fine! The numeric indicator for speed is off the screen though (data 2) and this is the one that shows speed. Could you post a screenshot of your DaqMX task?
07-30-2009 03:43 AM
Dear Mark,
Thank you very much for your reply.
These are some screenshots which I think that you need to have a look at. But I think that you can see them on my VI which I sent to you as well.
Fig. DAQ Assitant
Fig. Error
Fig. DAQmx Channel
Thanks so much for your helps.
Best regards,
Duy
07-30-2009 03:54 AM
Hello,
I could not see these settings on the VI you sent, as the DaqMX task only exists in your MAX panel.
Could you change this setting:
To Externally Controlled