majekw / sigrok-ccd-pd

CCD (Chrysler's Collision Detection) Data Bus protocol decoder for Sigrok
GNU General Public License v2.0
10 stars 3 forks source link

0C message correct oil pressure and temperatures scaling #5

Closed laszlodaniel closed 3 years ago

laszlodaniel commented 3 years ago

0C AA BB CC DD CS

Battery voltage: AA × 0.125 [V] Oil pressure: BB × 0.5 [psi] or BB × 0.5 × 6.894757 [kPa] Coolant temperature: (CC × 1.8) - 83.2 [°F] or (((CC × 1.8) - 83.2) × 0.555556) - 17.77778 [°C] Intake/battery temperature: (DD × 1.8) - 83.2 [°F] or (((DD × 1.8) - 83.2) × 0.555556) - 17.77778 [°C]

These calculations come from the DRB3 database directly and are verified by someone else.

Check out my updated CCD.cs file for more info (start at line 928): https://github.com/laszlodaniel/ChryslerCCDSCIScanner/blob/master/GUI/ChryslerCCDSCIScanner/CCD.cs

I recently discovered new ID byte descriptions from a really old CCD-bus user's manual, without value description, though. As I see you have new ID bytes too that I didn't see before, thank you for those!

majekw commented 3 years ago

Thank you. Oil pressure was really tricky because it doesn't match gauges. In old US version there are correct psi labels, but in newer or EU version there are only some cryptic single-numbers. I found somewhere that /32 gives more or less correct result consistent with gauge reading (now I see that 1/32 is close to 6.894757/2/100 for kPa). I think that they just omitted trailing zeros, so it could look better :-) I'll fix it. Maybe I should also add option to PD to switch output between imperial and metric (with latter as default :-) )

As for temperature scaling: Your Amega is definitely not happy with Celsius calculations because readings are just in Celsius shifted by 64 up (no floats required) :-) See: (((CC × 1.8) - 83.2) × 0.555556) - 17.77778 = (CC × 1.8) x 0.555556 - 83.2 × 0.555556 - 17.77778 = CC x 1.0000008 - 46.2222592 - 17.77778 = CC x 1.0000008 - 64.0000392 = CC-64

As for Your code, I spent some time yesterday looking through it, it was very helpful and it was one of information sources I used to document new/updated codes.

Do You have some link to this old manual? Any source of information could help decode other messages. And CCD dump from other car could be also helpful (just connect logic analyzer after comparator and fire Pulseview):-)

laszlodaniel commented 3 years ago

You're right, the DRB3 database defaults to imperial units, so that's where the weird calculation comes from.

Here is the link for the CCD-bus user's manual: https://chryslerccdsci.files.wordpress.com/2020/05/880586-ccdbususersmanual.pdf

At the end there are assembly codes where ID bytes are visible but no calculations are done with them.

Here's the DRB3 database reader where I got most of the ID bytes with calculations: https://mega.nz/file/DZ8EhYya#z6ZfyXxdc51l-Ur77lIsE9G1r6SVs8kKygzCGSRc4yE

And I described basic usage in the scanner's user's manual (page 26): https://raw.githubusercontent.com/laszlodaniel/ChryslerCCDSCIScanner/master/Documentation/ChryslerCCDSCIScanner_Users_Guide.pdf

Unfortunately I have no logic analyzer, so I can't help you with that. :')

majekw commented 3 years ago

Thanks!

I didn't have this document.Good old documentation, even with source codes :-)

As for DRB3 database, I need to figure out how to run this on Linux, from your manual it looks very promising.

You could buy logic analyzer for ~$7 and this is definitely very handy device for designing or debugging real hardware. I made dumps of my Jeep using Atmega8 as comparator and cheap logic analyzer to gather digital data, total cost less than $10 and only few lines of code to put comparator state on some output pin :-)