Version 7.1 by Mengting Qiu on 2024/09/02 14:14

Hide last authors
Mengting Qiu 4.1 1 **~ Table of Contents:**
2
3 {{toc/}}
4
5
6
7 = 1. Instroduction =
8
9
10 This chapter shows how to perform linear calibration.
11
12
13 = 2. Linear calibration =
14
15
16 In some case, the measurement and real value are in different range, but they are both linear, we have to calculate the real value with the measurement we can use a simple Linear Calibration.
17
Mengting Qiu 7.1 18 (% style="color:blue" %)**Example:**(%%) we have a water level probe, the measurement range is 0 ~~ 10 meters, and the output is 4~~20mA, this means the when the water level is 0 meter, the output is 4mA, when the water level is 10 meters, the output is 20mA.
Mengting Qiu 4.1 19
Mengting Qiu 6.1 20 We can make a coordinate axis as below:
Mengting Qiu 4.1 21
Mengting Qiu 7.1 22 1. (% style="color:#4f81bd" %)**Y**(%%) axis is the real value, from 0~~10 meters
23 1. (% style="color:#4f81bd" %)**X**(%%) axis is the probe output , from 4~~20mA
Mengting Qiu 4.1 24
Mengting Qiu 6.1 25 We use two points to make the linear line: Point1(x1,y1) = (4,0), Point2(x2,y2)= (20,10).
Mengting Qiu 4.1 26
Mengting Qiu 7.1 27 Since the reading is linear, all (% style="color:#4f81bd" %)**probe output**(%%) and (% style="color:#4f81bd" %)**real value**(%%) is on this line, so we can calculate the real value by probe output in two steps:
Mengting Qiu 4.1 28
Mengting Qiu 7.1 29 * **Step1:** Get (% style="color:#4f81bd" %)**realk(Slope)**(%%) for the line:
Mengting Qiu 6.1 30
31 k=(y2-y1)/(x2-x1) = (10-0)/(20-4) =10/16= 0.625
32
Mengting Qiu 7.1 33 * **Step2:** Get (% style="color:#4f81bd" %)**real value( y )**(%%):
Mengting Qiu 6.1 34
Mengting Qiu 7.1 35 k =(y-y1)/(x-x1)  
Mengting Qiu 4.1 36
Mengting Qiu 7.1 37 ~-~-> y = k*(x-x1)+y1 = 0.625 * (x-4) + 0.
Mengting Qiu 4.1 38
Mengting Qiu 7.1 39 ~= 0.625 * (x-4)
Mengting Qiu 4.1 40
Mengting Qiu 7.1 41 Thus, we can introduce x-values to the already obtained equations to derive the corresponding y-values:
Mengting Qiu 4.1 42
Mengting Qiu 7.1 43 When x=12 mA , y=5 meters
Mengting Qiu 4.1 44
Mengting Qiu 7.1 45 When x=8 mA, y=2.5 meters
Mengting Qiu 4.1 46
Mengting Qiu 7.1 47
Mengting Qiu 4.1 48 A more general formular:
49
Mengting Qiu 7.1 50 (% style="color:#4f81bd" %)**Y=(y2-y1)/(x2-x1)* (x-x1) + y1**
Mengting Qiu 4.1 51
52
Mengting Qiu 7.1 53 Calibration Curve Schematic:
Mengting Qiu 4.1 54
Mengting Qiu 7.1 55 [[image:image-20240902114541-1.png||height="479" width="851"]]
Mengting Qiu 4.1 56
57
Mengting Qiu 7.1 58
Mengting Qiu 4.1 59 = 3. Case examples =
60
61
62 Some case for example which we can use Linear Calibration:
63
64
Mengting Qiu 7.1 65 (% style="color:blue" %)**Case 1: Calibrate Microwave Radar Readling.**
Mengting Qiu 4.1 66
67 The microwave radar reading might effect by the OUM(Object Under Measured), but the reading still linear. In this case, we can measure the closest(x1,y1) and the farthest point(x2,y2). Where the x is reading in platform, y is the real value. And use above method to calibrate.
68
69
Mengting Qiu 7.1 70 (% style="color:blue" %)**Case 2: Calibrate the Soil EC base on SE01 soil sensor raw EC reading.**
Mengting Qiu 4.1 71
72 The SE01 probe is calibrated via mineral soil. The reading for other soil will be different by still in linear, In this case, we can measure two points (x1,y1) and (x2,y2). Where the x is reading of Raw EC, y is the real EC for the soil. And use above method to calibrate
73
74
Mengting Qiu 7.1 75 (% style="color:blue" %)**Case 3: use water level probe to calibrate for oil.**
Mengting Qiu 4.1 76
77 Oil has different density vs water, but we can still use the immersion type water level pressure sensor to get the oil level. In this case, we can measure two points (x1,y1) and (x2,y2). Where the x is reading of water level, y is the oil level. And use above method to calibrate
78
79
Mengting Qiu 7.1 80 (% style="color:red" %)**Notice for Linear Calibrate:**
Mengting Qiu 4.1 81
82 1. k(Slope) is very important, We can measure more points to calculate the most accuracy k.
Mengting Qiu 7.1 83 1. Make sure the mapping is linear, and choose two calibrate points as "far" as possible.
Mengting Qiu 4.1 84
85
86
87