06-21-2016 11:24 AM
Hi Guys,
I am working with myRIO to generate PWM pulses.
here is the Block Diagram of my circuit.
I have connected the PWM pin to the analog input pin externally. So I can observe the PWM pulses in the waveform chart.
But the waveform is not clear. It is as shown in the screenshot.
See the waveform is not proper. When I am observing the same PWM pulses in the CRO(Cathode Ray Oscilloscope, the actual oscilloscope in the real world), I am getting the waveform accurately. i.e., the PWM pulses are generated properly. But the analog read is unable to read the PWM pulses.
I faced the same problem with the analog read pin earlier when I am reading the input voltage. It is not giving the continuous readings of the actual voltage input.
Please guide me how to read these pulses using analog read.
Please tell me to what range of frequency I can use this myRIO to generate pulses?
Am I able to use 40kHz?
Solved! Go to Solution.
06-21-2016 01:23 PM
I have tried even using analog express. and the response is same as shown below.
06-23-2016 02:08 PM
can anyone help me in this?
06-23-2016 02:11 PM
can anyone help me in this?
I am stuck in this work.
07-07-2016 12:44 AM - edited 07-07-2016 12:46 AM
Hi Bhanu,
From seeing the snapshot, it seems that you're generating a PWM with a frequency 1000Hz.
But the loop rate is set to 500ms, which means the sampling rate for your analog input is 2Hz .
You can't acquire a 1kHz signal with a sampling rate of 2Hz. It does not obey Nyquist Theorem of Sampling.
Regards
Archan Mudwel
Applications Engineer
National Instruments
07-07-2016 01:59 AM
Hi rcs,
As you said, I have removed the wait block. But still the response is same.
Can you suggest me any other way
07-07-2016 03:15 AM
Hi Tripta,
I did not mean to remove the wait in the loop. Once you've removed the wait, you'll have to benchmark the loop to check the loop period.
Because you're generating a 1kHz square pulse, you'll have to sample it at least at 10kHz. When you're using the express VIs, if you give a pulse freq of 1Hz or say 10 Hz, you should be able to acquire analog samples correctly if you sample it at 10Hz or 100Hz respectively. You also need to monitor whether the loop itself is taking more time to execute than the delay you've specified.
The pulses will defintely be generated according to the settings that you've sent but If you are trying to acquire them back on the analog input pin at that fast a rate, I will recommend you to use the myRIO in the FPGA mode. Have 2 parallel loops in the FPGA. One to generate the pulses and the second one to acquire analog data at a rate such that you acquire the square pulse with a good enough waveform. Please note the higher the sampling freq the better it is.
Let me know if you have any further questions.
08-03-2016 02:28 AM
HI RCS
Can you Please explain your answer by some block diagram of labview FPGA.
08-17-2016 01:26 PM
Hi,
Try to use the Analog Input Express VI in the n sample mode.
Please refer to the snapshot attached.
You will have to change the instance to be n samples, provide a sampling rate around 10 times the pulse frequency. For e.g. in case the pulse freq is 1kHz, put the sampling rate as 10kHz, put a valid number in the number of samples according to the loop rate required and then use the VI.
08-17-2016 07:30 PM