You are on page 1of 18

ASME Workshop on Sensor Interface Using LabVIEW

Najib Metni, Ph.D.


„ „ „ „

Intelligent Machines (Mechatronics systems) Sensors for Robotics Motion Sensor Static Characteristics Data Acquisition & Conditioning
‰ ‰ ‰

Resistive Sensors Capacitive Sensors A/D Conversion PC: Labview Microcontroller PLC and ladder programming


‰ ‰ ‰


Thermocouple interface (HW and SW experiments)
ASME Workshop – N.Metni Slide 2

Jan 28, 2008

Mechatronics Systems

Jan 28, 2008

ASME Workshop – N.Metni

Slide 3


Metni Slide 6 Jan 28. „ Jan 28.Metni Slide 4 Sensors „ Sensors are input-transducers that transform a physical signal to an electric signal (physical → electrical ).Transducers „ A transducer is a device that converts a signal from one physical form to a corresponding signal having a different physical form.Metni Slide 5 Elements of the Data Acquisition System „ Transducer/Sensor ‰ ‰ ‰ May generate their own electrical signal (thermocouple or piezoelectric) or require external excitation (power) Converts one physical Quantity Under Measurement (QUM) into another Typical output is in volts to microvolt ASME Workshop – N. Most measurement systems use electric signals. 2008 2 . Sensors are sometimes called transducers. 2008 ASME Workshop – N. 2008 ASME Workshop – N. A transducer is an energy converter. „ „ Jan 28. and hence rely on sensors.

2008 3 . 2008 Provides external excitation Completes the circuit (bridges) Linearizes Filters (typically low pass filter which only allows low frequency signals through) Amplifies Isolates one part of a system electrically from other parts of the system Typical output is in volts ASME Workshop – N.Metni Slide 8 Jan 28. Storage Display Analysis ASME Workshop – N.Metni Slide 7 Elements of the Data Acquisition System „ Data Acquisition Unit (DAU) ‰ ‰ ‰ ‰ ‰ ‰ Samples and holds Digitizes Multiplexes (combines with other measurements) Converts for transmission Transmits Typical output is in binary digits (bits) ASME Workshop – N.Metni Slide 9 Jan 28.Elements of the Data Acquisition System „ Signal Conditioning ‰ ‰ ‰ ‰ ‰ ‰ ‰ Jan 28. 2008 Elements of the Data Acquisition System „ Personal Computer or microcontroller ‰ ‰ ‰ ‰ Recording.

Metni Slide 12 4 . one should have the full details of the sensor used. ‰ ‰ ‰ ‰ ‰ ‰ Analog vs.Sensor Interfacing „ Before designing any data conditioning system.Metni Slide 10 Jan 28.Metni Slide 11 Proximity Sensors „ Proximity sensors come in two forms ‰ ‰ Digital: Obstacle detection Analog: Range finder „ Mainly. 2008 ASME Workshop – N. 2008 Sensors for Motion „ We will present sensors used for Robotics motion: ‰ ‰ ‰ ‰ ‰ ‰ ‰ Proximity sensors: infrared. self-excitation … ASME Workshop – N. 2008 ASME Workshop – N. ultrasonic range finder. INS GPS Accelerometers Jan 28. Encoders Gyroscopes Electronic Compasses IMU. two technologies used ‰ ‰ Infrared Transmitter & Receiver (Transceiver) Ultrasound Transmitter & Receiver (Transceiver) Jan 28. digital Level of voltages Resistive / Inductive / Capacitive / piezoelectric Linearity Modulating vs.

