JBperf GPS - CAN format info?

Testing and development of Megasquirt 3

Moderators: jsmcortina, muythaibxr

Post Reply
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

JBperf GPS - CAN format info?

Post by MWPau »

Hi all,

The MS3 supports requesting GPS data via CAN using the "JBperf GPS" option.
Is there any info anywhere on the data format / locations?

I want to supply GPS data to my MS3 from my DIY dash display.

Thanks.
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: JBperf GPS - CAN format info?

Post by racingmini_mtl »

The is the extract from the IOx ini file related to the GPS data read by the MS3:

Code: Select all

   gps_latdeg       = scalar, S08,  128, "", 1,0
   gps_latmin       = scalar, U08,  129, "", 1,0
   gps_latmmin      = scalar, U16,  130, "", 1,0
   gps_londeg       = scalar, U08,  132, "", 1,0
   gps_lonmin       = scalar, U08,  133, "", 1,0
   gps_lonmmin      = scalar, U16,  134, "", 1,0
   gps_outstatus    = scalar, U08,  136, "", 1,0
   gps_altk         = scalar, S08,  137, "", 1,0
   gps_altm         = scalar, S16,  138, "", 0.1,0
   gps_speedms      = scalar, U16,  140, "", 0.1,0
   gps_course       = scalar, U16,  142, "", 0.1,0
The offset you see is the one used by the IOx so you can change that but the relative position and the scaling have to be respected for the MS3 to be able to read the data correctly.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

Re: JBperf GPS - CAN format info?

Post by MWPau »

Ah ha!
I didnt think to look there, thanks.

Now to work out what gps_outstatus represents.
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: JBperf GPS - CAN format info?

Post by racingmini_mtl »

This:

Code: Select all

  unsigned char gps_outstatus;// bit 0 : 0=E, 1=W; bit 1 : 0=invalid data, 1=valid data; bits 2, 3 TBD; bits 4-7 : frame counter
Since the longitude can't fit in a signed 8-bit variable (0-180 degrees east or west), there is a bit in the status to specify if it's east or west. The second bit specifies if the GPS has locked onto satellites and is generating valid data. The upper nibble (4 bits) is for a counter that tells the MS3 if the data it read has been updated or if it's just the same data or if a frame has been missed. It goes from 0 to 15 and rolls back to 0.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

Re: JBperf GPS - CAN format info?

Post by MWPau »

Perfect, thanks again Jean!
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
xrattiracer
Experienced MS/Extra'er
Posts: 301
Joined: Fri Aug 01, 2008 2:25 pm

Re: JBperf GPS - CAN format info?

Post by xrattiracer »

thats good info, i will have to update my code since i only knew about the E/W bit. seems to work just fine without everything else though, checked the post i just made in the expansion boards section for a screenshot :)
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

Re: JBperf GPS - CAN format info?

Post by MWPau »

Im having some trouble with the format of the variables :(

What does mmin refer to? As in gps_latmmin?
It doesn't appear to be seconds as TS then displays the wrong value.

I assumed altk and altm would be 'altitude kilometers' and 'altitude meters', but it doesnt seem be to correct.
Course is odd too.

:?
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: JBperf GPS - CAN format info?

Post by racingmini_mtl »

mmin refers to milli-minutes (thousandths of minutes) since the the NMEA senstences from the GPS gives the data in fractions of minutes. The altitude in meters is (altk X 1000) + altm. The course is in tenths of degrees with respect to the true north.

These are all data taken directly from the GPRMC NMEA sentence except that the speed is converted from knots to m/s.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Post Reply