I have used HMC5883 and LSM303 to mimic a compass in a robot. I observe the following: 1) neither is consistent. When I take a reading at a specific spot (not moving) pointing to a second specific spot using the same compass , then the compass will not give the same reading again. Sometimes off by 10 degrees or more. I have done this experiment with both compasses. To be clear: I use say the LSM303 today and again tomorrow using the same unit to measure the same heading. Then i repeat with the 5883. Both compasses have been calibrated. 2) When the robot drives over gravel / uneven ground both compasses get thrown off wildly.
I had hoped the LSM303 would be a good solution since it is tilt and angle compensated from what I was advised.
I have tried to find a better compass for Arduino projects but have not found anything on the internet. Does anyone know of a consistent and vibration protected compass? thank you in advance.
If the compasses you are using return "true" readings in a laboratory environment, the compasses are good. If the compasses do not return true readings in less-than-laboratory environments, the system is bad; motor feedback, loose connections, flexing boards, power fluctuations... while the compasses were made for laboratory environments.
How much ferrous material is the vehicle made of?
When i used compass in the field, I wore a brass belt buckle to not warp the magnetic field near where I held the compass.
I stopped to take each reading as the needle needed to settle. But that was not fancy gadget, just a real compass.
When you have a motor running, the local magnetic field will be warped.
Imagine the accuracy of you, a bicycle, reading a compass. Do the same for the machine as for yourself. Give the compass a reproducible, accurate, environment. Stop the vehicle.
They use models of their own motion over time to plan their future movements. They don’t assume perfect independent readings at 100Hz, and plan from the latest observation. They work out the physics of the system and use the imperfect information to update their state.
Spend about US$1 billion per month on research and development with hundreds-of-thousands of employees working in mining, refining, processing, milling, designing, engineering, testing and production... You want a Mars Rover for US$15?
Yes. Your "stop" is a million times slower than their "stop."
[edit]
Mars rover: top speed 120 meters per hour, 3.3 centimeters per second (the width of a coin). Cost: 10 years of research and continuing $US billions. And you want more for US$15.
[/edit]
You're throwing me out of the fantasy party? Poor me. : {
They work out position not just by compass but using 6DoF accelerometer/gyro and if possible by markings, edges and nearby structures. The good ones will avoid obstacles.
Stop for 100ms is 1/10th of a second. If that's better then try 50ms, even 10.
See how long it takes the compass to settle and give consistent readings one after the other. STOP as in the motor is not running stop. See if it makes a difference just to end the unknown-go-round this thread is on.
Get a cheap, battery powered, AM radio (nothing superheterodyned) and put it on your vehicle when it is running... put a probe on the ground plane... and listen for noise.
Says the one expecting (less than) billion dollar results from a $15 device.
You start it, mocked a valid suggestion (then adopted a similar idea, even asking "how much"), call names, now demand I stop, but not you? Maybe stick to tech talk from the beginning, and don't start stuff, even if your feelings are hurt from someone pointing out obvious issues... adding a suggestion... and one more: not a 3DOF compass. Try planar.
You are calling a function running on your controller that interrogates the LSM303 over I2C or SPI for the raw magnetometer and accelerator readings and calculates the heading.
I imagine you are using someone's library since you have demonstrated that you know absolutely nothing about how the sensor works. Is there a
A theodolite is a surveyor's compass. In the Army we called them Aiming circles. i was a kind of forward observer for artillery and we had to be very accurate over kilometers.
We leveled the instrument using the bubbles in to curved glass tubes before we did any sightings.
If your module gives inconsistent reads sometimes and less inconsistent reads other times.. that's a sign something is being done differently. Do not expect helpers here to have crystal balls into what you don't provide, we can only guess what you are better situated to know.
I have a couple of cheap compass modules and expect +/- 1 or 2 degrees tolerance from the spec.
I thought you said earlier that when stationary, it read correctly without wavering. It sounds like there is something other than the sensor alone that is causing the problems and not just the movement.