MECHATRONICS
ANALOGUE TO DIGITAL CONVERTERS
             PUSHPARAJ MANI PATHAK
     MECHANICAL & INDUSTRIAL ENGINEEING, IIT ROORKEE
                                                       1
   Mechatronic system components
      ACTUATORS                         SENSORS
▪ Solenoids, voice coils     ▪switches
                                                                       INPUT SIGNAL
▪ DC motors                  ▪Potentiometer, Thermocouple            CONDITIONING AND
▪ Stepper motors             ▪Photoelectrics, Accelerometer             INTERFACING
▪ Servo motors               ▪Digital encoder                     ▪ Discrete circuits ▪ Filters
▪Hydraulics, Pneumatics      ▪Strain gauge, MEMs                  ▪ Amplifiers        ▪ A/D, D/D
                            OUTPUT SIGNAL
                                                              DIGITAL CONTROL ARCHITECTURES
  GRAPHICAL                CONDITIONING &
   DISPLAYS                                               ▪Logic circuits        ▪Control algorithms
                             INTERFACING
▪LEDs, LCD, CRT                                           ▪Microcontroller       ▪communication
                      ▪D/A, D/D ▪Power transistors
▪Digital display                                          ▪Sequencing & Timing   ▪SBC, PLC
                      ▪Amplifiers ▪Power op amps
                                                          ▪Logic & Arithmetic    ▪A/D, D/D
                      ▪PWM
                                                                                             2
Analog & Digital Signals
• In analogue signal changes are
  continuous whereas, a digital signal
  exists only at specific levels or states
  and changes its level in discrete steps.
• Most digital signals have only two
                                             Analogue signal
  states: high and low.
• A system using two-state signals
  allows the application of Boolean
  logic and binary number
                                              Digital signal
  representations.
                                                               3
Digital Signals
• The o/p from most sensors tends to be in analogue form, the
  size of the o/p being related to the size of the input.
• A microprocessor is used as part of the measurement or
  control system and it can take only digital signals.
• So the analogue output from the sensor has to be converted
  into a digital form before it can be used as an input to the
  microprocessor.
• Likewise, most actuators operate with analogue inputs.
                                                                 4
• So, the digital output from a microprocessor has to be
  converted into an analogue form before it can be used as an
  input by the actuator.
               A/D           Micro-         D/A
 Sensor                                                Actuator
             converter      processor     converter
                                                                  5
Binary System
• It is based on two symbols or states 0 and 1, these possibly
  being 0 V and 5 V signals.
• 0, 1 are termed as binary digits or bits.
• Digit position in number indicates the weight attached to each
  digit.
• Weight increases by a factor 2 as we proceed from right to
  left.
                −− −     23      22      21      20
                        Bit 3   Bit 2   Bit 1   Bit 0
                                                               6
•   Example: the decimal number 15 = 23 + 22 + 21 + 20
•   Thus binary representation of 15 is 1111
•   The combination of bits to represent a number is a word.
•   Thus 1111 is a 4-bit word.
•   Such a word could be used to represent the size of a signal.
•   The term 1 byte = 8 bits.
                                                                   7
Decimal and their Binary Equivalent
 Binary       Decimal        Binary   Decimal
 0000         0              1000     8
 0001         1              1001     9
 0010         2              1010     10
 0011         3              1011     11
 0100         4              1100     12
 0101         5              1101     13
 0110         6              1110     14
 0111         7              1111     15
                                                8
Analogue and Digital Signals
• A/D conversion involves converting analogue signals into
  binary words.
• A clock supplies regular time signal pulses to the A/D
  converter and every time it receives a pulse it samples the
  analogue signal
            Input    Sample          A/D      Output
           Analogue and hold       converter
                                             Digital
           signal                            signal
• We have a analogue signal.
• The clock signal supplies the time signals at which the
  sampling occurs.
• The result of the sampling is a series of narrow pulses.
• A sample and hold unit is then used to hold each
  sampled value until the next pulse occurs.
• The sample and hold unit is necessary because the
  A/D Conversion requires a finite amount of time (i.e.,
  conversion time), to convert the analogue signal into a
  digital.
                                                             10
Analog-to-digital Conversion
• A/D converter is an electronic device that converts an
  analogue voltage to digital code.
• The o/p of the A/D converter can be directly interfaced to
  digital devices such as microcontrollers and computers.
• Analog-to-digital conversion, conceptually involves two steps:
  Quantizing and Coding.
• Quantizing is the transformation of a continuous analog i/p
  into a set of discrete output states and coding is the
  assignment of a digital code word/number to each o/p state.
                                                              11
• The resolution of an A/D converter is the number of bits used to
  digitally approximate the analog value of the input.
• The number of possible states N is equal to the number of bit
  combinations that can be o/p from the converter, i.e., 𝑁 = 2𝑛
• Where n is the number of bits. For example in a 3-bit device has 23 or 8
  o/p states.
• The o/p states are usually numbered consecutively from 0 to (N-1)i.e.,
  0 to 7 in this case.
• Most A/D converters are 8, 10 or 12 bit devices that resolves 28, 210,
  212 or 256, 1024, 4096 states.
                                                                        12
• The analog quantization size Q, sometimes called the code
  width, is defined as the full-scale range of the A/D converter
  divided by the number of output states
                     𝑄 = (𝑉𝑚𝑎𝑥 −𝑉𝑚𝑖𝑛 )/𝑁
• It is a measure of the analog change that can be resolved by
  the converter.
• The number of analog decision points that occur in the
  process of quantizing is (N-1), i.e. 7 in case of 3 bit device.
                                                               13
• Consider a 3-bit device, which has 23 or 8 output states as listed in the
  first column.
• The output states are numbered from 0 to (N-1).
• The corresponding code word for each output state is listed in the
  second column.
• The decision points occur at 1.25 V, 2.50 V, . . . , and 8.75 V.
        Code Width, 𝑄 = (𝑉𝑚𝑎𝑥 −𝑉𝑚𝑖𝑛 )/𝑁 = (10 − 0)/8 = 1.25 𝑉
• This means that the amplitude of the digitized signal has an error of at
  most 1.25 V. Therefore, the A/D converter can only resolve a voltage to
  within 1.25 V of the exact analog voltage.
                                                                         14
Example:      7 111
              6 110
              5 101
 A 3-bit      4 100
 device       3 011
 has 23 or    2 010
 8 output
              1 001
 states
              0 000
             O/P O/P 0.00-     1.25- 2.50- 3.75- 5.00- 6.25- 7.50- 8.75-
             state code 1.25   2.50 3.75 5.00 6.25 7.50 8.75 10.0
                                   Discretized Analog Voltage Ranges
                                                                       15
Shannon’s Sampling Theorem
• The first step for A/D conversion is to numerically evaluate the
  signal at discrete instants in time.
• This process is called sampling, and the result is a digitized
  signal composed of discrete values corresponding to each
  sample.
• So how fast or often the signal should be sampled to obtain an
  accurate representation?
• It needs high speed hardware and large computer memory.
                                                               16
• Shannon’s Sampling Theorem states that, the sampling rate of
  a signal should be more than two times the maximum
  frequency component in the signal to retain all frequency
  components.
• In other words, to represent the analog signal, the digital
  samples must be taken at a frequency 𝑓𝑠 (sampling rate) such
  that
                        𝑓𝑠 > 2𝑓𝑚𝑎𝑥
                                                            17
• 𝑓𝑠 > 2𝑓𝑚𝑎𝑥
• Where 𝑓𝑚𝑎𝑥 (Nyquist frequency) is the highest frequency
  component in the input analog signal.
• Time period between digital samples is ∆𝑡 = 1/𝑓𝑠
• If sampling rate is 5000 Hz, time interval between samples
  would be 1/5000 = 0.2 ms
                                                               18
Aliasing
• If a signal is sampled at less than two times its maximum
  frequency component, then aliasing will occur.
• Twelve equally spaced samples are taken over 10 cycles of the
  original signal. Therefore, the sampling frequency is 1.2𝑓0 ,
  where 𝑓0 is the frequency of the original sine wave.
• Because the sampling frequency is not greater than 2𝑓0 , it will
  not capture the frequency in the original signal.
                                                                19
• Furthermore, the apparent frequency in the sampled signal is
  0.2𝑓0 (2 aliased signal cycles for ten original signal cycles).
