Wednesday, September 28, 2016

The Fourier Transform

Excerpt from Science & Mathematics nautil.us

From article by Aatish Bhatia is a recent physics Ph.D. working at Princeton University to bring science and engineering to a wider audience. He writes the award-winning science blog Empirical Zeal and is on Twitter as @aatishb.



 What was Fourier’s discovery, and why is it useful? Imagine playing a note on a piano. When you press the piano key, a hammer strikes a string that vibrates to and fro at a certain fixed rate (440 times a second for the A note). As the string vibrates, the air molecules around it bounce to and fro, creating a wave of jiggling air molecules that we call sound. If you could watch the air carry out this periodic dance, you’d discover a smooth, undulating, endlessly repeating curve that’s called a sinusoid, or a sine wave. (Clarification: In the example of the piano key, there will really be more than one sine wave produced. The richness of a real piano note comes from the many softer overtones that are produced in addition to the primary sine wave. A piano note can be approximated as a sine wave, but a tuning fork is a more apt example of a sound that is well-approximated by a single sinusoid.)
Now, instead of single key, say you play three keys together to make a chord. The resulting sound wave isn’t as pretty—it looks like a complicated mess. But hidden in that messy sound wave is a simple pattern. After all, the chord was just three keys struck together, and so the messy sound wave that results is really just the sum of three notes (or sine waves).
Fourier’s insight was that this isn’t just a special property of 
musical chords, but applies more generally to any kind of repeating 
wave, be it square, round, squiggly, triangular, whatever. 
The Fourier transform is like a mathematical prism—you feed in a
wave and it spits out the ingredients of that wave—the notes 
(or sine waves) that when added together will reconstruct the wave.
If this sounds a little abstract, here are a few different ways of 
visualizing Fourier’s trick. The first one comes to us from
 Lucas V. Barbosa, a Brazilian physics student who volunteers 
Wikipedia, where he goes by “LucasVB.”
the Fourier transform is a recipe—it tells you exactly how 
much of each note you need to mix together to 
reconstruct the original wave.
And this isn’t just some obscure mathematical trick. The
 Fourier transform shows up nearly everywhere that waves do. The ubiquitous MP3 format uses a variant of Fourier’s trick to
 achieve its tremendous compression over the WAV (pronounced 
“wave”) files that preceded it. An MP3 splits a song into short 
segments. For each audio segment, Fourier’s trick reduces the 
audio wave down to its ingredient notes, which are then stored in 
place of the original wave. The Fourier transform also tells you how 
much of each note contributes to the song, so you know which
 ones are essential. The really high notes aren’t so important 
(our ears can barely hear them), so MP3s throw them out, 
resulting in added data compression. Audiophiles don’t like MP3s
 for this reason—it’s not a lossless audio format, and they claim 
they can hear the difference.
song. It splits the music into chunks, then uses Fourier’s trick to 
figure out the ingredient notes that make up each chunk. It then 
searches a database to see if this “fingerprint” of notes matches 
that of a song they have on file. Speech recognition uses the same 
Fourier-fingerprinting idea to compare the notes in your speech 
to that of a known list of words.
You can even use Fourier’s trick for images. Here’s a great 
video that shows how you can use circles to draw Homer Simpson’s
 face. The online encyclopedia Wolfram Alpha uses a similar idea 
to draw famous people’s faces. This might seem like a trick you’d 
reserve for a very nerdy cocktail party, but it’s also used to 
compress images into JPEG files. In the old days of Microsoft 
Paint, images were saved in bitmap (BMP) files which were a long 
list of numbers encoding the color of every single pixel. JPEG is 
the MP3 of images. To build a JPEG, you first chunk your image 
into tiny squares of 8 by 8 pixels. For each chunk, you use the same
 circle idea that reconstructs Homer Simpson’s face to 
reconstruct this portion of the image. Just as MP3s throw out the 
really high notes, JPEGs throw out the really tiny circles. The 
result is a huge reduction in file size with only a small reduction in 
quality, an insight that led to the visual online world that we all 
love (and that eventually gave us cat GIFs).
How is Fourier’s trick used in science? I put out a call on 
Twitter for scientists to describe how they used Fourier’s idea
 in their work. The response astounded me. The scientists who 
responded were using the Fourier transform to study the 
vibrations of submersible structures interacting with fluids, to 
try to predict upcoming earthquakes, to identify the ingredients 
of very distant galaxies, to search for new physics in the heat 
remnants of the Big Bang, to uncover the structure of proteins from 
X-ray diffraction patterns, to analyze digital signals for NASA, 
to study the acoustics of musical instruments, to refine models 
of the water cycle, to search for pulsars (spinning neutron stars),
 and to understand the structure of molecules using nuclear 
magnetic resonance. The Fourier transform has even been used to
 identify a counterfeit Jackson Pollock painting by 
deciphering the chemicals in the paint.
Whew! That’s quite the legacy for one little math trick.

Wednesday, September 21, 2016

Introduction to Control Systems

For a simple introduction to Control Systems refer to the page below

https://www.facstaff.bucknell.edu/mastascu/eControlHTML/Intro/Intro1.html


Evaluation of Control Systems

