Saturday, February 25, 2023

Solution of a second order system using LabVIEW

 

The second-order system model is a set of mathematical equations used to describe the behavior of nonlinear systems. It consists of two nonlinear differential equations and a set of constants that define how those variables change over time. The system is defined by its state variables and the values for their respective operators at each instant in time.

Standard mathematical form of a second-order differential equation is as below:


Where A and B are constants.

For control system, the standard mathematical form of second order system with Unit step input is as below:


Where ξ is the damping factor and ωn is the natural frequency.

The system will be underdamped when 0 < ξ < 1. The particular solution,
yp(t) = 1 determines the steady state solution of the system. The homogeneous solution determines the transient solution which is


 

1.     Methods

This project report will be executed using LabVIEW. The first part of the report will be presenting Numeric block based code for analyzing the response of the system based on the following solution:

Where ξ is the damping factor and ωn is the natural frequency. If T is the total time for which response is analyzed, N is the number of points then time step is ∆t = T/N. At ith iteration, t= i*∆t = i*T/N.

We will be using this equation for different parameters of ζ , ωn, T and N to analyze its response on graph.

In next part of the lab we will be using another method which is call formula node. In formula node we write the formula in script and then give input and output arguments to it.

Below code is written using Numeric blocks in LabvIEW.



We can simulate the same model using Formula script node also.










Wednesday, February 1, 2023

Current Sinking and Current sourcing configuration of a device

Current sinking refers to a configuration in electrical circuits where a device, such as an LED or transistor, is connected to a power source and "sinks" current into the ground. This means that current flows from the power source, through the device, and into the ground.

Current sourcing, on the other hand, is when a device "sources" current out of a power source and into a load. In this configuration, current flows from the power source, through the device, and into a load, such as a motor or a resistor.

In both cases, the device acts as a switch that controls the flow of current in the circuit. The choice of whether to use current sinking or sourcing depends on the specific requirements of the circuit and the characteristics of the device being used. sinking and sourcing terminology applies only to DC input and output circuits. Input and output points that are sinking or sourcing can conduct current in one direction only. 
The figure below depicts a sinking input. To properly connect the external supply, it must be connected so the input provides a path to supply common(-). So, start at the PLC input terminal, follow through the input sensing circuit, exit at the common terminal, and connect the supply (-) to the common terminal. By adding the switch between the supply (+) and the input, the circuit is completed. Current flows in the direction of the arrow when the switch is closed.



The four possible combinations of input/output sinking/sourcing circuits are shown below. The common terminal is the terminal that serves as the common return path for all I/O points in the bank.





Why 4-20 mA signal is used for transmission?

4 to 20 mA Current Transmission

In many process control applications, signals are transmitted in the form of current in the range of 4 to 20 mA. Current loops are used not only for receiving information from sensors and field instrumentation, they are also used for transmitting control signals to actuators or other devices to regulate a controlled action. For long distance signal transmission, current signal is preferred because of

(1) Compatibility: The 4-20 mA signal is widely used in industrial process control because it is a widely accepted standard. This means that a wide range of instrumentation and control equipment is available that can use this signal, making it easy to integrate into many different types of control systems.


(2) Noise immunity from EMI:  Industrial environments can be noisy places, with electrical interference from other equipment and power sources. The 4-20 mA signal is designed to be immune to this type of noise, which helps to ensure that the signal remains accurate and reliable even in noisy environments.

(3) Unaffected by voltage drop along the line.

(4) No stray Thermocouples at joints

(5) Current signal can be transmitted over long distance till the compliance voltage requirement is met.

(6) Self monitoring ability. currents less than 4 mA and higher than 20 mA can indicate a fault in the circuit.

(7) Power Transmission: The 4-20 mA signal is self-powered, meaning that it can be transmitted over long distances without the need for an external power source.

4 mA lower limit known as "Live zero" provides ability to detect cable or connection fault. The current upto 3.6-3.8mA is used to power the loop instruments in loop-powered mode.


How current transmission provide noise immunity?

(1) Loop wiring: The 4-20 mA signal is typically transmitted in a loop configuration, where the signal is transmitted from the field device back to the control system. This creates a closed loop circuit that helps to reduce the impact of noise and interference on the signal.

(2) Low frequency: The 4-20 mA signal operates at a relatively low frequency, typically in the range of a few kilohertz. This low frequency reduces the impact of high-frequency noise and interference that can be present in industrial environments.

(3) Signal strength: The 4-20 mA signal is transmitted at a relatively high current level, typically between 4 and 20 milliamperes. This high current level helps to ensure that the signal remains strong and robust, even in the presence of noise and interference.

(4) Common mode rejection: Many industrial control systems are designed to reject common mode noise, which is a type of noise that affects both the positive and negative parts of the signal in a similar way. The 4-20 mA signal is typically transmitted in a differential configuration, which helps to reduce the impact of common mode noise.

Tuesday, January 31, 2023

Analog data logging using Arduino

To acquire an analog signal using an Arduino, you can use the analog input pins, which are labeled A0 to A5. The following steps can be taken to read an analog signal:

  1. Connect the analog signal to one of the analog input pins.
  2. Use the analogRead() function to read the analog signal. The function takes the analog input pin number as an argument and returns a value between 0 and 1023.
  3. Convert the 10-bit value to a voltage by multiplying it by 5 and dividing it by 1023.
Example code:

int analogPin = A0; // select the input pin for the analog signal int sensorValue = 0; // variable to store the value read from the sensor void setup() { Serial.begin(9600); // initialize serial communication } void loop() { sensorValue = analogRead(analogPin); // read the analog signal Serial.println(sensorValue); // print the value to the serial monitor delay(100); // wait for 100ms }

