|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2012-6-30 10:42:07
|
显示全部楼层
js200300953 发表于 2012-6-29 20:20 ![](static/image/common/back.gif)
很可能是x和y轴的偏移和比例不同,的确要校正。
这是针对我的芯片测出的校正系数,每个芯片都不同,可以参 ...
你好 已经按你的旋转法校正了, 还是不行, 和原来变化不大
我是水平旋转2周采样, 分别得到x, y, z最大值然后按你的计算出得到
#define HMC5883L_OFFSET_X -49.5f
#define HMC5883L_OFFSET_Y -106.5f
#define HMC5883L_GAIN_X 1f
#define HMC5883L_GAIN_Y 1.048120301f
下面是我校正后的采样, Direction后面第一个数字是未校正算出来的, 第二上数字是校正后的角度.
-362 23 -346 Direction: 356.364624 12.006744
-359 21 -358 Direction: 356.652313 12.373138
-370 -4 -355 Direction: 0.619324 15.433929
-370 -7 -346 Direction: 1.083786 15.832199
-369 1 -349 Direction: 359.844788 14.800476
-364 12 -351 Direction: 358.111877 13.470428
-368 2 -345 Direction: 359.688660 14.699875
-372 4 -346 Direction: 359.384003 14.299088
-370 5 -346 Direction: 359.225830 14.230026
-368 10 -347 Direction: 358.443481 13.618057
-362 22 -343 Direction: 356.522278 12.146286
-356 41 -345 Direction: 353.430328 9.609100
-328 80 -349 Direction: 346.293091 4.207993
-298 122 -349 Direction: 337.736053 357.323395
-288 137 -341 Direction: 334.559875 354.589203
-270 148 -338 Direction: 331.270782 352.247437
-247 165 -339 Direction: 326.256470 348.316223
-226 177 -338 Direction: 321.932495 344.985992
-202 191 -337 Direction: 316.603333 340.600250
-158 205 -344 Direction: 307.622620 333.547791
-103 216 -348 Direction: 295.494263 323.035492
-98 216 -347 Direction: 294.404022 322.113708
-57 219 -348 Direction: 284.588959 312.088531
82 189 -354 Direction: 246.545807 249.401123
159 140 -365 Direction: 221.364029 197.778854
115 167 -364 Direction: 235.447845 224.071747
188 112 -371 Direction: 210.784149 182.383392
197 99 -374 Direction: 206.681274 176.949356
239 46 -368 Direction: 190.894424 161.498505
258 24 -363 Direction: 185.314545 157.475037
247 30 -357 Direction: 186.925079 157.903778
248 39 -357 Direction: 188.937042 160.383224
248 37 -355 Direction: 188.485580 159.848160
248 38 -358 Direction: 188.711441 160.115250
252 29 -358 Direction: 186.564682 158.142670
260 11 -359 Direction: 182.422607 154.568298
261 6 -364 Direction: 181.316910 153.524719
289 -83 -374 Direction: 163.976074 140.330872
291 -123 -372 Direction: 157.087158 135.113663
283 -161 -382 Direction: 150.364243 129.788239
283 -173 -384 Direction: 148.562241 128.557114
281 -175 -384 Direction: 148.086334 128.118561
271 -209 -396 Direction: 142.359940 123.815262
276 -202 -399 Direction: 143.800186 125.010834
270 -199 -394 Direction: 143.608398 124.552460
270 -203 -392 Direction: 143.062241 124.205124
270 -202 -393 Direction: 143.198059 124.291382
270 -203 -393 Direction: 143.062241 124.205124
273 -201 -394 Direction: 143.637115 124.739731
274 -210 -397 Direction: 142.532593 124.088356
282 -147 -392 Direction: 152.468018 131.187592
280 -172 -397 Direction: 148.438171 128.296371
275 -217 -389 Direction: 141.723328 123.626289
254 -260 -393 Direction: 134.331192 118.029182
226 -301 -397 Direction: 126.900322 112.452515
212 -319 -394 Direction: 123.607071 110.020203
156 -372 -400 Direction: 112.750954 101.988762
102 -402 -402 Direction: 104.237251 95.625732
48 -417 -402 Direction: 96.566269 89.843338
21 -422 -404 Direction: 92.848831 87.054672
-11 -430 -402 Direction: 88.534584 83.859100
-150 -424 -386 Direction: 70.517525 70.262230
-185 -398 -394 Direction: 65.069817 66.083801
-239 -375 -388 Direction: 57.489235 60.245049
-295 -312 -385 Direction: 46.604187 51.854401
-386 -135 -359 Direction: 19.276764 30.165939
-389 -27 -345 Direction: 3.970398 17.697678
-387 0 -339 Direction: 360.000061 14.344589
-359 -3 -357 Direction: 0.478729 15.692795
-367 0 -342 Direction: 360.000061 15.003021
-367 8 -344 Direction: 358.751312 13.921524
-372 -31 -354 Direction: 4.763580 18.876190
-412 -53 -313 Direction: 7.330261 19.912506
-355 33 -350 Direction: 354.689240 10.782761
-346 56 -344 Direction: 350.806458 7.622589
-334 78 -343 Direction: 346.855194 4.453812
-327 88 -338 Direction: 344.937866 2.948135
-316 106 -342 Direction: 341.456390 0.082092
-299 119 -337 Direction: 338.297852 357.847107
-299 118 -339 Direction: 338.463440 358.019196
-299 116 -349 Direction: 338.795807 358.363464
-292 110 -352 Direction: 339.358032 359.384613
-291 109 -356 Direction: 339.465576 359.559143
-294 108 -356 Direction: 339.829407 359.737823
校正以后分布不均匀的情况更加严重了, 我先把模块放到0度, 然后放置180度后计数才108度.
是不是我的模块有问题?
|
|