OpenMarine
Connect IMU to pyPilot through TTL over USB - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: Pypilot (https://forum.openmarine.net/forumdisplay.php?fid=17)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=18)
+--- Thread: Connect IMU to pyPilot through TTL over USB (/showthread.php?tid=3275)



Connect IMU to pyPilot through TTL over USB - pdrost - 2021-02-13

I've got a MPU9255 that communicates via TTL and not I2C (WIT-motion  WT901C TTL). I connect this IMU to my OpenPlotter RPI 3B+ via a TTL to USB and it is detected as a serial connection. 
Is i possible to get pypilot to use this IMU instead of the one I have connected through I2C, because I want to remove the IMU from electromagnetic interference and position it close to the center of motion on my boat.


RE: Connect IMU to pyPilot through TTL over USB - seandepagnier - 2021-02-14

you could also use i2c for a few meters usually, and repeaters are also possible.

Anyway, it's not a problem directly on the pi. You could use ttl or usb sensors but I don't recommend usb because of latency. So I don't have a great solution since the pi has only one hardware serial port. The pi4 has more uart.


RE: Connect IMU to pyPilot through TTL over USB - Onno - 2021-02-14

Andreas29 has made a IMU/I2C extention:
https://forum.openmarine.net/showthread.php?tid=3137


RE: Connect IMU to pyPilot through TTL over USB - Ralph - 2023-03-24

Hello,
There is a "App" for SignalK about the WT901 (WIT Motion IMU)
The App is : signalk-hwt901b-imu-plus (You can find in the AppStore of SignalK)
It works great.

Is it possible for PyPilot the get the data (Roll, Pitch ... Magnetic Compass ...) from SignalK instead of a connected I2C MPU-9250/6500 ?


RE: Connect IMU to pyPilot through TTL over USB - seandepagnier - 2023-03-24

It is not implemented. With software it would be possible but I hesitate because this could ruin the performance of the autopilot.

The reason is due to both undefined lag from getting sensor updates in this way which could vary, as well as reliability. Adding any delay from the time the gyro is sampled to when the autopilot can command the rudder to react will degrade performance. Using signalk with a network could make the lag-time highly variable which would further degrade things and make tuning even more difficult.

I want to ensure everyone has the best performance within reason, so the process that reads the IMU using i2c is realtime scheduled meaning no other processes can interrupt or get in its way. The signalk handling in pypilot is not realtime scheduled and doesnt need to be. Using signalk rather than i2c directly here could significantly degrade performance, and even if all the relevant processes were realtime scheduled, there would always be more lag even if all the connections were local. I really really want to avoid people sending the gyro signals over some kind of wireless network which this would allow as it would give pypilot a bad reputation for performance and reliability. This is also the reason why sending inertial sensors over nmea0183 is not supported.


RE: Connect IMU to pyPilot through TTL over USB - Ralph - 2023-03-24

Hi Sean,
Thank for the answer. I do understand and think you're right about the performance issue.
Thanks again for all.


RE: Connect IMU to pyPilot through TTL over USB - Gui Ramalho - 2023-06-28

There is a version of this sensor that has an I2C interface (WT901) can I use this ?