1. Attachments are working again! Check out this thread for more details and to report any other bugs.

Is it possible to get the internal GPS position/speed on the CAN?

Discussion in 'Gen 3 Prius Main Forum' started by Lares_Mat, Dec 29, 2021.

  1. Lares_Mat

    Lares_Mat Member

    Joined:
    May 17, 2014
    164
    46
    0
    Vehicle:
    2009 Prius
    Model:
    III
    Hi all!

    I couldn't figure out to which sub forum I should write, so I ask it here...

    I made a small CAN bus sniffer and am experimenting with it. It is permanently connected to the CAN network at one of the ECU plugs behind the lower glove box.

    The normal CAN traffic is fast and extremely interesting ;) I can close and open the door locks, listen to the engine RPM numbers, speed of every single wheel and things like this, but I can not figure out how to get the GPS data (position, speed) from the navigation unit.

    I'm even not sure, if it is possible at all, but I know, that all the networks in the car are interconnected and I can, bing connected to CAN1, tell the body ECU (which is connected to a different network) to close/open the door locks, so why could I not "ask" the navigation unit to tell me its GPS speed?

    What do you think?

    Maybe there is a better sub forum here for this king of questions?

    Regards

    Mat
     
  2. Elektroingenieur

    Elektroingenieur Senior Member

    Joined:
    Jan 8, 2017
    2,515
    3,256
    9
    Location:
    California
    Vehicle:
    2016 Prius
    Model:
    Three Touring
    The Repair Manual (more info) shows that the multi-display is connected by AVC-LAN buses to the navigation ECU and to the gateway ECU, which is connected to the CAN bus, so there is in principle a data path from the navigation ECU to the CAN bus, but I’m not aware of any reason this would be used.

    In general, ECUs are programmed to send data to a bus only when their designers believed there would be some other ECU to receive and use the data. I don’t know of any CAN-connected ECUs on Prius cars that would use the speed or position determined by the navigation ECU, so there wouldn’t have been a reason to include these in any CAN message sent normally.

    There also wouldn’t be a need for a way to retrieve the speed or position using a handheld or PC-based diagnostic system connected to the DLC3 port, since the navigation system is covered instead by the built-in diagnostic mode on the multi-display. (I assume you’ve already seen the “GPS Information” page there.)

    Even on Prius Prime and other much later models with the Predictive Efficient Drive (predictive deceleration support) feature, I believe the location data are stored and processed entirely within the navigation receiver assembly, and thus wouldn’t appear on any CAN bus.
    If your question is about a second-generation (NHW20 series) car, you could use the Report button to ask the moderators to move this thread to the “Gen 2 Prius Technical Discussion” forum, but frankly, I’m not sure PriusChat has all that many members with both interest and expertise in reverse engineering.
     
  3. Lares_Mat

    Lares_Mat Member

    Joined:
    May 17, 2014
    164
    46
    0
    Vehicle:
    2009 Prius
    Model:
    III
    This is actually, why I am asking this question - technically the possibility would be there, but I did not found any information, on how to retreive it from the navigation unit...

    It is a very good point from the passive CAN BUS point of view, so I would not expect to find any GPS information in the normal CAN traffic. But maybe one can "ask" the right question (send a request) to the navigation unit to get the GPS answer ;)

    Right - I know that, it is a hint in the direction, there is no possibility to retreive the GPS information from the navigation unit on the CAN... Additionally - I found no appliccation like Torque Pro or Hybrid Assistant, which would get the GPS data from the CAN - they all rely on informations from your samrtphones GPS...

    Nonono ;) I'm talking about a NHW30 - Prius gen 3 from 2009 ;)

    And maybe there really is a more technical sub forum, where this kind of questions are more common :)

    Regards

    Mat
     
  4. ChapmanF

    ChapmanF Senior Member

    Joined:
    Mar 30, 2008
    23,440
    15,189
    0
    Location:
    Indiana, USA
    Vehicle:
    2010 Prius
    Model:
    IV
    On a minor tangent from this question, anybody happen to know what the specified frequency-to-road-speed relationship is for the "VSS" speed pulse signal (the one that gets generated by the brake ECU, and that Gen 3 owners sometimes find getting coupled onto their hazard lights)?
     
  5. Lares_Mat

    Lares_Mat Member

    Joined:
    May 17, 2014
    164
    46
    0
    Vehicle:
    2009 Prius
    Model:
    III
    I'm not sure what you mean, what you wanted to say.

    I'm sorry - english is not my first language, so I'm a little embarrassed.

    The car gives me a multitude of possibilities to read speed (on the CAN bus), but all this is related to the rotational speed of the wheels, which can change, for example, if you change your tires...

    Mat
     
  6. ChapmanF

    ChapmanF Senior Member

    Joined:
    Mar 30, 2008
    23,440
    15,189
    0
    Location:
    Indiana, USA
    Vehicle:
    2010 Prius
    Model:
    IV
    Yes, there is all of that, but there is also an analog signal, carried over from earlier days: a single wire carrying a pulse train whose frequency is proportional to the vehicle speed. Certain accessories in the car still rely on that rather than CAN queries.

    In the old days, it would be generated as (something like) four pulses per revolution of a mechanical speedometer cable. In the Prius, it is generated by the brake ECU based on the wheel speed sensor readings.

    It is true that, unlike the GPS, all such signals (including what the speedometer displays) are affected by things like tire diameter that can change after the car is built.
     
  7. Lares_Mat

    Lares_Mat Member

    Joined:
    May 17, 2014
    164
    46
    0
    Vehicle:
    2009 Prius
    Model:
    III
    This is exactly what bothers me - the signals on the CAN are all tire diameter dependant - this is a disadvantage. But they are quick and precise - this is THE advantage of them.

    GPS is slow and lagging after speed changes, but over a longer distance - it is precise and independent.

    I wanted to use it to calibrate the speed signal from the CAN and after short calculation quickly know the precise speed based on the CAN signals.

    Mat
     
  8. Leadfoot J. McCoalroller

    Leadfoot J. McCoalroller Senior Member

    Joined:
    May 12, 2018
    6,899
    6,528
    1
    Location:
    Pennsylvania
    Vehicle:
    2018 Prius c
    Model:
    Two
    Why does the GPS data have to come from the car itself? Surely you can record it on some other device that is in the car during the calibration sample run?
     
  9. Lares_Mat

    Lares_Mat Member

    Joined:
    May 17, 2014
    164
    46
    0
    Vehicle:
    2009 Prius
    Model:
    III
    Sure one could use a smartphone or any device with GPS.

    I want to automate this process in my small gizmo, that I build.

    If I could read GPS from the car, I would not have to build an additional cirquitry to communicate for example by bluetooth with an external GPS device.

    A recent idea would be to tap into the connection between the internal GPS and the navigation unit and try to read the data stream/calibrate. But it is an additional cabling and cirquitry too...

    Mat
     
  10. Leadfoot J. McCoalroller

    Leadfoot J. McCoalroller Senior Member

    Joined:
    May 12, 2018
    6,899
    6,528
    1
    Location:
    Pennsylvania
    Vehicle:
    2018 Prius c
    Model:
    Two
    Ah yeah well there's a difference between just gathering data to calibrate a signal what you're talking about.

    Most cars (especially of that vintage) just don't have any data interconnect between the navigation system and the other ECUs on board. None was needed.

    In the years since, a new generation of aftermarket head units have been created which are designed to be connected to the diagnostic port at all times, and they typically include some applications that make use of that link. The replacement hardware generally includes a GPS antenna. A rig like that leaves a lot of room for the hobbyist to develop even more applications.

    Maybe take a look at some of the ones coming out of China lately, alibaba usually lists them.
    Generic example

    If nothing else, it's something to check out before you sell your own hardware.
     
  11. Lares_Mat

    Lares_Mat Member

    Joined:
    May 17, 2014
    164
    46
    0
    Vehicle:
    2009 Prius
    Model:
    III
    Yeah... So...

    I did a reserch in internet before and found almost nothing, what could help to answer my questions in this regard with certainty...

    Priuschat was my last resort :)

    In my gizmo I programmed a manual procedure to calibrate the speed. It would be nice to do it automatically, but... yeah - if it is impossible - it stays manual ;)

    Mat
     
  12. ChapmanF

    ChapmanF Senior Member

    Joined:
    Mar 30, 2008
    23,440
    15,189
    0
    Location:
    Indiana, USA
    Vehicle:
    2010 Prius
    Model:
    IV
    I find myself wondering what size of error is to be chased here ... that is, the maximum % difference in tire diameter to be expected (among people using the cars for ordinary purposes, not building novelty cars or what not).
     
  13. Lares_Mat

    Lares_Mat Member

    Joined:
    May 17, 2014
    164
    46
    0
    Vehicle:
    2009 Prius
    Model:
    III
    Correct me, if I'm totally wrong - 1 mm wear on your tire tread gives you a 0,5 m difference in travelled distance of 1000 m. Allowed is more than 1 mm wear ;)

    Of course it is very little of a difference.

    More, what I'm thinking about is, the tachometer in our Priuses in Europe are showing lower speed, as we really are doing (by law). So, if I'm going 50 kmh per GPS, I see ca. 56 kmh on my tachometer - THAT is a huge difference.

    Even more - if I read the speed from the CAN (based on rotational speed of the tires, calculated up to 0,1 kmh accuracy) - the speed is off by between 0,7 up to 2,5 kmh throu all the speeds.

    So, I can not really be sure, how fast I'm driving, and I'm not sure, if it is consistent through all produced Priuses gen 3 ;)

    Mat
     
  14. Elektroingenieur

    Elektroingenieur Senior Member

    Joined:
    Jan 8, 2017
    2,515
    3,256
    9
    Location:
    California
    Vehicle:
    2016 Prius
    Model:
    Three Touring
    In the Repair Manual for 2010, under Vehicle Interior: Meter/Gauge/Display: Meter/Gauge System: Speed Signal Circuit, Toyota writes, “When the system is functioning normally, one wheel revolution generates 4 pulses.”
    I see; I’d assumed your profile followed the American convention for model years, in which the earliest third-generation Prius cars (ZVW30 series) are described as 2010 models, even if built in calendar year 2009. On these models, of course, the navigation receiver assembly has a direct connection to the CAN (V1) bus, but I still don’t know any reason that the GPS-derived position or speed would be available there, even by request.
     
  15. ChapmanF

    ChapmanF Senior Member

    Joined:
    Mar 30, 2008
    23,440
    15,189
    0
    Location:
    Indiana, USA
    Vehicle:
    2010 Prius
    Model:
    IV
    Why so it does! I hadn't spotted that.

    I had seen some other descriptions online that related it to some JIS-defined mechanical speedometer cable turning 637 revs per kilometer, and the VSS defined as four pulses per rev of that.

    I guess with my tires rated at 831 revs/mile, I should see about 55.4 Hz on the VSS at 60 MPH, whereas by the definition involving a speedometer cable, it would be more like 68.3 Hz.
     
  16. Lares_Mat

    Lares_Mat Member

    Joined:
    May 17, 2014
    164
    46
    0
    Vehicle:
    2009 Prius
    Model:
    III
    Mine is from autumn 2009 and the "code name" is actually XW30 (as the wikipedia states), but I can not choose it from the list in the profile description. The "american convention" is new to me. Maybe tere is a place where I could read about it and the differencies to the "european convention"?

    I understand your piont, as there would not be a reson to comunicate the GPS data to the CAN members.

    Could you tell me more about the other communication of the navigation unit with the CAN?
    As it is connected, tere should be some communication as well ;)

    Mat
     
  17. Elektroingenieur

    Elektroingenieur Senior Member

    Joined:
    Jan 8, 2017
    2,515
    3,256
    9
    Location:
    California
    Vehicle:
    2016 Prius
    Model:
    Three Touring
    For European versions of the car, the Navigation System pages of the Electrical Wiring Diagram show the CAN connections. The power management control ECU, shift lever position sensors, skid control ECU, and front and rear speed sensors are all also shown on those pages, implying that they’re used by the navigation system. The Repair Manual doesn’t provide much further information; Toyota writes only, “The navigation system uses CAN communication between the navigation receiver assembly and ECUs.” That’s not very helpful, I realize.
    I’ve seen “XW30” only in Wikipedia articles; as far as I know, that’s a code made up by its editors. In every Toyota publication I’ve seen—including specifications, Repair Manual, New Car Features, and electronic parts catalog—and on the cars’ data plates, for all destination markets, Toyota has consistently used the basic model code “ZVW30” for third-generation Prius cars.
    In the U.S., automakers are free to define their own model years, up to 24 months long, within the limits of the U.S. Environmental Protection Agency regulations, 40 CFR 85, Subpart X. On vehicles built for the U.S. market, the model year is encoded in position 10 of the VIN, according to 49 CFR § 565.15(d)(1).
     
  18. Lares_Mat

    Lares_Mat Member

    Joined:
    May 17, 2014
    164
    46
    0
    Vehicle:
    2009 Prius
    Model:
    III
    You know, the car was face lifted about 2012. Are you talking about 2009/10-2011 or 2012+ model?
    The face lifted one can display the energy flow and much more on the MFD, what the version before the face lift (which I have) can not do.

    I read somewhere, that the navigation unit takes informations like wheel speed and informations from the yaw sensor from the CAN to get better stability of the position and speed, if the GPS signal is weak or non existent (to some extent - tunnels, high buildings). So it has to listen to the CANs traffic (the connection has to be there in all models with navigation, I think).

    Thank you for the information. It is actually unusual, that Wikipedia people make something up thou...
    Are you a Toyota professional - you seem to have good informations from the paid Toyota pool ;)

    Have a happy, healthy, good New Year!

    Mat
     
  19. Elektroingenieur

    Elektroingenieur Senior Member

    Joined:
    Jan 8, 2017
    2,515
    3,256
    9
    Location:
    California
    Vehicle:
    2016 Prius
    Model:
    Three Touring
    Both, since the CAN connections are shown for all three of:
    • Navigation System <Separate Type Amplifier Before Dec. 2011 Production>
    • Navigation System <Separate Type Amplifier From Dec. 2011 Production>
    • Navigation System <Built-in Type Amplifier From Dec. 2011 Production>
    I’m flattered that you might think so, but I don’t work for Toyota or in the automotive industry at all.
     
  20. Lares_Mat

    Lares_Mat Member

    Joined:
    May 17, 2014
    164
    46
    0
    Vehicle:
    2009 Prius
    Model:
    III
    I really thought, you are at least working for a good automotive company - given your obvious access to valuable data :)

    A few thoughts:

    Till now I did not decided to pay Toyota for this kind of data.

    But really precise data is only to have from Toyota themself, and they want to be payed for it.

    I can undestand it, but am (still) kind of rejecting it.

    All, I can find out myself, is incredible valuable for me - I'm learning a lot more, as if I would buy it.

    I'm a hobbyist and earn my money doing someting copletely dfferent, so I can (have to) "pay" with my time for the knowledge and I'm OK with that ;)

    There is a huge lot of information on the internet thou - some found out independently by other people, some seems to be in a grey zone - excerpts out of the repair manuals, part number databases and diagrams.
    Anyone can find them - Toyotas lawyers too, but the informations are still there, so maybe Toyota is not that concerned about this...

    I read and learn from what I can find on the Internet, sometimes feeling not that good about this - I don't like breaking copyright or any law...

    So - kind of information exchange like this forum (not only this, but this is one of the biggest) is extremely valuable, even if sometimes one can even here find pieces of information, which Toyota would like to be payed for...

    On the other hand, someone once told me something like "You know, I think, if I make this information avaliable for a handfull of people, it is like a borrowing a book to a friend - this is allowed by law".

    I like this thinking.

    A forum like this, however, is a whole lot of friends ;)

    I find, the informations reveiled by you are wisely choosen - not showing the exact content of the Toyotas copyrighted publications, but actually your knowledge taken from this source and giving te source of the knowledge, so anyone can find it, if he wanted to (pay for it).

    I even don't know, why I am writing this all...

    Maybe it is the day - January the first of the New Year 2022?

    Maybe...

    I whish you Elektroingenieur, and all of you here, a healthy, happy, better New Year!

    Mat
     
    Elektroingenieur likes this.