Thang Nguyen 2 Posted August 7, 2009 Report Share Posted August 7, 2009 (edited) 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 Edited August 7, 2009 by Thang Nguyen 2 Quote Link to comment
Thang Nguyen Posted August 14, 2009 Report Share Posted August 14, 2009 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.