Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i measure the pwm output of a ultrasonic sensor using ni-9403 module

Solved!
Go to solution
how can i measure the pwm output of a ultrasonic sensor using ni-9403 module
0 Kudos
Message 1 of 9
(7,524 Views)

Hi Tikoy,

 

This is assuming that you are using a cDAQ chassis with DAQmx:

 

You can interpret the sensor output signal by using a counter input on a cDAQ module using DAQmx.  However, this will require correlated DIO, which this 9403 module does not support correlated DIO.  The modules that do offer Correlated DIO in a cDAQ chassis and will therefore allow you to output the Counter Signal are as follows: 9401, 9402, 9411, 9421, 9422, 9423, 9435, 9472, 9474, 9481, 9485. 

 

With the 9403 module, you can perform software timed acquisition.  This is not as reliable as hardware timing because it will use your OS timing engine, but could work if your PWM signal is at a frequency below 500Hz.  This is because Windows can iterate a while loop somewhat reliably around 1kHz in optimal settings.  Obviously, it will require software logic built into your program to anallyze the Digital Siganl to check if it is High/Low.  It is worth a shot, but the recommended solution would be to go with a 9401 and a counter input to measure pulse width or pulse period/frequency.

 

Are you using a cRIO chassis and NI-RIO drivers?

 

Best,

Message Edited by cyclone2k9 on 05-10-2010 11:20 AM
Adam
Academic Product Manager
National Intruments
0 Kudos
Message 2 of 9
(7,481 Views)

Hi ,

 

Sorry i forgot to mention that i am using a NI-Crio9004

0 Kudos
Message 3 of 9
(7,469 Views)

hi fellows,

 Actually the project I am working on goes like this, I need to control and maintain the level/height of the ping pong ball in cylinder. There is a fan below the cylinder which control the height and a ultrasonic sensor (URM37 v3.2) which monitor the height. I can control the speed of the fan by generating a PWM output in ni-9472 module.,actually the crucial part is integrating the output of my sensor in ni-9403 module..did i said it right sir?

 

regards,

 

0 Kudos
Message 4 of 9
(7,461 Views)

Hi Tikoy,

 

As long as your sensor outputs a digital value, you can bring this signal into your 9403 module.  You will just connect the positive digital output to a line, and the negative digital output to the COM port of the module.  Do you have any information about the sensor you are using, or perhaps a datasheet?

 

Best,

Adam
Academic Product Manager
National Intruments
0 Kudos
Message 5 of 9
(7,435 Views)

Hi Sir Adam,

 

                   This is the datasheet of the sensor that we are using in our project

 

                                        http://letsmakerobots.com/files/URM3.2_Mannual_Rev2.pdf

 

                  thanks 

 

Regards,

 

0 Kudos
Message 6 of 9
(7,427 Views)
Solution
Accepted by topic author Tikoy

Tikoy,

 

When you say 'measure' the PWM signal, what exactly to you mean? 

 

Are you looking to measure the frequency or duty cycle of the signal? Are you counting rising edges of the PWM output? Are you looking to monitor the waveform?

 

With reconfigurable FPGA hardware, it is up to the user to define the function of the physical I/O on the FPGA chip. By connecting the signals as Adam suggested your digital pulse will be brought to the cRIO. In your FPGA program, you will define the measurement function. You may want to define a basic counter, or forward the single point digital data to you cRIO host for more complex floating point processing. FPGA example programs may be found at http://www.ni.com/IPnet. 

 

Hope this helps, please post any additional questions. 

Patrick Corcoran
Application Engineering Specialist | Control
National Instruments

0 Kudos
Message 7 of 9
(7,408 Views)

Hi Adam,

 

I am working on a project which involves srf02 which is connected to NI 9403. i am using a CRIO 9024.When you said " You will just connect the positive digital output to a line, and the negative digital output to the COM port of the module." What do you mean by that. I tried to use the example from the Ni website http://decibel.ni.com/content/docs/DOC-3737. the sensor has 4 nodes 5v supply, signal in, signal out and comp. i connected the signal out from ni9403 to signal in from sensor and signal out from sensor to signal in to the module. i specified the nodes as input or output by right clicking on the module in the project and specifing the property of the node. powered up with 5v supply and grounded the circuit. when i run the vi. i dont get any results. i just get random sequential numbers which keeps repeating. i cant understand why is it happening.  

 

 

Thank You

 

Nitin Jagadish

0 Kudos
Message 8 of 9
(6,311 Views)

Hi Nitin, 

It looks like that example you linked to was created for the SRF04/SRF05.  You've said you're using the SRF02.  From my quick search, it looks like the SRF02 communicates with either serial or I2C, and doesn't directly ouput a PWM signal. 

http://www.robot-electronics.co.uk/htm/srf02tech.htm

http://www.robotstorehk.com/srf04tech.pdf

 

Is this information correct?  If it is incorrect, can you post a link to the datasheet of your sensor? 

 

Thanks, 

Dave T.

National Instruments
FlexRIO & R-Series Product Support Engineer
0 Kudos
Message 9 of 9
(6,303 Views)