LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generating analog PWM using myDAQ

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.1.PNG2.PNG3.PNG

https://drive.google.com/drive/folders/1watyP12C7tGVLGVc9urIg_rF3_Ee_JN9

Thank you for help

0 Kudos
Message 1 of 9
(7,526 Views)

Hi Valentine,

 

what happens when you replace the ExpressVIs (and the DDT wires) by plain SignalGeneration functions?

 

And pleas upload the VI directly in the forum, your GoogleDrive link asks me for some login credentials…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(7,522 Views)

Hi, GerdW,

 

I have the working program with expressVI. Unfortunately I can`t use this approach for my application.

 

Best regards, Valentine

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

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

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

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.

Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.0, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
0 Kudos
Message 5 of 9
(7,458 Views)

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

0 Kudos
Message 6 of 9
(7,436 Views)

Hi Valentine,

 

mind to attach your current state of the VI?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 9
(7,434 Views)

Sorry I diid not get what you mean. Can you possibly explain?

0 Kudos
Message 8 of 9
(7,429 Views)

Hi Valentine,

 

Sorry I diid not get what you mean.

Please attach your VI - the most recent state!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 9
(7,425 Views)