Analysis of control system provides crucial insights to control practitioners on why and how feedback control works. Although the use of PID precedes the birth of classical control theory of the 1950s by at least two decades, it is the latter that established the control engineering discipline. The core of classical control theory are the frequency-response-based analysis techniques, namely, Bode and Nyquist plots, stability margins, and so forth.
In particular, by examining the loop gain frequency response of the system in Fig. 19.1.9, that is, L( jw) = Gc( jw)Gp( jw), and the sensitivity function 1/[1 + L(jw)], one can determine the following:
  1. How fast the control system responds to the command or disturbance input (i.e., the bandwidth).
  2. Whether the closed-loop system is stable (Nyquist Stability Theorem); If it is stable, how much dynamic variation it takes to make the system unstable (in terms of the gain and phase change in the plant). It leads to the definition of gain and phase margins. More broadly, it defines how robust the control system is.
  3. How sensitive the performance (or closed-loop transfer function) is to the changes in the parameters of the plant transfer function (described by the sensitivity function).
  4. ThefrequencyrangeandtheamountofattenuationfortheinputandoutputdisturbancesshowninFig.19.1.10 (again described by the sensitivity function).



    Digital Implementation
    Once the controller is designed and simulated successfully, the next step is to digitize it so that it can be pro- grammed into the processor in the digital control hardware. To do this:
    1. Determine the sampling period Ts and the number of bits used in analog-to-digital converter (ADC) and digital-to-analog converter (DAC).
    2. Convert the continuous time transfer function Gc(s) to its corresponding form in discrete time transfer func- tion Gcd(z) using, for example, the Tustin’s method, s = (1/T)(z 1)/(z + 1).
    3. From Gcd(z), derive the difference equation, u(k) = g(u(k 1), u(k 2), . . . y(k), y(k – 1), . . .), where g is a linear algebraic function.
      After the conversion, the sampled data system, with the plant running in continuous time and the controller
    in discrete time, should be verified in simulation first before the actual implementation. The quantization error and sensor noise should also be included to make it realistic.
    The minimum sampling frequency required for a given control system design has not been established ana- lytically. The rule of thumb given in control textbooks is that fs = 1/Ts should be chosen approximately 30 to 60 times the bandwidth of the closed-loop system. Lower-sampling frequency is possible after careful tuning but the aliasing, or signal distortion, will occur when the data to be sampled have significant energy above theNyquist frequency. For this reason, an antialiasing filter is often placed in front of the ADC to filter out the high-frequency contents in the signal.
    Typical ADC and DAC chips have 8, 12, and 16 bits of resolution. It is the length of the binary number used to approximate an analog one. The selection of the resolution depends on the noise level in the sensor signal and the accuracy specification. For example, the sensor noise level, say 0.1 percent, must be below the accuracy spec- ification, say 0.5 percent. Allowing one bit for the sign, an 8-bit ADC with a resolution of 1/27, or 0.8 percent, is not good enough; similarly, a 16-bit ADC with a resolution. 0.003 percent is unnecessary because several bits are “lost” in the sensor noise. Therefore, a 12-bit ADC, which has a resolution of 0.04 percent, is appropriate for this case. This is an example of “error budget,” as it is known among designers, where components are selected economically so that the sources of inaccuracies are distributed evenly.
    Converting Gc(s) to Gcd(z) is a matter of numerical integration. There have been many methods suggested, some are too simple and inaccurate (such as the Euler’s forward and backward methods), others are too com- plex. The Tustin’s method suggested above, also known as trapezoidal method or bilinear transformation, is a good compromise. Once the discrete transfer function Gcd(z) is obtained, finding the corresponding difference equation that can be easily programmed in C is straightforward.

    Once the controller is designed and simulated successfully, the next step is to digitize it so that it can be pro- grammed into the processor in the digital control hardware. To do this:
    1. Determine the sampling period Tand the number of bits used in analog-to-digital converter (ADC) and digital-to-analog converter (DAC).
    2. Convert the continuous time transfer function Gc(s) to its corresponding form in discrete time transfer func- tion Gcd(z) using, for example, the Tustin’s method, (1/T)(− 1)/(1).
    3. From Gcd(z), derive the difference equation, u(kg(u(− 1), u(− 2), . . . y(k), y(– 1), . . .), where is a linear algebraic function.

      After the conversion, the sampled data system, with the plant running in continuous time and the controller
    in discrete time, should be verified in simulation first before the actual implementation. The quantization error and sensor noise should also be included to make it realistic.
    The minimum sampling frequency required for a given control system design has not been established ana- lytically. The rule of thumb given in control textbooks is that f1/Tshould be chosen approximately 30 to 60 times the bandwidth of the closed-loop system. Lower-sampling frequency is possible after careful tuning but the aliasing, or signal distortion, will occur when the data to be sampled have significant energy above theNyquist frequency. For this reason, an antialiasing filter is often placed in front of the ADC to filter out the high-frequency contents in the signal.
    Typical ADC and DAC chips have 8, 12, and 16 bits of resolution. It is the length of the binary number used to approximate an analog one. The selection of the resolution depends on the noise level in the sensor signal and the accuracy specification. For example, the sensor noise level, say 0.1 percent, must be below the accuracy spec- ification, say 0.5 percent. Allowing one bit for the sign, an 8-bit ADC with a resolution of 1/27, or 0.8 percent, is not good enough; similarly, a 16-bit ADC with a resolution. 0.003 percent is unnecessary because several bits are “lost” in the sensor noise. Therefore, a 12-bit ADC, which has a resolution of 0.04 percent, is appropriate for this case. This is an example of “error budget,” as it is known among designers, where components are selected economically so that the sources of inaccuracies are distributed evenly.
    Converting Gc(s) to Gcd(z) is a matter of numerical integration. There have been many methods suggested, some are too simple and inaccurate (such as the Euler’s forward and backward methods), others are too com- plex. The Tustin’s method suggested above, also known as trapezoidal method or bilinear transformation, is a good compromise. Once the discrete transfer function Gcd(z) is obtained, finding the corresponding difference equation that can be easily programmed in C is straightforward.

    Finally, the presence of the sensor noise usually requires that an antialiasing filter be used in front of the ADC to avoid distortion of the signal in ADC. The phase lag from such a filter must not occur at the crossover frequency (bandwidth) or it will reduce the stability margin or even destabilize the system. This puts yet another
    constraint on the controller design.


    ALTERNATIVE DESIGN METHODS 


    Nonlinear PID
    Using nonlinear PID (NPID) is an alternative to PID for better performance. It maintains the simplicity and intu- ition of PID, but empowers it with nonlinear gains. The need for the integral control is reduced, by making the proportional gain larger, when the error is small.


    Controllability and Observability. Controllability and observability are useful system properties and are defined as follows. Consider an nth order system described by
    x = Ax + Bu, z = Mx
    where A is an n × n matrix. The system is controllable if it is possible to transfer the state to any other state in finite time. This property is important as it measures, for example, the ability of a satellite system to reorient itself to face another part of the earth’s surface using the available thrusters; or to shift the temperature in an industrial oven to a specified temperature. Two equivalent tests for controllability are:
    The system (or the pair (A, B)) is controllable if and only if the controllability matrix C = [B, AB,..., An1B] has full (row) rank n. Equivalently if and only if [siI A, B] has full (row) rank n for all eigenvalues si of A.
    The system is observable if by observing the output and the input over a finite period of time it is possible to deduce the value of the state vector of the system. If, for example, a circuit is observable it may be pos- sible to determine all the voltages across the capacitors and all currents through the inductances by observ- ing the input and output voltages.


    Eigenvalue Assignment Design. Consider the equations: x ̇ = Ax + Bu, y = Cx + Du, and u = p + kx. When the system is controllable, K can be selected to assign the closed-loop eigenvalues to any desired locations (real or complex conjugate) and thus significantly modify the behavior of the open-loop system. Many algo- rithms exist to determine such K. In the case of a single input, there is a convenient formula called Ackermann’s formula
    K = −[0,..., 0, 1] C1 ad(A)
    where C = [B, . . . , An1B] is the n × n controllability matrix and the roots of ad(s) are the desired closed-loop  eigenvalues.

    Refer link below
    https://www3.nd.edu/~pantsakl/Publications/348A-EEHandbook05.pdf

Terms in Control Theory

What are Eigenvalues ?


Eigenvalues are often introduced in the context of linear algebra or matrix theory. Historically, however, they arose in the study of quadratic forms and differential equations. Euler studied the rotational motion of a rigid body and discovered the importance of the principal axes. Lagrange realized that the principal axes are the eigenvectors of the inertia matrix.[11] In the early 19th century, Cauchy saw how their work could be used to classify the quadric surfaces, and generalized it to arbitrary dimensions.[12] Cauchy also coined the term racine caractéristique (characteristic root) for what is now called eigenvalue; his term survives in characteristic equation.

One of the particular values of a certain parameter for which a differential equation or matrix equation has an eigenfunction. In wave mechanics an eigenvalue is equivalent to the energy of a quantum state of a system
  1. 1
    each of a set of values of a parameter for which a differential equation has a non-zero solution (an eigenfunction) under given conditions.
  2. 2
    any number such that a given matrix minus that number times the identity matrix has zero determinan


What is Campbell Diagram & where is it used?

Campbell diagram plot represents a system's response spectrum as a function of its oscillation regime. It is named for Wilfred Campbell, who introduced the concept., also called interference diagram.
In acoustical engineering, the Campbell diagram would represent the pressure spectrum waterfall plot vs the machine's shaft rotation speed.The campbell diagram is used to evaluate the critical speed at different operating speed.

Tuesday, September 13, 2016

What is Noise ?

What is Noise?


Ans from WhatIs.com

Noise is unwanted electrical or electromagnetic energy that degrades the quality of signals and data.  Noise occurs in digital and analog systems, and can affect files and communications of all types, including text, programs, images, audio, and telemetry.
In a hard-wired circuit such as a telephone-line-based Internet hookup, external noise is picked up from appliances in the vicinity, from electrical transformers, from the atmosphere, and even from outer space.  Normally this noise is of little or no consequence.  However, during severe thunderstorms, or in locations were many electrical appliances are in use, external noise can affect communications.  In an Internet hookup it slows down the data transfer rate, because the system must adjust its speed to match conditions on the line.  In a voice telephone conversation, noise rarely sounds like anything other than a faint hissing or rushing.
Noise is a more significant problem in wireless systems than in hard-wired systems. In general, noise originating from outside the system is inversely proportional to the frequency, and directly proportional to the wavelength.  At a low frequency such as 300 kHz, atmospheric and electrical noise are much more severe than at a high frequency like 300 megahertz.  Noise generated inside wireless receivers, known as internal noise, is less dependent on frequency.   Engineers are more concerned about internal noise at high frequencies than at low frequencies, because the less external noise there is, the more significant the internal noise becomes.
Communications engineers are constantly striving to develop better ways to deal with noise.  The traditional method has been to minimize the signal bandwidth to the greatest possible extent.   The less spectrum space a signal occupies, the less noise is passed through the receiving circuitry.  However, reducing the bandwidth limits the maximum speed of the data that can be delivered.  Another, more recently developed scheme for minimizing the effects of noise is called digital signal processing (digital signal processing). Using fiber optics, a technology far less susceptible to noise, is another approach.

Why is noise amplified by numerical differentiation ?

From blog.prosig.com
Why should differentiation be much noisier than integration?  The answer is that differentiation is a subtraction process and at its very basic level we take the difference between two successive values, and then divide by the time between samples. The two adjacent data points are often quite similar in size. Hence the difference is small and will be less accurate, then we divide by what often is a small time difference and this tends to amplify any errors. Integration on the otter hand is addition. As any broadband noise tends to be successively, differently-signed then the noise cancels out.

Thursday, September 1, 2016

Important terms in Control Theory

A control system consists of

Inputs, which are things that we can not only measure, but to which we can assign chosen values (constants or functions of time). Examples: Drug dosages and treatment regimens.

Outputs, which are things that we can measure, but to which we cannot assign values. Examples: Concentrations of administered drug in urine, blood, etc.

States, which are things that affect the outputs, but which cannot even measure because we cannot directly access them. Examples: Concentrations of drug in targeted organ.

Trivial. solution or example that is ridiculously simple and of little interest. Often, solutions or examples involving the number 0 are considered trivial. Nonzero solutions or examples are considered nontrivial.

Causality (also referred to as causation, or cause and effect) is the agency or efficacy that connects one process (the cause) with another process or state (the effect), where the first is understood to be partly responsible for the second, and the second is dependent on the first.

singularity means a point where some property is infinite. For example, at the center of a black hole, according to classical theory, the density is infinite (because a finite mass is compressed to a zero volume). Hence it is a singularity.

Stochastic : For a system to be stochastic, one or more parts of the system has randomness associated with it. Unlike a deterministic system.


Wednesday, May 18, 2011

Noise in Electrical Circuits

Q1. What is meant by normal mode & common mode noise?

• Normal Mode -- an indication of a differential change at the inputs of the measuring instrument
• Common Mode -- an indication of an equal change on both inputs of the measuring instrument



• Normal-Mode Rejection Ratio (NMRR) -- describes the ability of the instrument to reject a normal (differential) signal, it is given by the following formula:
NMRR = 20 log (Vmeasured/Vin)

where Vin is applied differentially to the instrument inputs, and Vmeasured is the value indicated by the DMM. This specification is useful for measurement systems that have filters to eliminate signals at a given frequency or over a range of frequencies. For systems that do not have filters, the NMRR is 0 dB. This specification, which is often used to indicate the capability of the instrument to reject 50 or 60 Hz, is valid only at the specified frequency and useful only when making DC measurements.

For example, if you are measuring 1 mVDC with a DMM that specifies a NMRR of 130 dB at 60 Hz, and you have a normal-mode interference (noise) of 100 mVrms, then your resulting measurement error is 31.6nV

which is 0.003 percent of your measured signal instead of the 10,000 percent error that the 100 mV interference implies.
• Common-Mode Rejection Ratio (CMRR) -- a measure of the capability of an instrument to reject a signal that is common to both input leads. For instance, if you are measuring a thermocouple in a noisy environment, the noise from the environment appears on both input leads. Therefore, this noise is a common-mode signal that is rejected by the CMRR of the instrument. The CMRR is defined by the following equation:
CMRR = 20 log (Differential Gain/Common Mode Gain)

This specification is very important because it indicates how much of the common-mode signal will affect your measurement. CMRR is also frequency dependent.

Q2. What is quantisation error?

Quantization is defined as the process of converting an analog signal to a digital representation. Quantization is performed by an analog-to-digital converter (A/D converter or ADC).
The time resolution we have is limited by the maximum sampling rate of the ADC. Even if we were able to increase our sampling rate forever, it would still never be purely “continuous time” as is our input signal. For most real world applications, this is still very useful despite its limited nature. But obviously the usefulness of our digital representation increases as our time and amplitude resolution increases. The amplitude resolution is limited by the number of discrete output levels an ADC has.

For example, a 3-bit ADC divides the range into 23 or eight divisions. A binary or digital code between 000 and 111 represents each division. The ADC translates each measurement of the analog signal to one of the digital divisions. To increase the ADC number of divisions from eight (23) to 65,536 (216) allows the 16-bit ADC to obtain an extremely accurate representation of the analog signal. This inherent uncertainty in digitizing an analog value is referred to as the Quantization error. The quantization error depends on the number of bits in the converter, along with its errors, noise, and non-linearities.

Q3. What is dithering?

During Quantization, in the time domain, we could almost completely preserve the waveform information by sampling fast enough. In the amplitude domain we can preserve most of the waveform information by dithering.

Dithering involves the deliberate addition of noise to our input signal. It helps by smearing out the little differences in amplitude resolution. The key is to add random noise in a way that makes the signal bounce back and forth between successive levels. Of course, this in itself just makes the signal noisier. But, the signal smoothes out by averaging this noise digitally once the signal is acquired.




Q4. Name some common noise reduction strategies. What is noise floor?

1. Keep the source resistance and the amplifier input resistance as low as possible. Using high value resistances will increase thermal noise proportionally.
2. Total thermal noise is also a function of the bandwidth of the circuit. Therefore, reducing the bandwidth of the circuit to a minimum will also minimize noise. But this job must be done mindfully because signals have a Fourier spectrum that must be preserved for accurate measurement. The solution is to match the bandwidth to the frequency response required for the input signal.
3. Prevent external noise from affecting the performance of the system by appropriate use of grounding, shielding, cabling, careful physical placement of wires and filtering.
4. Use a low-noise amplifier in the input stage of the system.
5. For some semiconductor circuits, use the lowest DC power supply potential that will do the job.
The noise floor of a measurement device is the measured noise level with its inputs grounded.

Q5. What is electrical & safety isolation. What are ground loops, common mode voltage?

Isolation is a means of physically and electrically separating two parts of a measurement device, and can be categorized into electrical and safety isolation. Electrical isolation pertains to eliminating ground paths between two electrical systems. By providing electrical isolation, you can break ground loops, increase the common-mode range of the data acquisition system, and level shift the signal ground reference to a single system ground. Safety isolation references standards have specific requirements for isolating humans from contact with hazardous voltages. It also characterizes the ability of an electrical system to prevent high voltages and transient voltages from transmitting across its boundary to other electrical systems with which you can come in contact.

Incorporating isolation into a DAQ system has three primary functions: preventing ground loops, rejecting common-mode voltage, and providing safety.
Ground Loops
Ground loops are the most common source of noise in data acquisition applications. They occur when two connected terminals in a circuit are at different ground potentials, causing current to flow between the two points. To avoid ground loops, ensure that there is only one ground reference in the measurement system, or use isolated measurement hardware. Using isolated hardware eliminates the path between the ground of the signal source and the measurement device, therefore preventing any current from flowing between multiple ground points.
Common-Mode Voltage
An ideal differential measurement system responds only to the potential difference between its two terminals, the (+) and (-) inputs. The differential voltage across the circuit pair is the desired signal, yet an unwanted signal can exist that is common to both sides of a differential circuit pair. This voltage is known as common-mode voltage. An ideal differential measurement system completely rejects, rather than measures, the common-mode voltage. Practical devices, however, have several limitations described by parameters such as common-mode voltage range and common-mode rejection ratio (CMRR), which limit this ability to reject the common-mode voltage.
CMRR (dB) = 20 log (Differential Gain/Common-Mode Gain).

Q6. What types of isolation are used in Data Acquisition Systems?

There are three basic types of isolation that can be used in a data acquisition system:

Optical Isolation
Optical isolation is common in digital isolation systems. The media for transmitting the signal is light and the physical isolation barrier is typically an air gap. The light intensity is proportional to the measured signal. The light signal is transmitted across the isolation barrier and detected by a photoconductive element on the opposite side of the isolation barrier.


Electromagnetic Isolation
Electromagnetic isolation uses a transformer to couple a signal across an isolation barrier by generating an electromagnetic field proportional to the electrical signal. The field is created and detected by a pair of conductive coils. The physical barrier can be air or some other form of non-conductive barrier.


Capacitive Isolation
Capacitive coupling is another form of isolation. An electromagnetic field changes the level of charge on the capacitor. This charge is detected across the barrier and is proportional to the level of the measured signal.

Q6. What is the formula for signal to noise ratio?

It is expressed as SNR = 10 log 10 (Vs/Vn) where
Vs = RMS value of signal voltage
Vn = RMS value of noise voltage


Q7. How can the sensor ground loop problem occur?

Occasionally, you may get a ground loop problem. This happens when:
• The signal of the sensor is earthed locally.
• AND the acquisition system measures the sensor’s voltage with regard to the ground, its local ground

Ground loop
What one may not realise is that the electrical potential of the ground can vary significantly within the same building. This means there can be a potential difference (i.e. voltage) between the ground at the sensor’s end, and the ground at the acquisition end. It can easily by 1 Volt. Not a big value? Well, if it’s added to the few Volts representing the sensor’s measurement, it changes significantly the value read by the control system. The other consequence is the induced current. Ohm’s law says the current is voltage divided by the wire resistance, which for a long conductor may be 1 Ohm. Our 1 Volt turns into 1 Amp circulating in a loop through the sensor and the control system, potentially damaging the electronics.
Control systems are normally designed to avoid ground loops. Sensors themselves are either powered on the acquisition side or provide floating / non-referenced signals. But occasionally poor or damaged wiring can cause a ground loop. For instance if the cable shield is earthed at both ends: the current going though may not be in a signal wire, but still has the potential to do damage and to induce a voltage into the signal.
In practice, consider ground loops in the following cases. First if a sensor appears not to be working online, test it offline without the potential for ground loop. Second, if the sensor provides silly values intermittently, seemingly working fine the rest of the time, you may have a ground loop or another noise problem. Third, when checking independently the process, you may use a portable or PC-based signal logger. That’s where the greatest danger of ground loop is: the logging system, if not battery operated, is most likely earthed and you must make sure you use “differential input” as a form of signal conditioning (as opposed to ground-referenced single ended)

Sensor Selection

Q1. What is the difference between an incremental and absolute rotary encoder?

Incremental Encoder – measure change in position.
Absolute Encoder – determine absolute position of an object

Q2. How is the PPR of the encoder selected?

The minimum ppr should produce more than 25000Hz at rated speed & less than 300000Hz at 1.2 times rated speed. So if Rated RPM = 1000
PPRmin = 25000x 60/RatedRPM=1500ppr
PPRmax=300000x60/RatedRPMx1.2=15000ppr

Q3. What is the principle of Hall effect current sensor? How is the hall effect sensor different from the rotary encoder ?

The Hall effect sensor is based on the principle that a voltage (VH) is created when current (Ic) flows in a direction perpendicular to a magnetic field (B). Hall effect sensor is used to sense feedback from DC brushless motors. Encoders are used to sense feedback from ac brushless motors. If used to commutate a brushless DC motor an optical encoder must also be enhanced with supplementary commutation tracks.

Q4. State some important sensor characteristics

Sensitivity : Change in output signals to input signals
Span : Range of input physical signals that may be converted to electrical signals
Accuracy: Largest expected error between actual & ideal output signals
Hysteresis: Width of the expected error in terms of measured quantity
Nonlinearity: The max deviation from a linear TF over the specified dynamic range.
Resolution : Max detectable signal fluctuation.

Q5. Name the ways in which EMI/EMC is generated in circuits.

EMI/EMC can occur due to
1. Switching On/Off of currents in a circuit. V = Ldi/dt
2. Magnetic Fields : In AC circuits, currents flowing in & out of the conductor causes EMI in nearby conductors.
3. By conduction through the wires that the electronics uses.

Q6. In what ways can we shield from EMI/EMC?

Shielding – By grounding the conducting plates to the earth.
Metal plates shield against magnetic field. Nonferromagnetic metals have no effect on magnetic fields below 10MHz in frequency. Metals like Aluminium are transparent to these fields. The material must be ferromagnetic, i.e. with low magnetic reluctance, so it conducts the magnetic field.
Snubber networks –These are combinations of resistors & capacitors connected across the source of electrical noise or to be protected from the spikes.
It reduces the voltage generated across the MOSFET
It reduces the rate of voltage change.
Suppression : It is the process of adding components that dampen noise
To dampen high freq noise, inductance is added in series. Ferrite beads can be used.

Q7. What is the use of emissivity & susceptibility tests?

The emissions test (CE &RE) record any undesireable emissions from the test article.
The susceptibility test (CS &RS) record the article’s ability to operate in a typical operating environment.

Q8. What are the coupling mechanisms for EMI/EMC
They are
Conduction – Electric current
Radiation – Electromagnetic field
Capacitive coupling – By an Electric field
Inductive coupling – By Magnetic field
Electric Field coupling is caused by a voltage difference between conductors. The coupling may be modelled by a capacitor.
Magnetic Field coupling is caused by current flow in conductors. The coupling mechanism may be modelled by a transformer.
Most conducted coupling from external sources occurs through ac power lines.

Q9. Explain what are Differential mode interference & Common mode interference

Common mode interference occurs between all lines in a cable & reference potential , It occurs at high frequencies of 1MHz & up.
Differential mode interference occurs between 2 lines (L-L & L-N). It occurs at low frequencies upto several KHz.

Q10. What are optical fibres ? How much is the attenuation in OF? What is splicing?

They are wave guiding devices used to confine & guide light. They are made of silica glass cores surrounded by a cladding which is protected by a jacket. They work on the principle of total internal reflection. The composition of the cladding glass relative to the core glass determines the fibre’s ability to reflect light. The refractive index of the core is increased by doping it. The attenuation of signal strength is 0.35dB/Km at 1300nm wavelength of light. An optical signal can travel more than 100Km without regeneration or amplification. Attenuation is caused by scattering & absorption. Splicing objective is to match the core of one optical fibre with that of another in order to produce a smooth junction through which light signals can continue without alteration & interruption.

Q11. What are the advantages of OF over wired cable?

1) It has greater bandwidth & capacity
2) It provides electrical isolation
3) It has low error rate
4) Greater immunity to external influences
5) Greater immunity to interference & crosstalk
It is instructive to compare fiber to copper. Fiber has many advantages. To start with, it can handle much higher bandwidths than copper. This alone would require its use in high-end networks. Due to the low attenuation, repeaters are needed only about every 50 km on long lines, versus about every 5 km for copper, a substantial cost saving. Fiber also has the advantage of not being affected by power surges, electromagnetic interference, or power failures. Nor is it affected by corrosive chemicals in the air, making it ideal for harsh factory
environments. Oddly enough, telephone companies like fiber for a different reason: it is thin and lightweight.

