loading...
Starting.
running...
How to use
A Bluetooth Low Energy tag on an infusion pump broadcasts a short advertising packet a few times per second. Eight receivers (beacons) in the ceiling of a two-bed-bay ward measure the RSSI, the received signal strength in dBm. The page turns each RSSI into a distance, draws the resulting range circles and finds the point where they best agree: that is trilateration. The green dot is the estimate, the orange cross the raw fix, the blue ring the true pump position.
Start with Typical ward, then try the presets: Wrong model shows a bias that no filtering removes, Behind the partition shows what a wall does to the ranges, Only 3 beacons shows why redundancy and geometry matter, and Tag battery life trades update rate against the coin cell. Switch on Accuracy map (2D) to see the theoretical best error at every point of the floor.
What to try. (1) Set sigma to 0: the error drops to the 1 dB RSSI quantisation floor. (2) Raise the wall loss to 10 dB and park the pump in the other bay. (3) Untick Solver knows the true exponent and move n. (4) Compare the three estimators at sigma 6. (5) Switch Kalman smoothing off and watch the raw scatter. Space pauses, R resets. In 2D drag the pump or any beacon, double-click to release the pump; in 3D click the floor to place the pump and drag to orbit.
The science
1. Log-distance path loss with shadowing. The mean received power at slant distance d from a beacon is
RSSI(d) = P1m - 10 n log10(d / 1 m) - Lw Nw + Xσ, Xσ ~ N(0, σ2)
P1m = -59 dBm is the calibrated power at one metre (0 dBm transmit power), n the path-loss exponent (2 in free space, 2 to 3.5 indoors), Lw the loss per wall crossed (the page counts the partition crossings geometrically) and Xσ the slow fading plus measurement noise, here independent between beacons and between advertising events. The receiver reports whole dB, so the page also rounds RSSI to integers, and a beacon needs more than -95 dBm to hear the tag at all.
2. From RSSI to range. Inverting the model, d̂ = 10(P1m - RSSI)/(10 nm), where nm is the exponent the solver assumes. A Gaussian error of σ dB is a lognormal error in distance: ln(d̂/d) has standard deviation s = ln(10) σ / (10 n), so the range error grows in proportion to the range (about 23 percent for σ = 2 dB and n = 2) and the mean of d̂ is slightly biased by exp(s2/2). Beacons hang 1.6 m above the tag, so the horizontal range is ρ = √(d̂2 - Δz2).
3. Trilateration. Three estimators are offered. The weighted centroid averages the beacon positions with weights 1/d̂2 (cheap, needs no model, biased toward the room centre). Linear least squares subtracts the first circle equation from the others, which removes the quadratic term and gives a linear system A p = c for p = (x, z). Weighted Gauss-Newton minimises Σ wi (|p - bi| - ρi)2 with weights wi = ρi2 / d̂i4 (the inverse variance of ρi), starting from the linear solution; it is the maximum-likelihood estimate for small errors.
4. Cramer-Rao bound and geometry. For independent range errors the Fisher information is J = Σ ui uiT / σρi2, with ui the unit vector from beacon i and σρi = (d/ρ) d s. No unbiased estimator can have an rms position error below √trace(J-1); the map and graph show this bound. The factor GDOP = √trace((Σ u uT)-1) shows how the layout multiplies the ranging error: beacons all on one side of the tag, or one almost behind another, give a large GDOP.
5. Kalman smoothing. A constant-velocity model (acceleration noise 0.35 m/s2) per axis combines the fixes over time; the measurement variance is the Cramer-Rao bound at the current spot. This lowers the random error but cannot remove a bias from a wrong n or from walls, which is why such an installation needs a site survey (fingerprinting) rather than a better filter.
6. Tag battery. A CR2032 holds about 220 mAh; 80 percent is usable. One advertising event on the three advertising channels costs roughly 7.5 mA for 2.4 ms on top of a 2 uA sleep current, so the average current is 2 uA + 7.5 mA × 2.4 ms × rate and the life is capacity / current. These are typical datasheet-class numbers for an educational estimate, not those of a particular product.
Checks (run in the page). Noise-free positions recovered to 1e-6 m by both solvers; the RSSI-distance round trip; a fitted exponent from 6000 noisy samples compared with the true n; the standard deviation of ln(d̂/d) against ln(10) σ / (10 n); the Monte-Carlo rms error of the Gauss-Newton fix against the Cramer-Rao bound; the exact wall loss; and the Kalman error against the raw error.
Simplifications and honesty. Synthetic data, no real measurements. One exponent for the whole ward, independent noise per beacon (real shadowing is correlated in space and time), no multipath fading, no antenna pattern, no body shadowing, walls modelled as a fixed loss per crossing, and a fixed tag height. Real hospital real-time locating systems are usually accurate to room level (a few metres) and are never used for patient-critical decisions on their own. The product shown is generic and not affiliated with any manufacturer.