Page 800 - Mechatronics with Experiments
P. 800
786 MECHATRONICS
(a) measured ADC voltage versus the deflection distance of the beam,
(b) calculated force versus the deflection distance of the beam.
In order to be sure of your force estimation accuracy, the deformation can be induced
by a known set of weights at the tip of the beam instead of the screw mecha-
nism. Then, the student can compare the estimated force to the actually applied
weight (weight = force = mass ⋅ gravity, W = F = m ⋅ g). It is equally important to
be able identify the sources of error in the measurement. Discuss how this prin-
ciple can be used to design a digital weight measurement device (scale) used in
homes.
8. (Optional) In order to improve the signal amplification quality against noise and
temperature variations; design, build and test an instrumentation amplifier instead of
the amplifier used above.
9. (Optional) Develop two different software versions to handle ADC conversion: 1.
ADC conversion under program control, 2. ADC conversion under interrupt control.
In version 1, the program logic must:
(a) Setup the ADC conversion channel.
(b) Start the ADC conversion.
(c) Wait for ADC conversion to complete.
(d) Read the ADC conversion result and display it.
(e) Repeat steps (b–d) for every ADC conversion under program control.
In version 2, the program sets up the ADC conversion process to be triggered by
a timer, and every time the ADC conversion is completed, it generates an interrupt
to the CPU, then the CPU simply handles the ADC ISR (interrupt service routine)
which should just read and display the ADC conversion result.
(a) Setup the ADC conversion channel for timer driven periodic ADC conversion,
and for ADC to generate an interrupt whenever an ADC conversion is completed.
(b) Write the ISR routine for “ADC conversion complete” interrupt handling: read the
ADC register and display result. Setup this ISR as the ADC conversion complete
interrupt handling routine.
(c) Enable interrupts and start normal program execution. In the background, ADC
conversion will be periodically triggered by the timer, every time ADC conversion
is completed, the ADC will interrupt the CPU. Then, the CPU will execute the
defined ISR which reads and displays the result. Then returns to its previous
task.
We can experiment with the functionality of ADC operation by simply providing a voltage
to the ADC pins via a potentiometer which is connected to a 0–10 VDC or ± 10 VDC (or
smaller range) DC power supply (i.e., batteries). In the process of making this experiment
work, there are two aspects to debugging the potential problem:
1. First is the ADC operation of the microcontroller: does the ADC converter interface
and software work – does it read the analog voltage present at the pins correctly. We
can test that by proving a known voltage with a simple potentiometer and DC supply.
We can measure the voltage with a DMM or oscilloscope, and confirm if the ADC
reads it correctly.
2. The second aspect of the experiment is the strain gauge sensor, its signal processing
via the Wheatstone bridge and amplification of that signal. We can test that part of the
experiment simply by imposing deformation on the strain gauge mounted beam, then
measuring the output voltage at the output of the amplifier as well as at the output of
the Wheatstone bridge.