 Open access peer-reviewed chapter

# Using NI-USB Data Acquisition Systems to Study the Switching Phenomena of Reactive Loads

Written By

Niculescu Titu, Marcu Marius, Niculescu Vlad and Popescu Florin Gabriel

Submitted: December 18th, 2015 Reviewed: February 2nd, 2016 Published: July 7th, 2016

DOI: 10.5772/62349

From the Edited Volume

## Applications from Engineering with MATLAB Concepts

Edited by Jan Valdman

Chapter metrics overview

View Full Metrics

## Abstract

The chapter presents a new and modern method to study the transient phenomena that occur when connecting the reactive charges to an AC power source using the MATLAB-Simulink software package. It is known that NI-USB data acquisition systems manufactured by National Instruments are not recognized by the Simulink software package in 64-bit systems. That is why a 32-bit system is obligatory. From this point of view, the article presents a method by which this disadvantage is eliminated, making the data acquisition process possible in the Simulink software package.

### Keywords

• capacitive circuit
• data acquisition
• diagrams
• electrical diagram
• NI-USB

## 1. Introduction

Data acquisition systems of the NI-USB type, manufactured by National Instruments, allow real-time evaluation of analog measurements in various practical situations. These quantities can be read by the MATLAB software but cannot be processed in Simulink because MathWorks Incorporated does not offer support for this software in 64-bit systems. The chapter presents a method that makes this possible and studies the case when an inductive-capacitive load is connected to a voltage power source, with a data acquisition system in Simulink on 64-bit systems. In this scope, we will consider an RLC series circuit with concentrated parameters, which are connected to an AC power source.

This scenario occurs in practice in case one wants to connect an electrical equipment that includes capacitors to an AC power source. In this case, over voltages or over currents can occur during transient regime, which can cause problems in systems sizing.

## 2. Theoretical considerations

The differential equation for transitory phenomena is presented below:

iR+Ldidt+1Cidt=Umsinωt+ψE1

where Ris the circuit resistance, Lis the circuit inductance, Cis the capacity of circuit, and Ψ is the initial phase of voltage when was connected the circuit. The current is denoted by iand the angular frequency by ω.

The most important and common regime is when the circuit resistance is very small, practically the resistance of the junction wires. This event is known in the scientific literature as an oscillating regime. If we consider the Rresistance of circuit very small, the Laplace transform applied to this circuit conducts to the following solution , :

i=Imcosωt+ψϕ1+DUmeδt2ωeLcosωetγδωesinωetγE2
uCt=Umsinωt+ψϕ1CωR2+1ωCLω2+DUmeδt2LCωe2sinωetγE3

where Equation (3) represents the voltage on the capacitor.

uLt=Ldidt=ωLImsinωt+Ψϕ1+DUm2ωeeδtδ2ωe2ωesinωetγ2δcosωetγE4

where Equation (4) represents the voltage on the coil, and δis a dumping factor:

δ=R2LE5

and ω0 is the resonance angular frequency of the circuit:

ω0=1LCE6

The following notations are also used:

ωe=ω02δ2D=A2+B22ABcosβαtgγ=AsinαBsinβAcosαBcosβE7
α=ϕ3+ψβ=ϕ2ψE8
ϕ1=arctg2ωδω02ω2ϕ2=arctgδωeωϕ3=arctgδωe+ωE9
A=11+ωωe2+δωe2B=11ωωe2+δωe2E10
Im=UmR2+1ωCωL2E11

Due to the low value of the conductors’ resistance, the regime is oscillating. Therefore, a high-frequency oscillation can be observed in the following charts, which overlaps the current and voltage curve at a 50 Hz frequency.

## 3. Interface circuits necessary for study of inductive loads

For the experimental evaluation of these parameters, a data acquisition system manufactured by National Instruments was used, namely, the NI USB-6003 type. The graphics and the electrical diagram presented in Figures 1 and 2 were created using the MATLAB 2014b software. The inductive circuit is connected to the AC voltage through a capacitor C, and the DAQ input voltage levels are obtained using resistive dividers. A differential measurement was chosen to perform calculations.

To eliminate the risk of connecting directly the AC phase voltage to the input of the data acquisition system, symmetrical voltage dividers were used and the analog inputs of the measuring system were connected in parallel with the median divider resistors Ri0 and Ri1. To protect the analog inputs of data acquisition system to any voltage surge, the DZ Zener diodes were used (Figure 3) .

