Hi all,
I am working with ICM20948 IMU,
So I started to learn all the basic knowledge of IMU,
using this repo for fusion
jremington/ICM_20948-AHRS
I studied this for calibration
Done all steps as far as I understood,
As I am new to IMU I tried my best to understand and implement everything.
I am attaching my calib data
acc_cal.txt - Accelerometer calib data
acc_out.txt - Accelerometer corrected data
mag_cal.txt - Magnitometer calib data
mag_out.txt - Magnitometer corrected data
dataOut.txt - Dataut from Arduino
magneto1_4.c - Used magneto for this calibration by @jremington
I cannot upload files @jremington as I am new here.
I can send it personally.
Now with this calib data
Accelerometer
PS C:\Users\Lenovo\Documents\Arduino\libraries\ICM_20948-AHRS\New_Calib> .\magneto.exe
Magneto 1.4 2/10/2021
Input .csv file? acc.csv
0 -1432 856 17536
1 -1296 952 17328
2 -1400 824 17408
3 -1424 792 17272
4 -1336 672 17272
5 -1488 720 17448
6 -1280 512 17360
7 -1400 664 17288
8 -1248 784 17224
9 2560 -976 20056
10 -1520 880 17344
11 -1072 88 18216
12 4544 3736 15368
13 -3640 3920 16744
14 216 4240 15152
15 -1552 2976 16760
16 -1128 2760 14312
17 -680 4488 20160
18 11440 4176 8224
19 112 2584 17112
20 -1680 5392 17848
21 -4408 7640 12672
22 3016 280 17352
23 1216 -1800 21088
24 -48 4824 14976
25 -2840 4104 15464
26 -1432 5136 18600
27 -2144 360 15744
28 -2168 -3736 23656
29 1392 -9056 14856
30 5184 -6440 -6512
31 -1096 -4968 -14272
32 -7888 -1480 -14984
33 -9512 -864 -14568
34 -6000 -520 -17776
35 -3352 -5776 -17992
36 5736 -6600 -19904
37 -4008 2056 31216
38 -6104 18960 10952
39 1440 17360 -12648
40 -3336 8840 -9760
41 3520 6360 -11432
42 816 13744 -11496
43 1088 25992 2240
44 1808 5880 10992
45 1752 -1720 19320
46 1472 2360 14872
47 1736 864 19744
48 128 -1024 25600
49 592 -3800 12384
50 -1312 -1536 -10296
51 2344 -4504 -13600
52 1104 -3192 -19480
53 2968 -3040 -23288
54 72 -864 14192
55 -8512 7672 19048
56 4488 6592 15512
57 -1152 7736 15376
58 -7848 2240 24136
59 -13368 -3464 17264
60 -14968 -5656 -29728
61 -8480 -6976 -21584
62 -9824 -4488 -18208
63 5752 -2712 9376
64 22344 10112 31784
65 -1608 -1376 10720
66 944 -5784 20648
67 -1368 -5456 17328
68 -1080 -6520 15640
69 8984 -8944 200
70 3832 -1520 -13416
71 20288 9792 -19400
72 13392 15208 -16656
73 800 424 -776
74 -10592 4840 21112
75 -8712 12976 30360
76 -1288 11480 17424
77 2568 12504 -17160
78 8944 25248 -27320
79 6712 21344 -14896
80 -9400 9680 18464
81 -2984 9920 19504
82 -11568 15896 25448
83 -3968 12280 10480
84 240 15504 -27232
85 5144 22448 -18176
86 -7904 19040 -24384
87 -664 7808 -7152
88 9800 8120 20312
89 8672 12592 31920
90 -17272 9616 24416
91 -552 4112 -9816
92 -336 9416 -5376
93 -5752 20896 -28544
94 -17688 10480 -9832
95 -12984 8712 17256
96 -4600 9192 24024
97 -11984 18744 26640
98 9016 3704 -23064
99 9728 11960 -25416
100 -6416 29128 -26064
101 -9296 440 232
102 2360 9768 14136
103 -11312 11288 19264
104 -17136 7224 14728
105 10824 12144 -4216
106 6960 21008 -23496
107 -12384 29040 -15848
108 -22368 3000 -11904
109 4232 13472 15752
110 -15256 10320 23200
111 -4376 5192 18800
112 11816 22960 -19176
113 -20848 25760 -10792
114 -2984 6712 -16280
115 -4104 10000 1648
116 -32768 3992 1840
117 -21808 9800 1056
118 5896 30544 -13840
119 -6512 15888 -32768
120 -3648 14728 -6480
121 -5760 9256 18176
122 -24480 2600 23488
123 -2584 1344 17320
124 19776 896 14224
125 12328 15384 32767
126 18472 13448 16504
127 16688 2560 24968
128 -14824 -4072 11616
129 -11976 -24 -3152
130 3592 25120 5040
131 16584 24576 -5408
132 2952 8432 11720
133 -3368 19336 19280
134 6176 6512 32608
135 6000 3432 13280
136 13728 21464 -15336
137 12560 14536 -29016
138 1848 32767 -7776
139 -11984 13848 -4712
140 -17712 11992 26856
141 -15592 16912 29856
142 7712 12152 -6544
143 7696 18800 -19912
144 -1632 23544 -29968
145 -256 15928 -7008
146 -23520 15784 32560
147 -25720 19144 23136
148 8 6608 -368
149 6848 6744 456
150 18136 22224 3032
151 13424 17232 2088
152 2168 20728 11176
153 -1424 1720 1456
154 1896 5512 17928
155 -3960 3112 12104
156 -40 1208 -320
157 -3072 7904 21128
158 17656 10048 29288
159 344 9240 -2200
160 11408 4496 -29272
161 11072 5048 -22392
162 15208 9176 -10168
163 1480 9992 -7776
164 -6592 27704 26000
165 8400 31256 10064
166 16072 15832 16128
167 -2232 27408 -23592
168 18088 14336 -23920
169 9608 9360 -30776
170 8352 19184 20200
171 24928 24880 9968
172 18640 22208 10536
173 7320 10920 -32768
174 10528 -2288 -15648
175 4448 -13944 520
176 18504 -10680 -7112
177 13968 -6248 -10592
178 21344 -2640 -12512
179 800 -2080 -12416
180 -4160 -7216 -9784
181 -5392 -5608 -14912
182 552 -7320 -18184
183 1272 -1888 -17032
184 -1616 -2512 -14856
185 -7040 -2248 -12800
186 -13352 -2432 -8752
187 -18696 -752 -4232
188 -12856 -3288 5608
189 -11872 -2696 3624
190 -1768 72 18528
191 5336 2296 19576
192 3344 2416 13184
193 -5096 4144 16744
194 -10784 5592 16280
195 -15744 7168 7096
196 -13960 5304 -18496
197 -4456 2296 -11296
198 8504 496 -11696
199 9352 4152 -13152
200 11000 3776 -14120
201 5808 4192 -8824
202 10552 2824 -5648
203 14408 11640 7488
204 9000 9440 8528
205 6536 7800 12952
206 9760 8112 7936
207 8880 3048 -12080
208 4368 2856 -6936
209 3672 -1896 -11184
210 -5888 -2248 -20008
211 -14464 -4944 -10928
212 -4792 -5136 -1216
213 4360 -7424 7192
214 7488 10056 15144
215 5376 15744 12680
216 6120 16976 968
217 7136 14432 -8096
218 6888 6560 -10440
219 3920 10808 -12512
220 10848 16088 1336
221 6512 15440 31328
222 7168 2736 15512
223 -9232 -10504 -1344
224 -5328 -5576 -13472
225 -728 2472 -17312
226 -2888 952 -15040
227 -1160 -968 -13184
228 -1592 -544 -12528
229 -8832 -1328 -14184
230 -7672 -5920 1560
231 -1096 -2920 18848
232 -2560 2792 13944
233 -1760 8416 20512
234 3808 5640 13832
235 4368 6768 13336
236 -1800 -720 13600
237 4168 11728 16376
238 968 -1744 26672
239 -10264 -1520 13696
240 -1120 3808 16832
241 18464 6040 10264
242 5104 3888 22144
243 16512 400 1768
244 16200 -112 2072
245 17384 -744 2968
246 17040 768 -3496
247 23360 -2552 -96
248 32767 23904 -1544
249 5840 7120 19072
250 -1192 7880 28744
251 632 1528 17432
252 -2608 5184 19136
253 -312 1928 17376
254 -1848 1864 19144
255 -2848 -928 19144
256 2080 -4080 18096
257 -1912 -696 19536
258 -9432 -2264 25904
259 -8680 10632 26128
260 8112 2968 12648
261 15536 -2264 5976
262 15832 64 5304
263 15952 -904 768
264 16400 -144 944
265 16336 -200 2832
266 16584 -256 552
267 16552 -168 984
268 16240 -752 1680
269 16792 -320 1656
270 16640 -432 1264
271 16408 -208 2464
272 16992 328 744
273 16120 -992 1328
274 15696 -968 1344
275 10672 2216 13096
276 1920 728 19688
277 -1680 720 19584
278 -216 1064 17472
279 -9104 4176 16528
280 15880 32767 816
281 -14848 -1024 -1112
282 -15328 624 -3080
283 -16128 784 -1160
284 -15672 1080 -3560
285 -15840 872 -2480
286 -16096 616 -2344
287 -15696 560 -3160
288 -15752 1000 -2680
289 -15680 840 -2400
290 -16032 736 -2304
291 -15880 648 -2792
292 -15832 832 -2824
293 -22040 10800 7472
294 -32768 15712 288
295 536 -11728 8640
296 -7152 -10696 17480
297 -904 14080 13552
298 6960 20952 32767
299 1576 13112 5736
Average magnitude (default Hm) and sigma of 300 vectors = 20760.5, 7778.8
Reject outliers? (0 or d, reject if > d*sigma from mean) 2
Rejection level selected: 2.0
Rejecting measurements if abs(vector_length-average)/(std. dev.) > 2.0
reject #64, 22344.0 10112.0 31784.0
reject #73, 800.0 424.0 -776.0
reject #78, 8944.0 25248.0 -27320.0
reject #100, -6416.0 29128.0 -26064.0
reject #119, -6512.0 15888.0 -32768.0
reject #125, 12328.0 15384.0 32767.0
reject #141, -15592.0 16912.0 29856.0
reject #144, -1632.0 23544.0 -29968.0
reject #146, -23520.0 15784.0 32560.0
reject #147, -25720.0 19144.0 23136.0
reject #153, -1424.0 1720.0 1456.0
reject #156, -40.0 1208.0 -320.0
reject #164, -6592.0 27704.0 26000.0
reject #171, 24928.0 24880.0 9968.0
reject #248, 32767.0 23904.0 -1544.0
reject #280, 15880.0 32767.0 816.0
reject #294, -32768.0 15712.0 288.0
reject #298, 6960.0 20952.0 32767.0
Number of measurements to be rejected: 18, accepted: 282
282 measurements processed, expected 282
Expected norm of local field vector Hm? (Enter 0 for default 20760.5) 0
Set Hm = 20760.5
Combined bias vector B:
-614.88 9543.73 -810.14
Correction matrix Ainv, using Hm= 20760.5:
1.07207 0.00232 0.02329
0.00232 1.15398 0.01192
0.02329 0.01192 0.87100
Where Hcalc = Ainv*(H-B)
Code initialization statements...
float B[3]
{ -614.88, 9543.73, -810.14};
float Ainv[3][3]
{{ 1.07207, 0.00232, 0.02329},
{ 0.00232, 1.15398, 0.01192},
{ 0.02329, 0.01192, 0.87100}};
output filename for corrected values (csv) acc_out.txt
RMS corrected vector length 20760.505048
RMS residual -0.000000
PS C:\Users\Lenovo\Documents\Arduino\libraries\ICM_20948-AHRS\New_Calib>
Magnetic calib data
PS C:\Users\Lenovo\Documents\Arduino\libraries\ICM_20948-AHRS\New_Calib> .\magneto.exe
Magneto 1.4 2/10/2021
Input .csv file? mag.csv
0 220 72 147
1 231 74 131
2 226 81 141
3 217 77 140
4 219 74 138
5 224 74 134
6 221 74 131
7 221 76 143
8 238 66 143
9 225 67 135
10 214 99 150
11 178 169 186
12 105 252 184
13 -9 319 147
14 -98 335 150
15 -104 324 163
16 -2 319 171
17 107 257 153
18 161 106 257
19 133 -27 275
20 82 -113 311
21 12 -173 313
22 46 -158 299
23 142 -47 287
24 163 174 238
25 59 298 184
26 -30 338 165
27 -33 327 190
28 -4 314 237
29 7 135 399
30 -72 -183 313
31 -33 -261 118
32 41 -226 0
33 31 -211 -26
34 0 -226 -26
35 -23 -265 108
36 29 -148 339
37 117 260 252
38 8 308 -34
39 -36 93 -159
40 -25 -71 -146
41 -18 -127 -93
42 -16 -35 -154
43 33 216 -102
44 18 335 191
45 9 294 289
46 18 308 252
47 36 306 251
48 117 250 226
49 202 66 219
50 256 -60 104
51 192 -61 -58
52 182 -109 -29
53 192 -152 67
54 198 -12 223
55 165 187 184
56 182 179 74
57 175 205 122
58 194 164 138
59 208 98 125
60 262 13 127
61 69 -217 205
62 -89 -241 213
63 -173 89 385
64 90 199 305
65 163 114 257
66 173 69 257
67 164 55 263
68 142 7 287
69 104 -155 249
70 -7 -238 9
71 -128 -130 -99
72 -129 -230 41
73 118 -148 275
74 124 215 238
75 77 276 213
76 170 74 264
77 110 -202 8
78 -14 -10 -166
79 -119 -250 134
80 75 153 377
81 31 301 197
82 153 202 141
83 165 -96 207
84 99 -123 -97
85 39 1 -157
86 -25 -162 -79
87 -150 -171 287
88 -62 221 363
89 139 257 184
90 202 66 150
91 115 -192 -15
92 55 -65 -175
93 88 -76 -117
94 -111 -246 133
95 -70 161 410
96 159 244 133
97 210 -7 80
98 43 -183 -83
99 38 -50 -178
100 78 -111 -98
101 -128 -231 194
102 -83 157 395
103 161 222 119
104 169 -37 4
105 -83 -215 -51
106 -23 -44 -176
107 64 -79 -127
108 -21 -264 166
109 -37 142 409
110 139 215 198
111 185 -89 65
112 -129 -111 -167
113 31 -35 -159
114 -217 -171 30
115 -78 -41 388
116 122 257 143
117 173 -23 -20
118 -174 -223 76
119 -110 -38 -155
120 -199 -222 131
121 -83 91 419
122 140 201 159
123 107 -169 10
124 -185 -232 131
125 -129 -104 347
126 24 -171 270
127 -21 2 399
128 -171 -55 413
129 82 -236 123
130 -316 -31 53
131 -336 88 33
132 -61 -272 115
133 96 42 323
134 -78 270 264
135 -18 44 421
136 -53 -211 -52
137 -42 106 -181
138 -78 -192 -55
139 -13 -86 376
140 59 295 181
141 187 139 146
142 69 -205 -10
143 52 21 -193
144 -9 -110 -125
145 -60 -183 301
146 69 275 214
147 199 122 105
148 70 -228 104
149 -268 -145 163
150 -325 -6 65
151 -334 83 192
152 -286 8 290
153 -194 -61 366
154 -279 18 336
155 -231 31 376
156 -175 -59 388
157 -201 0 377
158 -171 -221 175
159 -31 -35 -171
160 -210 216 -26
161 -296 192 131
162 -296 109 62
163 -129 -235 174
164 -83 36 431
165 -185 -3 366
166 41 -238 178
167 -13 217 -148
168 -276 226 130
169 -237 -155 118
170 -134 -71 414
171 -257 51 328
172 6 -247 165
173 -112 172 -160
174 -216 189 -41
175 -271 -2 -47
176 -331 100 4
177 -278 238 66
178 -227 281 121
179 -225 223 -40
180 -111 186 -140
181 -167 193 -106
182 -226 227 -32
183 -230 259 4
184 -156 267 -34
185 -88 270 -81
186 -1 272 -84
187 71 275 -39
188 153 237 22
189 179 221 92
190 131 232 233
191 65 254 280
192 79 254 261
193 147 251 173
194 146 247 93
195 129 242 -5
196 -64 240 -105
197 -176 233 -59
198 -272 247 110
199 -261 269 185
200 -251 249 178
201 -251 269 171
202 -184 264 258
203 12 246 313
204 129 240 233
205 102 252 248
206 -66 315 255
207 -111 357 187
208 -162 357 85
209 -131 328 -41
210 -6 340 -27
211 100 255 -74
212 187 -56 -29
213 83 -207 214
214 2 -95 358
215 -42 33 419
216 -98 187 371
217 -131 280 271
218 -148 320 174
219 -157 319 156
220 -139 295 267
221 -70 -7 403
222 26 -213 237
223 77 -128 -95
224 -15 182 -141
225 -117 300 5
226 -108 296 19
227 -113 286 9
228 -116 294 9
229 -36 261 -68
230 219 61 -10
231 213 -40 121
232 214 64 165
233 152 178 201
234 153 144 195
235 170 129 217
236 175 142 176
237 201 108 156
238 196 103 154
239 217 90 125
240 211 101 119
241 115 86 293
242 23 71 369
243 -94 52 372
244 -101 37 368
245 -131 46 357
246 -134 44 352
247 -110 51 369
248 -7 70 368
249 124 89 286
250 217 95 159
251 215 72 154
252 222 80 147
253 211 91 136
254 213 83 159
255 215 90 144
256 219 96 141
257 211 79 141
258 225 80 149
259 148 94 257
260 79 88 334
261 -2 77 361
262 -81 49 366
263 -117 44 352
264 -117 41 345
265 -125 37 356
266 -129 49 350
267 -122 41 350
268 -130 30 339
269 -129 44 357
270 -134 36 350
271 -127 41 347
272 -130 42 356
273 -136 33 340
274 -113 42 363
275 81 51 331
276 191 57 201
277 214 64 174
278 211 69 162
279 215 100 128
280 186 100 30
281 37 91 -129
282 -10 99 -143
283 -12 88 -144
284 -14 77 -147
285 -8 81 -143
286 -9 80 -149
287 -8 74 -148
288 -3 74 -141
289 -19 88 -154
290 -8 79 -141
291 -20 79 -153
292 -20 79 -153
293 20 76 -143
294 83 51 -122
295 211 64 160
296 207 74 136
297 192 101 146
298 188 143 137
299 180 154 124
Average magnitude (default Hm) and sigma of 300 vectors = 307.2, 75.7
Reject outliers? (0 or d, reject if > d*sigma from mean) 2
Rejection level selected: 2.0
Rejecting measurements if abs(vector_length-average)/(std. dev.) > 2.0
Number of measurements to be rejected: 0, accepted: 300
300 measurements processed, expected 300
Expected norm of local field vector Hm? (Enter 0 for default 307.2) 0
Set Hm = 307.2
Combined bias vector B:
-54.22 41.79 112.05
Correction matrix Ainv, using Hm= 307.2:
1.10759 0.02096 0.03081
0.02096 1.00811 -0.00509
0.03081 -0.00509 1.08489
Where Hcalc = Ainv*(H-B)
Code initialization statements...
float B[3]
{ -54.22, 41.79, 112.05};
float Ainv[3][3]
{{ 1.10759, 0.02096, 0.03081},
{ 0.02096, 1.00811, -0.00509},
{ 0.03081, -0.00509, 1.08489}};
output filename for corrected values (csv) mag_out.txt
RMS corrected vector length 307.164411
RMS residual -0.000000
With this data implemented in code from
jremington/ICM_20948-AHRS
data from Arduino
343, 3, -33
343, 2, -32
343, 3, -33
343, 2, -33
342, 3, -33
342, 2, -33
345, 2, -32
338, -4, -32
335, -13, -33
331, -21, -33
327, -26, -35
322, -31, -37
313, -37, -41
307, -42, -43
297, -49, -49
287, -53, -56
275, -57, -64
263, -59, -74
260, -58, -74
257, -58, -76
261, -58, -74
260, -58, -73
261, -58, -74
283, -53, -56
296, -49, -49
307, -38, -44
322, -29, -35
331, -16, -32
336, -4, -32
340, 2, -33
342, 9, -35
348, 19, -36
1, 32, -40
17, 45, -51
33, 52, -59
46, 55, -9
65, 57, -83
70, 58, -87
78, 59, -92
82, 58, -96
86, 57, -98
89, 57, -101
88, 57, -101
89, 57, -101
83, 57, -97
59, 57, -78
25, 48, -56
35, 30, -42
335, 4, -28
339, 7, -36
349, 2, -31
350, 2, -33
350, 2, -32
348, 2, -32
349, 3, -33
349, 3, -32
350, 3, -32
349, 3, -33
350, 9, -34
Why pitch is effecting yaw is my primary concern..
is tilt compensation not done here?