Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 09-09-2020, 13:53   #1
Registered User

Join Date: Aug 2017
Location: Cape Breton, NS, Canada
Boat: Cape Islander - tour boat
Posts: 30
OpenCPN Heading (HDM) Dashboard precision

Hello all,
I am a great fan of OpenCPN. I am putting together a small heading sensor using an Arduino Nano and a CMPS14. I have it outputting NMEA HDM sentences. It shows up correctly in OpenCPN. PS, if anybody wants my code, PM me.

My question is why is the heading listed in the Dashboard rounded to the nearest whole degree? My sensor is outputting decimal degrees. Is there any way of changing this?

Also, why is the boat on the chart so slow to change direction? It is easily more than 2 seconds. I can see the heading change in the dashboard but the boat/chart don't move. The heading indicator line is turned on, but it doesn't move.

Thanks,
Ian
ian5142 is offline   Reply With Quote
Old 09-09-2020, 14:47   #2
Registered User

Join Date: Aug 2017
Location: Cape Breton, NS, Canada
Boat: Cape Islander - tour boat
Posts: 30
Re: OpenCPN Heading (HDM) Dashboard precision

I did some more testing. It seems that the boat/chart heading indicator only moves when I scroll in or out, or move the chart around with the mouse.
ian5142 is offline   Reply With Quote
Old 09-09-2020, 14:48   #3
Registered User

Join Date: Aug 2017
Location: Cape Breton, NS, Canada
Boat: Cape Islander - tour boat
Posts: 30
Re: OpenCPN Heading (HDM) Dashboard precision

OpenCPN 5.2.0 on Windows 7 by the way.
ian5142 is offline   Reply With Quote
Old 10-09-2020, 00:08   #4
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 3,167
Re: OpenCPN Heading (HDM) Dashboard precision

Ian..
HDT/HDM decimals in Dashboard.
I think the reason is for a small boat, like most of OCPN users have, a decimal degree would be meaningless since the movements are to fast. You don't get the real accuracy of a heading to have significant decimals, so no need to show "false" numbers.

On my own digital compass, CMPS10 and Ardunio, I don't even send decimals. What I did was to round up if the first decimal is more than 0.5 and round down if less.

The course presentation in OCPN can be slightly equalized by the GPS filter in Options->Connections-> "Filter NMEA course and speed data". Check your setting.

And, my opinion, if the heading predictor line would follow every course change each second the presentation would be very "nervous" and even irritating on a pendulous sea.
Håkan
Hakan is offline   Reply With Quote
Old 10-09-2020, 02:11   #5
Registered User
 
Karanga's Avatar

Join Date: Jun 2018
Location: NZ/Aus
Boat: Crowther 85 Catamaran
Posts: 185
Re: OpenCPN Heading (HDM) Dashboard precision

I also have an arduino exporting HDM to OpenCPN, and displaying in Dashboard.

I have dampened my COG and SOG data within Dashboard, to be less "twitchy".

I now have COG and HDM that match some of the time, but are often quite different. Is there some way to harmonise the damping? Presumably it would have to be the Arduino output modified to match whatever COG has been selected in Dashboard settings?

Tim
Karanga is offline   Reply With Quote
Old 10-09-2020, 07:37   #6
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 3,167
Re: OpenCPN Heading (HDM) Dashboard precision

My Arduino compass has a update frequency of about 2 Hz.
OCPN is basically updating every second.
COG and HDM can differ for many reasons. E.g. leeway by wind and current.

If you are turning the COG is slower than the HDM. First of all because it takes time for the boat to turn after the heading is changed and not less is the COG calculation by a GPS lagging. It has to be calculated based on several positions. A dated GPS is slower in calculation than a new one. This I can see when I compare the COG calculated by the AIS with the really dated Garmin 120 GPS.
Hakan is offline   Reply With Quote
Old 10-09-2020, 07:48   #7
Registered User

Join Date: Aug 2017
Location: Cape Breton, NS, Canada
Boat: Cape Islander - tour boat
Posts: 30
Re: OpenCPN Heading (HDM) Dashboard precision

I found my issue. It seems OpenCPN is fine when it has position and heading but not only heading. My arduino is outputting at 10Hz.



Here is my Arduino ino file: https://drive.google.com/file/d/1pk0...ew?usp=sharing


It is adapted from one I found on the net for the CMPS12. I then added the NMEA statements. It currently outputs HDM and XDR (both pitch and roll). Pitch and roll were just added yesterday and not extensively tested.


Thanks,
Ian
ian5142 is offline   Reply With Quote
Old 10-09-2020, 08:37   #8
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 3,167
Re: OpenCPN Heading (HDM) Dashboard precision

Ian..
Good the hear but what's the problem with HDM only? It should direct the ship symbol to line the heading and show a heading prediction line if that's selected. See my pict.