Q12. Name some Optical detectors & Optical Sources used in FOC systems

2 types of photodiodes are used as optical detectors

a) P-I-N Photodiode
b) Avalanche Photodiode
Heterojunction LED’s and LASER’s are mostly used as optical sources in FOC communication. Heterojunction means that a p-n junction is formed by a single crystal such that the material on one side of the junction differs from that on the other side of the junction.

Q13. What is the use of multiplexing & name the techniques?

The info carrying capacity of a fibre is increased by multiplexing. There are 3 types of multiplexing techniques:
TDM –Time Division Multiplexing
FDM – Frequency Division Multiplexing
WDM – Wave Division Multiplexing


Q14. Explain the principle of operation of an optocoupler.

It protects the controller from high voltage transients, surge voltage or noise. It consists of an LED and a phototransistor (or darlington pair) in a single 8 pin dual in line package. The LED can be made to emit light by passing forward current. The collector base of the transistor can be used as a photodiode & it produces output current by detecting light.

Q15. What are relays? What are Solid State Relays?

A relay consists of a coil of electromagnet with 2 states – close & open. The current & voltage are higher than a TTL gate can provide. Transistor buffers may be used to drive the relay coils. The problems of electromechanical relays are corrosion of contacts, arcing , contact bounce & slow speed of operation.
A SSR (Solid State Relay) consists of a SCR triggered by infrared light source. They are capable of controlling only ac operated devices like motors or heaters.
IRED (Infra red emitting diode) is used to isolate the control circuit & to trigger the SBS(Silicon Bilateral Switch). IRED is activated by current of 1 -10mA. SBS controls current as high as 40A.

