Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 07-05-2018, 07:21   #166
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,634
Images: 2
Re: New Plugin NmeaConvertor

PS: What seatalk converter do you have?
rgleason is offline   Reply With Quote
Old 07-05-2018, 10:34   #167
Registered User
 
Viking Sailor's Avatar

Join Date: Nov 2006
Location: San Francisco Bay
Boat: Fantasia 35
Posts: 1,251
Re: New Plugin NmeaConvertor

Quote:
Originally Posted by RhythmDoctor View Post
You can use that if you prefer. But two years from now, when something breaks and I'm trying to figure out wth I was doing, or if someone else is trying to figure out what I was doing, -180/3.14159265 is immediately recognizable as the needed conversion between degrees and radians. Sometimes the fewest keystrokes is not the cleanest code.

That's the same reason I used the unfactored Pythagorean theorem, instead of trying to reduce the terms using cos^2(x)+sin^2(x)=1 (like my trigonometry teacher would have demanded). It's just easier to see and debug.
Sorry!

I just thought you didn't know any better and didn't want you to look like a fool.

Viking Sailor is offline   Reply With Quote
Old 07-05-2018, 11:22   #168
Registered User

Join Date: Jan 2011
Posts: 670
Re: New Plugin NmeaConvertor

Quote:
Originally Posted by Viking Sailor View Post
Sorry!

I just thought you didn't know any better and didn't want you to look like a fool.

No problem, your suggestion is fine. It’s all a matter of preference. Wouldn’t be the first time I looked like a fool. Nice to know you’ve got my back!

I’ll respond to the others’ questions later when I have more time.
__________________
Please support OpenCPN by donating through Paypal!
RhythmDoctor is offline   Reply With Quote
Old 07-05-2018, 12:52   #169
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: New Plugin NmeaConvertor

The rad and deg functions are part of the package. You can test by using a formula of deg(rad(90))

It should produce pretty close to 90.0.
transmitterdan is offline   Reply With Quote
Old 07-05-2018, 19:56   #170
Registered User

Join Date: Jan 2011
Posts: 670
Re: New Plugin NmeaConvertor

Quote:
Originally Posted by rgleason View Post
PS: What seatalk converter do you have?
vYacht router (Seatalk+NMEA0183 version). It's since been replaced by a version that also speaks NMEA2000. https://vyacht.net/

Quote:
Originally Posted by transmitterdan View Post
The rad and deg functions are part of the package. You can test by using a formula of deg(rad(90))

It should produce pretty close to 90.0.
Thanks for the tip! Here are the new/improved equations:

Generic variables:

TWA=90-deg(atan((AWS*cos(rad(AWA))-SOG)/AWS*sin(rad(AWA))))

TWS=sqrt(sqr(AWS*sin(rad(AWA)))+sqr(AWS*cos(rad(AW A))-SOG))

Seatalk - vYacht dialect:

TWA=90-deg(atan(($GPVWR3*cos(rad($GPVWR1))-$GPRMC7)/$GPVWR3*sin(rad($GPVWR1))))

TWS=sqrt(sqr($GPVWR3*sin(rad($GPVWR1)))+sqr($GPVWR 3*cos(rad($GPVWR1))-$GPRMC7))

NmeaConverter Sentences

Seatalk - vYacht dialect:

$XXVWT,90-deg(atan(($GPVWR3*cos(rad($GPVWR1))-$GPRMC7)/$GPVWR3*sin(rad($GPVWR1)))),$GPVWR2,sqrt(sqr($GPVW R3*sin(rad($GPVWR1)))+sqr($GPVWR3*cos(rad($GPVWR1) )-$GPRMC7)),$GPVWR4,,,,<return>

ZZZ’s dialect (Simrad?):

$XXMWV,90-deg(atan(($WIMWV3*cos(rad($WIMWV1))-$GPRMC7)/$WIMWV3*sin(rad($WIMWV1)))),T,sqrt(sqr($WIMWV3*sin (rad($WIMWV1)))+sqr($WIMWV3*cos(rad($WIMWV1))-$GPRMC7)),N,A
__________________
Please support OpenCPN by donating through Paypal!
RhythmDoctor is offline   Reply With Quote
Old 07-05-2018, 20:16   #171
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: New Plugin NmeaConvertor

Here is a list of all functions supported by the underlying equation engine:

