Why GPS lies to you

Vì sao GPS nói dối

Global Navigation Satellite Systems — GPS, GLONASS, Galileo, BeiDou — work by a elegant geometric trick. Your phone's receiver measures the time delay of radio signals from at least four satellites, converts each delay into a pseudorange (an estimated distance to that satellite), and solves a system of equations for your three-dimensional position plus a clock bias correction. Outdoors under open sky, horizontal accuracy is often 3–8 meters at the 95th percentile. That is good enough to find a restaurant. It is not good enough to find your car on level B3 of a concrete parking garage — and the failure is not a software bug you can patch with a better map tile. It is physics: signal attenuation, multipath reflection, and geometry collapse.

How signals die underground

GPS signals broadcast at L1 band around 1575 MHz — microwave radio that behaves roughly like light at architectural scales. Reinforced concrete walls attenuate these signals by 20–30 dB or more per pass. By the time you are two levels underground, the receiver may see zero usable satellites, or worse, it may see reflections from a partial sky view at the ramp entrance. A receiver with fewer than four healthy satellite signals cannot solve for position reliably. Some phones fall back to stale dead-reckoning estimates or Wi-Fi positioning, which drifts or jumps unpredictably. The blue dot on the map keeps moving not because the phone knows where you are, but because it is guessing with degraded inputs and updating the guess every second.

Multipath: the silent position killer

Even when signals penetrate — near ramp mouths, open-air upper decks, or garages with skylights — multipath dominates the error budget. Multipath occurs when the direct signal from a satellite arrives at your antenna along with a delayed copy reflected off a concrete wall, metal roof, or another car. The receiver's correlation engine tracks the strongest peak, which may be a composite of direct and reflected paths equivalent to an extra path length Δd. That extra path translates directly into a pseudorange error, which translates into a position error on the order of Δd itself. Standing still in a garage, you can watch your GPS dot orbit 10–30 meters as satellite geometry changes and different reflections dominate. This is not incompetent map software. It is the receiver honestly reporting the best estimate from ambiguous measurements.

Vertical error and the floor problem

Horizontal GPS error gets the complaints, but vertical error is typically 1.5–3 times worse than horizontal even in good conditions. Satellites are mostly above you, so geometry poorly constrains altitude — the constellation is flat from your perspective. This means GPS cannot reliably answer "which floor am I on?" even when latitude and longitude look reasonable at the garage entrance. Wheria's barometer floor hints exist precisely because GPS altitude is useless underground; see our barometer parking math post for the hydrostatic approach. Other failure modes compound the problem: urban canyons between tall buildings create canyon effects similar to underground multipath; cheap RF jammers (illegal but real) flood the band with noise; faulty electronics emit broadband interference. Each mode produces a different signature, but the user experience is the same — the pin is not where you are.

The afternoon Wheria was born

Landmark 81, Ho Chi Minh City, level B3. I had parked, taken a photo of the pillar number, walked to the elevator. GPS showed my car floating in the Saigon River, four hundred meters east of reality. I walked two full laps of the floor before I found it, comparing the map dot against concrete reality and losing every time. That evening the decision was simple: stop showing a lying blue dot underground. Show the path I actually walked, reconstructed from step detection and heading fusion, with honest uncertainty bands. The indoor pipeline — IMU dead reckoning, barometer floor hints, adaptive compass fusion — is documented in our indoor navigation post. Step odometry details live in the IMU post. GPS still works fine when you park outdoors. We just stopped pretending it works where physics says it cannot.

Hệ thống định vị vệ tinh toàn cầu — GPS, GLONASS, Galileo, BeiDou — hoạt động bằng một mẹo hình học thanh lịch. Receiver trên điện thoại đo độ trễ tín hiệu radio từ ít nhất bốn vệ tinh, chuyển mỗi độ trễ thành pseudorange (khoảng cách ước lượng tới vệ tinh đó), rồi giải hệ phương trình cho vị trí ba chiều cộng hiệu chỉnh lệch đồng hồ. Ngoài trời trời trong, độ chính xác ngang thường 3–8 mét ở percentile 95. Đủ tìm quán ăn. Không đủ tìm xe ở tầng B3 hầm bê tông — và thất bại không phải bug software vá bằng tile bản đồ đẹp hơn. Là vật lý: suy hao tín hiệu, phản xạ multipath, và geometry sụp.

