LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cDAQ-9189 generator voltage and current not synchronized

Hi community,

 

I want to record 2 synchronous generators triphase currents (CTs) and voltages (PTs) so I can read power (S, P, Q & PF). The only card combination that actually works for me is NI-9225 for PTs and NI-9238 for CTs. I use these cards for generator #1. For generator #2, I have a second NI-9225 but I don't have another NI-9238 so I tried using NI-9205 and NI-9222 instead but I assume these cards synchonization is not managed the same way since the current I read lags of about 16.5 degrees (~0.76 ms @ 60 Hz) compared to what I expect.

 

I use default settings of DAQmx Timing.vi (default onboard clock) and I wonder if I can do something with it to make my setup work.

 

Thanks!

0 Kudos
Message 1 of 12
(1,119 Views)

You may need to investigate the trigger on each module. 

I assume you are using a cDaq Chassis. you will need to trigger the Acquisition of both modules to start acquiring data at the same time, so you can have an accurate measurement of the phase shift when calculating PF. 

0 Kudos
Message 2 of 12
(1,116 Views)

See Signal-based Synchronization of Analog Input C Series Modules with NI-DAQmx in LabVIEW 

-------------------------------------------------------
Control Lead | Intelline Inc
Message 3 of 12
(1,101 Views)

Interesting document. I'm currently using the simplest method : Multidevice task. DAQmx driver does not synchronize properly automatically like specified. Does that mean that I just can't use this method?

 

Would I have to do trigger and sample clock synchronization manually as explained in the document?

 

I'm a bit concerned about the performance. I have an application where I can have about 25 individual channels set and since I want flexibility, I would need to build and sync 25 different tasks rather than 1 task like I have actually.

 

Thanks.

0 Kudos
Message 4 of 12
(1,084 Views)

I tried to trigger and sync clock manually as per the document but I end up with either the error below or the vi runs and I get the exact same lag I had using multidevice task. It's random each time I run my vi, I have no idea why. Please see my vi attached.


Error -89131 occurred at DAQmx Start Task.vi:7220004

Possible reason(s):

An attempt has been made to perform a route when the source and the destination are the same terminal.

In many cases, such as when configuring an external clock or a counter source, you must select a PFI, PXI Trigger, or RTSI line as the source terminal.

Property: SampClk.Src
Property: SampClk.ActiveEdge
Source Device: cDAQ9189-1FB2D01
Source Terminal: ai/SampleClock

Task Name: _unnamedTask<109>


 

0 Kudos
Message 5 of 12
(1,066 Views)

Is that' because you are using the same device for both actions ? 

You must define one "master" device to be the primary source of clock and start trigger and setup the other device to follow the master. 

Your code use the same device for both- that explains the error message you received. 

 

Check the paragraph Sample Clock Synchronization on the article shared previously. 

0 Kudos
Message 6 of 12
(1,058 Views)

@LVNinja wrote:

Your code use the same device for both- that explains the error message you received. 


Could you elaborate about this statement? I think I misunderstand what is considered a device. I have several acquisition cards and only one cDAQ-9189. In multidevice task section, a device seems to be defined as module of acquisition. So in my case, I have several devices on the same chassis.

 

In my vi, I define the task at the top as Master like in the article. I have a doubt about how to set "source" of DAQmx Timing at the top (Master task). I chose "OnBoard Clock" but it's not clear if I need to configure it like that in the article.

 

Another details : to check if the 2 channels I read are in phase, I loop back an AO card located on the same chassis as my two AI cards. Could this be the source of the problem? I created an indepenant task in NI MAX to inject a sine wave. The sine wave generated is connected in parallel to my two AI channels. No reason to be different if the synchronization works correctly.

0 Kudos
Message 7 of 12
(1,044 Views)

Well, I think I found it. It was all in the spec sheets. Mixing 16 bits and 24 bits resolution together is not a good fit. These specs explain everything I observed. Anyone to confirm?

 

 

0 Kudos
Message 8 of 12
(1,028 Views)

Seems like you are trying to set both modules to use the sampling rate of 50kS/s, you could just put all of them into a single task, like in Figure 4 of Signal-based Synchronization of Analog Input C Series Modules with NI-DAQmx in LabVIEW

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 9 of 12
(1,021 Views)

Yes, I did it with a single task initially and that is how I'm going to do it but I will get extra hardware since there's no software solution to my problem.

0 Kudos
Message 10 of 12
(999 Views)