Q16. Name some devices used for isolation & advantages & disadvantages of each.

They are used to isolate a circuit from high voltages & to break ground loops
Exp – Transformer, High voltage capacitors & Opto Isolators
Transformers have analog accuracy of 12 to 16 bits, bandwidth of several KHz and max voltage upto 10KV
Capacitively coupled isolation amplifiers have lower accuracy of 12 bits, lower band width & voltage ratings, are cheap.
Optical isolators are fast & cheap 4-7KV but have poor analog linearity.



Q17. What is meant by resolution & digit count , sensitivity , accuracy & precision of an instrument?


Resolution -- the smallest amount of input signal change that the instrument can detect reliably. This term is determined by the instrument noise (either circuit or quantization noise). For example, if you have a noiseless voltmeter that has 5 1/2 digits displayed and is set to the 20 V input range, the resolution of this voltmeter is 100 µV. This can be determined by looking at the change associated with the least significant digit.
Digits Displayed and Overranging -- the number of digits displayed by the readout of a DMM. It is often specified as a certain number of full digits (i.e. digits that can display values from 0 to 9) and an additional overrange digit referred to as a 1/2 digit. That 1/2 digit typically shows only the values 0 or 1. For example, a 6 1/2 digit display has a 7-digit readout, but the most significant digit can read 0 or 1 while the other 6 digits can take any value from 0 to 9. Hence, the range of counts is ±1,999,999. This should not be confused with resolution; a DMM can have many more digits displayed than its effective resolution.
• Sensitivity -- a measure of the smallest signal the instrument can measure. Usually, this is defined at the lowest range setting of the instrument. For example, an AC meter with a lowest measurement range of 10 V may be able to measure signals with 1 mV resolution but the smallest detectable voltage it can measure may be 15 mV. In this case, the AC meter has a resolution of 1 mV but a sensitivity of 15 mV.
• Accuracy -- a measure of the capability of the instrument to faithfully indicate the value of the measured signal. This term is not related to resolution; however, it can never be better than the resolution of the instrument. The accuracy is often specified as:

