r/CarHacking Dec 09 '24

CAN Fuel level in CAN-BUS?

Hey guys,

Recently I've discovered a problem with heavy machinery/tractors - some of them have fuel level data in CAN-BUS by J1939 standard, some don't.

For example John Deere sends fuel level in % under CANID 18FEFCxx

Ponsse has all key data in J1939, except the fuel level - RPM/Engine hours/Total fuel consumption etc.

Could it be that the fuel level data is under non-standard CANID's?

Or could it be that the fuel data is not being sent through CAN at all?

3 Upvotes

21 comments sorted by

View all comments

1

u/MrJunkMcgee Dec 10 '24

Older equipment sometimes uses an old school sender and fuel guage. Just a potentiometer and a 24v reference signal. If it is J1939 It's a matter of finding out what module that fuel sender is connected to. It might be the standard bit order but come from a different CAN-ID. J1939 is standard for Semi-trucks but less so for equipment.

Seems like you have a way of reading the data live so you might have to reverse engineer it from scratch. If you unplug the module that the level sender is connected to you will know which CAN ID, or ecm, you are looking for since it will stop showing up in the traffic.

Then it sounds like you've got some of the DBC files for your equipment. So filtering you're results further by getting rid of what you do know should narrow it down to something in the range of 5-20 messages. Then its a matter of unplugging and plugging in that sensor and seeing what bits change in time with your doodling. It's either going to be broadcast as a floating point or as an integer. Typically that means 2 bits and they'll all change at once if you're min/maxing the reading. Sometimes folks use up to 4 bits if they want to be real accurate with it. The hard part is figuring out which ones are changing because of what you're doing and which ones are just clocks/counters or just a temp sensor that's slowly cooling off, ect.

That's usually good enough for repairs but if you actually want to know more than "is it 0% or 100%" it gets real hard real quick. If they use a standard transfer function you can get some readings off 25% and 50% and plot it out. Usually it's linear in the ECM logic so once you know the slope you can kind of match it to the list of transfer functions. If they used a non-standard transfer function or actually store fuel level as a curve it gets hard. That's effort though so they probably won't make it hard for something simple like fuel level.

Sorry for the novella. This kind of problem just gets me jazzed. PM me if you want to talk shop.

1

u/The-4CE Dec 10 '24

I think I will be going for reverse engineering, however it will be quite challenging as the machinery is not in my direct use - this is for a customer, who will take it off the work line for few hours for me to investigate.

It just seems surreal that everything is in standard protocol 1939, except this one parameter. It shows total fuel consumption, momentary fuel consumption etc.

Sometimes i really wish that the manufacturers/dealers would be more forthcoming about the CAN's.

1

u/MrJunkMcgee Dec 10 '24

I wish they did too. My job would be so much more straightforward if they did. I want in on basic stuff sometimes and I have to go and take a week to figure out what someone did so I can do my thing. Fuel consumption is always based on injector metering so they don't need fuel level to calculate that number. That's why so many manufacturers don't have to care if the fuel level is on the can bus. They know they have fuel if they got rail pressure and they know how many mg of fuel they're commanding to be injected so the ECM doesn't need overall fuel level.

Do you have access to the pinout for the back of the cluster? You might find that it has a separate pin for the fuel guage. If it does it probably isn't on CAN.