LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9401 cDaq 9174 Motor speed mesurement Two 5V TTL signals

Hello,

 

I have installed a NI 9401 in a NI cDaq 9174 4-slot rack and it is connected to the PC through USB. I have a three phase motor connected to a torque sensor that outputs two 5V TTL digital signals(A,B) that are separated apart by 90°.

 

My objective is to mesure the RPM of the motor using NI 9401 and Labview. I have tried using the VI exemple to mesure the motor rotation speed but still not sucessful.There are several types of configuration (CI frequency, pulse frequency, count edge etc.) which I don't know which to choose from. The torque sensor outputs 360 pulse per revolution. I did some calculation to get the RPM and it seems that the formula is "RPM=frequency*60/360" but I am not really sure because until this moment I can't seem to get the right frequency. 

 

I have tried using DAQ Assistant to do so. But there are three options "1 counter low frequency", "2 counters high frequency" and "2 counters large range". I have more or less tried them all but still the rpm calculated isn't correct.

 

Can anyone help me out please?

 

 

0 Kudos
Message 1 of 10
(4,912 Views)

Hello,

 

I have managed to get the RPM value for the motor by using the CI Freq VI.

 

I wanted to save the data into a tdms file, so I used the DAQmx Configure Logging vi. But there aren't any time axis values for the RPM value. I have put a DAQmx timing vi set to implicit. I tried changing "implicit" to "sample clock" but when it asked me to configured the clock source I can't get the right clock to make it work. Neither onboard clock nor 20, 80 Mhz timebase work.

 

I don't understand about the clock source. How can I acquire the RPM value and time value at the same time? Can anyone help me please? I am kinda a beginner in labview data acquisition.

0 Kudos
Message 2 of 10
(4,871 Views)

Hi

 

While you are using the counter in continuous model, the timing clock will be set in implict, and you are not allowed to change it.

 

If you want to get the time when you read the RPM, you need to program to get the time, and add it to the file you saved. I mean you have to use software way to get the time instead of getting from the hardware.

0 Kudos
Message 3 of 10
(4,861 Views)

Hello,

 

You can create a signal with a counter to create a sample clock that you will can use to sample (get datas) from the encoder measurement.

You can use the exemple Read Encoder (Continuous Clock). In this way you can rebuilt a signal with measurement coming from an hardware clock and not from the windows system clock (more reliable and precise)

 

Paolo_P
Certified TestStand Architect
Certified LabVIEW Architect
National Instruments France

0 Kudos
Message 4 of 10
(4,850 Views)

Thank you qiankun. I have tried your method but I got an error message every time I launch the vi after some time.

Capture.PNG

 

I have put a 1ms wait inside the while loop that reads the DAQmx Read function. I can't go faster than 1ms. If I don't put the timer, the while loop will execute with an inconsistent speed based on the speed of CPU. What should I do in this case? Can you help me please?

0 Kudos
Message 5 of 10
(4,842 Views)

Thank you Paolo_P. I don't quite understand your method. I know NI 9401 can create counter output signal. But how can I input the counter output signal generated from NI 9401 into the same module as a sample clock source?

 

I found the Read Encoder example vi :

 

Capture.PNG

 

I don't know what to choose for sample clock source. Can you help me out please? I am really a beginner in National Instrument acquisition.

0 Kudos
Message 6 of 10
(4,838 Views)

I found this connection diagram somewhere on the internet for NI 9401. I have connected 14 and 17 pin number to the A and B of the torque sensor respectively. I saw pin 19 is CTR 0 Out. Does that mean it can output a TTL signal that I can input into another pin let's say pin 16 CTR 0 Gate and then select it in the sample clock source?

Capture.PNG

0 Kudos
Message 7 of 10
(4,835 Views)

You can use the internal output of one of you counter, let's say ctr1InternalOutput.

In order to display this output on the listbox as the sample clocck source, right click on it and change the configuration on the filter mode.

You need to run in parrallel a vi to generate this sample clock and use crtlXInternalOutput on the read encoder vi.

 

Paolo_P
Certified TestStand Architect
Certified LabVIEW Architect
National Instruments France

0 Kudos
Message 8 of 10
(4,830 Views)

Thanks again Paolo_P. I don't quite understand how to generate a sample clock in parallel. I tried using the vi in the attachment to generate a counter output as a sample clock. I chose ctr1 as the counter and PFI4 which is pin 20.  I verified with an oscilloscope

that there is indeed a counter output signal of 200kHz. 

 

Capture.PNG

I then chose the Ctr1InternalClock just like you told me. When I lauch the Daq Assistant in a while loop, I got an error message :

Capture.PNG

 

Capture.PNG

I chose Ctr0 as the counter input and wire PFI1 to the TTL signal from my torque sensor. So I think there isn't any conflict with the connection. Yet it doesn't work. Can you help me please?

 

0 Kudos
Message 9 of 10
(4,797 Views)

Hi,

 

Can you use another PFI or try to use a LV example to Read the counter signal.

 

Paolo_P
Certified TestStand Architect
Certified LabVIEW Architect
National Instruments France

0 Kudos
Message 10 of 10
(4,780 Views)