• Accuracy -- a measure of the capability of the instrument to faithfully indicate the value of the measured signal. This term is not related to resolution; however, it can never be better than the resolution of the instrument. The accuracy is often specified as:

For example, a 5 1/2 digit voltmeter can have an accuracy of 0.0125% of reading + 24 µV on its 2.5 V range which results in an error of 149 µV when measuring a 1V signal. On the other hand, the resolution of this same voltmeter is 12 µV, 12 times better than the accuracy. Keep in mind that the accuracy of your measurement is affected by several factors and we will discuss these factors later in this paper.
• Precision -- a measure of the stability of the instrument and its capability of resulting in the same measurement over and over again for the same input signal. It is given by:

where Xn = the value of the nth measurement
and Av(Xn) = the average value of the set of n measurement.

Transmission Protocols

Q10. What are the basic differences between RS232, RS485 and RS422 serial transmission protocols?

Simplex can be viewed as a communications "one-way street". Data only flows in one direction. That is to say, a device can be a receiver or a transmitter exclusively. A simplex device is not a transceiver. A good example of simplex communications is an FM radio station and your car radio. Information flows only in one direction where the radio station is the transmitter and the receiver is your car radio. Simplex is not often used in computer communications because there is no way to verify when or if data is received. However, simplex communications is a very efficient way to distributed vast amounts of information to a large number of receivers.
Duplex communications overcome the limits of Simplex communications by allowing the devices to act as transceivers. Duplex communication data flow in both directions thereby allowing verification and control of data reception/transmission. Exactly when data flows bi-directionally further defines Duplex communications.
Full Duplex devices can transmit and receive data at the same time. RS232 is a fine example of Full Duplex communications. There are separate transmit and receive signal lines that allow data to flow in both directions simultaneously. RS422 devices also operate Full Duplex.
Half Duplex devices have the dubious honor of allowing both transmission and receiving, but not at the same time. Essentially only one device can transmit at a time while all other half duplex devices receive. Devices operate as transceivers, but not simultaneous transmit and receive. RS485 operates in a half duplex manner.