• Therefore, under-sampling not only results in errors but
  also creates information that is not really there!
                                                               20
                Analog-to-Digital Conversion
• To properly acquire an analog voltage signal for digital
  processing, the following components must be properly
  selected and applied in this sequence:
                                                       0011   0010   0100
                                                       0011   0010   1011
                                                       0001   0011   1100
                                                       0011   0101   0111
          Buffer     Low-pass   sample       A/D              Computer
Sensor
         Amplifier     filter   & hold     converter           memory
            Components used in A/D conversion
                                                                     21
• The buffer amplifier isolates the output from the input (i.e., it
  draws negligible current and power from the input) and
  provides a signal in a range close to but not exceeding the full
  input voltage range of the A/D converter.
• The low-pass filter removes any undesirable high- frequency
  components in the signal that could produce aliasing. The
  cutoff frequency of the low-pass filter should be no greater
  than 1/2 the sampling rate.
                                                                 22
• The sample and hold amplifier maintains a fixed input value
  (from an instantaneous sample) during the short conversion
  time of the A/D converter.
• The converter should have a resolution and analog
  quantization size appropriate to the system and signal.
• The computer must be properly interfaced to the A/D
  converter system to store and process the data.
                                                           23
• The A/D system components described above can be found
  packaged in a variety of commercial products called data
  acquisition (DAC or DAQ) cards or modules.
• DAC products are available in a variety of form factors
  including PC and instrument panel plug-in cards, laptop
  computer PCMCIA cards, and stand-alone external units with
  standard interfaces (e.g., USB). DAC and modules usually
  support various high-level language interfaces (e.g., C++ , Visual
  Basic, FORTRAN) that give easy access to the product’s features.
                                                                 24
• National Instruments’ LabVIEW software is an example.
       Various form factors of data acquisition products
                                                           25
Analog-to-Digital Converters
• The input to an ADC is an analogue signal and the output is a
  binary word that represents the level of the input signal.
• A/D converters are designed based on a number of different
  principles:
  1. Successive Approximation
  2. Flash or Parallel Encoding
  3. Single-slope and Dual-slope Integration
  4. Switched Capacitor
  5. Delta Sigma
                                                                  26
• Successive approximations
                                          Controls the admission of
                                          pulses to storage register
                                  Clock
Analogue i/p   Comparator
                                                                             4 bit
                                  Gate                    1    0   0   0     storage
                                                                             register
                            DAC
                                                                           Digital o/p
                                                                                  27
• A voltage is generated by a clock emitting a regular sequence
  of pulses which are counted in a binary manner.
• Resulting binary word is converted into an analogue voltage
  by a digital to analogue converter..
• This voltage rises in steps and is compared with the analogue
  i/p voltage from the sensor.
• When the clock generated voltage passes the i/p analogue
  voltage the pulses from the clock are stopped being counted
  by a gate.
                                                                  28
• o/p of the counter at that time in the digital representation of
  the voltage.
• While the comparison could be accomplished by starting the
  count at 1, the LSB, and then proceeding bit by bit upwards, a
  faster method is by successive approximations.
• This involves selecting the MSB that is less than the analogue
  value, then adding successive lesser bits for which the total
  does not exceed the analogue value.
                                                                 29
• For example, we might start the comparison with 1000. If this
  is too large we try 0100. If this is too small we then try 0110. If
  this is too large we try 0101.
• Because each of the bits in the word is tried in sequence, with
  an n-bit word it only takes n steps to make the comparison.
• Thus if the clock has a frequency f, the time between pulses is
  1/f .
• Hence the time taken to generate the word, i.e. the
  conversion time, is nf.
                                                                   30
References
• W. Bolton, Mechatronics: Electronic Control Systems in
  Mechanical and Electrical Engineering (6th Edition), Pearson,
  2015
• R. Merzouki, A. K. Samantaray, P. M. Pathak, B. Ould
  Bouamama, Intelligent Mechatronic Systems: Modeling,
  Control and Diagnosis, ISBN 978-1-4471-4627-8, 2013,
  Springer, London
• D.G. Alciatore and Michael B. Histand, Introduction to
  Mechatronics, Tata Mc Graw Hill, 2012.
                                                                  31
Thank You
            32