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.

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pypilot
#11
(07-04-2017, 11:35 AM)Sailoog Wrote: Ok to servo, this will be the next step.

Compass calibration. Today I am waiting for a MPU-9255, I will test again with this. Could this be the reason?

IMU calibration. I think all is working right. The field Model is disabled, what is the function of this field?

Scope windows fail:


It looks like the python gl api changed recently..  in a good way.  It broke the scope but I just fixed it in git.
Try both:

Code:
python scope.py localhost imu/gyro
python scope_wx.py localhost


For the server you need an arduino and ESC.   To properly use it, you also need a shunt.

As for calibration, not sure why it doesn't work but I have no other imu than the mpu9255, so maybe that could be the reason...   It should run the calibration every 2 minutes or so provided there is enough data.
  Reply
#12
Scope working, nice!!

   


IMU calibration. The field Model is disabled, what is the function of this field?

Waiting for the new IMU to check compass calibration.
  Reply
#13
I should remove the "model" field maybe. The idea was to be able to display different boat 3d models.
  Reply
#14
(07-04-2017, 01:33 PM)seandepagnier Wrote: I should remove the "model" field maybe.   The idea was to be able to display different boat 3d models.

Maybe.

Something happened with compass calibration, some yellow points appeared and a blue sphere. Still LSM9DS0.

   
  Reply
#15
Tested with MPU-9255 but same behaviour, no locked. Do you have idea what I could try to know what is happening?

I got this but it doesn't seems enough:

got new fit: [[15.789051729503603, 11.468184969253819, 6.9782197227366831, 41.181784025515924, 0.80930005820464312], [15.798962800806089, 11.340619246295704, 6.9142490720937833, 41.28667887043064], [15.798962800806089, 11.340619246295704, 6.9142490720937833, 41.28667887043064, 1, 1]]
calibration: sphere bias difference 0.143050645409
  Reply