Here is the short version of the critical specifications. Unfortunately, these are subject to interpretation by individual manufacturers. That is why RS232 is often regarded as an incredibly un-standard communications protocol.
One important note. You will see that one of the major differences between RS232 and RS422/RS485 is the signaling mode. RS232 is unbalanced while RS422/RS485 is balanced. An unbalanced signal is represented by a single signal wire where a voltage level on that one wire is used to transmit/receive binary 1 and 0: the can be considered a push signal driver. On the other hand, a balanced signal is represented by a pair of wires where a voltage difference is used to transmit/receive binary information: sort of a push-pull signal driver. In short, unbalanced voltage level signal travels slower and shorter than a balanced voltage difference signal.

Q11. What is the difference between baud rate and data rate?

A data transfer rate (or often just data rate) is the amount of digital data that is moved from one place to another in a given time, usually in a second's time. The data transfer rate can be viewed as the speed of travel of a given amount of data from one place to another. In general, the greater the bandwidth of a given path, the higher the data transfer rate.

In telecommunications, data transfer is usually measured in bits per second. For example, a typical low-speed connection to the Internet may be 33.6 kilobits per second (Kbps). On Ethernet local area networks, data transfer can be as fast as 10 megabits per second. Network switches are planned that will transfer data in the terabit range. In earlier telecommunication systems, data transfer was sometimes measured in characters or blocks (of a certain size) per second. Data transfer time between the microprocessor or RAM and devices such as the hard disk and CD-ROM player is usually measured in milliseconds.