Code:
 *  Math functions
 *      - abs : the absolute value, it removes the sign
 *      - ceil : the smallest integer greater than or equal to x
 *      - cub : x^3, safe way to compute such an exponent
 *      - deg : converts from radian to degree
 *      - exp : the exponential value
 *      - hvi : Heaviside's function, =0 if x<0, =1 if x>=0
 *      - int : the largest integer less than or equal to x
 *      - inv : inverts, 1/x
 *      - ln : the neperian logarithm
 *      - log : the logarithm base 10
 *      - rad : converts from degree to radian
 *      - sgn : the sign, -1 or +1. Zero returns +1.
 *      - sqr : x^2, safe way to compute such an exponent
 *      - sqrt : the root square
 *
 *  Trigonometric functions
 *      - acos : the secant (inverse of cosine)
 *      - acsh : the inverse of the hyperbolic cosine
 *      - asin : the cosecant (inverse of sine)
 *      - asnh : the inverse of the hyperbolic sine
 *      - atan : the cotangent (inverse of tangent)
 *      - atnh : the inverse of the hyperbolic tangent
 *      - cos : the cosine
 *      - cosh : the hyperbolic cosine
 *      - sin : the sine
 *      - sinc : the cardinal sine (radian)
 *      - sinh : the hyperbolic sine
 *      - tan : the tangent
 *      - tanh : the hyperbolic tangent
transmitterdan is offline   Reply With Quote
Old 08-05-2018, 05:20   #172
Registered User

Join Date: Jan 2011
Posts: 670
Re: New Plugin NmeaConvertor

Quote:
Originally Posted by RhythmDoctor View Post

NmeaConverter Sentences

...

ZZZ’s dialect (Simrad?):

$XXMWV,90-deg(atan(($WIMWV3*cos(rad($WIMWV1))-$GPRMC7)/$WIMWV3*sin(rad($WIMWV1)))),T,sqrt(sqr($WIMWV3*sin (rad($WIMWV1)))+sqr($WIMWV3*cos(rad($WIMWV1))-$GPRMC7)),N,A
I forgot to mention: I have not tested this revision of ZZZ's sentence, since I don't have the right VDR script. It would be good if someone else tested it.
__________________
Please support OpenCPN by donating through Paypal!
RhythmDoctor is offline   Reply With Quote
Old 08-05-2018, 19:00   #173
Registered User

Join Date: Jan 2011
Posts: 670
Re: New Plugin NmeaConvertor

Quote:
Originally Posted by RhythmDoctor View Post
Quote:
Originally Posted by RhythmDoctor View Post
ZZZ’s dialect (Simrad?):

$XXMWV,90-deg(atan(($WIMWV3*cos(rad($WIMWV1))-$GPRMC7)/$WIMWV3*sin(rad($WIMWV1)))),T,sqrt(sqr($WIMWV3*sin (rad($WIMWV1)))+sqr($WIMWV3*cos(rad($WIMWV1))-$GPRMC7)),N,A
I forgot to mention: I have not tested this revision of ZZZ's sentence, since I don't have the right VDR script. It would be good if someone else tested it.
After some additional work tonight, I am concerned that this sentence in ZZZ's "dialect" of NMEA will fail except in certain quadrants of wind direction. The (obsolete) VWR and VWT sentences report angles from 0-180 with an additional parameter for L (left) or R (right). Fortunately, the Dashboard plugin recognized this and displays correctly.

But the newer MWV sentence syntax reports direction as 0-360° with no L or R provided. This creates a uniqueness issue for any use of the atan() function. tan(45°) =1. But tan (225°)=1 also. Conversely, atan(1) could be 45° or 225°. The answer is not unique without further information on the quadrant (such as L or R, which is provided by the obsolete VWR/VWT sentences).

Maybe this is why ZZZ's equation worked for others, but not for me (although the value > 1 within the atan() function still raises alarm bells). Perhaps my equation works for the obsolete VWR/VWT sentences, but ZZZ's equation is needed for MWV sentences.

Eventually, I suggest that examples of both types of sentences be included in the Wiki, but only after further testing. That testing must be sure to include wind angles from all four quadrants for a complete test.
__________________
Please support OpenCPN by donating through Paypal!
RhythmDoctor is offline   Reply With Quote
Old 08-05-2018, 19:19   #174
Registered User

Join Date: Jan 2011
Posts: 670
Re: New Plugin NmeaConvertor

By the way, I found an error in the wiki for NmeaConverter:

Quote:
3. Do math-Convert units, e.g. Centigrade to Fahrenheit
But what if I was living in the US and prefered the reading to be in degrees Fahrenheit? Just change the format to:

