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
IMU Calibration using comand line client
Hi there,

I just managed to kind of run the pypilot project. I am using a Pi Zero, running python3.7 in a venv.
I plan on using only the IMU part of the project. I am able to run pypilot_boatimu (both as direct command or as python -m pypilot.boatimu), which constantly outputs pitch/roll/heading. Also I am able to run pypilot_client, which displays a list of values once. or if run with -c it displays that value constantly (-c does not work with every value though). So far so good. 
Now what would be the procedure to initiate accelerometer calibration, aligning and compass calibration using command line pypilot_client? Is that even possible?
I cannot run a gui to do that and I also do not want to run openplotter.

Some Background:
I am in the process of developing a very similar autopilot system, unfortunately i found this project too late. Mine is based around a Redis-Server to distribute different information.  That seems to be a cleaner solution and easier to maintain that the homemade server pypilot uses. My actuator is an old Autohelm ST2000, which failed last season. I replaced its electronics with an arduino and connect it to the pi. The control algorithm is still missing, I fancy some fuzzy-control based algorithm. Anyway I did find out that those IMUs (mine is also a MPU9255) are difficult (in the mathematical sens) to use and calibrate. Here I do like the efforts pypilot has taken and I hope it can be integrated, the approach would be to write a pypilot client that pushes all values to Redis.

Hints appreciated, 
Kind Regards,
The calibration is automatic unless locked.

You can do it without the gui just looking at the calibration age to see if it updates, but easier you run the gui on a different machine.

I have rewritten the server recently to be much more efficient and powerful. What do you intend to gain from the redis server? What is your project called and where is the source code?
Hi Sean,
thanks for your reply. I actually have made some progress.

well the project is still in an early experimental stage and i have not yet pushed it to a public server. It is also very limited to my actuator setup. Probably not much use for other. If I ever get it steering my boat I will be happy to share it.
The redis server is there mostly because I started out with it and I had the need that multiple modules need to share data. It is very simple to use, has a small footprint (less than 5%cpu on a Pi Zero) and has well tested clients in all important environments.

For the calibration, yesterday in the evening I possibly got the accelerometer calibration working. It showed a small age after I moved it in all 6 directions and reported a fix (cant remember the exact message), but after a while it then reports
imu.accel.calibration.log = need more range 0.0024124235272411365
I then did move the sensor again to all 6 directions but the age did not reset again. It however reported having a fix again, which disappeard after a while.
I then mounted the sensor and apparently got the leveling also working by doing pypilot_client imu.alignmentCounter = 100 (found this in the code of the gui). Now my roll and pitch looks correct. The compass is way off.

I took the boat out today for sailing and left pypilot_boatimu running. The trip was mostly the same direction, but at start and beginning I did turn around quite a bit. Also underway the boat rolled probably +-30 deg.
However the compass calibration has not find its fix:

imu.compass = [-100.986, -67.953, -70.107]
imu.compass.calibration = [[-39.542, -89.242, -56.589, 66.502, 74.224], [0.0 ...
imu.compass.calibration.age = 1h 13m 7s
imu.compass.calibration.locked = False
imu.compass.calibration.log = 0d fit, insufficient data 0.6094553698651597 1 ...
imu.compass.calibration.sigmapoints = [[-100.916, -68.843, -69.768], [-100.8 ...

I guess I will try again and see if it can find its fix. Next trip probably on Monday.

Forum Jump:

Users browsing this thread: 1 Guest(s)