Metni Slide 15 5 .Metni Slide 13 Ultrasonic Range Finder Devantech Ultrasonic Range Finder SRF04 • Ranges from 3cm to 3m • Returns a positive TTL level signal. width proportional to range (Analog Output) • 3-4cm Resolution Jan 28.) There are two basic types: ‰ Relative: they just indicate movement. ‰ Absolute: the same shaft position will always give the same position reading „ Jan 28.Infrared Proximity Sensors Sharp GP2Y0D340K IR Range Sensor • Infrared proximity detector. and they require that other circuits or programs be used to track position. robot arms. etc. 2008 ASME Workshop – N. 2008 ASME Workshop – N. 2008 ASME Workshop – N. 40cm judgment distance • Binary Interface LynxMotion IR Proximity Detector Sensor • Adjustable from 4'' to 26'' • Binary Output Jan 28.Metni Slide 14 Encoders „ Optical encoders are used for measuring shaft angular position (motors.

Gyroscopes „ Sensors used to measure the angular velocity. A gyroscopically stabilized sensor platform is used to maintain consistent orientation of the three accelerometers throughout this process. and integrating over time to derive velocity and position. 2008 ASME Workshop – N. The principle of operation involves continuous sensing of minute accelerations in each of the three directional axes.Metni Slide 16 IMU and INS „ The technology was quickly adapted for use on missiles and in outer space. 2008 ASME Workshop – N.Metni Slide 17 „ „ Jan 28. and found its way to maritime usage with nuclear submarines (1958). 2008 IMU and INS „ IMU contains ‰ ‰ ‰ ‰ ‰ ‰ 3-axis accelerometer Dual axis gyroscope Electronic Compass Temperature compensation Filtering circuitry … Picture from Xsens Technologies Jan 28. ASME Workshop – N. SFE Single Axis 75°/s Gyro Breakout Board • Complete rate gyroscope on a single chip • Single Axis 75 degree/sec (Range ± 75 deg/sec) • Z-axis (yaw rate) response • Dimensions: 18x18mm Jan 28.Metni Slide 18 6 .

1 percent of distance traveled. Low-cost MEMS INS cost from $200-$1000.IMU and INS ‰ ‰ ‰ High-end INS packages used in ground applications have shown performance of better than 0.Metni Slide 21 7 .01 m (Carrier Differential) Jan 28. for example orientation changes during a robot maneuver.Metni Slide 20 GPS (Global Navigation System) „ Position is calculated by triangulation Figure from MATLAB triangulation solution Jan 28. inertial navigation can provide accurate short-term information. 2008 GPS (Global Navigation System) „ 24 satellites navigation system. „ However. 2008 ASME Workshop – N. ASME Workshop – N. but cost in the neighborhood of $100K to $200K. 2008 ASME Workshop – N.Metni Slide 19 Jan 28. Lower performance versions (1% of distance traveled) run between $20K to $50K. Operated by the United States Air Force Picture from Wikipedia „ „ Nominal Accuracy „ „ „ 10 m (Stand Alone) 1-5 m (Code Differential) 0.

2008 ASME Workshop – N. evaluated at a specified input x0. SFE Triple Axis Accelerometer (LIS3LV02DQ) • Triple Axis ±2g or ±6g • SPI Analog.Metni Slide 23 Sensor Characteristics: Accelerometer „ Resolution: refers to the incremental change in the input signal from a nonzero arbitrary value that would cause a corresponding change in the sensor output.Metni Slide 24 8 .00981 m / s 2 „ ( ) Sensitivity: is the smallest detectable change in output of the sensor y to a change in the input x. 2008 ASME Workshop – N.81 m / s 2 = 0. or DIGITAL output (Through A/D converter) • Operating voltage 2.Accelerometers „ „ „ Sensors to measure acceleration. Units are with respect to the gravitational acceleration g.8x0.6V • Dimensions: 21x23mm (0.16V-3. Jan 28. ‰ The resolution of the accelerometer is 1 mg. Could be single. 2008 ASME Workshop – N. At FS = 2g S = 1024 LSB/g Jan 28. 10−3 g × 9.9") Jan 28.Metni Slide 22 Sensor Characteristics: Accelerometer „ We will skim through the different sensor characteristics from the Triple-Axis Accelerometer datasheet shown in the previous slide. dual or triple axis.

2008 ASME Workshop – N.Metni Slide 26 Sensor Characteristics: Accelerometer Jan 28. Accuracy: a measurement is more accurate if it is closer to what is defined as the “truth” as compared to a reference standard. 2008 ASME Workshop – N.Sensor Characteristics: Accelerometer Jan 28.Metni Slide 25 Sensor Characteristics: Accelerometer „ „ Offset Error: of a sensor is defined as the output that will exist when it should be zero. FS = 2g Z axis Zero-g accuracy offset = ± 40 mg Eliminated by a HIGH-PASS Filter Jan 28.Metni Slide 27 9 . 2008 ASME Workshop – N.

too noisy.Metni Slide 30 10 . 2008 ASME Workshop – N. hysteresis. „ „ Jan 28. 2008 ASME Workshop – N. The electric signal generated by the sensor may not be useful because it may be too small.… This figure shows a somewhat exaggerated relationship between the measured values and the calibration line. Nonlinearities are due to saturation. A linear response means that the output is proportional to the input signal. backlash.Metni Slide 28 Sensor Characteristics: Accelerometer ODR: Output Data Rate Jan 28. may have a DC offset or may not be compatible with the input requirements of the MCU device. The circuitry used for this purpose is called signal conditioning.Metni Slide 29 Signal Conditioning „ The signal coming from the sensor must go through an interface circuitry before it reaches a MCU or PLC.Sensor Characteristics: Accelerometer „ Linearity: is a measure of how close the sensor response curve is to being a straight line. 2008 ASME Workshop – N. Jan 28. Linear response is always a desirable feature.

Signal Conditioning 1. Device A Device B Unity gain amplifier (buffer) Jan 28.Metni Slide 31 2. Amplification is achieved with inverting or non-inverting opamps. Conversion: ‰ Analog to Digital Conversion Jan 28. The signal conditioning circuit should have a considerably larger input impedance in comparison with the output impedance of the sensor. 2008 ASME Workshop – N.Metni Slide 32 Impedance Matching . in order to reduce loading effects. The signal is multiplied by a constant called gain. Filtering process will reduce the signal noise that is present due to interference.Metni Slide 33 11 . Filtering: ‰ 3.Buffer „ A unity-gain op-amp used as a buffer amplifier or as an impedance converter serves this purpose. 2008 ASME Workshop – N. Linearization ‰ A linear output from a sensor is highly desirable. 5. Impedance Buffering: ‰ ‰ Jan 28. An impedance-matching buffer is used to reduce loading effects. The relation between the measured signal and sensor output is linear. 2008 Signal Conditioning 4. ASME Workshop – N. Amplification: ‰ ‰ Amplify the signal to a level where it is of practical use.

Voltage divider circuit .Metni Slide 35 Example: Accelerometer „ An integrator can be used to obtain velocity information from an accelerometer. Integrator Gain Amplification Jan 28.Metni Voltage Divider „ Voltage divider with Gain amplification.Wheatstone Bridge Signal Conditioning from resistive sensors are: . 2008 ASME Workshop – N.Metni Slide 36 12 .Wheatstone bridge circuit . Buffer Op-Amp Amplification with gain Ka Jan 28.Op-amp circuits Δv = ( R1 + R4 ) ( R2 + R3 ) Resistive Sensor Slide 34 R1R3 − R2 R4 Balanced bridge: offset voltage is zero R1R3 = R2 R4 Jan 28. 2008 ASME Workshop – N. 2008 ASME Workshop – N.

Metni Slide 37 Non-inverting Circuit ib C Rb R2 (9 k) R1 (1 k) + vO Sensor Response of this circuit to a step function in time domain is: VOUT = iRb (1 + R2 R1 ) (1 − exp [ − t Rb C ]) Jan 28.Metni Slide 39 13 . 2008 ASME Workshop – N. Jan 28.Capacitive Sensors „ If you are using a capacitive sensor where the measurand affects a capacitance variation. Signal conditioning: ‰ ‰ ‰ „ Non-inverting circuit Capacitive Bridge Oscillator Jan 28.Metni Slide 38 Capacitive Bridge B R1 C1 Z1 D ZX RX Z2 Z3 R3 R2 CR CX = 1 2 R3 ∼ CX CX (unknown) is compared with C1 (known). 2008 ASME Workshop – N. 2008 ASME Workshop – N.

Data should be converted into binary signals. A/D Conversion: Process of converting continuous time signals into discrete representations (binary).Metni Slide 41 Data Acquisition: PC . ASME Workshop – N. 2008 Full Scale 2k − 1 k: Number of bits in the converter ASME Workshop – N. It relies on graphical symbols to describe programming experience. A/D Resolution: The change in analog value corresponding to a change in the LSB in the digital number is called the resolution VQ. 2008 1 ⎡ ⎛ R1 // R2 ⎞ ⎤ ⎢ ln ⎜1 + ⎟⎥ R4C ⎣ R3 ⎠ ⎦ ⎢ ⎝ ⎥ −1 ASME Workshop – N. and data analysis. industrial automation. LabVIEW programs are called Virtual Instruments. „ „ VQ = Jan 28.Metni Slide 40 Data Acquisition : A/D Conversion „ After Signal Conditioning.Oscillator VDD R1 + C 1 R3 vO R2 C2 R4 Square wave oscillator f = Jan 28.Metni Slide 42 „ „ Jan 28. 2008 14 . LabVIEW is a major player in the area of instrumentation and measurements.LabVIEW „ LabVIEW is a powerful and flexible graphical programming language.

… They recognize industrial logic (DC 24 V or AC). PLC programming languages: ‰ ‰ ‰ ‰ ‰ „ LD – Ladder Diagram IL – Instruction List (assembly) SFC – Sequential Function Chart (GRAFCET) ST – Structured text (similar to high level language) FBD – Function Block Diagram Jan 28. It consists of a CPU with memories and an I/O interface. Designs differ by the number of I/O.Metni Slide 43 Data Acquisition: PLC „ A Programmable Logic Controller is a microprocessorbased control unit designed for an industrial application (Heavy-Duty Equipments).Metni Slide 44 Data Acquisition: PLC „ PLC execute: ‰ ‰ ‰ ‰ Boolean operations (bit.…) Timer/Counter functions A/D conversion PWM outputs „ It works by continually scanning a program that is interpreted by an embedded microprocessor. 2008 ASME Workshop – N.Data Acquisition: Microcontroller „ Popular MCU: ‰ Microchip PIC ‰ Freescale HCS12 Programming Language: ‰ Assembly ‰ C „ Jan 28. 2008 ASME Workshop – N. memory space.Metni Slide 45 15 . „ „ Jan 28. 2008 ASME Workshop – N. logical.

2008 ASME Workshop – N. A thermocouple is created whenever two dissimilar metals touch and the contact point produces a small opencircuit voltage as a function of temperature.Metni Slide 47 Thermocouple Letter Designation Jan 28. inexpensive devices that operate over a wide temperature range.Metni Slide 48 16 . 2008 ASME Workshop – N.Metni Slide 46 Thermocouple „ One of the most frequently used temperature sensors is the thermocouple. „ „ ΔV = S ΔT S: Seebeck Coefficient Jan 28. 2008 ASME Workshop – N.Ladder Programming SW1 SW3 MT1 Ladder Diagram SW2 Function Block Diagram Jan 28. Thermocouples are very rugged.

Instrumentation Amplifiers can reject Common-Mode Noise. For instance. Another source of noise is due to thermocouples being mounted or soldered directly to a conductive material.Metni Slide 49 Thermocouple Interfacing „ You can significantly improve the noise performance of your system by amplifying the low-level thermocouple voltages near the signal source (measurement point). ‰ ‰ „ Isolation helps to prevent ground loops from occurring. low-pass filters are useful for removing the 60 Hz power line noise that is prevalent in many laboratory and plant settings. making them susceptible to noise. „ Jan 28. 2008 ASME Workshop – N. 2008 17 . At the end an introduction to the DAQ assistant is presented. like steel or water.Thermocouple Interfacing „ Thermocouple output signals are typically in the millivolt range (The output range of all thermocouple types falls between -10 mV and 80 mV). Low-pass filters are commonly used to effectively eliminate high frequency noise in thermocouple measurements. The temperature measurement will be initiated by an external trigger (Digital Switch).Metni Slide 51 „ „ Jan 28.Metni Slide 50 Jan 28. 2008 Thermocouple Interface Tutorial „ This tutorial will help you deal with an example of the sensor interface hardware and software. ASME Workshop – N. We will design a hardware circuit for amplifying the thermocouple signal before connecting it to the DAQ. ASME Workshop – N. This configuration makes thermocouples particularly susceptible to commonmode noise and ground loops.

robotshop.CRC Press 2008 PLC’s and their Engineering Applications – Alan Crispin – McGraw Hill .Metni Slide 52 18 . 2008 ASME Workshop – N.1997 Most of the pictures and figures are copyrighted: www.References „ My Lecture Notes: ‰ MECH 530 : Mechatronics System Design ‰ MECH 643 : Advanced Mechatronics – Intelligent Systems ‰ MECH 430 : Instrumentation & Measurements ‰ Robotics and Manipulators The Mechatronics Handbook – Robert Bishop .ca „ „ „ Jan 28.