Conference PaperPDF Available

Oversampling And Averaging, Noise Analysis for Improving Control Performance


Abstract and Figures

Systems with feedback motion control are typically limited in bandwidth and control performance by the effect of system parameters which limit the gain of the controller, such as: (1) sensing noise; (2) plant dynamics - dominant behavior near crossover, res- onances, and right-half plane zeros; (3) sampling time - phase lag due to zero order hold; and, (4) non-linearities such as amplifier saturation and ac- tuator limits. This paper presents a mechatronic platform for experiential learning where students can learn about such issues.
Content may be subject to copyright.
Brij M. Bhushan1, Allison Lenhard1, David L. Trumper1
1Department of Mechanical Engineering
Massachusetts Institute of Technology
Cambridge, MA, United States of America
Systems with feedback motion control are typically
limited in bandwidth and control performance by the
eect of system parameters which limit the gain of
the controller, such as: (1) sensing noise; (2) plant
dynamics - dominant behavior near crossover, res-
onances, and right-half plane zeros; (3) sampling
time - phase lag due to zero order hold; and, (4)
non-linearities such as amplier saturation and ac-
tuator limits. This paper presents a mechatronic
platform for experiential learning where students can
learn about such issues.
In a teaching environment, students are taught about
all these aspects, but it is more challenging to create
cost-eective labs where students get a feel for the
constraints which dynamics places on feedback con-
trol performance. It is desirable to have a portable,
low-cost setup that enables students to learn these
principles hands-on, even outside dedicated lab facil-
ities. Such a setup, the FlexLab and LevLab printed
circuit board (PCB) has been developed in our lab
for this purpose [1], and has been used successfully in
teaching the Analysis and Design of Feedback Con-
trol Systems (2.14) course at the Massachusetts In-
stitute of Technology (MIT) [2].
We demonstrate a higher control loop performance
and management of dynamics and measurement
noise on the 2-degree of freedom (DOF) FlexLab T-
beam system, achieving a crossover of 100 Hz, with
about 40° phase margin in both the bending and
twisting directions. This is enabled by: (1) imple-
menting high-speed digital control by leveraging the
Field Programmable Gate Array (FPGA) on the NI-
myRIO embedded evaluation board by National In-
struments (NI), and (2) implementing oversampling
and averaging of the sensor measurement signals to
reduce sensing noise within the control bandwidth.
This paper describes the experimental setup, plant
modeling, sensor noise reduction by oversampling
and averaging, and controller design along with its
implementation and achieved performance results.
The paper also describes noise analysis using spec-
T-shaped bronze
permanent magnets
Hall effect sensor
Spiral coil using
traces in PCB
Power amplifiers for
Real-time controller:
FIGURE 1. The experimental setup includes a
FlexLab PCB and an NI-myRIO. Components of in-
terest are labeled accordingly.
tral tools such as power spectral density and cumu-
lative power spectrum, which can be used to identify
areas for improving the control performance. The
approach described in this paper provides a low-cost
way to improve control performance on commonly
available high-speed micro-controllers that usually
have moderately low-resolution analog inputs. We
also provide links to sample open-source LabVIEW
code for implementation using NI hardware.
The experimental setup consists of the
FlexLab/LevLab PCB connected to an NI-myRIO
real-time controller. Fig. 1shows the FlexLab
experimental setup with key components labeled.
The FlexLab conguration is composed of a bronze
T-shaped cantilever beam with two permanent
magnet (PM) pairs on each end of the T. The stem
of the T-beam is bolted to the PCB, while the end
of the beam with the PM pairs is the free end above
two actuating coils printed as spirals on the PCB.
Fig. 2shows a block diagram of the setup. The PM
pairs mounted at the two ends of the T-beam are
used for both sensing and actuation. The PM ux is
measured by the Hall sensors which is correlated to
the beam position above the coils. The Hall sensor
measurement circuit averages and low-pass lters the
outputs from the Hall sensor pair, acting as a rst-
order anti-aliasing lter (AAF) at 20 kHz bandwidth.
Hall se nsor
Meas. Circuit
(20 kHz LPF)
PCB traces
(250 kHz
Sample rate)
Moving A vg.
Control Loop
(100 kHz
loop rate)
Interface Loop
(5000 Hz
loop rate)
Host PC
UI + Spectral
(100 Hz loop rate)
Neodymium magnets
On b ronze beam
NI myRIO-1900
(100 kHz
output rate)
Linear power
PCB Coils
(To actuate
the magnets)
Dynami c Si gnal
(2000 Hz
loop rate)
FIGURE 2. Setup block diagram. Multi-processor architecture enables high speed controller implementation.
The input-output interface and controller is imple-
mented in FPGA on the myRIO. The Hall sensor
signals are read at 250 kHz and low-pass ltered with
a 256-pt. moving average (MA) lter. The control
loop runs at 100 kHz generating a control eort sig-
nal in response to position error. The control eort
signal commands the on-board linear power amplier
to drive current through the PCB coils to actuate the
magnets. The user interface and dynamic signal an-
alyzer enabling measurement of Bode plots run on
the real-time processor, while waveform visualization
and spectral analysis execute on the Host-PC.
The T-beam with a pair of PMs located at each end
of the T as seen in Fig. 1can be most simply modeled
as a fourth-order dynamical system. The plant mod-
eling for the system is described in [1]. The modeling
assumptions and resulting dynamic equations are re-
produced here for completeness.
To simplify the modeling of the system, we make the
following assumptions: the PMs move in the vertical
direction with small displacements relative to their
distance from the coils; the power ampliers driving
the actuator coils are linear and have no signicant
dynamics within position loop bandwidth; the actua-
tor coils have small inductance which has a negligible
eect on the circuit dynamics. Resolving the vertical
PM measurements coil actuation into a transformed
coordinate system of bend and twist makes the rst
two lumped modes at 11 Hz and 32 Hz independent
in each direction.
The dynamic equations resulting from the lumped
parameter model with respect to the decoupled bend
(zc) and twist (θx) coordinates are as follows. Ta-
ble 1denes the modeling parameters used in the
following equations:
The moment of inertia I, bending stiness kb, and
twisting stiness ktof the T-beam are dened as
I= 2mL2, kb=3E
30.21 t
To get the state-space model of the system, de-
ne x= [zc,˙zc, θx,˙
θx]T,u= [uz, uθx]T, and
y= [zc, θx]T, which gives
x=Ax +Bu
0 1 0 0
mRc0 0
0 0 0 1
0 0 kt
0 0
0 0
C=1 0 0 0
0 0 1 0
The coordinate transformation matrix used to get
zcand θxfrom the Hall sensor (sensitivity, SHall )
measurements [V] at each PM is:
Hall 1/2 1/2
Magnitude [abs]
Bend direction
Frequency [Hz]
Phase [deg]
plant model
plant meas.
RR model
RR meas.
Magnitude [abs]
Twist direction
Frequency [Hz]
Phase [deg]
plant model
plant meas.
RR model
RR meas.
FIGURE 3. Measured and modeled Bode plots of plant and loop return-ratio (RR), of the T-beam system driven
in (a) bend, and (b) twist directions. The plant inputs are the decoupled bending and twisting control voltages
[V], and the plant outputs are the decoupled bend [mm] and twist [rad] displacements. The units of the plant
magnitudes are in mm/V and rad/V for bend and twist respectively and RR magnitudes are dimensionless.
Mode 1: 11 Hz
Mode 2: 32 Hz
Mode 3: 154 Hz
Mode 5: 336 Hz
Mode 6: 428 Hz
FIGURE 4. First 6 exible vibration modes of the FlexLab T-beam, as determined by nite element analysis.
Color gradients represent maximum total displacement from blue (small displacement) to red (large displacement).
TABLE 1. Modeling Parameters
Description Parameter Value Unit
beam length lbeam 65 mm
beam width w9.525 mm
beam thickness t0.25 mm
T end length 2L30 mm
elastic modulus E110.3 GPa
shear modulus G38 GPa
mass of PM pair m1.7 g
amplier gain gamp 2 V/V
coil resistance Rc10.5
coil force-const. Ki0.055 N/A
Hall-sensor sens. SH all 1.25 V/mm
Fig. 3shows the modeled and measured plant and
return-ratio Bode plots in the bend and twist direc-
tions. The delity of the model is limited to 100 Hz
due to only accounting for the rst two lumped ex-
ible modes in the dynamic model. However, there
are higher frequency dynamics present in the system,
which are observable in the measured plant bend and
twist frequency responses. The next four exible vi-
bration modes occur at approximately 154 Hz, 253
Hz, 336 Hz, and 428 Hz. These modes are all a com-
bination of bending, twisting, and sideways motion;
their respective shapes can be seen in Fig. 4. Since
these higher frequency mode shapes do not strictly
fall into the bend or twist category, the vibration
modes are more complex to model, and not amenable
to control from the available inputs. Based on the
plant Bode plot measurements, the high frequency
modes that are problematic to control loop stability
are the 3rd and 5th exible modes. The Controller
Design section discusses the control implications of
these higher order modes.
One of the main contributions of this paper is show-
ing how to use an FPGA to implement high-speed
oversampling, and thereby extend the control loop
bandwidth in the face of sensing noise. In our sys-
tem, the sensing noise is dominated by analog to dig-
ital converter (ADC) quantization. The NI-myRIO
has a 12-bit ADC, with a 0–5 V range on the A,B
Signal noise
filte r
FIGURE 5. Power spectral density (PSD) of sensor
and ADC noise components. Digital low-pass lter
cuts o noise density as shown.
connectors [3]. The corresponding measurement res-
olution is 1.2 mV per least-signicant bit.
Oversampling and averaging [4] helps improve sens-
ing resolution by reducing the eective ADC quan-
tization noise as shown in Fig. 5. The sensor has
an approximately white-noise component from 0 to
fAAF , the anti-aliasing lter cut-o frequency. This
PSD is independent of sampling frequency and de-
pends on many factors such as inherent sensor noise
characteristics, wiring, signal conditioning, and AAF.
On the other hand, ADC quantization noise has ap-
proximately white-noise characteristics from 0 until
fsampling/2, the sampling Nyquist frequency. This
noise has a xed variance and therefore its PSD mag-
nitude reduces with increasing sampling frequency.
Reduction in quantization noise is achieved by:
(1) sampling much faster than the required crossover
frequency, which spreads out the quantization noise
power over a wider range of frequencies up to the
Nyquist frequency (fsampling/2), and (2) implement-
ing a low pass lter at a frequency (fLPF) such that
only noise power up to fLPF remains. These stages
reduce the overall noise variance and thereby improve
the apparent measurement resolution. The sensor
noise, originally appearing up to the anti-aliasing
lter cut-o (fAAF), is also limited by fLPF. All
noise sources are assumed to be Gaussian, which is a
good approximation for commonly available ADCs in
which the quantization non-linearity can be ignored.
FPGA implementation in the NI-myRIO enables 2-
channel sampling rates of up to 250 kHz along with
256-pt. MA lters at this data rate. This high speed
implementation helps in two ways: (1) by oversam-
pling 256-times faster, we can reduce the ADC quan-
tization noise standard deviation approximately by a
factor of 16, which corresponds to an increase in ef-
fective number of bits (ENOB) of 4 [5]. Thus, the
ADC input behaves as a 16-bit ADC up to a band-
width of about 1 kHz; (2) achieve higher sensing
resolution while reducing the accompanying phase
lag in the control loop. The 256-pt. MA lter is a
linear-phase nite impulse response (FIR) lter and
has a phase drop reaching about 18° at the de-
sired crossover of 100 Hz. The control loop run-
ning at 100 kHz loop rate causes negligible phase
drop of 0.18° at 100 Hz due to the zero-order hold
(ZOH). On the other hand, if the controller is im-
plemented on the real-time processor in the NI my-
RIO, the maximum achievable control loop rate is
about 2 kHz, which causes a phase drop of about 9°
at 100 Hz due to the ZOH. Implementing non-linear
phase FIR or Innite Impulse Response (IIR) lters
as the low-pass lter could further help reduce phase
lag due to oversampling and averaging. The value
from the MA lter is placed in a memory location
from which the control-loop reads values at a lower
rate of 100 kHz, which is like the decimation step [6].
Fig. 6shows the measured sensor noise in the bend
and twist directions under closed loop control with
oversampling and averaging. The noise standard de-
viation in both directions is about 60 µV, which cor-
responds to 50 nm and 3.3 µrad (0.2 milli deg) RMS
positioning noise in the bend and twist directions re-
spectively. Frequencies where the CPS plot shows
a large jump correspond to frequencies with high
noise power. For the bend direction, this corresponds
to about 45 Hz which is likely from some external
source such as oor vibration. For the twist direction,
the noise power jumps signicantly at about 154 Hz
corresponding to the 3rd exible mode of vibration.
In contrast, raw measurements have a noise stan-
dard deviation of about 600 µV which corresponds
to 500 nm positioning noise in the bend direction.
The plant requires a gain of about 100 (combination
of proportional gain and lead) from the controller
at 100 Hz for crossover at that frequency (Fig. 3).
This controller gain would increase the control eort
standard deviation to about 60 mV which results in a
peak to peak noise amplitude of about 0.6 V. Thus,
the control eort due to noise becomes a signicant
portion of the amplier range of 5 V making it di-
cult to crossover at 100 Hz with raw measurements.
Mechanical resonances arising from the exible
modes limit the achievable crossover frequency.
From the measured plant Bode-plots (Fig. 3), it can
be seen that the resonance at 336 Hz limits crossover
for the bend direction and the resonance at 154 Hz
limits the crossover for the twist direction. The
336 Hz resonance in the bend direction is from the
5th exible mode which is both observable and con-
trollable in the bend direction. The impact of this
(a) (b) (c)
(d) (e) (f)
FIGURE 6. Noise measurement of position in closed loop. The top plots (a,b,c) represent the bending direction
and the bottom plots (d,e,f) represent the twisting direction. (a,d) time-waveforms of bend and twist directions
when reference kept at 0. (b,e) probability density of noise. (c,f) The PSD and CPS of the noise waveform.
mode is mitigated by implementing a notch lter at
336 Hz with a quality factor, Qof 10. The notch
lter is of the form:
Hnotch(s) =
+ 2ζzs
ω0+ 1
+ 2ζps
ω0+ 1
with ω0=2090 rad/s, ζz= 0.025, and ζp= 0.25.
The 3rd exible mode corresponding to 154 Hz res-
onance, in which the center of the T-beam oscil-
lates vertically, should in principle be unobservable
in the twist direction. The coupling of this mode
into twist measurements is believed to be due to the
small parasitic motions in the twist direction due to
misalignment of PMs or other asymmetry of the T-
beam mechanism. This same mode should ideally
have a zero in the bend direction which is seen as
an anti-resonance in the bend-direction Bode plot.
This makes the 154 Hz mode observable, but uncon-
trollable in the rotation direction. A notch lter at
154 Hz would make this mode unobservable, but such
a notch lter reduces phase signicantly at 100 Hz
and is therefore not feasible. Due to the parasitic
origin of this mode, the magnitude of resonance is
small and this mode was managed by keeping the
phase above −180° to keep the loop stable. How-
ever, the sensitivity Bode plot of the closed loop in
the twist direction is large at 154Hz and this mode
is easily excited by any jerk in the bending direction
that can excite the 3rd vibration mode. The excited
oscillation slowly dampens out from energy dissipa-
tion in the mounting joints and structural damping
in the T-beam.
With the notch lters in place, a standard PID con-
troller with a low pass lter is used in both bend and
twist directions. The controllers were designed in
continuous time and then mapped into discrete time
using pole-zero matching for implementation as dif-
ference equations in the FPGA at Ts=10 µs loop
time. The controller is of the form:
Gc(s) = Kp1 + Ki
sατ s + 1
+ 2ζs
ω0+ 1
with the values of Kp=31.25 V/mm, Ki=
62 rad/s, α= 20,τ=3.9789 ×104s, ω0=
2285 rad/s, and ζ= 0.707 for the bend di-
rection. For the twist direction, the values are
Kp=375 V/rad, Ki=45 rad/s, α= 10,τ=
5.6841 ×104s, ω0=1600 rad/s, and ζ= 0.5.
Fig. 3shows the measured decoupled loop return
ratios using the specied controller parameters. As
discussed in the Plant Modeling section, high fre-
quency dynamics are observable in both the bending
and twisting directions.
FIGURE 7. Step responses in bend and twist.
With oversampling and averaging, we are able to
achieve a crossover frequency of 100 Hz in both the
bend and twist directions with a phase margin of
about 40° (Fig. 3). Step responses of the system in
bend and twist directions is shown in Fig. 7. The step
responses are consistent with the crossover and phase
margin obtained above. As expected, in the step re-
sponse for the bending direction, the impulse excites
the 3rd exible vibration mode at 154 Hz that shows
up parasitically in the twist direction and rings down
very slowly. Note that this mode is visible because
of the improved sensing resolution. In the raw mea-
surements, this mode gets masked by the ADC noise.
Using the raw ADC measurements we can achieve a
maximum crossover frequency of about 50 Hz in the
bend direction and 65 Hz in the twist direction with
40° phase margin.
The control bandwidth is severely limited by the res-
onance at 154 Hz . The performance of the system
could be improved by increasing damping of the T-
beam or by better alignment of the magnets and
the Hall sensors to decrease the magnitude of the
resonance. Further, the 3rd exible mode could in
principle be actively damped using the 3rd coil at the
center of the long beam - the location at which the
beam has large amplitude in this mode (anti-node).
In this paper, we presented an example of improv-
ing the control performance enabled by sensing noise
reduction by oversampling and averaging and high-
speed control implementation in FPGA. The control
was implemented in an NI-myRIO for 2-DOF T-beam
control on the Flexlab PCB. We also describe the role
of dynamics in achieving desired control performance
and the use of spectral noise analysis tools. The ap-
proach described in this paper provides a relatively
low-cost way to improve the control performance
on commonly available high-speed micro-controllers
that frequently have low-resolution ADCs.
Sample LabVIEW code for implementation of the
controller on the FlexLab hardware using NI-myRIO
is provided at [7]. The design details of the FlexLab
system are open-source and can be found at [8].
[1] L. Zhou, J. Y. Yoon, A. Andriën, M. I. Ne-
jad, B. T. Allison, and D. L. Trumper, “Flexlab
and levlab: A portable control and mechatron-
ics educational system,” IEEE/ASME Trans. on
Mechatronics, vol. 25, no. 1, pp. 305–315, Feb.
2020. doi:10.1109/TMECH.2019.2951308.
[2] D. Trumper, in 2.14 Analysis and Design of
Feedback Control Systems. Spring 2014, MIT
OpenCourseWare, Cambridge MA, 2014.
[3] User Guide and Specications NI myRIO-1900,
376047C-01, National Instruments Corp., May
2016. [Online]. Available: http : / / www . ni .
[4] B. Bhushan and D. Trumper, “Low cost, high
dynamic range position sensing enabled by over-
sampling and averaging,” in 2020 ASPE Spring
Topical Meeting – Design and Control of Pre-
cision Mechatronic Systems, May 2020.
[5] “Improving Adc Resolution By Oversampling
and Averaging,” pp. 1–20, 2013. [Online]. Avail-
able: https:/ / www.silabs. com/Support%
[6] A. V. Oppenheim and R. W. Schafer, Discrete-
Time Signal Processing, 3rd edition. Pearson
Education Limited, 2013, p. 647, isbn: 978-
[7] B. Bhushan, FlexLab. [Online]. Available:
https : / / github . com / mbrijbhushan /
[8] L. Zhou, FlexLab Design Files. [Online]. Avail-
able: https : / / pmc . mit . edu / projects /
ResearchGate has not been able to resolve any citations for this publication.
Conference Paper
Full-text available
Sensors place a fundamental limit on system performance and stability for mechatronic systems with closed-loop feedback. There is a strong correlation between sensor cost and performance resulting in a constant thrust to improve the performance-to-cost metric of sensing systems. One of the ways to im- prove sensing performance is by oversampling and averaging. With reducing computation costs and the availability of low-cost, high-speed analog-to-digital (ADC) converters, this is becoming a feasible approach even for regular motion control systems. This paper describes such an approach using Contrinex DW-AS-509-M8-390, a low-cost eddy-current sensor having a measurement range of 2.5 mm and available for about US $100. Measurement with typical connections to a 16-bit ADC converter and no filtering results in a mid-point resolution (measurement resolution at half the sensor range) of 500nm−rms which is a dynamic range (range/resolution at a given bandwidth) of 5 × 103 (76 dB) at 500 Hz bandwidth. By implementing anti-aliasing filters, sampling at 20 kHz, and then low-pass filtering with a 500Hz cut-off, we demonstrate a mid-point resolution of 100nm−rms resulting in a dynamic range of 2.5 × 1e4 (88 dB) at 500 Hz bandwidth. Capacitive sensors with high-accuracy amplifiers for a similar measurement range of 2mm exhibit a mid-point resolution of 10 nm−rms resulting in a dynamic range of 2×1e5 (106dB) at 500Hz bandwidth. However, these capacitive sensing systems (probe + amplifier) typically cost upwards of US $3000 per channel. Thus, we are able to achieve 1/10th of the performance at about 1/30th of the cost.
This paper describes a compact, low-cost, single-board FlexLab/LevLab electromechanical system for use in teaching modeling, dynamics, and control of mechatronic systems. The portable educational platform proposed in this paper enables a flipped-lab approach where students can do experimental work outside a dedicated lab facility and so achieve a better understanding through more extensive hands-on experiences. The system has actuators, sensors, and power electronics implemented on a 70 mm×100 mm printed circuit board (PCB). Mechanical motion in up to three degrees-of-freedom (DOFs) is implemented using on-board spiral coils as Lorentz actuators to drive moving permanent magnets (PM) with Hall effect position sensing on each magnet. The maximum magnet motion range is 4 mm and 3 mm in the vertical direction for the FlexLab and LevLab, respectively, and the positioning noise of the Hall effect sensors with an over-sampling filter is approximately 0.2 µm RMS. In the FlexLab configuration, up to three PM disk pairs can be mounted on a flexible cantilever beam in locations which interact with three spiral coils. This configuration allows modeling, measurement, and control of second-, fourth-, and sixth-order mass-spring system dynamics. In the LevLab configuration, the board can implement both single- and three-DOF magnetic suspension systems via Lorentz forces on either a spherical PM or three pairs of disk PMs on a triangular backbone.
14 Analysis and Design of Feedback Control Systems. Spring
  • D Trumper
D. Trumper, in 2.14 Analysis and Design of Feedback Control Systems. Spring 2014, MIT OpenCourseWare, Cambridge MA, 2014.
FlexLab Design Files
  • L Zhou
L. Zhou, FlexLab Design Files. [Online]. Available: https : / / pmc. mit. edu / projects / project-flexlab-and-levlab.