The voltage level of the analog signal should be within the range that the analog input pin can handle, which is typically 0 to 5V.

Connection diagram:






Sunday, May 22, 2022

Synchronous pulse train generation using Arduino

Using arduino, i have generated synchronized pulses with a fixed delay between them. The parameters can be remotely adjusted using serial port.

The pulse 2 (Blue) goes high after some user settable delay of Pulse 1(Yellow) rising edge.


 If we set td=tm, we can get consecutive pulses as below:



Monday, March 14, 2022

Analog signal isolation using HCNR200/201 optocoupler

 

The HCNR200/201 is a high-linearity analog optocoupler which can be used to isolate analog signals. It offers good stability, linearity, bandwidth, simple design and low cost. With choice of suitable application circuit it can also incorporate amplification, attenuation, offset, inversion among others to the input signal. 

 Details of the IC along with datasheet can be found in the link below.

https://www.broadcom.com/products/optocouplers/industrial-plastic/specific-function/high-linearity-analog/hcnr200

 

 At first glance, understanding the application circuit is difficult for a new user. 

To get complete isolation, make sure that grounds as well as bias supplies of input and output stage are isolated. Note the label used in above circuit for input stage are GND, VCC, VEE and that of output stage are GND2, VCC2 and VEE2. I generally use two isolated DC to DC converters each powering one stage at a time.

Now coming back to working of the circuit. Lets us analyze the input stage first.

The input side op-amp always tries to force same input voltages at its two input terminals in close loop connection. Thus, the input side  photodiode PD1 (terminal 3,4 of HCNR200) will have zero voltage across it. A positive voltage at inverting terminal of U1 will swing the output to negative rail causing current flow through LED (terminal 1,2 of HCNR200). Also the positive voltage will cause a current through R1 which will eventually flow through photodiode PD1.

IPD1 = Vin/ R1

Current is linearly related to input voltage. 

Since photodiode PD1 and PD2 are identical to each other, IPD2 should be equal to IPD1 ideally. Practically the relation is

 IPD2 = K x IPD1

where K is gain coefficient.

Output voltage can be given as Vout =  R2 x IPD2


Wednesday, February 16, 2022

Differential, Referenced single ended (RSE), Non-referenced single ended (NRSE) signals interfacing with DAQ

Before acquiring data using the DAQ board the following points must be considered

The nature of the signal source(grounded or floating)
The grounding configuration of the amplifier on the DAQ board
Finding a Common Ground 
Earth ground - potential of the earth below your feet.
         Most electrical outlets have a prong that connects to the earth ground which is usually wired into the building electrical system for safety. Many instruments are also” grounded” to this earth ground System ground. This type of grounding is for safety.
         Ground Symbol 
 
        Referenced Signal

        Reference ground -return path or signal common.This is usually the reference potential. The common ground may or may not be wired to the earth ground.

         Many instruments ,devices and signal sources provide a reference (the negative terminal,common terminal  etc that gives meaning to the voltages that we are measuring.

         Signal Source Reference Configuration
         Signal sources come in two forms-(1) Referenced sources called grounded signals, (2) Non referenced sources called floating signals

        Grounded signal sources have voltage signals referenced to a system ground, such as earth or a building ground.

 

        Devices that plug into the building ground through wall outlets such as signal generators and power supplies are examples of Grounded signal sources.

         Floating signal sources contain a signal that is not connected to an absolute reference such as earth or a building ground. Batteries, Thermocouple, transformers are examples of floating signal sources.

 

         Differential Connections (DIFF configuration):
        Differential connections are those in which each  analog input signal has its own reference signal or signal return path. Each input signal is tied to the positive input of the instrumentation amplifier, and its reference signal, or return, is tied to the negative input of the instrumentation amplifier.
        When configuring the DAQ for DIFF input, each signal uses two of the multiplexer inputs-one for the signal and one for its reference signal.
         Therefore, only half the analog input channels are available when using the DIFF configuration.  
         Conditions for using DIFF configuration:
         Use the DIFF input configuration when your DAQ system has any of the following conditions: 
  •             Input signal levels are low (less than 1V)
  •             Leads connecting the signals to DAQ system are at long distance.
  •             Any of the input signals require a separate ground-reference point or signal-return.
  •             The signal travels through a noisy environment.
  •  
A differential instrument requires two inputs where neither input to the instrumentation amplifier is referenced to a system ground. For example, CH0+ and CH0- are wired into the positive and negative terminals of the instrumentation amplifier respectively, but they are not connected to the measurement system ground (AI GND).
       The differential voltage across the circuit pair is the desired signal, yet an unwanted signal that is common to both sides of a differential circuit pair can exist. This voltage is known as common-mode voltage. An ideal differential measurement system completely rejects, instead of measures, the common-mode voltage for more accurate measurements. Practical devices, however, have limitations described by specifications such as common-mode voltage range and common-mode rejection ratio (CMRR).
          Differential input connection for Grounded sources
 
Differential input connection for floating sources
 
 
RSE and NRSE connections
     RSE measurement system is used to measure a floating signal, because it grounds the signal with         respect to building ground.
 
     NRSE measurement system, all measurements are made with respect to a common reference, because all of the input signals are already grounded.
     Use the RSE configuration for floating signal sources; in this case, the DAQ boards provide the     reference ground point for the external signal.  
        Use the NRSE configuration for ground-referenced signal sources; in this case, the external signal     supplies its own reference ground point and the DAQ boards should not supply one.
 

Modbus and OPC comparison Table

  Modbus vs OPC Comparison between Modbus and OPC Feature Modbus OPC (OLE f...