NXP NTM88 User guide

Type
User guide
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
Rev. 1 — 27 March 2020 User manual
1 Introduction
This document provides an overview of the algorithms used in the NTM88_LocAngle_XZ
project source code functions, including:
The wheel rotation period measurement algorithm in function u8fXGetRotPeriod()
The wheel rotation direction finding algorithm in function u8fFindWheelDir()
The RF packet transmission timing algorithm in function Xmit_RF_Packets_Loop()
The low pass filters (LPF) 4-pole and 2-pole algorithms used in the rotation direction
finding function u8fFindWheelDir() and the rotation period measurement function
u8fXGetRotPeriod()
This document complements the NTM88 Dual-Axis Location Angle Project – Software
user manual, which describes how these algorithms are implemented and offers details
on the project source code.
The NTM88_LocAngle_XZ project was designed as a reference project with limited
performance verification. Users are encouraged to experiment and modify the algorithms
and the project code to suit their application requirements.
2 Rotation period measurement
Wheel rotation speed measurement is performed in function u8fXGetRotPeriod(). The
algorithm is implemented as a state sequencer with state variable u8MoveState. During
wheel rotation, a sequence of samples read from the TPMS accelerometer X is passed
through the LPF to attenuate noise and distortions, and the period of the resulting sine
wave is measured. The peak-to-peak value of the sine wave is equivalent to acceleration
X changing in the range ±1 g. In the ideal scenario, accelerometer X's sensitivity axis
is tangent to the wheel's circle and the sequence of accelerometer X samples is a
sine wave with an average value of 0. In practice, due to installation inaccuracies,
accelerometer X is not perfectly tangent to the wheel and is influenced by centripetal
acceleration. As a result, the sine wave average value is not 0, and the value changes
with the wheel rotation speed. In the period measurement function, the centripetal
acceleration estimate is calculated in variable i16AccXCnt_cpt and is then subtracted
from all subsequent accelerometer X readings. This allows the dynamic range of the
signal being processed by the LPF to be limited.
To save processing time, two possible cases are considered, depending on whether
the first sample of accelerometer X data sequence happens to be on the rising or falling
sine wave slope. The state sequencer follows the sequence shown in Figure 1 in case
the rising slope is detected first and the sequence shown in Figure 2 in case the falling
slope is detected first. Detection of the slope at the beginning of the sequence is done in
state 1. If the rising slope is detected first, the control path follows states 1, 2, 3, 4, 5, 21,
22. If the falling slope is detected first, the control path follows states 1, 12, 13, 14, 15,
21, 22. In both Figure 1 and Figure 2, the sine wave curve represents the signal on the
output of the LPF.
NXP Semiconductors
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
UM11362 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
User manual Rev. 1 — 27 March 2020
2 / 16
The sequence of events when the sine wave rising slope is detected in state 1 is
described below with reference to the characteristic sine wave points shown in Figure 1.
aaa-036887
MAX1
MIN1
MAX2
i16XLPF_out
i16XSamp_max1
i16XSamp_min1
u16FRC_PrdStart
PERIOD
u16FRC_Prd
u16FRC_PrdEnd
X_PRD_LVL_CNT
X_RISE_FALL_CNT
i16XSamp_max2
u16FRC_0cr
time
X_PRD_LVL_CNT
X_PRD_LVL_CNT
1
1 2 3 ... -sequencer state in u8MoveState
5
2
B
C
E
F
D
A
0
4
3
21
Figure 1. Period measurement when an accelerometer X rising slope is detected first
Point A – Read the first accelerometer X sine wave sample. Control remains in state 1.
Point B – Accelerometer X LPF output count in i16XLPF_out has increased by more
than X_RISE_FALL_CNT from Point A, triggering a decision that a rising slope has been
detected. Transfer control to state 2.
Points MAX1 and C – Monitor the sine wave in state 2 to find the maximum peak count
at point MAX1 and save that value in i16XSamp_max1. Wait until the sine wave count
drops from i16XSamp_max1 by X_PRD_LVL_CNT at Point C. When that occurs, read
the FRC count and save the value in u16FRC_PrdStart. Using the last two sample
counts, apply an interpolation correction to u16FRC_PrdStart to improve the accuracy of
the period starting time. Transfer control to state 3.
Points MIN1 and D – Monitor the sine wave in state 3 to find the minimum peak count at
Point MIN1 and save the value in i16XSamp_min1. Then wait until the sine wave count
increases from i16XSamp_min1 by X_PRD_LVL_CNT at Point D. At this point, make the
decision that the sine wave minimum MIN1 has been detected. Transfer control to state 4
to wait for the following maximum MAX2.
Points MAX2 and E − Monitor the sine wave in state 4 to find the maximum peak count
at point MAX2 and save that value in i16XSamp_max2. Then wait until the sine wave
count drops from i16XSamp_max2 by X_PRD_LVL_CNT at Point E. At Point E, read
the FRC count and save the value in u16FRC_PrdEnd. Using the last two sample
counts, apply an interpolation correction to u16FRC_PrdEnd to improve the accuracy
of the period ending time. To calculate the period length in terms of the FRC count,
subtract u16FRC_PrdStart from u16FRC_PrdEnd and store the result in u16FRC_Prd.
Then, using the FRC calibration result stored in u16usPerPrd, convert the period length
u16FRC_Prd to milliseconds and store the result in u16XPrd_ms. Finally, calculate the
average of the sine wave's last two maximums in i16XSamp_max1 and i16XSamp_max2
and minimum i16XSamp_min1. Save that value in i16XSamp_0crLvl to be used as the
NXP Semiconductors
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
UM11362 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
User manual Rev. 1 — 27 March 2020
3 / 16
sine wave 0-crossing count level. Then transfer control to state 5 to wait for the sine
wave 0-crossing point (Point F)
Point F – The accelerometer X sine wave 0-crossing point in state 5. In state 5, monitor
the accelerometer X signal on the output of the LPF. If LPF did not introduce any signal
delay, this point would be equivalent to a location angle of 0° on the car's right-side
wheel (top) and an angle of 180° on the left-side wheel (bottom). In practice, because
the LPF delay is always greater than 0 (several milliseconds), Point F is detected with
a delay equal to the LPF signal delay time. Using an interpolation between the last two
LPF output samples, calculate the value of the FRC counter precisely at the 0-crossing
point F and save the value in variable u16FRC_0cr. u16FRC_0cr is used as a reference
for determining the starting time of the RF packet transmission in state 22 in function
Xmit_RF_Packet_Loop(). Then transfer control to function Xmit_RF_Packet_Loop() in
state 21 to find the target angle in array cai16TargetAngle[] where the first RF packet
must be transmitted.
The sequence of events when the sine wave falling slope is detected in state 1 is
described below with references to the characteristic sine wave points shown in Figure 2.
aaa-036888
MIN1
MAX1
MIN2
i16XLPF_out
i16XSamp_min1
i16XSamp_max1
u16FRC_PrdStart
PERIOD
u16FRC_Prd
u16FRC_PrdEnd
X_PRD_LVL_CNT
X_RISE_FALL_CNT
i16XSamp_min2
u16FRC_0cr
time
X_PRD_LVL_CNT
X_PRD_LVL_CNT
1
1 12 13 ... -sequencer state in u8MoveState
15
12
G
H
J
K
I
A
0
14
13
22
Figure 2. Period measurement when an accelerometer X falling slope is detected first
Point A – Read the first accelerometer X sine wave sample. Control remains in state 1.
Point G – Accelerometer X LPF output count in i16XLPF_out has decreased by more
than X_RISE_FALL_CNT count from Point A, triggering a decision that a falling slope
has been detected. Transfer control to state 12.
Points MIN1 and H – Monitor the sine wave in state 12 to find the minimum peak count
at point MIN1 and save that value in i16XSamp_min1. Wait until the sine wave count
increases from i16XSamp_min1 by X_PRD_LVL_CNT at point H. When that occurs,
read the FRC count and save the value in u16FRC_PrdStart. Using the last two sample
counts, apply an interpolation correction to u16FRC_PrdStart to improve the accuracy of
the period starting time. Transfer control to state 13.
Points MAX1 and I – Monitor the sine wave in state 13 to find the maximum peak count
at point MAX1 and save that value in i16XSamp_max1. Then wait until the sine wave
NXP Semiconductors
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
UM11362 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
User manual Rev. 1 — 27 March 2020
4 / 16
count drops from i16XSamp_max1 by X_PRD_LVL_CNT at Point I. At this point, decide
that the sine wave maximum MAX1 has been detected. Transfer control to state 14 to
wait for the following minimum MIN2.
Points MIN2 and J – Monitor the sine wave in state 14 to find the minimum peak count
at point MIN2 and save that value in i16XSamp_min2. Then wait until the sine wave
count increases from i16XSamp_min2 by X_PRD_LVL_CNT at Point J. At Point J,
read the FRC count and save that value in u16FRC_PrdEnd. Using the last two sample
counts, apply an interpolation correction to u16FRC_PrdEnd to improve the accuracy
of the period ending time. To calculate the period length in terms of the FRC count,
subtract u16FRC_PrdStart from u16FRC_PrdEnd and store the result in u16FRC_Prd.
Then, using the FRC calibration result stored in u16usPerPrd, convert the period length
u16FRC_Prd to milliseconds and store the result in u16XPrd_ms. Finally, calculate the
average of the sine wave's last two minimums in i16XSamp_min1 and i16XSamp_min2
and maximum i16XSamp_max1 and store the result in i16XSamp_0crLvl to be used as
the sine wave 0-crossing count level. Then transfer control to state 15 to wait for the sine
wave 0-crossing point K.
Point K – The accelerometer X sine wave 0-crossing point in state 15. In state 15,
monitor the accelerometer X signal on the output of the LPF. If LPF did not introduce any
signal delay, this point would be equivalent to a location angle of 180° on the car's right-
side wheel (bottom) and an angle of 0° on the left-side wheel (top). In practice, because
the LPF delay is always greater than 0 (several milliseconds), Point K is detected with
a delay equal to the LPF signal delay time. Using interpolation between the last two
LPF output samples, calculate the value of the FRC counter at precisely the 0-crossing
point K and save the result in variable u16FRC_0cr. u16FRC_0cr is used as a reference
to determine the starting time of the RF packet transmission in state 22 in function
Xmit_RF_Packet_Loop(). Then transfer control to function Xmit_RF_Packet_Loop() in
state 21 to find the target angle in array cai16TargetAngle[] where the first RF packet
should be transmitted.
An example of raw counts of accelerometer X output at different wheel location angles is
shown in Figure 3. The sine wave peak count equivalent to ±1 g is approximately ±105.
After processing the sine wave by the LPF in function RunLPF_IIR16x16() using fixed-
point arithmetic, the LPF output signal in variable i16XLPF_out can be considered as
an integer number in the range of ±1680 (LPF gain equal to 16). All period measuring
operations are performed on the filtered LPF output signal in i16XLPF_out.
aaa-036889
2155
2050
105
180º
270º
0º
90º 180º
time180º
90º19452155
2050
2050
270º
a) b)
105
1945
Figure 3. Accelerator X raw count readings at different location angles (right side wheel)
NXP Semiconductors
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
UM11362 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
User manual Rev. 1 — 27 March 2020
5 / 16
3 Finding wheel rotation direction
Wheel rotation direction, clockwise (CW) or counter-clockwise (CCW), is determined
using the readings of both TPMS accelerometers X and Z. When the wheel rotates,
the sequences of samples from both accelerometers are sine waves with peak-to-
peak values representing ±1 g gravity acceleration. In addition, accelerometer Z data
includes a constant acceleration component proportional to wheel rotation speed
—centripetal acceleration. Accelerometer X may also include a small amount of
centripetal acceleration due to an inaccurate TPMS mounting position. The phase
relation between the X and Z sine waves provides information about the wheel rotation
direction. When the wheel rotates in CW direction, the accelerometer Z sine wave is
leading the accelerometer X sine wave by 90°. When the wheel rotates in CCW direction,
the accelerometer Z sine wave is lagging the accelerometer X sine wave by 90°. The
captured sine wave plots are shown in Figure 4 for CW rotation direction and in Figure 5
for CCW rotation direction.
Sample Nr
0 604020 503010
aaa-036891
0
-1000
1000
2000
-500
-1500
500
1500
Count
X
Z
-2000
Figure 4. X and Z acceleration sine waves when the wheel rotates in CW direction
Sample Nr
0 604020 503010
aaa-036892
0
-1000
1000
2000
-500
-1500
500
1500
Count
X
Z
-2000
Figure 5. X and Z acceleration sine waves when the wheel rotates in CCW direction
NXP Semiconductors
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
UM11362 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
User manual Rev. 1 — 27 March 2020
6 / 16
The wheel rotation direction finding algorithm is implemented in function
u8fFindWheelDir(). After reading each of the accelerometer X and Z samples, first the
estimate of the respective centripetal acceleration is subtracted and then the resulting
sine wave samples are passed through their LPFs. The values from the LPF outputs
are then processed by the direction-determining state sequencer. Beginning in state
1, the state sequencer looks for the falling or rising sine wave slope. If a rising slope is
detected first, control transfers to state 2 to wait for the sine wave maximum. At each
accelerometer X sample (which could be the sine wave X maximum) the values of both
samples X and Z are saved. When the X sine wave value, after passing its maximum,
drops by D_X_DIR_CNT below its maximum, the new value of the accelerometer Z
sample is recorded. The two recorded samples of acceleration Z are used to determine
if the slope of sine wave Z in the vicinity of the sine wave X maximum is rising or falling.
Then the decision is made on the wheel rotation direction: if sine wave Z is falling
where sine wave X has its maximum, the direction is CW; if sine wave Z is rising at the
moment of sine wave X maximum, the direction is CCW. Similar logic and processing is
performed in state 3 when the first detected sine wave X slope is falling instead of rising.
In such a case, the program waits in state 3 for the sine wave X minimum. Depending
on whether sine wave Z has a rising or a falling slope at the sine wave X minimum, a
decision is made on the wheel rotation direction.
Using a software conditional compilation switch, the rotation direction monitoring function
can be configured to use 2-pole or 4-pole LPFs for filtering accelerometer X and Z
signals. Using 4-pole LPFs provides better noise attenuation but requires a longer
execution time, which results in a lower maximum car speed at which the direction finding
function will work.
When monitoring the acceleration sine waves X and Z in the wheel direction finding
function using the 2-pole LPFs, the minimum sampling period is Ts=3.3 ms equivalent to
the maximum sampling frequency Fs=303.0 Hz. The minimum sampling period is limited
by the sum of the execution times of all major functions that must be executed on each
pass of the program loop. These are:
Reading accelerometer X – 0.85 ms
Reading accelerometer Z – 0.85 ms
2-pole accelerometer X LPF – 0.78 ms
2-pole accelerometer Z LPF – 0.78 ms
The total minimum execution time is 0.85 ms + 0.85 ms + 0.78 ms + 0.78 ms ≈ 3.3 ms.
This limits the maximum wheel rotation period at which the direction finding algorithm will
work reliably to ≈ 60 ms. Therefore, using the 2-pole LPFs, the wheel rotation direction
can be determined at car speeds up to a maximum of ≈130 km/h (estimation done for tire
size 245/45R18).
With 4-pole LPFs used in the direction finding function, the above functions execution
times are:
Reading accelerometer X – 0.85 ms
Reading accelerometer Z – 0.85 ms
4-pole accelerometer X LPF – 1.6 ms
4-pole accelerometer Z LPF – 1.6 ms
The total minimum execution time is 0.85 ms + 0.85 ms + 1.6 ms +1.6 ms ≈ 4.9ms. This
limits the maximum wheel rotation period at which the direction finding algorithm will work
reliably to ≈ 88 ms. Therefore, using the 4-pole LPFs, the wheel rotation direction can be
NXP Semiconductors
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
UM11362 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
User manual Rev. 1 — 27 March 2020
7 / 16
determined at car speeds up to a maximum of ≈ 90 km/h (estimation done for tire size
245/45R18).
4 Packet transmission
The calculation of RF packet transmission times and the transmission of packets is
handled in function Xmit_RF_Packet_Loop(). The function implements a simple state
sequencer that is a continuation of the sequencer started in function u8fXGetRotPeriod()
with state variable u8MoveState.
State 21 is entered when control transfers from either state 5 or state 15. If the
previous state was 5, control transferred to state 21 at Figure 1 Point F, coinciding
with a 0-crossing at TPMS location angle 0°. The initial angle value passed in variable
u8InitAng_0cr is 0. If the previous state was 15, control transferred to state 21 at Figure 2
Point K, coinciding with a 0-crossing at TPMS location angle 180°. The initial angle value
passed in variable u8InitAng_0cr is 180. In state 21, the delay from 0-crossing Points
F or K to the start of the first RF packet transmission is calculated in terms of the FRC
count in variable u16FRCTargAngDly using the initial angle in u8InitAng_0cr.
After calculating the delay in u16FRCTargAngDly, control transfers to state 22. In state
22, the function waits the required delay time for the appropriate moment to start the
next RF packet transmission. The delay is determined by the starting FRC count in
u16FRC_0cr and the delay duration count in u16FRCTargAngDly. After the packet
transmission has started, the program cycles through the remaining target angles
defined in the cai16TargetAngle[] array to find the next suitable angle for transmitting
a packet. After all TARGET_ANG_MAX target angles are processed, the function
Xmit_RF_Packets_Loop() exits and control returns to the main() function.
Calculation of the time delay from the last 0-crossing after the period measurement in
state 5 at point F to the start of the first RF packet transmission is explained below for
the case shown in Figure 1 The same algorithm applies to Figure 2 and 0-crossing point
K. The only difference is that Point F is assumed to coincide with a TPMS location angle
of 0° and Point K is at location angle of 180°. In both cases, the wheel is assumed to be
on the right-side of the car and rotating in a clockwise direction. Figure 6 (a) shows the
events on a time axis and Figure 6 (b) shows the corresponding points marked on the
rotating wheel.
aaa-036893
F
F
TA0
TA0
i16DegAng2
u16DlyAng3
u16DlyAng1
LPF delay
code execution time
packet transmit time
a) b)
180º
Figure 6. Calculation of the earliest target angle TA0
Figure 7 shows the processing of a sequence of target angles listed in the
cai16TargetAngle[] array.
NXP Semiconductors
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
UM11362 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
User manual Rev. 1 — 27 March 2020
8 / 16
aaa-036895
F M
delaydelay
u16FRCTargAngDly
LPF delay packet transmit time
delay
packet transmit time
N P
first target
angle
first packet
transmit start
next packet
transmit start
Q R
t
next target
angle
next packet
transmit start
Figure 7. Calculation of consecutive RF packets start times
Calculations of the first time delay from Point F to the start of the first RF packet are
performed in state 21 when the TPMS is in the Point F location. The variable u16DlyAng3
is used to calculate the sum of the packet transmission time and the MCU code
execution time. Then the sum of u16DlyAng3 and the signal delay introduced by the
LPF is calculated and stored in u16DlyAng1. Using the wheel rotation period measured
previously, the delay in u16DlyAng1 is converted to degrees in u16DegAng1. The value
represents the minimum difference required from the 0° location angle point to the
earliest possible target angle TA0 in Figure 6 (a). If RF packet transmission starts at this
moment, the target angle (where the packet transmission would end) would be at the
angle i16DegAng2 = u8InitAng_0cr + u16DlyAng1, where u8InitAng_0cr=0.
Next, the sum of the packet transmission time and the MCU code execution time is
calculated and saved in u16DlyAng3 to be used in future processing as a minimum time
delay between two consecutive target angles. The time delay in u16DlyAng3 is converted
to degrees and saved in u16DegAng3. This value becomes the minimum required
difference from the current target angle to the next angle listed in cai16TargetAngle[]
array when deciding whether an RF packet can be transmitted for the next target angle or
whether the next target angle transmission should be skipped.
Having the next minimum target angle in i16DegAng2, the array cai16TargetAngle[] is
scanned to find the array index u8NextAngIdx for the target angle that is greater or equal
to the minimum angle in i16DegAng2. The difference:
i16DlyAngToStart = cai16TargetAngle[u8NextAngIdx] − i16DegAng2
is the delay angle between Point F, where these calculations are performed, and the
moment when the RF packet transmission should start (the angle between points F
and M in Figure 7.) The last operation in state 21 is a conversion of the delay angle in
i16DlyAngToStart into time units in u16FRCTargAngDly representing the FRC counter
count used in state 22 to measure the required time delay. After the delay to the first
packet transmission start is calculated in u16FRCTargAngDly, control transfers to state
22.
In state 22, the program waits until the delay in u16FRCTargAngDly expires and then
transmits the RF packet associated with target angle cai16TargetAngle[u8NextAngIdx].
Immediately after starting the packet transmission at Point M in Figure 7, the operation
of scanning array cai16TargetAngle[] is repeated to find the next target angle suitable
for packet transmission. The difference between the target angle associated with
the currently transmitted RF packet and the next one suitable for transmission must
be greater than packet transmission time and code execution time delay calculated
previously in u16DlyAng3. If the time difference between the currently transmitted
packet at target angle cai16TargetAngle[u8NextAngIdx] and the next angle in
cai16TargetAngle[] array is less than u16DlyAng3, the next packet transmission must
be skipped because its transmission would have to start before the current packet
NXP Semiconductors
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
UM11362 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
User manual Rev. 1 — 27 March 2020
9 / 16
transmission terminates. In such a case, the next target angle in the cai16TargetAngle[]
array is considered.
Again, for the next target angle where an RF packet can be transmitted, the new delay to
start the next packet transmission is calculated in u16FRCTargAngDly and the program
waits in the loop for expiration of the delay between Points M and P in Figure 7. At
Points P and possibly R, the same calculations as those used at point M are repeated
until all TARGET_ANG_MAX target angles are processed. The running counter of the
processed target angle entries is kept in variable u8TargAngProcessed. After all target
angles in array cai16TargetAngle[] are processed and all RF packets are transmitted,
the program exits function Xmit_RF_Packets_Loop() and the MCU enters power
saving mode STOP1. The whole sequence of measuring the wheel rotation period and
transmitting RF packets is repeated with the PWU interrupt period defined by parameter
LOC_ANGLE_RUN_PERIOD in main.c.
The sensitivity axis of accelerometer X used in the Location Angle algorithm is tangent
to the wheel's circle. This alignment and the definition of the TPMS position angles
on wheels rotating in clockwise (CW) and counter-clockwise (CCW) directions cause
the same TPMS software to sense different target angles, depending on the wheel's
rotation direction. If the target angle defined in the software is A in the range of 0° to
359°, the TPMS device attached to the wheel rotating in the CW direction (on the car's
right side) will transmit RF packet at angle A. When a TPMS device with the same
software is attached to the wheel rotating in CCW direction (on the car's left side), it will
transmit an RF packet at angle A + 180°. The example of a target angle defined in the
software where angle A = 60° and the TPMS device position angles when RF packets
are transmitted are shown in Figure 8 (a) for CW rotation direction and in Figure 8 (b) for
CCW rotation direction. On a CW rotating wheel, the RF packet is transmitted at a 60°
angle. On a CCW rotating wheel, the RF packet is trnsmitted at angle 60° + 180° = 240°.
Transmitting the packet at the same angle for both rotation directions requires applying
an angle correction to the CCW direction.
No such correction is applied in the Location Angle software in order to reduce code size,
execution time and battery power consumption. The correction that could be applied
would involve determining the wheel rotation direction and then subtracting 180° from the
target angle for wheels rotating in the CCW direction. With this correction, the RF packet
would be transmitted at the same target angle no matter what the rotation direction.
aaa-036894
0º
180º
CW
90º
60º
270º
a) b)
RF packet
transmit time
RF packet
transmit time
end
start
start
end
0º
180º
CCW
90º
240º
270º
Figure 8. RF packets transmission angles on CW and CCW rotating wheels with a software
target angle of 60°
NXP Semiconductors
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
UM11362 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
User manual Rev. 1 — 27 March 2020
10 / 16
5 Low pass filters
5.1 4-pole low pass filters
The 4-pole LPFs implemented in functions RunLPF_IIR16x16() and
RunLPF_IIR16x16Z() are used for filtering X and Z accelerometer signals respectively.
If the rotation direction finding function u8fFindWheelDir() is configured to use 4-
pole LPFs, both of the above LPF functions are used. In addition, the X signal LPF
function RunLPF_IIR16x16() is always used in the rotation period measurement
function u8fXGetRotPeriod(). Both LPFs are identical; they use the same set of constant
coefficients and separate sets of their state variables.
When used in the rotation period measurement function, the X signal LPF is executed
with one of four different sampling periods. The result is equivalent to having four LPFs
with different bandwidths LPF1 through LPF4. One LPF is selected for use during the
entire sequence of wheel rotation period measurements to optimize the LPF performance
at a given rotation speed. Selection of the LPF is done in function SelectLPF() based on
the rotation rate estimated using the acceleration Z centripetal component. Centripetal
accelerations Z, representing the rotation rates, are divided into four LFP usage range:
LPF1 for low car speeds and low rotation rates where acceleration Z is less than 13.6 g
LFP2 for medium car speeds and rotation rates where acceleration Z is in the range
13.6 g to 51.0 g
LPF3 for medium car speeds and rotation rates where acceleration Z is in the range
51.0 g to 155.0 g
LPF4 for high car speeds and rotation rates where acceleration Z is greater than
155.0 g
The filter transfer function in the z domain is:
H(z) = Y(z) / X(z) = H1(z)
H2(z)
where:
H1(z) represents the transfer function of section I given by:
H1(z) = V(z) / X(z) = [B10 + B11
z
−1
+ B12
z
−2
] / [A10 + A11
z
−1
+ A12
z
−2
]
Eq. 1
and H2(z) represents the transfer function of section II given by:
H2(z) = Y(z) / V(z) = [B20 + B21
z
−1
+ B22
z
−2
] / [A20 + A21
z
−1
+ A22
z
−2
]
Eq. 2
X(z) is the z domain transform of the filter input signal
Y(z) is the z domain transform of the filter output signal
The time equation implementing section I in software using filter coefficients converted to
fixed-point format is:
v(n) = B10X
x(n) + B11X
x(n − 1) + B12X
x(n − 2) − A11X
v(n − 1) − A12X
v(n − 2) Eq. 3
The time equation implementing section II in software using filter coefficients converted to
fixed-point format is:
y(n) = B20X
v(n) + B21X
v(n − 1) + B22X
v(n − 2) − A21X
y(n − 1) − A22X
y(n − 2) Eq. 4 where:
NXP Semiconductors
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
UM11362 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
User manual Rev. 1 — 27 March 2020
11 / 16
x(n) is the time domain sequence of the filter input signal samples
y(n) is the time domain sequence of the filter output signal samples
A 4-pole LPF block diagram is shown in Figure 9.
aaa-036898
1
Y
n
Y
n-1
Y
n-2
X
n
X
n-1
X
n-2
V
n-2
V
n
V
n-1
Z
-1
Z
-1
Z
-1
Z
-1
B
20
1
B
21
B
22
-A
21
-A
22
-A
12
-A
11
Z
-1
Z
-1
B
10
B
11
B
12
Figure 9. Accelerometers X and Z 2-pole low pass filter block diagram
It was decided experimentally to design four LPFs with different bandwidths optimized for
four ranges of car speeds. For all LPFs, there is one set of coefficients used B10…B22
and A11…A22 and their bandwidth is set by using a different signal sampling period in
each range. The sampling periods are:
LPF1 – 13.68 ms
LPF2 – 7.24 ms
LPF3 – 4.14 ms
LPF4 – 3.00 ms
The parameters for LPF1-4 are shown in Table 1.
Table 1. Low pass filters parameters—data for tire size 205/65R16
LPF
Accel Z
Range [g]
Car
Speed
Range
[km/h]
Max RPM
[RPM]
Min
Rotation
Period
[ms]
Sampling
Period
[ms] 6
Sampling
Freq [Hz]
LPF
Bandwidth
[Hz]
LPF1 5.9–13.6 20.5–31.0 244 245 13.68 73 4.4
LPF2 13.6–51 31–60 474 126 7.24 138 8.3
LPF3 51–155 60–105 826 73 4.14 242 14.5
LPF4 >155 105–152 1200 50 3.00 333 20.0
Different sampling periods are implemented by making dummy calls to the firmware
function TPMS_E_READ_ACCEL_X() with carefully chosen SMI time delays. During
TPMS_E_READ_ACCEL_X() function execution, the MCU spends most of its time in
STOP4 mode, which reduces power consumption.
Filter LPF4, as the base filter, was designed using the Matlab ‘filterBuilder’ digital filter
design command. The target filter configuration chosen was 4-pole IIR implemented as
two 2-pole sections in series. The remaining filters LPF1, LPF2 and LPF3 were derived
from LPF4 by adjusting the sampling period/sampling frequency. Design parameters of
the base LPF4 are shown in Table 2.
NXP Semiconductors
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
UM11362 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
User manual Rev. 1 — 27 March 2020
12 / 16
Table 2. Base low pass filter design parameters
Fs – Sampling Frequency
Bandwidth @ Gain
LPF4 333.0 Hz 20.0 Hz @ -0.5 dB
The signal delay vs. signal frequency characteristic of each LPF was calculated and
plotted using the transfer function H(z) with the sampling rate appropriate for the LPF.
The characteristics were then approximated using a straight line interpolation in function
SetLPFDelay() where the variable u16LPFDlyx10 is filled out with the LPF delay for a
signal with period u16XPrd_ms in units ms
10.
An example of LPF input and output waveforms is shown in Figure 10. The plotted data
was collected from a TPMS device attached to a car driving on a typical road with a
speed of ≈ 30 km/h. The amplitude of the raw accelerometer X data sequence recorded
on the LPF input shown in red was multiplied by LPF gain=16 to scale it to the same level
as the LPF output sequence shown in blue. The filter used was LPF1.
Sample Nr
0 604020 503010
aaa-036899
0
7000
6000
5000
4000
2000
3000
1000
8000
Count
-1000
LPFout
X Raw
Figure 10. Accelerometer X waveforms on LPF input and output
5.2 2-pole Low Pass Filters
The 2-pole LPFs implemented in functions RunLPF_IIR2P16x16X() and
RunLPF_IIR2P16x16Z() are used for filtering X and Z accelerometer signals in the
rotation direction-finding function if it is configured to use 2-pole LPFs. Both LPFs are
identical; they use the same set of constant 2-pole coefficients and separate sets of their
state variables.
The 2-pole LPF transfer function is:
H(z) = Y(z) / X(z) = [B0 + B1
z
-1
+ B2
z
-2
] / [A0 + A1
z
-1
+ A2
z
-2
]
The time equation implementing the LPF in software using coefficients converted to
fixed-point format is:
y(n) = B0d
x(n) + B1d
x(n − 1) + B2d
x(n − 2) − A1d
y(n − 1) − A2d
y(n − 2)
The filter block diagram is shown in Figure 11.
NXP Semiconductors
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
UM11362 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
User manual Rev. 1 — 27 March 2020
13 / 16
aaa-036900
1
Y
n
Y
n-1
Y
n-2
Z
-1
Z
-1
Z
-1
Z
-1
B
0
B
1
B
2
-A
1
-A
2
X
n
X
n-1
X
n-2
Figure 11. Accelerometers X and Z 2-pole low pass filter block diagram
Similar to the 4-pole LPF, the 2-pole LPF was designed using the Matlab ‘filterBuilder’
command using the 2-pole IIR as the target configuration. Design parameters of the 2-
pole LPF are shown in Table 3.
Table 3. 2-pole low pass filter design parameters
Fs – Sampling Frequency Bandwidth @ Gain
LPF 2-pole 303.0 Hz 18.0 Hx @ -0.5 dB
6 Revision history
Table 4. Revision history
Document ID Release
date
Descriptions
UM11362 v.1 20200327 Initial release
NXP Semiconductors
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
UM11362 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
User manual Rev. 1 — 27 March 2020
14 / 16
7 Legal information
7.1 Definitions
Draft — The document is a draft version only. The content is still under
internal review and subject to formal approval, which may result in
modifications or additions. NXP Semiconductors does not give any
representations or warranties as to the accuracy or completeness of
information included herein and shall have no liability for the consequences
of use of such information.
7.2 Disclaimers
Limited warranty and liability — Information in this document is believed
to be accurate and reliable. However, NXP Semiconductors does not
give any representations or warranties, expressed or implied, as to the
accuracy or completeness of such information and shall have no liability
for the consequences of use of such information. NXP Semiconductors
takes no responsibility for the content in this document if provided by an
information source outside of NXP Semiconductors. In no event shall NXP
Semiconductors be liable for any indirect, incidental, punitive, special or
consequential damages (including - without limitation - lost profits, lost
savings, business interruption, costs related to the removal or replacement
of any products or rework charges) whether or not such damages are based
on tort (including negligence), warranty, breach of contract or any other
legal theory. Notwithstanding any damages that customer might incur for
any reason whatsoever, NXP Semiconductors’ aggregate and cumulative
liability towards customer for the products described herein shall be limited
in accordance with the Terms and conditions of commercial sale of NXP
Semiconductors.
Right to make changes — NXP Semiconductors reserves the right to
make changes to information published in this document, including without
limitation specifications and product descriptions, at any time and without
notice. This document supersedes and replaces all information supplied prior
to the publication hereof.
Applications — Applications that are described herein for any of these
products are for illustrative purposes only. NXP Semiconductors makes
no representation or warranty that such applications will be suitable
for the specified use without further testing or modification. Customers
are responsible for the design and operation of their applications and
products using NXP Semiconductors products, and NXP Semiconductors
accepts no liability for any assistance with applications or customer product
design. It is customer’s sole responsibility to determine whether the NXP
Semiconductors product is suitable and fit for the customer’s applications
and products planned, as well as for the planned application and use of
customer’s third party customer(s). Customers should provide appropriate
design and operating safeguards to minimize the risks associated with
their applications and products. NXP Semiconductors does not accept any
liability related to any default, damage, costs or problem which is based
on any weakness or default in the customer’s applications or products, or
the application or use by customer’s third party customer(s). Customer is
responsible for doing all necessary testing for the customer’s applications
and products using NXP Semiconductors products in order to avoid a
default of the applications and the products or of the application or use by
customer’s third party customer(s). NXP does not accept any liability in this
respect.
Limiting values — Stress above one or more limiting values (as defined in
the Absolute Maximum Ratings System of IEC 60134) will cause permanent
damage to the device. Limiting values are stress ratings only and (proper)
operation of the device at these or any other conditions above those
given in the Recommended operating conditions section (if present) or the
Characteristics sections of this document is not warranted. Constant or
repeated exposure to limiting values will permanently and irreversibly affect
the quality and reliability of the device.
Terms and conditions of commercial sale — NXP Semiconductors
products are sold subject to the general terms and conditions of commercial
sale, as published at http://www.nxp.com/profile/terms, unless otherwise
agreed in a valid written individual agreement. In case an individual
agreement is concluded only the terms and conditions of the respective
agreement shall apply. NXP Semiconductors hereby expressly objects to
applying the customer’s general terms and conditions with regard to the
purchase of NXP Semiconductors products by customer.
Suitability for use in automotive applications — This NXP
Semiconductors product has been qualified for use in automotive
applications. Unless otherwise agreed in writing, the product is not designed,
authorized or warranted to be suitable for use in life support, life-critical or
safety-critical systems or equipment, nor in applications where failure or
malfunction of an NXP Semiconductors product can reasonably be expected
to result in personal injury, death or severe property or environmental
damage. NXP Semiconductors and its suppliers accept no liability for
inclusion and/or use of NXP Semiconductors products in such equipment or
applications and therefore such inclusion and/or use is at the customer's own
risk.
Export control — This document as well as the item(s) described herein
may be subject to export control regulations. Export might require a prior
authorization from competent authorities.
Translations — A non-English (translated) version of a document is for
reference only. The English version shall prevail in case of any discrepancy
between the translated and English versions.
7.3 Trademarks
Notice: All referenced brands, product names, service names and
trademarks are the property of their respective owners.
NXP — is a trademark of NXP B.V.
NXP Semiconductors
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
UM11362 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
User manual Rev. 1 — 27 March 2020
15 / 16
Tables
Tab. 1. Low pass filters parameters—data for tire
size 205/65R16 ............................................... 11
Tab. 2. Base low pass filter design parameters ...........12
Tab. 3. 2-pole low pass filter design parameters ......... 13
Tab. 4. Revision history ...............................................13
Figures
Fig. 1. Period measurement when an
accelerometer X rising slope is detected first .... 2
Fig. 2. Period measurement when an
accelerometer X falling slope is detected first ....3
Fig. 3. Accelerator X raw count readings at different
location angles (right side wheel) ......................4
Fig. 4. X and Z acceleration sine waves when the
wheel rotates in CW direction ........................... 5
Fig. 5. X and Z acceleration sine waves when the
wheel rotates in CCW direction .........................5
Fig. 6. Calculation of the earliest target angle TA0 .......7
Fig. 7. Calculation of consecutive RF packets start
times .................................................................. 8
Fig. 8. RF packets transmission angles on CW and
CCW rotating wheels with a software target
angle of 60° .......................................................9
Fig. 9. Accelerometers X and Z 2-pole low pass
filter block diagram ..........................................11
Fig. 10. Accelerometer X waveforms on LPF input
and output ....................................................... 12
Fig. 11. Accelerometers X and Z 2-pole low pass
filter block diagram ..........................................13
NXP Semiconductors
UM11362
NTM88 Dual-Axis Location Angle Project – Algorithms
Please be aware that important notices concerning this document and the product(s)
described herein, have been included in section 'Legal information'.
© NXP B.V. 2020. All rights reserved.
For more information, please visit: http://www.nxp.com
For sales office addresses, please send an email to: [email protected]
Date of release: 27 March 2020
Document identifier: UM11362
Contents
1 Introduction ......................................................... 1
2 Rotation period measurement ........................... 1
3 Finding wheel rotation direction ........................5
4 Packet transmission ........................................... 7
5 Low pass filters .................................................10
5.1 4-pole low pass filters ......................................10
5.2 2-pole Low Pass Filters ................................... 12
6 Revision history ................................................ 13
7 Legal information .............................................. 14
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16

NXP NTM88 User guide

Type
User guide

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI