03-23-2017 09:31 AM
Hello,
I have a DC motor with a digital encoder that I've successfully connected to my DAQ and LabVIEW. I've attached a screenshot of my front and back panels.
Now I want to measure the RPM of the motor but I'm having difficulty converting the encoder on/off signal to an RPM signal. All I want to do is determine the frequency of the pulses so I can in turn calculate the RPM.
Thank you.
03-23-2017 10:29 AM
Hi JCayou,
so you read a digital signal.
Hint: Now you want to count the pulses you received, then you want to calculate how many pulses you got in the last second (or any other time interval) and then scale this to rpm.
- Have you tried any of this?
- What kind of DAQ device do you use?
- Can't you use a pulse counter of the device? This way would be (much) easier than detecting and counting pulses on your own…
03-23-2017 10:35 AM
Hi GerdW
I have not tried any of this as I'm quite unfamiliar with LabVIEW. My original question is determining how to make a LabVIEW interface that counts the pulses I get.
I'm using the DAQ NI-USB 6009, and unfortunately I can't use a pulse counter since the encoder outputs a digital signal and the DAQ I am using does not have the physicals channels to acquire pulse counts.
03-23-2017 10:45 AM
Hi JCayou,
I can't use a pulse counter since the encoder outputs a digital signal and the DAQ I am using does not have the physicals channels to acquire pulse counts.
The NI6009 has a counter input (named PFI0)!
What kind of "digital signal" does your encoder provide? Can you provide a manual/datasheet of your encoder?
how to make a LabVIEW interface that counts the pulses I get.
I usually count rising edges: compare the current digital value with the previous one. When the current one is TRUE and the previous one is FALSE you found a new pulse and you can count up your counter by one.
I'm quite unfamiliar with LabVIEW.
In the header of the LabVIEW board you will find the "Getting Started" section…
03-23-2017 11:22 AM
Hi GerdW,
Thanks for the continuous responses. I've attached the user manual of the encoder.
I might try using your counter suggestion later as I don't have access to the DAQ at the moment.
Please let me know if you have any other suggestions.
I imagine setting up the counter is just an if statement that checks the current value? I'm familiar with programming on MATLAB, just the visual interface of LabVIEW is tough to get the hang of.
Thanks a lot.
03-23-2017 02:53 PM
Hi JCayou,
with this encoder you should use a better DAQ device!
Two reasons:
- the USB6009 is rather slow when handling digital IO with ~100samples/s. According to Nyquist you can only get digital waveforms with max. 50Hz…
- the USB6009 has a very simple counter only able to handle one pulse input and strictly counting upwards. To get the most of your encoder you would need a counter able to handle 2 digital inputs with direction detection…
You may use the analog inputs of the USB6009 to read the pulses (with 24kS/s using two channels), but then you need to do even more data processing afterwards!