$XXMTA, 5 / 9 * $WIMDA5 + 32, F
The equation should be 9/5, not 5/9. Also, I suggest taking out the excess spaces, since that may cause problems of people paste the equation in to the plugin.

I'd make this change myself, but my login no longer works.
__________________
Please support OpenCPN by donating through Paypal!
RhythmDoctor is offline   Reply With Quote
Old 09-05-2018, 07:22   #175
Registered User

Join Date: Jan 2018
Posts: 6
Re: New Plugin NmeaConvertor

I am trying to show the Leeway (field2 of VMVBW) value as a DPT instrument. I setup NMEAConverter like this: $XXDPT,VMVBW2 The NMEAConverter shows the values updating, but when i set a Depth gauge up in OpenCPN I get no data. Any idea what I am doing wrong?

Thanks!
knowconcept is offline   Reply With Quote
Old 09-05-2018, 07:44   #176
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 4,742
Re: New Plugin NmeaConvertor

Rhythmdoctor,

done,

and btw.: the formula is correct in the window of the Wiki screenshot..
Attached Thumbnails
Click image for larger version

Name:	Captura de pantalla 2018-05-09 a las 16.41.52.png
Views:	88
Size:	206.9 KB
ID:	169493  
bcn is online now   Reply With Quote
Old 09-05-2018, 08:00   #177
Registered User

Join Date: Jan 2011
Posts: 670
Re: New Plugin NmeaConvertor

Quote:
Originally Posted by knowconcept View Post
I am trying to show the Leeway (field2 of VMVBW) value as a DPT instrument. I setup NMEAConverter like this: $XXDPT,VMVBW2 The NMEAConverter shows the values updating, but when i set a Depth gauge up in OpenCPN I get no data. Any idea what I am doing wrong?

Thanks!
My tranducer puts out DBT, not DPT, so take this with a grain of salt:

DBT sentences have additional parameters that indicate units. For example:

$GPDBT,47.90,f,14.60,M,,

It's possible that without a valid parameter to indicate units, O will not display it.

It might be totally different for DPT, but I'd first try to enter units. Of course, if you enter N (typical abbreviation for kNots), it might refuse to accept it, since that's not a valid depth unit.
__________________
Please support OpenCPN by donating through Paypal!
RhythmDoctor is offline   Reply With Quote
Old 09-05-2018, 08:27   #178
Registered User

Join Date: Jan 2018
Posts: 6
Re: New Plugin NmeaConvertor

Awesome and Thank you! It required the entire sentence which makes sense. This is what I did: $XXDBT,1.1,f,VMVBW2,M,3.3,F
knowconcept is offline   Reply With Quote
Old 09-05-2018, 10:24   #179
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: New Plugin NmeaConvertor

DBT means depth below transducer. An offset is needed to get water depth from the surface (DPT). Just FYI.

O should display DPT if it is available.
transmitterdan is offline   Reply With Quote
Old 09-05-2018, 11:28   #180
Registered User

Join Date: Jan 2011
Posts: 670
Re: New Plugin NmeaConvertor

Quote:
Originally Posted by transmitterdan View Post
DBT means depth below transducer. An offset is needed to get water depth from the surface (DPT). Just FYI.

O should display DPT if it is available.
Yes, I am aware of that, DBT and DPT are different things, as I pointed out. My SeaTalk network is only reporting DBT at this time.

I have an offset programmed into the depth instrument, but it’s not reporting DPT on Seatalk. I can make my autopilot display depth, and it shows the value corrected for offset, so the DPT value is definitely going onto SeaTalk network (otherwise the autopilot wouldn’t display it), but I think it’s reporting the DPT value in the DBT sentence.

I’ll have to wait until the boat is in the water before I figure this out.
__________________
Please support OpenCPN by donating through Paypal!
RhythmDoctor is offline   Reply With Quote
Reply

Tags
nmea, plug


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
Calculator_pi New Finished Plugin for OpenCPN SaltyPaws OpenCPN 136 28-12-2022 07:19
New IAC Fleetcode Plugin for OpenCPN CBorchardt OpenCPN 77 23-04-2019 05:40
New Plugin Development on Linux globalkeith OpenCPN 5 03-05-2012 07:16
New History Plugin for OpenCPN seandepagnier OpenCPN 11 04-10-2010 14:11

Advertise Here


All times are GMT -7. The time now is 13:40.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.