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
MPU-9250 instead of MPU-9255?
#11
(2018-07-24, 02:48 PM)seandepagnier Wrote: If it works with openplotter it should work with tinypilot because the driver is the same.

There is a bug in tinypilot that if you change to a different sensor, it won't work.  If you delete RTIMULib.ini it will work again.  I will correct this soon, I am currently working on supporting more sensors.   the library may technically detect them and give data, but many sensors need to calibrate the accelerometer bias unlike mpu925x.

The new mpu9255 with orange (not yellow) capacitor also need accelerometer bias calibrated, so beware of this.  Currently I have some that have bias so far wrong (more than 1 g)  that they saturate the 2g range even when perfectly still.   This needs additional work to automatically switch to 4g range in the driver, and will lose a bit of precision (which should be ok)

So at the moment I suggest only mpu9250/mpu9255 with yellow capacitor or otherwise factory calibrated accelerometer (range .098 to 1.02 g)   but I will support other sensors soon, and it requires additional calibration for accelerometer bias.

The new IMU arrived, and after some struggles it was working.
Was, because when I did the update to 1.1.0 Alpha, the mpu-9250 is detected, but all the variables say n/a when I go to calibration.

Switching back to 1.0.0 made it work again.
And when the calibration is stable I have to lock it immediately, because after a while it starts misbehaving again (values all over the range)

Is this the Yellow one?
   
Reply
#12
Not sure the problem with alpha, but since v1.0.0 the calibration in pypilot was improved.

I think you have the good sensor. You can scope the accel output, and see that each sensor gives output in the range of +- 1. If it goes from -0.9 to 1.1 or something like this, then it needs calibration,
Reply
#13
Please check if you have any error output.
open a terminal and type openplotter. Go to pypilot tab, press restart and watch the terminal.
Reply
#14
This is the output from version 1.0.0 when the sensor values are going all around...


pi@openplotter:~ $ openplotter
No pressure sensor detected
No pressure sensor detected4
Settings file RTIMULib.ini loaded
Using fusion algorithm RTQF
read_sensors_d waiting for signal to exit
launched pypilot pid 32058
connect failed to localhost:21311
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
failed to open special file /dev/watchdog0 for writing:
autopilot cannot strobe the watchdog
connected to gpsd
Settings file RTIMULib.ini loaded
Using settings file RTIMULib.ini
Using fusion algorithm Kalman STATE4
IMU Name: MPU-925x
min/max compass calibration not in use
Using ellipsoid compass calibration
Accel calibration not in use
autopilot failed to read imu at time: 1532541241.11
servo probe... (u'/dev/ttyOP_pymotor', 38400)
connect failed to localhost:21311
arduino servo found on (u'/dev/ttyOP_pymotor', 38400)
serialprobe success: /home/pi/.pypilot/servodevice {u'path': u'/dev/ttyOP_pymotor', u'bauds': [38400]}
servo is running too _slowly_ 0.057953119278
MPU-925x init complete
autopilot failed to read imu at time: 1532541241.31
arduino server buffer overflow
arduino server buffer overflow
connect failed to localhost:21311
nmea client connected
listening on port 20220 for nmea connections
connected

