LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM signal generation by varying duty cycle on USB NI-6366

Solved!
Go to solution

Good day

 

I am trying to perform Impedance Spectroscopy (IS) on a Lithium Ion battery while it is supplying power to a load.

I am using a usb NI-6366. 

 

To perform IS I need to inject small sinusoidal signals onto a DC current bias. What I am currently doing is creating a PWM waveform by comparing a triangle waveform (Switching Frequency of 20kHz) to a DC bias with a sine wave. The duty cycle is given by the following equation:

 

duty cycle = 0.5 + 0.05*sin(2pi*f), where f varies from 0.01Hz - 1kHz. 

 

The PWM signal outputs on an Analog out port of my NI 6366

 

The issue is, I am unable to produce a decent looking waveform for the low frequencies (0.01Hz) because the number of samples I need to send to the NI-6366 (for the PWM signal) is too large and I am getting buffer overflow issues. 

 

Is there a better way that I can create the PWM waveform, so that I do not have to send so many data points to my NI-6366? Is there a way I can dynamically vary my duty cycle

 

I also have access to a myRio which has FPGA functionality, if that will be an easier solution.

 

Any help will be great.

 

Regards

Sean Moore

0 Kudos
Message 1 of 3
(2,971 Views)
Solution
Accepted by seanabmoore

Hi Sean,

 

the example VI "Cont Gen Voltage Wfm-Int Clk-Non Regeneration" explains how to output large amounts of waveform data.

You might split your waveform into smaller parts suitable for your hardware…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(2,936 Views)

Thank you so much. That did the trick.

 

Regards

Sean Moore

0 Kudos
Message 3 of 3
(2,867 Views)