Jump to content

Ask about Generate and Measure PWM with PXI6624


Recommended Posts

I posted this queston on NI forum but I still not get any asnwer for it, so I hope I can get help here. I need to finish this project soon.

I am working on a project which require both measure and generate PWM signals.

Currently I have some issues with both of these.

I use PXI NI 6624 card.

1. Issue with measure PWM.

I connect the signal to Gate + and GND to Gate -. I expect I can read the width of the high pulse, casue the gate will start the counter.

I use the code as in example of measure the duty cycle (in picture 1). The problem I have is the values in the array also include the low pulse, and these two values will be shifted countinously in the array. So if I index from the array I cannot get a stable number (in picture 2).

Ex:

1. 2-5-2-5 <-----

2. 5-2-5-2 <-----

3. 2-5-2-5 <-----

I want to know the reason and how to fix it.

2. Issue with generate PWM.

I use another counter to generate the PWM.

I connect Vdd and Vss with a 13.8V DC Power Supply. I use a 10 KOhm resister connect between Vss and Out. I got a right signal with 13.8 V.

a> My first problem is the frequency is not stable. I set it to 122 Hz, and I saw it jump from 119Hz to 125Hz.

b> My second problem is when I connect this to the measure PWM I did above the voltage will down to 2.5 V. I tried with 1 KOhm resister and it downs to 6V. When I connect a real controller with a 12V PWM, this signal is stable after I connect with measure PWM channel above.

I would like to know if I did anything wrong. Cause this PWM will be use to simulate a sensor value and it must be stable.

I highly appreciate reading and answering my questions.

Best regards,

Thang Nguyen

post-16188-124965459122_thumb.jpg

post-16188-124965460468_thumb.jpg

Edited by Thang Nguyen 2
Link to comment

Hi,

Currently, I can measure the PWM quite good but when the duty cycle is more than 70%, the low pulse time start fluctuate between the low pulse time and high pulse time. This lead to the duty cycle will fluctuate between the right value and 50%.

Some one with experience please help me on this.

I attach here my test program which has this issue.

TestPWM.zip

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.