#16
(07-05-2017, 01:55 PM)(Sailoog Wrote: Tested with MPU-9255 but same behaviour, no locked. Do you have idea what I could try to know what is happening?

I got this but it doesn't seems enough:

got new fit: [[15.789051729503603, 11.468184969253819, 6.9782197227366831, 41.181784025515924, 0.80930005820464312], [15.798962800806089, 11.340619246295704, 6.9142490720937833, 41.28667887043064], [15.798962800806089, 11.340619246295704, 6.9142490720937833, 41.28667887043064, 1, 1]]
calibration: sphere bias difference 0.143050645409

I just tried today on orange pi and I get a fix.   It is working if you see that line "calibration: sphere bias difference"

I just pushed some changes to print more information please pull.

please give a complete log of boatimu.py output once the line "calibration: sphere bias difference" appears

Code:
signalk_client localhost imu/compass_calibration

What does the client say?
  Reply
#17
MPU-9255

Changes pulled and after 8-9 min I got this from boatimu.py
Code:
sphere fit [13.036294570063996, 12.182777511673979, 6.2503562940638648, 43.044422489029124]
new bias fit [13.077897660457191, 12.156202971873087, 6.2192212503316142, 43.053658209618142, 0.84627415006863116] 57.8087085845
fit [[13.077897660457191, 12.156202971873087, 6.2192212503316142, 43.053658209618142, 0.84627415006863116], [13.036294570063996, 12.182777511673979, 6.2503562940638648, 43.044422489029124], [13.036294570063996, 12.182777511673979, 6.2503562940638648, 43.044422489029124, 1, 1]]
coverage 275.696717681
got new fit: [[13.077897660457191, 12.156202971873087, 6.2192212503316142, 43.053658209618142, 0.84627415006863116], [13.036294570063996, 12.182777511673979, 6.2503562940638648, 43.044422489029124], [13.036294570063996, 12.182777511673979, 6.2503562940638648, 43.044422489029124, 1, 1]]
calibration: sphere bias difference 0.0583644947216
[boatimu] cal result ([[13.077897660457191, 12.156202971873087, 6.2192212503316142, 43.053658209618142, 0.84627415006863116], [13.036294570063996, 12.182777511673979, 6.2503562940638648, 43.044422489029124], [13.036294570063996, 12.182777511673979, 6.2503562940638648, 43.044422489029124, 1, 1]], [[50.84063969706502, 28.940530291718996, 13.450795419508106, 0.9922897178364136, -0.017134609040870035, -0.12271828654523526], [4.929141807365418, -7.699411305618285, 42.81844530944824, -0.19279560290807912, 0.07904961569285812, 0.9780461545187138], [-2.112546226978302, -15.107414245605469, -23.272947502136233, -0.0320811320399137, -0.8159363497034229, -0.5771745519838487], [-28.31768165588379, 19.123852729797363, -5.253757033348084, -0.9337312268101186, -0.2819024024032991, -0.2037641068797005], [32.72612853044185, 28.261176693773027, 41.00647221563411, 0.020796821224277378, 0.020542064379493016, 0.9995183128097499], [39.00846347748487, 20.104050213239752, 40.64284848936345, 0.058694378303795494, 0.05253287297348549, 0.9968308944268046], [18.1705472032547, 35.956125030517576, 41.621533959198, 0.04536547966128558, 0.0011948038755751353, 0.9988755663449176], [38.972356483570096, 8.395253951021672, 40.91653586987687, 0.030606223886385377, -0.00253482134241404, 0.9995199463916534], [38.951448712004165, 3.5548279596004417, 39.696838488947975, 0.05628371725908813, -0.02750629783911274, 0.9980205969334773], [36.053769131208384, 0.9729070583743415, 40.92697860279491, 0.027450048832508345, 0.006140948857535157, 0.9996000177103794], [13.822440547943115, 34.8001655960083, 42.611710472106935, -0.047753089198382885, -0.0187028000808233, 0.9984402216647227], [51.685330956219545, 31.165211790467946, 11.998223080748083, 0.997003993445436, -0.03525595503920057, -0.06804145529680336], [7.862888630297537, 33.05363505938545, 43.37010812352306, 0.04454311407093744, -0.03135918812918692, 0.998132492496968]])
[imu process] new cal (13.077897660457191, 12.156202971873087, 6.2192212503316142)

And after few minutes more I got this
Code:
sphere fit [12.977383545927676, 12.136182736879547, 6.316029497720149, 43.0119847352592]
new bias fit [13.012850804146554, 12.105987507330736, 6.2917992178422422, 43.017758820076217, 0.84507345686026769] 57.6798070262
fit [[13.012850804146554, 12.105987507330736, 6.2917992178422422, 43.017758820076217, 0.84507345686026769], [12.977383545927676, 12.136182736879547, 6.316029497720149, 43.0119847352592], [12.977383545927676, 12.136182736879547, 6.316029497720149, 43.0119847352592, 1, 1]]
insufficient change in bias

sphere fit [12.977696535773063, 12.13641438036222, 6.3156800594029026, 43.0121572060993]
new bias fit [13.013166430960647, 12.106215541376754, 6.2914461182257604, 43.017933483528942, 0.84507882177275218] 57.6803819615
fit [[13.013166430960647, 12.106215541376754, 6.2914461182257604, 43.017933483528942, 0.84507882177275218], [12.977696535773063, 12.13641438036222, 6.3156800594029026, 43.0121572060993], [12.977696535773063, 12.13641438036222, 6.3156800594029026, 43.0121572060993, 1, 1]]
insufficient change in bias

And signalk_client localhost imu/compass_calibration says:
Code:
{"imu/compass_calibration": {"value": [[13.078, 12.156, 6.219, 43.054, 0.846], [13.036, 12.183, 6.25, 43.044], [13.036, 12.183, 6.25, 43.044, 1.0, 1.0]]}}

Trying now with LSM9DS0

What we should do to calibrate the IMU? moving it around?

I though that "calibration locked" would be auto-enabled when a fix is done. Does that means that "calibration locked" should be enabled manually when you are happy with calibration?

Is it always calibrating until you enable "calibration locked"?

Last day I got a fix with LSM9DS0 after 40 min but the red sphere did not fit the points cloud very well, would it have kept calibrating until improving the fit?
  Reply
#18
LSM9DS0 after 20 min


Code:
sphere fit [-4.2586061041856809, -3.8133114712781739, 2.3351774003567134, 43.379796511362024]
new bias fit [-4.0147716172766028, -3.2905107609445574, 2.3046543696766082, 43.432439121649672, 0.84390506868342652] 57.5548121362
fit [[-4.0147716172766028, -3.2905107609445574, 2.3046543696766082, 43.432439121649672, 0.84390506868342652], [-4.2586061041856809, -3.8133114712781739, 2.3351774003567134, 43.379796511362024], [-4.2586061041856809, -3.8133114712781739, 2.3351774003567134, 43.379796511362024, 1, 1]]
coverage 175.048161982
got new fit: [[-4.0147716172766028, -3.2905107609445574, 2.3046543696766082, 43.432439121649672, 0.84390506868342652], [-4.2586061041856809, -3.8133114712781739, 2.3351774003567134, 43.379796511362024], [-4.2586061041856809, -3.8133114712781739, 2.3351774003567134, 43.379796511362024, 1, 1]]
calibration: sphere bias difference 0.577674211934
[boatimu] cal result ([[-4.0147716172766028, -3.2905107609445574, 2.3046543696766082, 43.432439121649672, 0.84390506868342652], [-4.2586061041856809, -3.8133114712781739, 2.3351774003567134, 43.379796511362024], [-4.2586061041856809, -3.8133114712781739, 2.3351774003567134, 43.379796511362024, 1, 1]], [[32.54464158739919, -25.504702019913587, -5.168918306144248, 0.9503322466783362, -0.025852117124415337, -0.30980904747516386], [32.129384438561075, -25.977406285447362, -3.3661266064669557, 0.9494618323648202, -0.041759840811735977, -0.31097433236994965], [31.088635118504143, -26.992121838374846, -4.982080598954869, 0.95894999862706, -0.01004698250379127, -0.28137260662086133], [32.648282921103956, -25.340505725453433, -7.3248668447759755, 0.9514520722003186, -0.014551858204227892, -0.3074454982272419], [31.676753400747465, -26.70203434786689, -6.826096827787549, 0.9476120765147134, -0.05513817811978368, -0.3145867612445295], [-38.51544048394347, 21.442104062552218, -5.9263089819139285, -0.9747632489049315, 0.016275704274470632, -0.22250281827315166], [-6.090880193710327, -5.752400331497193, -40.8856810760498, -0.003980970632571914, -0.5995244257161447, -0.799263802783504], [-44.39240268707275, -5.644800238609314, -14.226880350112916, -0.5981231035826599, -0.6479427115516699, -0.4641872336569295], [33.79426557796094, -23.817935780033135, -5.247618684975496, 0.9533782022891047, 0.020915087783464216, -0.30105206692772324]])
[imu process] new cal (-4.0147716172766028, -3.2905107609445574, 2.3046543696766082)

And then

Code:
sphere fit [-4.1839982188711744, -3.746662468441289, 2.2667873746980667, 43.38661798086287]
new bias fit [-3.9389164175120226, -3.2129029410158427, 2.2328408018311174, 43.43809388713666, 0.84611158718553925] 57.7912295569
fit [[-3.9389164175120226, -3.2129029410158427, 2.2328408018311174, 43.43809388713666, 0.84611158718553925], [-4.1839982188711744, -3.746662468441289, 2.2667873746980667, 43.38661798086287], [-4.1839982188711744, -3.746662468441289, 2.2667873746980667, 43.38661798086287, 1, 1]]
insufficient change in bias
sphere fit [-4.1860031220224325, -3.7479515744894929, 2.2662084588645452, 43.38531346701282]
new bias fit [-3.9409133804595631, -3.2140460358894747, 2.2322356869992332, 43.436733416539369, 0.84611607708152214] 57.7917122042
fit [[-3.9409133804595631, -3.2140460358894747, 2.2322356869992332, 43.436733416539369, 0.84611607708152214], [-4.1860031220224325, -3.7479515744894929, 2.2662084588645452, 43.38531346701282], [-4.1860031220224325, -3.7479515744894929, 2.2662084588645452, 43.38531346701282, 1, 1]]
insufficient change in bias

And signalk_client localhost imu/compass_calibration says:
Code:
{"imu/compass_calibration": {"value": [[-4.015, -3.291, 2.305, 43.432, 0.844], [-4.259, -3.813, 2.335, 43.38], [-4.259, -3.813, 2.335, 43.38, 1.0, 1.0]]}}

And the points cloud fits quite well the red sphere, similar to MPU-9255

Does this means that all is working as expected? what about "calibration locked"?
  Reply
#19
It looks like it is working.   I don't know about the other sensors, but I calibrated everything to the mpu9255

It has a very bad magnetic sensor, but it's good enough.  I reduced the noise a lot with my changes to mpu9255.  I didn't optimize the drivers for any other sensor, so it could be that it just has worse data.

I have been trying to use the hmc5280 magnetometer because it should have 3x the resolution
of the one in the mpu9255, but so far, both parts I have are duds.


It automatically calibrates all the time.   It should have enough error checking to prevent really bad fixes from being utilized...   It's a tricky problem, and I'm sure it can be improved.

As for calibration, it should receive boat motions.   If you move it around in your hand
it will not work very well, it should be fixed to the boat, and the boat moving.  After the boat
swings 60 degrees (works even at anchor) then a fix becomes possible.

If you are very careful and can slowly move it away from magnetic distiortions, wires and metal,
then you should be able to calibrate it in your hand as well, but it may still have more noise.


The locking calibration is completely manual right now.  It doesn't lock itself, it's a user setting.  In theory it shouldn't need locking, as the running fix is always best, but this theory isn't proven just yet.
  Reply
#20
It is important for us that we could use more than one IMU model. Despite being optimized for MPU-9255, it seems to me that I am getting good result with LSM9DS0.

After following your moving instructions I get a first fix after less than a minute and I keep getting fixes.
Code:
{"imu/compass_calibration": {"value": [[-4.188, -1.277, 4.439, 42.134, 0.839], [-4.192, -1.287, 4.04, 42.462], [-4.192, -1.287, 4.04, 42.462, 1.0, 1.0]]}}

   

Do you think this is acceptable? I do.

I have already an idea to implement pypilot to openplotter. The plan is to fully implement pypilot in 2 steps.

First I will add a new tab "compass" for pypilot compass/imu management. I will run boatimu.py and I will connect to signalk python server to get values to the main signalk node server. Could you point me to the best way to get data from signalk python server?

Seconf I will add a tool "Autopilot" for the rest of scripts. I will do this when I get the hardware.

e-sailing has developed a way to create the deviation table for your boat and add values to data coming from the IMU. Do you have plans to implement deviations on pypilot or can I apply e-sailing method?
  Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)