In computers, data transfer is often measured in bytes per second. The highest data transfer rate to date is 14 terabits per second over a single optical fiber, reported by Japan's Nippon Telegraph and Telephone (NTT DoComo) in 2006.

BAUD RATE: In telecommunications and electronics, baud (pronounced /bɔːd/ unit symbol "Bd"), is a measure of the symbol rate; that is, the number of distinct symbol changes (signalling events) made to the transmission medium per second in a digitally modulated signal. The term baud rate is also commonly used to refer to the symbol rate.

The baud rate (symbol rate) is distinct from the bit rate, because one symbol may carry more than one bit of information. For example, in modems, where bandwidth efficiency is important, it is commonly arranged for one symbol to carry 3 or more bits. So a 3000 bit per second modem, which is transmitting symbols that each carry 3 bits, should be described as operating at 1000 baud. Conversely, direct-sequencespread spectrum operation requires many symbols to carry only one bit.

Unfortunately, this distinction is not widely understood. Early modems operated only at one bit per symbol, and so baud rate and bit rate for those devices were equivalent. This has led many to believe the two terms to be synonymous, which they are not.

Conveying more than one bit per symbol has advantages. This reduces the time required to send a given quantity of data, and allows modern modems, FDDI and 100/1000 Mbit/s Ethernet LANs, and so on, to achieve high data rates. An optimal symbol set design must take into account channel bandwidth, desired information rate, noise characteristics of the channel and the receiver, and receiver and decoder complexity. A typical 2400 bit/s modem actually transmits at 600 baud (600 symbol/s), where each quadrature amplitude modulation symbol carries four bits of information. And further, 1000 Mbit/s Ethernet LAN cables use multiple wire pairs and multiple bits per symbol to encode their data payloads. Specifically, 1000BASE-T uses 4 wire pairs and 2 data bits per symbol to get a symbol rate of 125MBaud.

