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:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New IMU BerryGPS-IMUv4
#1
Hi 
I am trying to get the BerryGPS-IMUv4 working with pypilot, which uses LSM6DSL + LIS3MDL.

LSM6DSL isnt recognised by RTIMULib2, but the LSM6DS33 is.
These chips are basically the same, they using the same registers.    The LSM6DSL has a lot more, but aren't needed for basic functionality.  They do however have different responses to the WHO_AM_I register. (this is why RTIMULib2 doesn't recognise it)

I was able to get RTIMULib2 to recognise the LSM6DSL, by downloaded the code, changing the response for the "WHO" register for the LSM6DS33 to match the LSM6DSL and then complying and installing. 

If I run RTIMULib2 (RTIMULibDemo) from the command line, it recognises the IMU and works well.
However, if i run pypilot, i get "IMU not detected"

I made sure RTIMULib2.ini has been updated under ~/.pypilot   And manually set the IMU type.

Code:
#   12 = STM LSM6DS33 + LIS3MDL
#   13 = HMC5883L + ADXL345 + L3G4200D
IMUType=12

It would be great if we got this chip working as we have a lot of people asking to to get it working with OpenPlotter 

BTW:We are using the OpenPlotter basic starter image


Thanks in dance!
Mark
Reply
#2
If I can see your rtimulib2 diff it would help because I also support the ism330dhcx in a similar way as the lsm6ds33

are there any other differences besides whoami?
Reply
#3
(2021-06-04, 03:27 AM)seandepagnier Wrote: If I can see your rtimulib2 diff it would help because I also support the ism330dhcx in a similar way as the lsm6ds33

are there any other differences besides whoami?

it was a very small change, in  /home/pi/RTIMULib2/RTIMULib/IMUDrivers/RTIMUDefs.h
I changed the below line from 0x69  to 0x6a.  This made RTIMULib think it had a LSM6DS33 connected and not through an error


Code:
#define LSM6DS33_ID                 0x6a
Reply
#4
Hi Sean and Mark
Just wondering if there has been any progress on moving this forward?
Thank you!
Reply
#5
I have made changes:

https://github.com/seandepagnier/RTIMULi...ddece6dad2

I don't have the hardware to test, please check it.
Reply
#6
Thanks Sean
I cloned your RTIMUlib2 repo onto a clean openplotter start image, compiled and installed.

I can run RTIMULibDemo without problems, it gets readings from the IMU

However, pypilot still isnt working.

How does pypilot use RTIMULib2?
Reply
#7
you probably need to run "sudo python3 setup.py install" from the python directory of rtimulib2
Reply
#8
Okay, I just did that, and still no difference to pypilot


RTIMULib now detects the IMU, both with the binaries and python.
See below example of python working


Code:
pi@openplotter:~/.pypilot $ python Fusion.py
Using settings file RTIMULib.ini
Settings file RTIMULib.ini loaded
Using fusion algorithm RTQF
IMU Name: LSM6DS33 + LIS3MDL
min/max compass calibration not in use
Ellipsoid compass calibration not in use
Accel calibration not in use
LSM6DS33LIS3MDL init complete
IMU Init Succeeded
Recommended Poll Interval: 3mS

r: 0.703446 p: -13.372098 y: 74.293518
r: 0.792122 p: -13.613783 y: 73.986604
r: 1.503362 p: -14.866170 y: 73.277247
r: 1.722301 p: -15.251744 y: 73.509966



Even though i was manually setting the IMU in   ~/.pypilot/RTIMULib.ini  PyPilot still was show "auto discover".

I downloaded the source and noticed that PyPilot is looking for ~/.pypilot/RTIMULibTemp.ini

I updated it so it would use the none "temp" ini file,
Code:
self.imuDetected.SetLabel(_('none'))
#SETTINGS_FILE = "RTIMULibTemp"
SETTINGS_FILE = "RTIMULib"
s = RTIMU.Settings(SETTINGS_FILE)
compiled and installed.
pypilot now shows detected imu as STM LSM6DS33 + LISMDL as this is what i specified in the ini file.  But it still isnt working reading the IMU
Reply
#9
are you sure you are using python3 for everything?

python is maybe python2

Try:
cd pypilot/pypilot
python3 boatimu.py
Reply
#10
(2021-06-10, 06:45 AM)Mark_OzzMaker Wrote: Okay, I just did that, and still no difference to pypilot


RTIMULib now detects the IMU, both with the binaries and python.
See below example of python working


Code:
pi@openplotter:~/.pypilot $ python Fusion.py
Using settings file RTIMULib.ini
Settings file RTIMULib.ini loaded
Using fusion algorithm RTQF
IMU Name: LSM6DS33 + LIS3MDL
min/max compass calibration not in use
Ellipsoid compass calibration not in use
Accel calibration not in use
LSM6DS33LIS3MDL init complete
IMU Init Succeeded
Recommended Poll Interval: 3mS

r: 0.703446 p: -13.372098 y: 74.293518
r: 0.792122 p: -13.613783 y: 73.986604
r: 1.503362 p: -14.866170 y: 73.277247
r: 1.722301 p: -15.251744 y: 73.509966



Even though i was manually setting the IMU in   ~/.pypilot/RTIMULib.ini  PyPilot still was show "auto discover".

I downloaded the source and noticed that PyPilot is looking for ~/.pypilot/RTIMULibTemp.ini

I updated it so it would use the none "temp" ini file,
Code:
self.imuDetected.SetLabel(_('none'))
#SETTINGS_FILE = "RTIMULibTemp"
SETTINGS_FILE = "RTIMULib"
s = RTIMU.Settings(SETTINGS_FILE)
compiled and installed.
pypilot now shows detected imu as STM LSM6DS33 + LISMDL as this is what i specified in the ini file.  But it still isnt working reading the IMU

Hi Mark
Just wondering if there has been any progress on moving this forward?
Thank you!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)