完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我正在尝试计算3轴罗盘的标题,并坚持这个我无法解决的问题。当我读到罗盘输出寄存器时。
0x03(x_m***),0x04(x_l***), 0x05(z_m***),0x06(z_l***), 0x07(y_m***)和0x08(y_l***)。 当y和z LSB按预期更新时,x,y和z MSB值根本不会更新。我配置了 30Hz ODR的CRA_REG_M(00h)到0x10, 对于连续模式和MR_REG_M(02h)到0x00 所有传感器范围的CRB_REG_M(01h)到(GN2,GN1,GN0)的每个可能值 但结果相同。我无法理解问题是什么,I2C软件看起来很好,因为它适用于加速度计和陀螺仪!!!! 有人遇到过这个问题???? 样本输出: Mxh = -16 Mx1 = 0Myh = -1 Myl = 35 Mzh = -1 Mzl = 20 Mxh = -16 Mx1 = 0Myh = -1 Myl = 35 Mzh = -1 Mzl = 20 Mxh = -16 Mx1 = 0Myh = -1 Myl = 35 Mzh = -1 Mzl = 20 Mxh = -16 Mx1 = 0Myh = -1 Myl = 35 Mzh = -1 Mzl = 20 Mxh = -16 Mx1 = 0Myh = -1 Myl = 35 Mzh = -1 Mzl = 20 Mxh = -16 Mx1 = 0Myh = -1 Myl = 35 Mzh = -1 Mzl = 20 Mxh = -16 Mx1 = 0Myh = -1 Myl = 35 Mzh = -1 Mzl = 23 Mxh = -16 Mx1 = 0Myh = -1 Myl = 35 Mzh = -1 Mzl = 23 请注意Mxh,Myh和Mzh不会发出嗡嗡声,但我会旋转或移动指南针。 #lsm303dlm 以上来自于谷歌翻译 以下为原文 I am trying to calculate the heading of the 3 axis compass and stuck with this issue that I can't solve. when I read the compass output register viz. 0x03 (x_m***), 0x04 (x_l***), 0x05 (z_m***), 0x06 (z_l***), 0x07 (y_m***) and 0x08 (y_l***). the x,y and z MSB values are not updated at all where as y and z LSB are updated as expected. I configured the CRA_REG_M (00h) to 0x10 for 30Hz ODR, MR_REG_M (02h) to 0x00 for continuous mode and CRB_REG_M (01h) to every possible value of (GN2,GN1,GN0) for all sensor range but had same result. I can't understand what the problem is, The I2C software seems to be fine as it works perfectly for accelerometer and gyro!!!!. did anyone come across this issue???? sample output: Mxh=-16 Mxl=0 Myh=-1 Myl=35 Mzh=-1 Mzl=20 Mxh=-16 Mxl=0 Myh=-1 Myl=35 Mzh=-1 Mzl=20 Mxh=-16 Mxl=0 Myh=-1 Myl=35 Mzh=-1 Mzl=20 Mxh=-16 Mxl=0 Myh=-1 Myl=35 Mzh=-1 Mzl=20 Mxh=-16 Mxl=0 Myh=-1 Myl=35 Mzh=-1 Mzl=20 Mxh=-16 Mxl=0 Myh=-1 Myl=35 Mzh=-1 Mzl=20 Mxh=-16 Mxl=0 Myh=-1 Myl=35 Mzh=-1 Mzl=23 Mxh=-16 Mxl=0 Myh=-1 Myl=35 Mzh=-1 Mzl=23 please note the Mxh, Myh and Mzh won't buzz however I rotate or move the compass. #lsm303dlm |
|
相关推荐
3个回答
|
|
我终于解决了这个问题。但是我花了一些时间来弄清楚这个问题。问题是指南针或磁力计的默认灵敏度很容易被周围的磁场覆盖(可能来自电源或其他设备)。这会导致输出寄存器溢出并包含-4096作为输出。这个没有在LSM303DLM数据表中提到!!!
然而,解决方案很简单,只需选择最低灵敏度。我为0x02寄存器选择了值0xE0,它工作了 |
|
|
|
啊你发现我做了同样的事情:
[DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32F%20MEMS%20%20iNEMO/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32F MEMS iNEMO / LSM303DLHC最大MAG范围是错&安培; FolderCTID = 0x01200200770978C69A1141439FE559EB459D7580003E26E7DD54228C428E8F9FB5EE9C5185&安培; currentviews = 47] LSM303DLHC最大磁场范围错误 我与你分享你的恶化! 实际上我在这部分看到了4个错误: 一,是的,未指定“超出范围”的值。 二,“超出范围”的价值奇怪地做了这个事情,它在符号超出范围值的位置翻转,但只有Z轴。 三,它超出范围的点不仅没有说明,而且没什么意义 - 它不是在数字空间的最大/最小值,而是一个更低的值 - 我以前从未见过这个我能想到的任何部分。 四 - 这很大,我怀疑你有同样的问题,但还没有意识到 - 总的范围不仅比数据表中规定的要少得多,但它对地球应用来说是无用的,因为它甚至会在内部饱和当部件的轴开始与地球的磁矢量对齐时,地球的磁场。 测量单位都有意义,sqrt(x ^ 2 + y ^ 2 + z ^ 2)〜= 0.480gauss,环境适合我的区域。但是当比例设置为1.3gauss时,我能读到的最大值是: Xrange = + / - 0.736高斯 Yrange = + / - 0.439gauss Zrange = + / - 2.080高斯(!) 当与地球的磁场对齐时,Y会断裂。这是一个WICKED问题,因为你的代码可以很好地工作并提供良好的输出,直到你达到一个小范围的方向,它对齐到足以突然跳到-4096! 我建议您将其设置为在屏幕上实时读取,并在其附近缓慢地放置磁铁,以便在出现“超出范围”错误之前查看您的部件可以读取的最大和最小轴值。据我所知,磁场幅度确实是正确的,但轴的极限都是错误的。如果你遇到了我所看到的同样的问题 - 一个轴甚至无法读取地球的磁场 - 那么你就无法使用那个尺度。 事实上,请为我做这个测试!我怀疑我只是有一个不好的部分,但产品本身可能有一个重大的设计缺陷。你的问题跟我的一样。 以上来自于谷歌翻译 以下为原文 Ah you found the same thing I did: [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32F%20MEMS%20%20iNEMO/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32F MEMS iNEMO/LSM303DLHC max mag range is wrong&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580003E26E7DD54228C428E8F9FB5EE9C5185¤tviews=47]LSM303DLHC max mag range is wrong I share your aggravation with this! There's actually 4 things wrong here I was seeing in this part: One, yes, the ''out-of-range'' value is not specified. Two, the ''out-of-range'' value weirdly did this thing where it flipped sign near the out-of-range value, but only with the Z-axis. Three, the point at which it goes out-of-range is not only unspecified, but makes little sense- it was not at the max/min of the number space, but a far lower value- I've never even seen this before in any part I can think of. Four- this is big, I suspect you have the same problem but haven't realized it yet- the total range is not only much less than specified in the datasheet, but it's uselessly low for Earth-based applications as it will saturate even within the Earth's magnetic field, when the part's axis starts to line up with the Earth's magnetic vector. The measurement's units all made sense, sqrt(x^2+y^2+z^2)~=0.480gauss, ambient for my area. But with the scale set to 1.3gauss, the max values I could read were: Xrange=+/-0.736 gauss Yrange=+/-0.439gauss Zrange=+/-2.080 gauss(!) The Y will break when aligned with Earth's magnetic field. This is a WICKED problem, because your code will work just fine and give good output until you hit a small range of orientations where it aligns enough that it suddenly jumps to -4096! I recommend you set this up to read live on your screen and bring a magnet near it, slowly, to see what YOUR part can read as a max and min axis value before you get the ''out-of-range'' error. From what I could tell, the magnetic field amplitude was indeed correct, but the limits of the axes are all wrong. If you've got the same problem I saw on my part- that an axis can't read even the Earth's magnetic field- then you can't use that scale. In fact, PLEASE do this test for me! I'd suspected I merely got a bad part, but the product itself may have a major design flaw. Your problem sounds the same as mine. |
|
|
|
是的,我和你一样有磁测的问题!
有趣的是:效果取决于设备。我使用了几个LSM303DLM,其中一些有饱和问题,跳转到-4096。我不满意并且现在尝试将那些有问题的传感器的测量范围改为+/- 1.9高斯。 我希望将来有一个暗示可以修复或改进传感器。 ;) 以上来自于谷歌翻译 以下为原文 Yeah, I have the same problem with magnetic measurement as you! The interesting thing: the effect is device dependent. I work with a couple of the LSM303DLM and some of them have this saturation problem, jumping to -4096. I'm not happy with and try now to change the measurement range to +/- 1.9 gauss at those sensors with problems. I hope there will be a hint for fixing it or improvement of the sensor for the future. ;) |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2738 浏览 1 评论
3241 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1810 浏览 1 评论
3650 浏览 6 评论
6039 浏览 21 评论
1339浏览 4评论
201浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
353浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
444浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
275浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 07:58 , Processed in 2.175669 second(s), Total 80, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号