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
Heading input over NMEA
#1
Hi,
I have a B&G H2000 on my boat, that currently is outputting pre-filtered heading information at 10hz over NMEA. I want to use this heading in the control loops of the PID instead of the yaw and heading from the IMU. (I haven't fitted the IMU).
I have modified the NMEA.py and sensor.py to receives the heading from NMEA, and I have added the calculation of yaw. I need a tip for where in the code it would be wise to:
- set the heading and yaw from NMEA that is normally calculated in boatimu.py to replacing this calculation?
- and where I would easiest deactivate the IMU module from the code?

My signals from the NMEA compass show nicely in the scope as "compas.heading" and "compas.yaw".
Reply
#2
(2020-05-04, 08:50 AM)CaptDjaahn Wrote: Hi,
I have a B&G H2000 on my boat, that currently is outputting pre-filtered heading information at 10hz over NMEA. I want to use this heading in the control loops of the PID instead of the yaw and heading from the IMU. (I haven't fitted the IMU).
I have modified the NMEA.py and sensor.py to receives the heading from NMEA, and I have added the calculation of yaw. I need a tip for where in the code it would be wise to:
- set the heading and yaw from NMEA that is normally calculated in boatimu.py to replacing this calculation?
- and where I would easiest deactivate the IMU module from the code?

My signals from the NMEA compass show nicely in the scope as "compas.heading" and "compas.yaw".

What did you change in nmea.py?
have another nmea router and want to connect to it.

John
I'm sure I could figure it out but I'm lazy :-)
Reply
#3
(2020-05-04, 03:57 PM)johnm Wrote:
(2020-05-04, 08:50 AM)CaptDjaahn Wrote: Hi,
I have a B&G H2000 on my boat, that currently is outputting pre-filtered heading information at 10hz over NMEA. I want to use this heading in the control loops of the PID instead of the yaw and heading from the IMU. (I haven't fitted the IMU).
I have modified the NMEA.py and sensor.py to receives the heading from NMEA, and I have added the calculation of yaw. I need a tip for where in the code it would be wise to:
- set the heading and yaw from NMEA that is normally calculated in boatimu.py to replacing this calculation?
- and where I would easiest deactivate the IMU module from the code?

My signals from the NMEA compass show nicely in the scope as "compas.heading" and "compas.yaw".

What did you change in nmea.py?
have another nmea router and want to connect to it.

John
I'm sure I could figure it out but I'm lazy :-)

Hello Lazy John ;-)
I have attached the NMEA and sensor.py files. But in short i have added the name of "comaps" in the NMEA_Parses, added the parses function that triggers on "HDM" in the NMEA sentence, added "compas" to the watchlist, last_values list.
In Sensor.py - added the Class compas, added compas to the sensor array in the sensor class.
And that was the easy part.

The deactiviation of the IMU requires a minor re-write of the autopilot.py script?

@ John What do you mean by another NMEA router? NMEA source or multiplexer?


Attached Files
.gz   nmea.tar.gz (Size: 8.09 KB / Downloads: 0)
Reply
#4
I really don't suggest this. Besides heading you absolutely need heading rate. The yaw gyro is critical to performance as is lag. Anything you receive from nmea will be delayed by few hundred milliseconds and it will degrade performance.

For correct alignment and kalman filter all 3 gyros are needed.

Most likely the mpu9255 gives a better heading output than b&g h2000 and it can constantly recalibrate all the time. It cost $4 so what is the reason to not use it?
Reply
#5
(2020-05-05, 05:42 PM)seandepagnier Wrote: I really don't suggest this.   Besides heading you absolutely need heading rate.   The yaw gyro is critical to performance as is lag.   Anything you receive from nmea will be delayed by few hundred milliseconds and it will degrade performance.

For correct alignment and kalman filter all 3 gyros are needed.

Most likely the mpu9255 gives a better heading output than b&g h2000 and it can constantly recalibrate all the time.  It cost $4 so what is the reason to not use it?

Hi,
Its stuck shipment i the Neterlands - due to Corona ;-(
But thanks for the advice.
Reply
#6
(2020-05-05, 04:15 PM)CaptDjaahn Wrote: @ John What do you mean by another NMEA router? NMEA source or multiplexer?

Have old autohelm seatalk wind speed and depth. Have them hooked to shipmodul MiniPlex-3Wi-N2K.
http://www.shipmodul.com/en/miniplex-3.html.
Thanks for the file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)