Tín hiệu chết dưới đất thế nào

Tín hiệu GPS phát ở băng L1 khoảng 1575 MHz — radio vi sóng xử xử gần giống ánh sáng ở scale kiến trúc. Tường bê tông cốt thép suy hao 20–30 dB hoặc hơn mỗi lần xuyên. Khi bạn xuống hai tầng dưới lòng đất, receiver có thể không thấy vệ tinh dùng được nào, hoặc tệ hơn, chỉ thấy phản xạ từ phần trời hở ở cửa ramp. Receiver với ít hơn bốn tín hiệu vệ tinh khỏe không giải vị trí tin cậy được. Một số điện thoại fallback ước lượng dead-reckoning cũ hoặc định vị Wi-Fi, trôi hoặc nhảy không đoán trước. Chấm xanh trên bản đồ vẫn chuyển không phải vì máy biết bạn ở đâu, mà vì nó đoán với input suy giảm và cập nhật mỗi giây.

Multipath: kẻ giết vị trí thầm lặng

Dù tín hiệu xuyên được — gần cửa ramp, tầng hở, hầm có skylight — multipath chi phối ngân sách lỗi. Multipath xảy ra khi tín hiệu trực tiếp từ vệ tinh tới anten cùng bản sao trễ phản xạ từ tường bê tông, mái kim loại, hoặc xe khác. Engine correlation của receiver bám peak mạnh nhất, có thể là tổng hợp đường trực tiếp và phản xạ tương đương path dài thêm Δd. Path thêm đó chuyển thẳng thành lỗi pseudorange, rồi thành lỗi vị trí cỡ Δd. Đứng yên trong hầm, bạn có thể thấy chấm GPS quay 10–30 mét khi geometry vệ tinh đổi và phản xạ khác chi phối. Không phải software bản đồ kém. Là receiver báo cáo thật ước lượng tốt nhất từ đo lường mơ hồ.

Lỗi dọc và bài toán tầng

Lỗi GPS ngang hay bị phàn nàn, nhưng lỗi dọc thường tệ hơn ngang 1,5–3 lần ngay cả điều kiện tốt. Vệ tinh chủ yếu ở trên bạn, nên geometry ràng buộc độ cao kém — chòm sao "dẹt" từ góc nhìn bạn. GPS không trả lời tin cậy "đang ở tầng nào?" dù lat/lon có vẻ ổn ở cửa hầm. Gợi ý tầng áp kế Wheria tồn tại chính vì độ cao GPS vô dụng dưới hầm; xem bài toán áp kế hầm xe cho cách thủy tĩnh. Chế độ fail khác cộng dồn: hẻm phố giữa nhà cao tạo hiệu ứng canyon giống multipath ngầm; jammer rẻ (bất hợp pháp nhưng có thật) ngập băng tần nhiễu; thiết bị lỗi phát nhiễu broadband. Mỗi mode có chữ ký khác, nhưng trải nghiệm user giống nhau — pin không ở chỗ bạn đang đứng.

Chiều Wheria ra đời

Landmark 81, TP.HCM, tầng B3. Mình đỗ xe, chụp ảnh số cột, đi tới thang máy. GPS bảo xe nổi trên sông Sài Gòn, lệch bốn trăm mét về phía đông so với thực tế. Mình đi hai vòng đầy đủ tầng mới thấy xe, so chấm bản đồ với bê tông và thua mỗi lần. Tối hôm đó quyết định đơn giản: ngừng hiện chấm xanh dối dưới hầm. Hiện đường thật sự đã đi, tái tạo từ phát hiện bước và fusion heading, với dải uncertainty thật thà. Pipeline indoor — dead reckoning IMU, gợi ý tầng áp kế, fusion la bàn thích ứng — mô tả trong bài indoor navigation. Chi tiết odometry bước chân ở bài IMU. GPS vẫn tốt khi đỗ ngoài trời. Team chỉ ngừng giả vờ nó chạy ở chỗ vật lý bảo không thể.