The measuring mode is a differential one, because it allows accurate measurements for low-voltage amplitudes (below 1 V).

The used system for data acquisition has the following important parameters:

• 2 analog outputs (16-bit, 5 kS/s/ch); 13 digital I/O lines; one 32-bit counter;

• Lightweight and BUS powered for easy portability;

• Easy to install sensors and signals with screw-terminal connectivity.

The system is compatible with MATLAB software but not with the Simulink package, because the Data Acquisition Toolbox package does not appear in its graphical interface on 64-bit operating systems.

To study switching transient inductive-capacitive loads, two situations were considered to be representative:

• Connectingan inductive-capacitive load to an alternating power supply made with the following values of electrical parameters:

U=220 V; R=1.2 Ω; L=2 mH; C=100 μF.

In this case the diagram from Figure 1 is obtained.

• Disconnectingan inductive capacitive load from an alternating power supply made with the following values of electrical parameters:

U=220 V; R=1.2 Ω; L=90 mH; C=100 μF.

In this case, the diagram from Figure 2 is obtained.

s=daq.createSession(‘ni’);

s.Rate=45,000;

s.DurationInSeconds=1.5;

[data,time]=s.startForeground;

figure;

data(:,1)=data(:,1)*163;

data(:,2)=data(:,2)*27;

[ax,p1,p2]=plotyy(time,data(:,1),time,data(:,2),’plot’);

ylabel(ax(1),’Voltage[V]’); % label left y-axis

ylabel(ax(2),’Current[A]’); % label right y-axis

xlabel(‘Time[secs]’); % label x-axis

grid;

Data acquisition is made with the Ni-USB 6003 system, which has a sampling frequency of 100 ks/s. The sequence of MATLAB program that reads current and voltage inputs and make data acquisition is shown as follows:

where 163 and 27 are values dependent on resistor values of interface from Figure 3. These values are dependent on the input resistive divider values of the measurement system (163 is the value of 2R1/Ri1 and 27 represents the value of 2R0/Ri0).

To run this code, it needs a system NI USB-6000 series connected to the PC and installing the driver from the National Instruments website. The first part of this code represent data acquisition with a rate of the 45 kS/s, and the acquisition time is 1.5 s. The second part of the code represents the plotting mode of voltage and current .

Because the acquisition time is relatively high (1.5 s), after the completion of the acquisition process, one can decrease this time to 0.1 s by focusing on the event (click Edit figure>Axes properties…>xLimits).

The sampling frequency is divided by two because there are two inputs to read. Therefore, it was used a sampling rate of 45 kS/s for each channel.

Connecting regime from Figure 1 primarily highlights an oscillating process for current and coil voltage. In the first moment of connection, an over current appears, with a peak of over 30 A. The overvoltage peak is almost 200 V in the first moment, after which these values are stabilized to the oscillating values.

The disconnecting regime from Figure 2 highlights a peak voltage that can be almost 1000 V. This value can be dangerous for consumers, connected to the alternating supply voltage. These overvoltages can cause the semiconductor destruction or insulation electric penetrations.

## 4. Measurement processing in Simulink software package

Experimental measurements were made with a data acquisition system type NI USB-6003 with a rate of 100 kS/s, and the measurements were processed by the 2014b MATLAB version, which recognizes only data acquisition system in MATLAB, not in Simulink. Data processing in Simulink involves the following steps:

• It makes the appropriate data acquisition in MATLAB (using specific program lines for data acquisition system type);

• It saves the Workspacegenerated by the measurement (for further processing);

• The Datafile from the Workspaceopens;

• The Timefile from the Workspaceopens;

• Undock command is given to these files (Figure 4);

• The Timecolumn is copied in the Datafile and is placed at the beginning of the columns (Figure 5).

• It executes the DockVariablescommand and saves the new Workspace.

At this moment, the Datafolder from the Workspacecan be read from a Simulink simulation model (Figure 6).

## 5. Study of inductive loads

The first representative case for connecting the inductive-capacitive load leads to the following charts for the inductor voltage, circuit current, and the powers dissipated in the coil.

As one can observe, the coil voltage and current diagrams (Figures 7 and 8) show the identical dependences with Figure 1 where the forms were obtained by data acquisition directly in MATLAB, by programming. The MATLAB program is presented in paragraph 3.

Figures 9 and 10 represent the diagrams of the active and reactive power variation during the commutation process. An inductive load of 2 mH was connected to an alternating power source.

