LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help implementing two different delays on a falling edge

Hi, I'm working on a project where I have to output some digital SPWM signals through a cRIO-9030 to drive a three-phase inverter.

 

I need to avoid overlapping between the high PWM and the low PWM (considering that the rise and fall time are not equal to zero, I've measured them already in the oscilloscope). I'm currently using the NI 9401 to output those signals.

 

My problem is that I haven't found a way to delay the rising edge of the low PWM after an specific amount of time has passed since the falling edge of the high PWM has occurred.

 

I'm developing my VI in the FPGA directly.

 

I'll attach an screenshot of my current VI.

 

Thanks in advance

0 Kudos
Message 1 of 6
(2,314 Views)

Hi Soski,

 

you can measure time on a FPGA target, too!

 

So:

1. On a falling edge of the "High" PWM you start a counter.

2. After the counter has reached the target time you can switch on the "Low" PWM…

 

In the end it's just counting loop iterations in the FPGA when you want to generate digital PWM output signals!

(Hint: draw those signals on a sheet of paper to develop the algorithm.)

Best regards,
GerdW


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

Hi GerdW, thank you for your kind answer.

 

Could you illustrate me on how to exactly build a counter directly onto the FPGA in LabView?

 

I'm a newbie with this software and I'm not used to Graphical Programming yet.

 

Thank you again and sorry for the trouble.

0 Kudos
Message 3 of 6
(2,263 Views)

Hi Soski,

 

this is a counter (countdown) I made for a special counter I needed once:

check.png

It counts rising edges using the compound node with the feedback node…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,260 Views)

Thank you again,

 

 

what does this case structure looks like when the condition is "false"?

 

 

0 Kudos
Message 5 of 6
(2,255 Views)

Hi Soski,

 

inputs and outputs are just connected by wires: valid := FALSE, count := count

 

The point is: to count pulses you need to detect pulse edges and you need to keep a register/buffer (like the indicator in my image or a shift register) to store the counter…

Best regards,
GerdW


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