And here is the output from 1.1.0:
pi@openplotter:~ $ openplotter
No pressure sensor detected
No humidity sensor detected
No pressure sensor detected
No humidity sensor detected
read_sensors_d waiting for signal to exit
Settings file RTIMULib.ini loaded
Using fusion algorithm RTQF
launched pypilot pid 2886
connect failed to localhost:21311
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
failed to open special file /dev/watchdog0 for writing:
autopilot cannot strobe the watchdog
connected to gpsd
Settings file RTIMULib.ini loaded
Using settings file RTIMULib.ini
Using fusion algorithm Kalman STATE4
IMU Name: MPU-925x
min/max compass calibration not in use
Using ellipsoid compass calibration
Accel calibration not in use
connect failed to localhost:21311
autopilot failed to read imu at time: 1532543028.0
Traceback (most recent call last):
File "/usr/local/bin/pypilot", line 11, in <module>
load_entry_point('pypilot==0.1', 'console_scripts', 'pypilot')()
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/basic_autopilot.py", line 108, in main
ap.run()
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 178, in run
self.iteration()
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 317, in iteration
self.servo.poll()
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/servo.py", line 427, in poll
device_path = serialprobe.probe('servo', [38400], 1)
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/serialprobe.py", line 195, in probe
devices = enumerate_devices()
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/serialprobe.py", line 105, in enumerate_devices
devices = scan_devices()
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/serialprobe.py", line 89, in scan_devices
if os.path.realpath(devices) in allowed_serial_ports:
File "/usr/lib/python2.7/posixpath.py", line 375, in realpath
path, ok = _joinrealpath('', filename, {})
File "/usr/lib/python2.7/posixpath.py", line 381, in _joinrealpath
if isabs(rest):
File "/usr/lib/python2.7/posixpath.py", line 54, in isabs
return s.startswith('/')
AttributeError: 'list' object has no attribute 'startswith'
got signal atexit cleaning up
got signal 15 cleaning up
Process GpsProcess-4:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
got signal 15 cleaning up
Process NmeaBridgeProcess-5:
self.run()
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/gpsdpoller.py", line 63, in gps_process
self.read(pipe)
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/gpsdpoller.py", line 37, in read
gpsdata = self.gpsd.next()
File "/usr/lib/python2.7/dist-packages/gps/gps.py", line 326, in next
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/nmea.py", line 545, in process
if self.read() == -1:
File "/usr/lib/python2.7/dist-packages/gps/gps.py", line 312, in read
status = gpscommon.read(self)
File "/usr/lib/python2.7/dist-packages/gps/client.py", line 84, in read
frag = self.sock.recv(4096)
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 92, in cleanup
time.sleep(2)
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 92, in cleanup
raise KeyboardInterrupt # to get backtrace on all processes
raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
KeyboardInterrupt
got signal 15 cleaning up
Process Process-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
got signal 15 cleaning up
got signal 17 cleaning up
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
self.run()
func(*targs, **kargs)
File "/usr/lib/python2.7/multiprocessing/util.py", line 325, in _exit_function
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
Process Process-2:
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/signalk/pipeserver.py", line 153, in pipe_server_process
p.join()
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 145, in join
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
res = self._popen.wait(timeout)
File "/usr/lib/python2.7/multiprocessing/forking.py", line 154, in wait
time.sleep(.1)
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 92, in cleanup
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/calibration_fit.py", line 450, in CalibrationProcess
p = points.recv(1)
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/signalk/pipeserver.py", line 35, in recv
if self.pollin.poll(1000.0*timeout):
got signal 17 cleaning up
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 92, in cleanup
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 30, in _run_exitfuncs
traceback.print_exc()
File "/usr/lib/python2.7/traceback.py", line 233, in print_exc
print_exception(etype, value, tb, limit, file)
File "/usr/lib/python2.7/traceback.py", line 125, in print_exception
raise KeyboardInterrupt # to get backtrace on all processes
print_tb(tb, limit, file)
KeyboardInterrupt
File "/usr/lib/python2.7/traceback.py", line 69, in print_tb
line = linecache.getline(filename, lineno, f.f_globals)
File "/usr/lib/python2.7/linecache.py", line 14, in getline
lines = getlines(filename, module_globals)
File "/usr/lib/python2.7/linecache.py", line 41, in getlines
return updatecache(filename, module_globals)
File "/usr/lib/python2.7/linecache.py", line 132, in updatecache
lines = fp.readlines()
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 92, in cleanup
raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
MPU-925x init complete
got signal 15 cleaning up
Process Process-3:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/boatimu.py", line 71, in imu_process
if not rtimu.IMUInit():
File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 92, in cleanup
raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
pypilot exited
stopping pypilot pid: 2886
exception stopping pypilot [Errno 3] No such process
pypilot thread exiting
Reply
#15
I think you just found a bug. Thanks. I have corrected now in github.
Reply
#16
I will add the changes in next openplotter update. Please test these changes manually:

Code:
cd
mkdir delete
cd delete
git clone https://github.com/pypilot/pypilot
git clone https://github.com/pypilot/pypilot_data
cp -rv pypilot_data/* pypilot
cd pypilot
python setup.py build
sudo python setup.py install
cd
sudo rm -rf delete

And report please.
Reply
#17
I am working on more changes all the time. I just incorporated accelerometer calibration but I need to improve it more. This will allow for a much wider variety of sensors to actually work well besides the factory calibrated mpu9255.
Reply
#18
OK, please notify us when we can test.
Reply
#19
(2018-07-26, 06:17 PM)Sailoog Wrote: I will add the changes in next openplotter update. Please test these changes manually:

Code:
cd
mkdir delete
cd delete
git clone https://github.com/pypilot/pypilot
git clone https://github.com/pypilot/pypilot_data
cp -rv pypilot_data/* pypilot
cd pypilot
python setup.py build
sudo python setup.py install
cd
sudo rm -rf delete

And report please.

Works like a charm! Thank you!

Well ok, for five minutes....
Than it starts behaving like the problem in 1.0.0:
There seems to be an oscillation somewhere... possibly in the auto calibration?
The sailboat in the calibration imu picture turns around in all directions,
on the scope it looks like this:
   

So, the problem introduced in 1.1.0 seems to be solved, but now I am back to the old problem....
Reply
#20
I switched over to an IMU I received yesterday, and that stayed stable for about two hours.
After that it slowly started drifting at first, and after moving it around the behaviour of slow oscillation started again.
So I pressed reset on the pypilot tab of openplotter and after recallibration I now locked the calibratiion (the i is a typo on the compass tab of the calibration pop-up) and am now testing how long it will remain stable.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)