Skip to content

IR Sensor Calibration

Peter Mitrano edited this page Apr 1, 2018 · 8 revisions

Since we are now just using diodes and phototransistors, we need to think to calibrate them. The ADC readings we get will not equal to the distance in meters, and in fact they are not even linearly related. Furthermore, each sensor is different because of the angle and mounting location.

Sensor Letter Location
A front left
B back left
C not on the robot
D front right
E front
F Gerald left
G Gerald right
H back right
I no on the robot

I took readings every 5 mm with a jig and fit a power model $a*x^b+c$ to the data. These are the results averaging ten samples per distance, and a few different trials. You can reproduce these results with this command:

cd docs/ir_sensor_testing
cat no_outliers.txt | xargs ./compute_calibration_parameters.py --logs
sensor a b
G 1.325542 0.034024
F 1.307681 0.032274
A 1.290353 0.031279
B 1.387919 0.043049
E 1.408344 0.044311
H 1.340392 0.036548
D 1.266203 0.027914

Based on the extensive testing I did in different lighting conditions, we do need to model each sensor separately. If we do this, and we can model the reflectivity of the material we can expect ~5mm accuracy from each sensor

Clone this wiki locally