03-05-2017 06:08 PM
Hi,
Im trying to create two PWM waves with the myRio, both outputting 40 kHz and a 80% duty cycle. I know how to do this when neither of the waves are phase shifted but Im wondering if its possible to have a 60 degree phase shift between the two PWM waves?
Thanks,
Tyler
03-06-2017 01:39 AM
Hi E.Greene,
using the FPGA in your myRIO you should be able to output about anything on DIO pins!
60° phase shift at 40kHz means a delay of 4.167µs between both waveforms. This translates to ~167 ticks of a (default) 40MHz loop, running on your FPGA…
03-06-2017 01:57 PM
Do you have an example of this? Im new to LabView and am having some trouble figuring out how to set up a loop that will accomplish this.
Thanks you!
03-07-2017 12:47 AM
Hi E.Greene,
on FPGA I use a simple counter to generate PWM output signals:
count++ out := (count >= duty) IF count >= fullperiod THEN count := 0 ENDIF
All values (count, duty, fullperiod) are in ticks (or iteration time of the loop).
To have a second output with a given phase shift you just need to use the very same "count" with an offset. With my example calculation above that offset would be 167 for a loop running at 40MHz…