03-02-2018 06:51 AM
Hello,
my programm generating analog PWM using myDAQ wich goes to h-bridge and make the speed control for dc motor . The problem in my programm is that the PWM signal at analog output changes with great delay (about 10 seconds) when i change the duty cycle with slide conrol.
https://drive.google.com/drive/folders/1watyP12C7tGVLGVc9urIg_rF3_Ee_JN9
Thank you for help
03-02-2018 07:04 AM
03-03-2018 04:10 PM - edited 03-03-2018 04:13 PM
Hi, GerdW,
I have the working program with expressVI. Unfortunately I can`t use this approach for my application.
Best regards, Valentine
03-03-2018 09:33 PM
Hard to tell if the Dreaded Dynamic Data Wires (grrrr) are messing you up or not -- I don't have a myDAQ handy to test with your code. There are some strange things, however -- you have two Timing routines inside your While loop, namely the AO function (which should produce an output every 10 msec) and a 10 msec Wait (I think unnecessary, and wrong).
Bob Schor
03-04-2018 01:04 PM
There are two things to check in your application.
1. Is the DAQmx Write appending to the FIFO in the MyDAQ buffer? If so, you could have up to 8.1 seconds of delay in the output. You do not use a shift register for the error out, so there is no indication of a buffer overflow.
2. How slowly are you changing the Duty Cycle control? The control indicates a range from 0 to 100, but 100Hz PWM generated at 1000Hz is only 10 points of resolution. Your output will jump from 50% to 60% when you slide the control.
03-05-2018 05:28 AM
Hi, Michael,
I replaced the shift register with tunnel but it did not help and made the program running even worse: no indication and pwm is not changes anymore.
When I change the duty cycle the pwm changes with 9 seconds delay. So if change the value for example 4 times; no matter how fast, the pwm will change 4 times with delay of 9 seconds.
Best regards, Valentine
03-05-2018 05:41 AM
03-05-2018 06:47 AM
Sorry I diid not get what you mean. Can you possibly explain?
03-05-2018 07:48 AM