Because of the capacitor, the oscillating process occurs in both the current curve and the coil voltage. The value of capacitance that made the connection process was of 100 μF. The voltage oscillations and current circuit right after the connection was initiated are accompanied by the oscillations of active and reactive power. The measurement was done in the time interval of 1.1 to 1.2 s.

If one considers the second case, the disconnection of inductive-capacitive load, Simulink model from Figure 6 leads to the following diagrams for electrical quantities considered: the voltage variation on the coil at circuit disconnecting (Figure 11), the current variation in circuit at disconnecting (Figure 12), and active and reactive powers in this regime (Figures 13 and 14). As can be seen, coil voltage and current diagrams (Figures 11 and 12) show the identical dependences with Figure 2 where the forms were obtained by data acquisition directly in MATLAB, by programming.

The high-frequency oscillations of the voltage and current curves generate oscillations also in the two powers variation curves. The active and reactive powers dissipated on the coil upon disconnection are shown in Figures 13 and 14.

If we take into consideration the two regimes, connecting and disconnecting, from the first measurements, one can notice a reactive and active power peak in the powers chart. Then, these stabilize at oscillating constant values.

## 6. Interface circuits necessary for study of capacitive loads

For the study of transitory phenomena regarding capacitive loads, the interface circuits from Figure 15 were used.

The study of capacitive loads considered the case of connecting a capacitive load to an AC voltage power source through an inductivity.

The measuring circuit is similar to the one in Figure 3, differing by the fact that, on the input of acquisition system (−a1, +a1), the voltage on the C capacitor terminals is measured.

## 7. Study of capacitive loads

For the study of capacitive loads, take into consideration the case of connecting a capacitor to an AC voltage power source through an inductivity of 2 mH. The electrical parameters have the values:

• U=220 V;

• R=2 Ω;

• L=2 mH;

• C=100 μF;

The MATLAB code for the data acquisition is the same with the one used in paragraph 3, and as a result of its run, it was obtained from the diagram in Figure 16. This displays the current and voltage variation on capacitor in the same axis system.

After Workspace processing, as described in paragraph 4, the Simulink model from Figure 6 was used for the reading of this data, and the following charts were obtained. The capacitor voltage variation and current variation in the circuit are plotted in Figures 17 and 18.

As seen in the voltage and current variation charts, a current peak appears in circuit, immediately after connection is initiated, and it can become dangerous for the other electrical equipment. This is accompanied by a small voltage peak, which disappears quite fast. In the current curve, a high-frequency oscillation can be noticed, which overlaps the current curve and disappears after a time.

It must be noticed that these variation forms are dependent on the connecting moment, so they are dependent on the ψangle from Equations (2) and (3).

Diagrams from Figures 19 and 20 show the variation of the two dissipated powers. In Figure 19, the active power variation on the circuit resistance is plotted, and in Figure 20, the one of the reactive power dissipated on the capacitor.

Figure 19 highlights the active power oscillations, owing to current oscillations in the circuit. Figure 20 highlights the fact that the reactive capacitor power is negative and its value can be read using the diagram. It is almost constant, with low oscillations around this value.

## 8. Conclusions

This analysis method allows the study of transient electrical phenomena on 64-bit operating systems. In this case, the Data Acquisition Toolbox package, which is specific to the 32-bit operating systems, does not appear in Simulink.

We have to mention that the transient regime for connecting the reactive loads to an AC power source depends on the moment of connecting, given by the Ψ angle from relations (2)–(4). In this paper, we considered a representative case of several measurements that emphasize the higher values of voltage and current occurring immediately after connecting.

The most dangerous regime is the oscillating regime and this is the most common regime that can be met in practice. In practice, this could be seen in the alternative power supply for electric motors, which includes the starting capacitor. In this case, oscillating overvoltage may occur and they need to be taken into account when sizing the systems. The value of these voltages depends on the connecting moment, which is the initial phase of the AC voltage. For the circuits designing and sizing phase, the overvoltage peaks occurring immediately after connection must be taken into account, which can endanger the internal isolation of the equipment. Overcurrent peaks in oscillatory regime can lead to the possible switching of protective relays.

It is important that the electric charge on the connected capacitor to be initially zero, otherwise a high value of over current may occur after the connecting moment.

In conclusion, it must be stressed that the proposed method can be applied to other Simulink models of greater complexity.

Written By

Niculescu Titu, Marcu Marius, Niculescu Vlad and Popescu Florin Gabriel

Submitted: December 18th, 2015 Reviewed: February 2nd, 2016 Published: July 7th, 2016