rpm measurement using mems inertial measurement unit (imu) · they do not work like the digital...
TRANSCRIPT
RPM measurement using MEMS Inertial
Measurement Unit (IMU)
Tongjun Ruan, Robert Balch Reservoir Evaluation and Advanced Computational Technologies Group
Of Petroleum Recovery Research Center, New Mexico Tech., Socorro, NM, USA
Abstract- A Small device with MEMS Inertial
Measurement Unit ( IMU ) was designed and
implemented for non-wired sensing and recording of
the RPM (Revolutions per Minute) of mud motor
during Radial Drilling where the wire or wireless
communication ground/surface is impractical or not
feasible. This is accomplished by measuring angular
velocity and accelerations using 3-Axis Gyroscope
and 3-Axis Accelerometer of IMU, store the data on
the device, offloading data to an onsite laptop
computer。Four methods of calculating RPM based
on the outputs of IMU were proposed and the
accuracies of results from different methods were
compared. The measured RPM will be used for the
efficiency analysis and performance analysis of
Radial Drilling.
Keywords: RPM Measurement; MEMS Inertial
Measurement Unit; Radial Drilling;
1. Introduction In 2016-2017, we developed a RPM measurement
device using a 3 –Axis magnetometer and
successfully tested in lab [1]. After Lab test we went
to partner’s test site where the device was mounted
and sealed inside the slot of the steel shaft of mud
motor. The earth magnetic field was disturbed so
much by the steel shaft and steel tube (wellbore) and
the magnetometer could not give the expected
sufficient measurement precision of RPM as it did in
lab test. To improve the measurement precision of
RPM, we tried very hard to find a way (or sensor)
for the on-shaft RPM measurement. There are many
sensors available on market for RPM measurements
for example: photoelectric speed sensor, magnetic
speed sensor, hall speed sensor, eddy current speed
sensor, giant reluctance speed sensor etc. But all of
them require an off-shaft part and an on-shaft part
working together to generate RPM signals during
rotating. They do not work like the digital compass
which can generate the RPM signals by itself during
rotating.
After a lot of searching we think the IMU, which
contains a gyroscope and a accelerometer sometimes
a compass, is perfect for the RPM measurement
since it can measure the angular velocity and
accelerations. The low cost, low power consumption
and small size make MEMS digital output IMU is
very good fit for the On-Shaft RPM measurement. In
this study, MEME Inertial Measurement Unit (IMU)
which contains 3-axis gyroscope, accelerometer and
compass was selected to measure the RPM. After
implementing the prototypes, we tested by putting
the device into the slot of the shaft. The test results
was analyzed and 4 methods to calculate the RPM
based on the outputs of IMU were proposed:
1. Use the angular velocity
2. Use the acceleration
3. Use the quaternion
4. Euler angle
The testing results show the method 3 and 4 have
higher precision and more efficiency than other
methods.
A data processing tool was developed for the
processing and analyzing and visualizing the test
data and calculated results.
2. MEMS Inertial Measurement
Unit
An inertial measurement unit (IMU) is an
electronic device that measures and reports a body's
specific force, angular rate, and sometime the
magnetic field surrounding the body, using a
combination of accelerometers and gyroscopes,
sometime also magnetometers. IMUs are typically
used to maneuver aircraft, among many others, and
space craft, including satellites. Recent developments allow for the production of IMU-enabled GPS devices.
An IMU allows a GPS receiver to work when GPS-
signals are unavailable, such as in tunnels, inside
buildings, or when electronic interference is present.
Int'l Conf. Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 | 49
ISBN: 1-60132-475-8, CSREA Press ©
But we have not found that the IMU was applied in
RPM measurement.
There are many IMU products in the market: from
customer grade(cheap) to tactical grade(very
expensive). For on-shaft RPM measurement, the IMU
must be small, low cost, low power consumption and
digital output (no extra circuit and power needed).
As modern electronic technology develops,
microchip-packaged digital MEMS IMU have been
developed and popularly used in many electronic
device and customer products for example: smart
phone.
The digital MEMS IMU has following features:
Tiny body
Low single operational voltage
Lower power consumption.
Digital output (analog one needs extra circuit and
power)
Lower price
3 Design and Implementation
Based on the requirements, InvenSense’s MPU-
9250 was selected for this study. MPU-9250 is
InvenSense company’s second generation IMU, also is
the world’s smallest 9-axis IMU with
3mmx3mmx1mm package, low cost and low power
consumption.
The device was designed with the device with
following chips:
MPU-9250 as IMU
Microchip’s PIC16LF18250 as MCU to
configure the sensor and the flash memory, read
data from the sensor and write data into the flash
memory during rotation
IS25LP128 serial flash memory as the data
storage
Lithium Coin battery LR1632 is selected to
provide operating power
Figure 1. Hardware architecture of the device
Figure 2. the implemented prototype and the shaft with
slot.
Figure 1 shows the device’s architecture. Figure 2
shows the implemented prototype and the shaft with
slot. During the testing, the device with coin battery
will be sitting inside of the slot.
4 Methods of computing RPM
Based on the possible outputs of MPU-9250, we
proposed 4 methods to compute the RPM.
4.1 Use the angular velocity
MPU-9250 has 3 –axis gyroscope. According to its
function (measuring the angular velocity), gyroscope
should be perfect for the RPM measurement. The
angular velocity can be easily converted into RPM.
The gyroscope’s highest Full-Scale range, is +/-
2000 Degree/Second, the range of RPM should be 0--
---60*2000/360, thus the maximum RPM which could
be measured by this device is about 333 RPM.
Normally the RPM of the downhole mud motor, which
drives the drilling head, is between 0 and 250, so the
sensor is suitable to measuring its RPM.
If the angular velocity is the rate of change of angle
with respect to time. Unit of angular velocity is ω
radians per second (rad/sec). The relationship of ω and
RPM can be descripted as formula (1) and (2)
ω=2πN/60 (1)
N= 60 ω/2π=30 ω/ π (2)
Where: ω is the angular velocity in radians per
second, N is Revolutions per Minute (RPM).
Figure 3 show the angular velocity when the device
rotates at 60 RPM
Figure 3. Angular velocity
-300
-200
-100
0
100
17
31
45
21
72
89
36
14
33
50
55
77
64
97
21
79
38
65
93
7
Series1 Series2 Series3
50 Int'l Conf. Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 |
ISBN: 1-60132-475-8, CSREA Press ©
4.2 Computing RPM based on
accelerations
The IMU can measure the acceleration; according
to physics we can use the accelerations to calculate the
RPM respectively:
The gravity is removed by low-pass digital filter
from the 3-Axis accelerations to get the linear
accelerations. And linear accelerations were
transferred from body frame to global frame. They
became sinusoidal signal (see figure 4). Then the
linear-global accelerations are integrated twice to get
the trajectory of the movement that consists of many
circles. RPM will be calculated based on the
period/time (between the two peaks) of the device
moving one circle(the linear-global accelerations,
linear-global velocity or position). Figure 5 show the
trajectory of the movement is circles. (see Figure 5)
Fig. 4 Linear/Global Accelrations (removed
gracity and transfereed from body/device fram to
global frame)
Figure 5 Computed circular paths
4.3 Computing RPM based on quaternions
Quaternion is calculated from angular velocity
and acceleration, below is popular used codes[6] to
calculate quaternion based on the angular velocity and
acceleration:
// variable definitions
// quaternion elements representing the estimated
orientation
float exInt=0,eyInt=0 , ezInt=0;
// scaled integral error
//gx, gy, gz------angular velocity
//ax, ay, az -----acceleration
IMUUpdate( float gx, float gy, float gz, float ax, float
ay, float az )
{
float norm;
float vx, vy, vz;
float ex, ey, ez;
// normalise the measurements
norm = nr_sqrt((ax*ax) + (ay*ay) + (az*az));
ax = ax / norm;
ay = ay / norm;
az = az / norm;
// estimated direction of gravity
vx = 2*(q1*q3 - q0*q2);
vy = 2*(q0*q1 + q2*q3);
vz = q0*q0 - q1*q1 - q2*q2 + q3*q3;
// error is sum of cross product between reference
direction of field and direction measured by sensor
ex = (ay*vz - az*vy);
ey = (az*vx - ax*vz);
ez = (ax*vy - ay*vx);
// integral error scaled integral gain
exInt = exInt + ex*Ki;
Int'l Conf. Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 | 51
ISBN: 1-60132-475-8, CSREA Press ©
eyInt = eyInt + ey*Ki;
ezInt = ezInt + ez*Ki;
// adjusted gyroscope measurements
gx = gx + Kp*ex + exInt;
gy = gy + Kp*ey + eyInt;
gz = gz + Kp*ez + ezInt;
// integrate quaternion rate and normalise
q0 = q0 + (-q1*gx - q2*gy - q3*gz)*halfT;
q1 = q1 + (q0*gx + q2*gz - q3*gy)*halfT;
q2 = q2 + (q0*gy - q1*gz + q3*gx)*halfT;
q3 = q3 + (q0*gz + q1*gy - q2*gx)*halfT;
// normalise quaternion
norm=nr_sqrt((q0*q0)+(q1*q1)+(q2*q2)+(q3*q3));
q0 = q0 / norm;
q1 = q1 / norm;
q2 = q2 / norm;
q3 = q3 / norm;
}
Comparing figure 4 and figure 6, the period of
quaternion’s sinusoidal signal and is half of the period
of acceleration’s sinusoidal signal. We can use the
same method to calculate the RPM. For quaternion we
need to double it to get correct RPM.
Figure. 6 Quaternion sinusodal wave
4.4 Euler angles
Euler angles, ie Roll, Pitch and Yaw, can be callated
from quaternion using forllown formulas :
Euler angles change during the device rotating. Its
period is the same as that of the acceleration. Figure 7
shows the changes.
Figure 7a. Euler angles
Figure 7b. Algorithm Examples
The peak value should be
𝜋(𝑅𝑜𝑙𝑙72 − 𝑅𝑜𝑙𝑙71)
𝑇72 − 𝑇71= (𝜋 − 𝑅𝑜𝑙𝑙72)/(𝑇𝑝 − 𝑇72)
Then we can get
𝑇𝑝 = 𝑇72 + (𝜋 − 𝑅𝑜𝑙𝑙72)(𝑇72 − 𝑇71)/(𝑅𝑜𝑙𝑙72− 𝑅𝑜𝑙𝑙71)
𝑅𝑃𝑀 = 60/𝑇𝑝
Or we have another simplified algorithm which
directly use the Euler change between two nearest
points to calculate the RPM :
RPM= 60*(Rolli+1-Rolli)*sampling-rate/(2 𝜋)
52 Int'l Conf. Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 |
ISBN: 1-60132-475-8, CSREA Press ©
5 Estimate the period of the signals
of Accelerations, quaternion and
Euler angles
It is very clear that these three signals, global
linear acceleration, quaternion and Euler angle, are
periodic signals. We can use a method to estimate the
periods and convert them into RPM.
In the test the sampling number (Ns) of a period
was counted. Thus
Tp= Ns x (1/sampling rate)
RPM=60/Tp
Where Tp is the time of one period
We specifically used the following calculation
process to calculate the RPM from one of
Accelerations, Quaternion and Euler angles:
1. Select the signal S with max peak values(for
example the Roll signal in Euler angles)
2. Select two nearest peak values of signals S
3. Count the sampling number ( Ns) between the two
peak values
4. Calculate the time Tp of between the two peak
values ( one period):
Tp= Ns x (1/sampling rate) 5. Calculate the RPM :
If signal is acceleration or Euler angle
(method 2 and 4) RPM=60/Tp
If signal is quaternion: RPM=2*60/Tp
To get more accurate results, Interpolation
calculation was used in finding the positons of peak
value and computing the Ns.
6 Test results Methods 1 and 2 give the RPM 58.9 when the shaft
turns at RPM=60.
The error is (60-58.59)/60.00 = 2.35%
Methods 3 and 4 give the RPM 60.60 when the
shaft turns at RPM=60.
The error is (60.60-60)/60.00 = 1%
Thus the method 3 and 4 have higher accuracy and
more efficiency than method 1 and 2.
7 Conclusion and future work
7.1 Conclusion
Test results show MEMS IMU is a perfect device
for on-shaft RPM measurement.
1 It does not need accurately positing on the
rotator or shaft. Because RPM computation does
not rely on the line speed of the rotation
2 It depend on the period of a rotation from
angular velocity.
3 It does not require a specific angle or a position
on rotator or shaft. It can be mounted on any
position and any angle on the shaft or rotator
which will not affect the RPM measurement
accuracy.
4 The measurement range will decided by the
gyroscope’s highest Full-Scale range, if the
highest Full-Scale range is +/- A Degree/Second,
RPM range should be {-60*A/360-60*A /360}.
The Gyroscope of IMU with the higher Full-Scale
range can have the larger RPM measurement
range.
5 Proposed methods of RPM computing based on
the IMU’s output all work well ,but method
3(quaternion ) and 4(Euler angles ) give higher
accuracy ( 1% error )and more efficiency than
method 1 and 2.
7.2 Future work Future work: more tests will be done next
month to get more results and to improve the
RPM computational methods and data analysis.
8 Reference
[1] Tongjun Ruan, Robert Balch,”RPM measurement
using 3-Axis Digital. Magnetometer.” Int'l Conf.
Embedded Systems, Cyber-physical Systems, &
Applications (ESCS'17 ), Las Vegas NV,July.
2017.
[2] Micochip Technology Inc, “PIC16F1825 data
sheet,” 2012,pp.1-5
[3] Integrated Silicon Solution Inc.“IS25LP128
128M-BIT 3V Serial Flash Memory datasheet”,
10/3/2014
[4] InvenSense Inc., “MPU-9250 Product
Specification Revision 1.0”, 2014
[5] P Cheng, Y Yang, B Oelmann,”design and
implement of a stator –free RPM sensor prototye
basedon MEMS accelerometers” IEEE
Transactions on Instrumentation and
Measurement 61 (3), 775-785,2012.
[6] https://github.com/dancollins/Quad-
Rotor/blob/master/QuadRotor/imu.c, April, 2018
Int'l Conf. Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 | 53
ISBN: 1-60132-475-8, CSREA Press ©