9DoF sensor and ground underneath? - Page 1
Forum section: electronics / beginners

author: Tantalum
author_rank: Regular Contributor
timestamp: January 11, 2025, 11:24:15 am
content: HelloShort question.Should I remove the ground-fill on all layer underneath a 9DoF sensor?Does the masse harm the magnetic field?Thank you

author: ahsrabrifat
author_rank: Regular Contributor
timestamp: January 11, 2025, 04:12:17 pm
content: Remove the ground plane or ground-fill directly underneath the 9DoF sensor. Place the sensor where there is minimum number of traces. It should be away from inductors, transformers and high-current traces.

author: Siwastaja
author_rank: Super Contributor
timestamp: January 11, 2025, 04:18:54 pm
content: Current flowing in the ground plane obviously causes a magnetic field so removing the fill makes sense, then again current flowing in nearby traces affect it anyway. If you are trying to do compass measurements you are going for some serious learning curve, expect some serious engineering effort including calibration jigs. This is because the whole PCB is full of ferromagnetic stuff (something as simple as metal alloys in component leads) which distorts the Earth's field you are trying to measure, and varying supply currents.What are you planning to do with the sensor, and what kind of expectations do you have?

author: Tantalum
author_rank: Regular Contributor
timestamp: January 11, 2025, 05:50:17 pm
content: I expected to use it as a compass :-/I though it would be easier with a sensor which incorporates already a fusion algorithm.Currently it looks like this:

author: Siwastaja
author_rank: Super Contributor
timestamp: January 11, 2025, 07:19:38 pm
content: If it has a built-in algorithm, surely it must come with example layout and PCB design guidelines. If not, the whole story sounds fishy.What is the claimed application for the "fusion algorithm"? I mean, stuff like leveling pitch and roll is pretty easy because the gravity (acceleration of 1g) is a perfect natural reference; all the algorithm needs to do is to compensate for other accelerations when the sensor moves, using the gyros. But yaw is different, accelerometer is of no help and gyros drift within seconds, so you have magnetic only. And magnetic is notoriously problematic even just because of stuff in the ground (even naturally occurring minerals, not to even talk about buildings, underground cables etc), which is why when using manual compass you are supposed to take the direction frequently from different spots and average it out in your Human Intelligence algorithm.Now with your own PCB and components and casing sitting around, the least you can do is to calibrate out their effect. If the existing algorithm is worth anything, it will have some described procedure how to do that calibration.The best I was ever able to get out of a magnetometer (indoors application, maybe that was one of the mistakes) was something like +/- 30 degrees. I just gave up. But of course it can be done and there are companies specialized to do it.For the PCB, I would probably put the chip as far from other parts carrying current as possible. I.e., in the corner. It seems you have some empty space there.

author: Tantalum
author_rank: Regular Contributor
timestamp: January 12, 2025, 02:16:56 pm
content: Thank you for your advisesI will make a prototype first and see if the data are usable or not.

author: Nominal Animal
author_rank: Super Contributor
timestamp: January 12, 2025, 02:45:19 pm
content: Quote from: Siwastaja on January 11, 2025, 07:19:38 pmSensor fusioncan help the precision even in orientation in the plane perpendicular to gravity, as long as the movement of the IMU is not strictly planar and perpendicular to gravity; say when walking, for example. Less useful for smooth-wheeled devices on utterly flat surfaces (where you may need to use high-precision gyroscopes or beacon-based navigation instead).The difference between sensor fusion and simply averaging the estimates from different sensor is qualitatively similar to the difference between mean and median in statistics, especially when it comes to filtering out noise from the sensor readings: Sensor fusion combines different inputs in a logical manner, whereas averaging the estimates makes all sorts of conceptual and mathematical assumptions you may not be aware of.There are three main sensor fusion algorithms used:Kalman, Mahony, and Madgwick filters. Seethisexplanation at QSenseMotion, andComplementary,Extended Kalman,Mahony, andMadgwickorientation filter descriptions atAHRS documentationat Attitude and Heading Reference System library (written in Python) documentation.

author: Siwastaja
author_rank: Super Contributor
timestamp: January 13, 2025, 08:56:27 am
content: Quote from: Nominal Animal on January 12, 2025, 02:45:19 pmI meant, what is the claimed application for this specific fusion algorithm? Manufacturer of the chip (and the algorithm) should be saying something about what it can do and to what accuracy - and also have application notes how to achieve this accuracy (e.g. PCB layout).

author: Nominal Animal
author_rank: Super Contributor
timestamp: January 13, 2025, 10:39:01 am
content: Quote from: Siwastaja on January 13, 2025, 08:56:27 amApologies, I was apparently particularly dense yesterday.Yes, fully agreed.After looking at the 28-pin LGA footprint, I'm pretty sure OP is talking about Bosch BNO055 9DoF sensor;PDF datasheet,documentation. Or possibly a clone. It is not a particularly good or precise 9DoF sensor, though.Sensor fusion isn't difficult to implement yourself, though. You can find many open source ones for the 9DoF MPU9250, for example. I do believe some are so disappointed at the BNO055 built-in one that they prefer to use it as a dumb 9DoF IMU and run their own Madgwick sensor fusion algorithm on a suitable microcontroller.Whatever you do, learn to use versors/unit quaternions/bivectors –– four-component \$(q, i, j, k)\$ objects –– for the orientation and describing rotations in general.Euler and Tait-Bryan angles will lead you astray, because they are actually an ordered set of rotations around specific axes, with at least the third one dependent on the first two and thus leading to gimbal lock, and nobody agreeing to exactly what axes are to be rotated in which order, leading to many different variants used under the same name, leading to surprising issues when part of your implementation uses a different one by accident.Perhaps I should write a post to the Beginners section to describe the operations needed. Euler/Tait-Bryan angles users too often fall into its traps, thinking they're easier than the versor/quaternion/bivector approach, but it's just not true! And using 3×3 matrices (or two unit vectors perpendicular to each other, the third being the cross product of the first two) is just too cumbersome.

author: sokoloff
author_rank: Super Contributor
timestamp: September 26, 2025, 10:55:09 am
content: Quote from: Nominal Animal on January 13, 2025, 10:39:01 amIt's been a while since this post, but I will personally guarantee at least one interested reader in this topic (and I'm sure hundreds more, of course, but I can only 100% guarantee one).