This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compass becomes crazy (SOLVED)
#1
Sad 
Hi all,

I am Daniel, a new pypilot user located in Portugal. I use a very recent pypilot computer to control an old ST4000 tiller actuator with rudder sensor feedback.

I followed the instructions to calibrate the IMU. Accelerators calibration at home, then locked the accel. calibration. Then, after installing the pypilot in the boat, setting the alignment. Finally, the compass calibration setting began with first circling and maneuvering in calm waters. I left the compass calibration unlocked, as it is assumed that it should update continuously while sailing.

Then I did some hours sailing with few wind and waves to discover the behavior of the pilot, and set the pilot gains. No noticeable problems during these first sessions.

A first problem occurred last week after several hours of sailing with more swell. While we were coming back with down wind and waves, the compass became crazy, with erratic readings and and “compass distortions” messages. Even in gps mode the pilot was unstable. We finished using manual control, and the compass calm down while maneuvering in the marina.


The same problem occurred again yesterday after one hour shaking facing the swell. Erratic readings of the compass, and even instabilities in gps mode. Assuming that it might use corrupted data from the IMU I nullified the DD gain and it worked better.
Finally, making a slow circle under engine allowed to get a “calibration same as old one” message from the compass. I then locked the compass calibration, and could sail quietly several hours under pilot control, under compass or gps modes, with no other problems.

However, the calibration screen displayed again some alert messages, need more range” for the accelerometers (although its calibration was still locked) and “insufficient coverage” and “sigmapoints flat, 2D fit only...”for the compass (see files).
Quote:compass screen:

insufficient coverage: 7  need 14

plane fit found, 2D fit only 3.7165933375099542 [array([ -7.16773151, 237.2477599 ,  81.2444359 ]), array([ 0.06108222, -0.99812793, -0.0030984 ])] 0.3998046358258801 1.0725858450956594
sigmapoints flat, 2D fit only 0.03936035019780477 0.25
insufficient coverage: 7  need 14
sigmapoints flat, 2D fit only 0.02245884394495053 0.25
insufficient coverage: 5  need 14
line fit found, insufficient data 0.4 1.1
line fit found, insufficient data 0.5 1.1
line fit found, insufficient data 0.4 1.1

Quote:accelerators screen:

need more range 0.0004

need more range 0.0004
need more range 0.0006
need more range 0.0007
need more range 0.0006
need more range 0.0006
need more range 0.0007

When restarting this morning in the marina, no such messages were displayed… (see pictures).

Is this behavior known? Do I need to lock the compass calibration as soon as the sea is not flat? How can I know that the compass calibration is sufficiently accurate?

On the calibration screen, there is a yellow spot at the top of the sphere, both for accel. and compass: what does it means? Do I need to recalibrate the accelerators?

Thanks,

Daniel


Attached Files Image(s)
               
Reply
#2
Thanks for reporting this.

It has been observed that sometimes false calibrations are obtained underway in certain sea states. Especially when there is significant boat motion. The algorithm believes the boat has completed a circle when it has not. I intend to improve this, but in the meantime, I suggest locking the calibration once readings are stable. This will prevent the compass calibration from updating.

Please try this and report any issues with the compass. As for 2d vs 3d calibration, it will mostly make a difference when heeling. It should retain the previous estimated 3d value when making a 2d update, and from your screenshot the estimated inclination seems appropriate for your location, so it should work well. The gps mode uses the compass, so would also become unstable.

You never needed to calibrate the accelerometers, you can see the bias are near zero, and factory calibrated for that sensor, but slight improvements (0.02g) will improve things slightly.

The y bias in the compass is quite high (202) This should be "ok" but considering the earth field is 43, this is a large bias, and I wonder if the sensors are mounted near metal, or wires with current, or hopefully not a floating compass (which is the worst)

Sorry for the inconvenience. I will make a special note to explain this fully in my next pypilot video.
Reply
#3
Thanks for the answer.

>I suggest locking the calibration once readings are stable.

Right. It works, even if not optimal Smile

>The y bias in the compass is quite high (202) This should be "ok" but considering the earth field is 43, this is a large bias, and I wonder if the sensors are mounted near metal, or wires with >current, or hopefully not a floating compass (which is the worst)

The main floating compass is about 1 meter far from imu. The DCDC 5v supply of tinypilot is about 10cm far from imu. I 'll try to move it at the maximum distance allowed by the wires and check what happens.
Reply
#4
That should be far enough... but floating compass at 1meter could maybe make slight variations making it seem to work but it wont work as well....

You could maybe take a small magnet and use it to cause the compass to spin, and see if when doing this the pypilot compass changes when the boat is stationary.
Reply
#5
I made the compass spin +- 90⁰ with a magnet, without visible effect on the imu compass readings (inside a 1⁰ noise due to boat motions while docked). May be a very light effect with some self persuasion.

Equally, moving the 5V DCDC supply even very close to the imu has no visible effect.

Anyway, I intended to find a better location (far from the main entrance) for the tinypilot, I guess that I must also avoid proximity with loudspeakers and with the big DCDC converter of the lithium battery! The distance between the main compass and the imu is exactly 90 cm, I can easily increase it... but is is closer to the big DCDC converter. Others locations are more difficult to reach, but I am ready for soldering and splicing wires Smile

More news once I can perform a new calibration session with calm or moderate conditions, the last one might have been too short ? (only a single circle before locking the compass calibration).
Reply
#6
once it locks on and gives useful readings it should be good.

For bonus points... if you can log the data after a bad update I could analyze it and hopefully improve the algorithm, although for this you might want 2 pilots (one to use locked, and the other unlocked) You would want to save the imu.calibration.points eg:
pypilot_client -i imu.calibration.points
or even just the entire pypilot.conf file which contains them. I have 1 set already but have been so sidetracked on other projects and because the fact you can lock the calibration, this issue does have a workaround.
Reply
#7
If one day I have a crew onboard maybe I could log the data on line. I guess that I must install the pypilot software on the Pi4 running OpenCPN to get these files? Are they lost when tinypilot is switched off?
Reply
#8
(2024-07-04, 06:59 PM)Daniel Simon Wrote: If one day I have a crew onboard maybe I could log the data on line. I guess that I must install the pypilot software on the Pi4 running OpenCPN to get these files?  Are they lost when tinypilot is switched off?

Online data tracking looks like an excellent plan if you have a crew onboard. Indeed, in order to obtain the files, you must install Pypilot on the Pi4 running OpenCPN. To prevent data loss when tinypilot is turned off, make sure it is saved correctly.
Reply
#9
(2024-07-05, 02:04 PM)Dybala Wrote:
(2024-07-04, 06:59 PM)Daniel Simon Wrote: If one day I have a crew onboard maybe I could log the data on line. I guess that I must install the pypilot software on the Pi4 running OpenCPN to get these files?  Are they lost when tinypilot is switched off?

Online data tracking looks like an excellent plan if you have a crew onboard. Indeed, in order to obtain the files, you must install Pypilot on the Pi4 running OpenCPN. To prevent data loss when tinypilot is turned off, make sure it is saved correctly.
You can do it from the tinypilot but the logs are lost on poweroff.

You can access the logs from http://192.168.14.1/logs  or by ssh into the tinypilot in /var/log/pypilot
Reply
#10
> ssh into the tinypilot in /var/log/pypilot

ssh access would be fine from the Pi4, but it requests a password for pi@192.168.14.1

I tried several such as nothing, pypilot and tinypilot, but no one worked. How can I initiate the connection?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)