To update the HDM by 10 Hz to OCPN only is so to say "overkill". If you TX it direct to a radar scanner calculating ARPA is would make sense though.

BTW: I saw your program, thanks. One Q: How do you calibrate your deviation and offset on the CMPS14?
Attached Thumbnails
Click image for larger version

Name:	HDM_only.jpg
Views:	30
Size:	28.6 KB
ID:	223132  
Hakan is offline   Reply With Quote
Old 10-09-2020, 09:45   #9
Registered User

Join Date: Aug 2017
Location: Cape Breton, NS, Canada
Boat: Cape Islander - tour boat
Posts: 30
Re: OpenCPN Heading (HDM) Dashboard precision

I don't calculate the deviation or offset at all. Am I supposed to?
ian5142 is offline   Reply With Quote
Old 10-09-2020, 11:55   #10
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 3,167
Re: OpenCPN Heading (HDM) Dashboard precision

Well, I haven't studied the CMPS14 so it may be it has some inbound method for this?
But if you mount it off the boat's center line I suppose it has to adjusted for that.
Deviation can be self adjusted by some devices at start up but I know some has to be rotated in a special manner to trig it. (Like the Moitessier HAT)
Neither is available for my CMPS10 so I've to do it myself in the program.
Hakan is offline   Reply With Quote
Old 10-09-2020, 13:39   #11
Registered User

Join Date: Aug 2017
Location: Cape Breton, NS, Canada
Boat: Cape Islander - tour boat
Posts: 30
Re: OpenCPN Heading (HDM) Dashboard precision

What does your program look like than?
ian5142 is offline   Reply With Quote
Old 11-09-2020, 06:44   #12
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 3,167
Re: OpenCPN Heading (HDM) Dashboard precision

Ian..
My pgm attached but there would be a better method for the deviation. There's one for the CMPS10 but it's more adapted for robots than a boat so it's not practical. But check the specifications for your CMPS14 for how to perform the calibration.

As can be seen my deviation is based on a manual deviation table constructed on board while sailing in protected waters.
Håkan
Attached Files
File Type: pdf Compass_cmps10_Momo.ino_ver1.7..pdf (95.0 KB, 18 views)
Hakan is offline   Reply With Quote
Old 11-09-2020, 08:54   #13
Registered User

Join Date: Aug 2017
Location: Cape Breton, NS, Canada
Boat: Cape Islander - tour boat
Posts: 30
Re: OpenCPN Heading (HDM) Dashboard precision

Isn't deviation only needed when outputting HDT? My sketch only outputs HDM. I only use Mag headings any way.
ian5142 is offline   Reply With Quote
Old 11-09-2020, 09:55   #14
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 3,167
Re: OpenCPN Heading (HDM) Dashboard precision

No, deviation is a compass error caused by surrounding magnetic material like iron.
Variation or declination is caused by the ambulant magnetic north pole corrected by the WMM table, like in OCPN inbound plugin, to get HDT.
Hakan is offline   Reply With Quote
Old 11-09-2020, 16:27   #15
Registered User

Join Date: Aug 2017
Location: Cape Breton, NS, Canada
Boat: Cape Islander - tour boat
Posts: 30
Re: OpenCPN Heading (HDM) Dashboard precision

Here is my code as it stands now: https://github.com/ian5142/Arduino_CMPS14_NMEA


I have Pitch, roll and heading working like they should. 10Hz output.



I did not do any deviation calculations because nothing on our boat is calibrated (old fashioned magnetic compass, etc). Heck our magnetic compass is within 20cm of the radio, depth sounder and GPS. Radar display (CRT type) is only about 1m away. If I extend the USB cable, I will put the Arduino up away from the helm station near the bow. See photos of our boat here: https://birdisland.net/bestboat/


In my case this is all going into a Panasonic Toughbook CF-31, Third Gen i5 processor. I have computational power to spare. It is not running on a Raspberry Pi. I plan on adding a Raspberry Pi 4B to handle the multiplexing (Toughbook only has one accessible USB port). I will write a Java program for that though. I know I could just buy a USB hub but what is the fun in that.
ian5142 is offline   Reply With Quote
Reply

Tags
enc, head, opencpn

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TRUE heading shows 372 degrees when MAG Heading is 359...? PeterKissam OpenCPN 7 20-02-2019 10:46
Dashboard - Mag Heading rgleason OpenCPN 35 06-09-2017 00:20
For Sale: Newmar HDM 30 Battery Charger/Converter 120v AC shore power to 12v DC redpointist Classifieds Archive 0 18-01-2016 11:25
Custom NMEA Sentences-convert HDG in HDM Madden OpenCPN 3 25-05-2015 20:21
Opencpn 2.2 Build 823 Crashes when Dashboard Is Opened in Ubuntu tebsin OpenCPN 1 24-08-2010 14:16

Advertise Here


All times are GMT -7. The time now is 22:57.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2021, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.