Conversely, representing one bit by many symbols has the advantage of overcoming signal noise, particularly radio jamming, hence is commonplace in military radio, despite the disadvantage of using more bandwidth to carry the same bit rate.
Baud is a measurement of transmission speed in asynchronous communication. Because of advances in modem communication technology, this term is frequently misused when describing the data rates in newer devices.
Traditionally, a Baud Rate represents the number of bits that are actually being sent over the media, not the amount of data that is actually moved from one DTE device to the other. The Baud count includes the overhead bits Start, Stop and Parity that are generated by the sending UART and removed by the receiving UART. This means that seven-bit words of data actually take 10 bits to be completely transmitted. Therefore, a modem capable of moving 300 bits per second from one place to another can normally only move 30 7-bit words if Parity is used and one Start and Stop bit are present.
If 8-bit data words are used and Parity bits are also used, the data rate falls to 27.27 words per second, because it now takes 11 bits to send the eight-bit words, and the modem still only sends 300 bits per second.
The formula for converting bytes per second into a baud rate and vice versa was simple until error-correcting modems came along. These modems receive the serial stream of bits from the UART in the host computer (even when internal modems are used the data is still frequently serialized) and converts the bits back into bytes. These bytes are then combined into packets and sent over the phone line using a Synchronous transmission method. This means that the Stop, Start, and Parity bits added by the UART in the DTE (the computer) were removed by the modem before transmission by the sending modem. When these bytes are received by the remote modem, the remote modem adds Start, Stop and Parity bits to the words, converts them to a serial format and then sends them to the receiving UART in the remote computer, who then strips the Start, Stop and Parity bits.
The reason all these extra conversions are done is so that the two modems can perform error correction, which means that the receiving modem is able to ask the sending modem to resend a block of data that was not received with the correct checksum. This checking is handled by the modems, and the DTE devices are usually unaware that the process is occurring.
By striping the Start, Stop and Parity bits, the additional bits of data that the two modems must share between themselves to perform error-correction are mostly concealed from the effective transmission rate seen by the sending and receiving DTE equipment. For example, if a modem sends ten 7-bit words to another modem without including the Start, Stop and Parity bits, the sending modem will be able to add 30 bits of its own information that the receiving modem can use to do error-correction without impacting the transmission speed of the real data.
The use of the term Baud is further confused by modems that perform compression. A single 8-bit word passed over the telephone line might represent a dozen words that were transmitted to the sending modem. The receiving modem will expand the data back to its original content and pass that data to the receiving DTE.
Modern modems also include buffers that allow the rate that bits move across the phone line (DCE to DCE) to be a different speed than the speed that the bits move between the DTE and DCE on both ends of the conversation. Normally the speed between the DTE and DCE is higher than the DCE to DCE speed because of the use of compression by the modems.
Because the number of bits needed to describe a byte varied during the trip between the two machines plus the differing bits-per-seconds speeds that are used present on the DTE-DCE and DCE-DCE links, the usage of the term Baud to describe the overall communication speed causes problems and can misrepresent the true transmission speed. So Bits Per Second (bps) is the correct term to use to describe the transmission rate seen at the DCE to DCE interface and Baud or Bits Per Second are acceptable terms to use when a connection is made between two systems with a wired connection, or if a modem is in use that is not performing error-correction or compression.
Modern high speed modems (2400, 9600, 14,400, and 19,200bps) in reality still operate at or below 2400 baud, or more accurately, 2400 Symbols per second. High speed modem are able to encode more bits of data into each Symbol using a technique called Constellation Stuffing, which is why the effective bits per second rate of the modem is higher, but the modem continues to operate within the limited audio bandwidth that the telephone system provides. Modems operating at 28,800 and higher speeds have variable Symbol rates, but the technique is the same.

Q12. What is asynchronous serial transmission?

Asynchronous transmission allows data to be transmitted without the sender having to send a clock signal to the receiver. Instead, the sender and receiver must agree on timing parameters in advance and special bits are added to each word which are used to synchronize the sending and receiving units.
When a word is given to the UART for Asynchronous transmissions, a bit called the "Start Bit" is added to the beginning of each word that is to be transmitted. The Start Bit is used to alert the receiver that a word of data is about to be sent, and to force the clock in the receiver into synchronization with the clock in the transmitter. These two clocks must be accurate enough to not have the frequency drift by more than 10% during the transmission of the remaining bits in the word. (This requirement was set in the days of mechanical teleprinters and is easily met by modern electronic equipment.)
After the Start Bit, the individual bits of the word of data are sent, with the Least Significant Bit (LSB) being sent first. Each bit in the transmission is transmitted for exactly the same amount of time as all of the other bits, and the receiver “looks” at the wire at approximately halfway through the period assigned to each bit to determine if the bit is a 1 or a 0. For example, if it takes two seconds to send each bit, the receiver will examine the signal to determine if it is a 1 or a 0 after one second has passed, then it will wait two seconds and then examine the value of the next bit, and so on.
The sender does not know when the receiver has “looked” at the value of the bit. The sender only knows when the clock says to begin transmitting the next bit of the word.
When the entire data word has been sent, the transmitter may add a Parity Bit that the transmitter generates. The Parity Bit may be used by the receiver to perform simple error checking. Then at least one Stop Bit is sent by the transmitter.
When the receiver has received all of the bits in the data word, it may check for the Parity Bits (both sender and receiver must agree on whether a Parity Bit is to be used), and then the receiver looks for a Stop Bit. If the Stop Bit does not appear when it is supposed to, the UART considers the entire word to be garbled and will report a Framing Error to the host processor when the data word is read. The usual cause of a Framing Error is that the sender and receiver clocks were not running at the same speed, or that the signal was interrupted.
Regardless of whether the data was received correctly or not, the UART automatically discards the Start, Parity and Stop bits. If the sender and receiver are configured identically, these bits are not passed to the host.
If another word is ready for transmission, the Start Bit for the new word can be sent as soon as the Stop Bit for the previous word has been sent.
Because asynchronous data is “self synchronizing”, if there is no data to transmit, the transmission line can be idle.