Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
university:courses:engineering_discovery:lab_6 [24 Jun 2016 23:22] Jonathan Pearsonuniversity:courses:engineering_discovery:lab_6 [04 Sep 2019 20:32] (current) – add alternate inductor options from kit Doug Mercer
Line 1: Line 1:
 ===== A Simple Magnetic Proximity Sensor===== ===== A Simple Magnetic Proximity Sensor=====
-{{ analogTV>VIDEO NUMBER HERE}}+{{ analogTV>5032143786001}}
  
 ==== Introduction ==== ==== Introduction ====
Line 28: Line 28:
   * (1) 0.1 μF capacitor (marked "104") from the ADALP2000 Analog Parts Kit   * (1) 0.1 μF capacitor (marked "104") from the ADALP2000 Analog Parts Kit
   * (1) 10 μF capacitor from the ADALP2000 Analog Parts Kit   * (1) 10 μF capacitor from the ADALP2000 Analog Parts Kit
-  * (1) 100 μH inductor (marked "101"from the ADALP2000 Analog Parts Kit+  * (1) inductor from the ADALP2000 Analog Parts Kit, either 100uH (marked 101), 1mH (102), 10mH (103)
 ==== Procedure ==== ==== Procedure ====
   - Construct the following electromagnet circuit on the solderless breadboard{{ university:courses:engineering_discovery:lab_6_image_1.png?400 }}   - Construct the following electromagnet circuit on the solderless breadboard{{ university:courses:engineering_discovery:lab_6_image_1.png?400 }}
-  - **Note that the 100 Ω resistors get very hot due to Joule heating, so avoid coming in contact with them**+  - **Note that the 100 Ω resistors get very hot due to Joule heating, so avoid coming in contact with them** Using 1mH or 10mH inductor will draw less current and make stronger magnetic field.
   - Refer to the illustration below for one way to install the components in the solderless breadboard{{ university:courses:engineering_discovery:lab_6_assembly_image_1.png?900 }}   - Refer to the illustration below for one way to install the components in the solderless breadboard{{ university:courses:engineering_discovery:lab_6_assembly_image_1.png?900 }}
   - Add the following Hall effect sensor circuit to the solderless breadboard{{ university:courses:engineering_discovery:lab_6_image_2.png?800 }}   - Add the following Hall effect sensor circuit to the solderless breadboard{{ university:courses:engineering_discovery:lab_6_image_2.png?800 }}
Line 43: Line 43:
   - Refer to the following schematic for the placement of R4, but do not install any resistor here at this time{{ university:courses:engineering_discovery:lab_6_image_3.png?800 }}   - Refer to the following schematic for the placement of R4, but do not install any resistor here at this time{{ university:courses:engineering_discovery:lab_6_image_3.png?800 }}
   - Calculate the op-amp closed-loop gain   - Calculate the op-amp closed-loop gain
-  - Our objective is to place the sensor output voltage with no applied magnetic field as close as possible to the lower end of its linear range, which is 0.5 V.  We calculate the value of R4 in the next few steps.  It's important to note that the 5.0 V supply will actually be at about 4.8 V to 4.9 V due to the IR drop (internal to the M1K) that is produced by the 150 mA current that drives the electromagnet and that the resistor values are limited and have +/-5% tolerances, so the final voltage will not be perfect.  We will therefore use 2.4 for the mid-supply voltage. +  - Our objective is to place the sensor output voltage with no applied magnetic field as close as possible to the lower end of its linear range, which is 0.5 V.  We calculate the value of R4 in the next few steps.  It's important to note that the 5.0 V supply will actually be at about 4.8 V to 4.9 V due to the IR drop (internal to the M1K) that is produced by the 150 mA current that drives the electromagnet and that the resistor values are limited and have +/-5% tolerances, so the final voltage will not be perfect.  We will designate V<sub>SUPPLY</sub> as the supply voltage and V<sub>MID</sub> as the mid-supply voltage. 
-  - In order to calculate R4 it is necessary to know the currents flowing in and out of the op-amp summing node.  The current through R2 is defined as I<sub>R2</sub> Under ideal conditions this current would be zero since the voltage on each side of it would be mid-supply, but there is a small offset voltage between the internal Hall effect sensor output voltage with zero field and the internally buffered V<sub>REF</sub> For small gains this voltage can in many instances be ignored, but it must be considered in high-gain circuits such as this one.+  - Measure and record V<sub>SUPPLY</sub> using the M1K 
 +  - In order to calculate R4 it is necessary to know the currents flowing in and out of the op-amp summing node.  The current through R2 is defined as I<sub>R2</sub> Under ideal conditions this current would be zero since the voltage on each side of it would be V<sub>MID</sub>, but there is a small offset voltage between the internal Hall effect sensor output voltage with zero field and the internally buffered V<sub>REF</sub> For small gains this voltage can in many instances be ignored, but it must be considered in high-gain circuits such as this one.
   - Use the M1K to measure and record the voltage at Pin 7 and define it as V<sub>REF</sub>   - Use the M1K to measure and record the voltage at Pin 7 and define it as V<sub>REF</sub>
   - Use the M1K to measure and record the voltage at Pin 6 and define it as V<sub>CM</sub>; this is the common-mode voltage at the op-amp input, and is driven to be very close to the output of the internal Hall effect sensor by negative feedback   - Use the M1K to measure and record the voltage at Pin 6 and define it as V<sub>CM</sub>; this is the common-mode voltage at the op-amp input, and is driven to be very close to the output of the internal Hall effect sensor by negative feedback
Line 54: Line 55:
   - Calculate the amount of additional current, I<sub>SHIFT</sub>, required through the feedback resistor R3 to shift V<sub>OUT,Z</sub> to 0.5 V as I<sub>SHIFT</sub> = V<sub>SHIFT</sub>/100 KΩ; note that this is a negative quantity because V<sub>SHIFT</sub> is negative   - Calculate the amount of additional current, I<sub>SHIFT</sub>, required through the feedback resistor R3 to shift V<sub>OUT,Z</sub> to 0.5 V as I<sub>SHIFT</sub> = V<sub>SHIFT</sub>/100 KΩ; note that this is a negative quantity because V<sub>SHIFT</sub> is negative
   - The current flowing into the summing node through R4, I<sub>R4</sub>, that is used to create the desired offset is in the opposite direction to that of I<sub>SHIFT</sub>, so we can write I<sub>R4</sub> = -I<sub>SHIFT</sub>, which is a positive quantity   - The current flowing into the summing node through R4, I<sub>R4</sub>, that is used to create the desired offset is in the opposite direction to that of I<sub>SHIFT</sub>, so we can write I<sub>R4</sub> = -I<sub>SHIFT</sub>, which is a positive quantity
-  - Calculate the value of R4 by noting that the voltage across R4 is the difference between the supply voltage, which we determined to be 4.8 Vand V<sub>CM</sub>, as R4 = (4.8 V - V<sub>CM</sub>)/I<sub>R4</sub>+  - Calculate the value of R4 by noting that the voltage across R4 is the difference between V<sub>SUPPLY</sub> and V<sub>CM</sub>, as R4 = (V<sub>SUPPLY</sub> - V<sub>CM</sub>)/I<sub>R4</sub>
   - Select a resistor from the kit that is closest to this value for R4; unless the calculated value is very close to a value available in the kit, round up in order to make any error result in a higher output voltage   - Select a resistor from the kit that is closest to this value for R4; unless the calculated value is very close to a value available in the kit, round up in order to make any error result in a higher output voltage
   - Place R4 in the circuit as shown in the schematic above   - Place R4 in the circuit as shown in the schematic above
Line 76: Line 77:
   - Can you explain why there are two different threshold voltages and how having two threshold voltages provides an advantage in this binary proximity detector?   - Can you explain why there are two different threshold voltages and how having two threshold voltages provides an advantage in this binary proximity detector?
 ==== Theory ==== ==== Theory ====
-Most magnetic-field-based proximity sensors use strong permanent magnets to generate the magnetic fields that are sensed, and therefore the sensors only require modest gains in order to output a reasonable voltage.  In this lab we generate a relatively weak magnetic field using an electromagnet carrying about 150 mA, and thus require a fairly large gain in the op-amp contained in the Hall effect sensor.  Having large op-amp gain introduces a few practical problems.  One problem is that the output noise is large.  This happens because the noise at the input to the op-amp gets multiplied along with the desired signal in the op-amp and appears at the op-amp output.  Another similar problem is DC offset, in which a small offset at the input to the op-amp gets multiplied by the op-amp and appears as a DC offset on the output voltage.  The op-amp itself has an input offset voltage, imperfectly matched input bias currents that get converted to voltages which are reflected to the op-amp output voltage, and the internal Hall effect sensor output offset and internally generated and buffered reference voltage, REF, are not exactly the same.  These all contribute to the output offset voltage, and are the reasons why the output voltage is not exactly at mid-supply when no magnetic field is present.  We can compensate for these offsets, and even shift the output offset voltage wherever we need to (within the limits of the part) by summing in an offset voltage at the op-amp's summing node.+Most magnetic-field-based proximity sensors use strong permanent magnets to generate the magnetic fields that are sensed, and therefore the sensors only require modest gains in order to output a reasonable voltage.  In this lab we generate a relatively weak magnetic field using an electromagnet carrying about 150 mA, and thus require a fairly large gain in the op-amp contained in the Hall effect sensor.  Having large op-amp gain introduces a few practical problems.  One problem is that the output noise is large.  This happens because the noise at the input to the op-amp gets multiplied along with the desired signal in the op-amp and appears at the op-amp output.  Another similar problem is DC offset, in which a small offset at the input to the op-amp gets multiplied by the op-amp and appears as a DC offset in the output voltage.  The op-amp has an input offset voltage, and imperfectly matched input bias currents that get converted to voltages, and these are reflected by the op-amp gain to the op-amp output voltage. Additionally, the internal Hall effect sensor output offset and internally generated and buffered reference voltage, REF, are not exactly the same.  These all contribute to the output offset voltage, and are the reasons why the output voltage is not exactly at mid-supply when no magnetic field is present.  We can compensate for these offsets, and even shift the output offset voltage wherever we need to (within the limits of the part) by summing in an offset voltage at the op-amp's summing node.
  
 The summing node of the op-amp contained in the AD22151 is made available on Pin 6, and the non-inverting op-amp input is internally biased at approximately +2.5 V, so it is possible to inject positive or negative current into the summing node in order to shift the output offset level.  In this case we desire to shift the output offset down, which requires an injection of current into the summing node.  This can also be viewed as summing a positive voltage into an inverting op-amp summing amplifier configuration.  With zero magnetic field applied, the voltage across the op-amp gain resistor R2 is ideally zero since the reference voltage VREF and the output of the Hall effect sensor would be the same -- note that the voltage on the op-amp inverting input is driven to be essentially the same as the voltage no the non-inverting input by negative feedback, so the voltage on the inverting input can be viewed as essentially the same as that of the Hall effect sensor output, neglecting the op-amp input offset voltage.  The voltage that is essentially common to both op-amp inputs is referred to as the "input common-mode voltage."  There is, however, a small voltage across R2 due to the mismatch between VREF and the op-amp input common-mode voltage.  Even though this is a small voltage, it is applied across a small resistance and produces an appreciable current that flows through a large-valued feedback resistor to produce an appreciable shift in output voltage.  This is how op-amps work to amplify signal voltages, and why the inverting gain of an op-amp is proportional to the feedback resistance and inversely proportional to the gain resistance.  We can determine the current flowing though R2 by measuring the voltage across it and dividing by its value.  Most of this current flows through the feedback resistor R3, but a small amount flows into the op-amp inverting input; this small current is the input bias current, and is the reason why the current through R2 is not exactly equal to the current through R3. The summing node of the op-amp contained in the AD22151 is made available on Pin 6, and the non-inverting op-amp input is internally biased at approximately +2.5 V, so it is possible to inject positive or negative current into the summing node in order to shift the output offset level.  In this case we desire to shift the output offset down, which requires an injection of current into the summing node.  This can also be viewed as summing a positive voltage into an inverting op-amp summing amplifier configuration.  With zero magnetic field applied, the voltage across the op-amp gain resistor R2 is ideally zero since the reference voltage VREF and the output of the Hall effect sensor would be the same -- note that the voltage on the op-amp inverting input is driven to be essentially the same as the voltage no the non-inverting input by negative feedback, so the voltage on the inverting input can be viewed as essentially the same as that of the Hall effect sensor output, neglecting the op-amp input offset voltage.  The voltage that is essentially common to both op-amp inputs is referred to as the "input common-mode voltage."  There is, however, a small voltage across R2 due to the mismatch between VREF and the op-amp input common-mode voltage.  Even though this is a small voltage, it is applied across a small resistance and produces an appreciable current that flows through a large-valued feedback resistor to produce an appreciable shift in output voltage.  This is how op-amps work to amplify signal voltages, and why the inverting gain of an op-amp is proportional to the feedback resistance and inversely proportional to the gain resistance.  We can determine the current flowing though R2 by measuring the voltage across it and dividing by its value.  Most of this current flows through the feedback resistor R3, but a small amount flows into the op-amp inverting input; this small current is the input bias current, and is the reason why the current through R2 is not exactly equal to the current through R3.
  
-Additional current can be added through the feedback resistor in order to shift the output voltage down to the lower end of its linear range of 0.5 V.  The amount of current necessary for this can be calculated by taking the difference between the existing output voltage and the desired output voltage and dividing by the feedback resistance.  This value of current is then injected into the op-amp summing node through an offset injection resistor R4.  The value of R4 is calculated as the difference between the voltage on the input side of R4 (we used 4.8 for this) and the op-amp input common-mode voltage divided by the required injection current.+Additional current can be added through the feedback resistor in order to shift the output voltage down to the lower end of its linear range of 0.5 V.  The amount of current necessary for this can be calculated by taking the difference between the existing output voltage and the desired output voltage and dividing by the feedback resistance.  This value of current is then injected into the op-amp summing node through an offset injection resistor R4.  The value of R4 is calculated as the difference between the voltage on the input side of R4 (V<sub>SUPPLY</sub>) and the op-amp input common-mode voltagedivided by the required injection current.
  
 The op-amp is set up as a non-inverting amplifier to the voltage that is output from the Hall effect sensor element.  The gain of a non-inverting op-amp, A<sub>V,NI</sub>, is the ratio of the feedback resistance to the gain resistance plus one.  In terms of the reference designators used in the lab, this is A<sub>V,NI</sub> = 1 + R3/R2.  Note that VREF is also summed in an inverting fashion in order to place the output nominally at mid-supply (it is close to mid-supply for the typical small gains that are used when permanent magnets are used as the sources of the magnetic fields).  The gain of an inverting op-amp, A<sub>V,I</sub>, is the negative of the ratio of the feedback resistance to the gain resistance, or A<sub>V,I</sub> = -R3/R2.  The output level with no magnetic field present has been defined by the gain, circuit offsets, VREF, and the offset injection circuitry.  The AD22151 output voltage, V<sub>O</sub>, due to the Hall effect sensor element output voltage, V<sub>H</sub>, is therefore simply The op-amp is set up as a non-inverting amplifier to the voltage that is output from the Hall effect sensor element.  The gain of a non-inverting op-amp, A<sub>V,NI</sub>, is the ratio of the feedback resistance to the gain resistance plus one.  In terms of the reference designators used in the lab, this is A<sub>V,NI</sub> = 1 + R3/R2.  Note that VREF is also summed in an inverting fashion in order to place the output nominally at mid-supply (it is close to mid-supply for the typical small gains that are used when permanent magnets are used as the sources of the magnetic fields).  The gain of an inverting op-amp, A<sub>V,I</sub>, is the negative of the ratio of the feedback resistance to the gain resistance, or A<sub>V,I</sub> = -R3/R2.  The output level with no magnetic field present has been defined by the gain, circuit offsets, VREF, and the offset injection circuitry.  The AD22151 output voltage, V<sub>O</sub>, due to the Hall effect sensor element output voltage, V<sub>H</sub>, is therefore simply
Line 115: Line 116:
   * Operational amplifiers should not be used as comparators   * Operational amplifiers should not be used as comparators
   * Hysteresis can be added to a comparator to prevent chattering that occurs with noisy slow-moving input signals   * Hysteresis can be added to a comparator to prevent chattering that occurs with noisy slow-moving input signals
 +
 +**Return to [[university:courses:engineering_discovery|Engineering Discovery Index]]**
university/courses/engineering_discovery/lab_6.1466803351.txt.gz · Last modified: 24 Jun 2016 23:22 by Jonathan Pearson