LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating a 6X Sine Wave using an absolute encoder

How do I get an Analog Signal Generation Synchronized to six times the frequency of an absolute nine bit parallel encoders output with adjustable phase relation. I am using a PXI-6533, a PXI-6711 and have available a PXI-6070E.
Now the long version of the problem. I have a 9-bit absolute encoder connected to a motor shaft (up to 420Hz). From the encoders 9-bit (0-511) parallel signal I need to create a synchronized 6X sine wave (up to 2500Hzwith an adjustable phase relation. Picture an electronic timing chain. For every cycle of the encoder, I need to produce six full sine wave cycles with a variable tuned phase shift. I have LabView 7 w/RT.

I have tried to use the Update Clock (PFI5) to step through a buf
fer but it seems to drop an update every so often. I also have tried to monitor the bit-0 line to determine freq. and scaled the update rate accordingly but the phase shifts all over the place. Does anyone have any ideas on the matter ? I would really appreciate it! Thanx….Phil
0 Kudos
Message 1 of 3
(3,095 Views)
Program one of the general purpose counters on your 6070E to perform retriggerable pulse generation triggered off the encoder signal. Program the other general purpose counter to perform gated pulse train generation (use output of first counter as gating signal). Adjust pulse specs of second counter on the fly using Counter Control - switch cycle. Feed output of second counter to PFI5 (or a RTSI line) to drive analog outputs.

Stick AO Single Update - output only in your loop to poke new analog values onto the board. Anchor you SW loop frequency to the output signal of your second counter with Counter Control - wait (supported on RT only).

So your VI should configure one counter for retrig pulse generation, another for gated pulse train, and HW-timed singl
e-point AO. In the loop, call Counter Control - wait to wait on pulse train output, followed by AO SingleUpdate - output only, followed by Counter Control - switch cycle to update freq of pulse train if necessary.

Adjust length of the retrig pulse so that you get enough pulses to output all 6 sine waves. I *think* you can use switch cycle on the retrig counter. If so, you can adjust phase relation too.
0 Kudos
Message 2 of 3
(3,095 Views)
Phil,

Another different option to solve your application would be to use the new LabVIEW FPGA module and the 7831R reconfigurable I/O hardware. Using these tools you can configure the FPGA on the board to generate the sine wave based on the 9-bit parallel input. The most simple setup would be to have a lookup table in the FPGA that has a corresponding output value to each of the 512 possible input values. This 512 sample table would contain 6 cycles of a sine wave. Every time the parallel input changes the analog output value would be updated accordingly from the lookup table. This setup would also allow to easily add a phas
e shift of the output by shifting the point in the lookup table you are reading by a known constant.

Christian L
NICS
authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
0 Kudos
Message 3 of 3
(3,095 Views)