Sending Custom CAN messages from SDU openinverter board

Topics concerning the Tesla front and rear drive unit drop-in board
Post Reply
tensa
Posts: 8
Joined: Sun Oct 04, 2020 8:22 pm
Has thanked: 3 times

Sending Custom CAN messages from SDU openinverter board

Post by tensa »

Can I send custom CAN messages based on SDU value mappings?

For example, I would like to send the CAN messade ID 0x43F over 8 bits starting at Bit 0 with the decimal value of 13976218851319218176 when "Forward" direction is selected.

Can this be done over the web interface or CLI?
P.S.Mangelsdorf
Posts: 772
Joined: Tue Sep 17, 2019 8:33 pm
Location: Raleigh, NC, USA
Has thanked: 96 times
Been thanked: 96 times

Re: Sending Custom CAN messages from SDU openinverter board

Post by P.S.Mangelsdorf »

If at first you don't succeed, buy a bigger hammer.

1940 Chevrolet w/ Tesla LDU - "Shocking Chevy" - Completed 2023 Hot Rod Drag Week
tensa
Posts: 8
Joined: Sun Oct 04, 2020 8:22 pm
Has thanked: 3 times

Re: Sending Custom CAN messages from SDU openinverter board

Post by tensa »

So just to be clear, and something that the documentation does not clarify, do I enter the custom value as the gain?
P.S.Mangelsdorf
Posts: 772
Joined: Tue Sep 17, 2019 8:33 pm
Location: Raleigh, NC, USA
Has thanked: 96 times
Been thanked: 96 times

Re: Sending Custom CAN messages from SDU openinverter board

Post by P.S.Mangelsdorf »

I think so, but I haven't done that myself so I'm not certain. I'd suggest giving it a shot and seeing if it works, it can't hurt anything. It's useful to have a CAN sniffer like SavvyCAN set up to verify the messages being sent.
If at first you don't succeed, buy a bigger hammer.

1940 Chevrolet w/ Tesla LDU - "Shocking Chevy" - Completed 2023 Hot Rod Drag Week
User avatar
mane2
Posts: 177
Joined: Fri Jan 13, 2023 6:32 am
Location: Finland
Has thanked: 20 times
Been thanked: 8 times

Re: Sending Custom CAN messages from SDU openinverter board

Post by mane2 »

You can send direction as a can message, but not with custom data. Only the number (probably like 0, 1, 2) with gain factor, eg. multiplied by 100. It will also be sent constantly. I didn't see the frequency from wiki, but it's like 50 times per second or so. So not really something you want probably.
User avatar
timbradley
Posts: 17
Joined: Sat Jan 22, 2022 11:49 pm
Location: Castle Pines, CO USA

Re: Sending Custom CAN messages from SDU openinverter board

Post by timbradley »

Hello,

Thanks for all the help this forum has provided. The electric Fiero has achieved about 800 miles with the SDU, OI board, charger interface board and Orion BMS. Only a few pesky kinks, one of which is CAN messaging from OI board.

I have Speedhut CAN Gauges and all but the motor temperature are working. Granted, all the working ones are getting their messages from the Orion.

Can anyone offer suggestions on what I may be missing? Based on BMS screenshot, I'm feeling like no CAN traffic is coming from the inverter. Do I need to manually insert a line for this rather than the CAN mapping already done?

Thanks, in advance, for any help here.
Attachments
CAN Motor Temp.JPG
ZeroEV Output in Orion.JPG
1969 Beetle w/ Hyper-9
1988 Pontiac Fiero w/ Tesla SDU(OI), 16 18650, Orion BMS2
1968 VW Transporter 2 w/ Hyper-9
User avatar
johu
Site Admin
Posts: 5792
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 158 times
Been thanked: 1028 times
Contact:

Re: Sending Custom CAN messages from SDU openinverter board

Post by johu »

May sound silly but have you selected the correct CAN speed?
Are you aware that all numbers are decimal, not hex?

If possible you could monitor the CAN bus to check if your messages are generated
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
timbradley
Posts: 17
Joined: Sat Jan 22, 2022 11:49 pm
Location: Castle Pines, CO USA

Re: Sending Custom CAN messages from SDU openinverter board

Post by timbradley »

I have confirmed CAN speed at 500K. Attaching JSON for any other suggestions.

I must access CAN wiring from under car with weather shield removed (yes, design feature we won't repeat) so I haven't gotten there yet (with CAN sniffer, that is).

While looking at JSON, if there are any settings you'd suggest changing to improve the startup jitter, I'm all ears. I've smoked IGBTs on the tuning process a few months back and still having PTSD due to it.
params (6).json
(1.41 KiB) Downloaded 57 times
1969 Beetle w/ Hyper-9
1988 Pontiac Fiero w/ Tesla SDU(OI), 16 18650, Orion BMS2
1968 VW Transporter 2 w/ Hyper-9
P.S.Mangelsdorf
Posts: 772
Joined: Tue Sep 17, 2019 8:33 pm
Location: Raleigh, NC, USA
Has thanked: 96 times
Been thanked: 96 times

Re: Sending Custom CAN messages from SDU openinverter board

Post by P.S.Mangelsdorf »

timbradley wrote: Wed Sep 06, 2023 2:11 pm I have Speedhut CAN Gauges and all but the motor temperature are working. Granted, all the working ones are getting their messages from the Orion.

Can anyone offer suggestions on what I may be missing? Based on BMS screenshot, I'm feeling like no CAN traffic is coming from the inverter. Do I need to manually insert a line for this rather than the CAN mapping already done?
I've got Speedhut gauges and it took a bit to get things working from my LDU. One thing to note: you need something else on the bus other than just the drive unit and the gauges. I think since their EV CAN gauges are based on their OBD2 gauges, they don't acknowledge the messages (so that they don't freak an OEM car out, they just silently observe), so the drive unit doesn't keep sending. It sounds like you do have the Orion on the bus, so that's likely not the issue.

To the best of my knowledge, they don't have separate Inverter and Motor temp gauges. The Inverter message looks correct, based on the attached table, but I'm not sure what you're sending the motor temp to.
Attachments
Screenshot 2023-09-12 124535.png
If at first you don't succeed, buy a bigger hammer.

1940 Chevrolet w/ Tesla LDU - "Shocking Chevy" - Completed 2023 Hot Rod Drag Week
User avatar
timbradley
Posts: 17
Joined: Sat Jan 22, 2022 11:49 pm
Location: Castle Pines, CO USA

Re: Sending Custom CAN messages from SDU openinverter board

Post by timbradley »

Thanks for your note. I have deleted all CAN mapping and tried for just the sole inverter temp and get nothing. Both by a direct entry in the table, and as a command. You're right, that is the only gauge I'm running for temperature around the motor.

Time to get it up on the rack and dig into the CAN wires to see if anything is coming out.

If there are any other ideas out there, I'm all ears!
1969 Beetle w/ Hyper-9
1988 Pontiac Fiero w/ Tesla SDU(OI), 16 18650, Orion BMS2
1968 VW Transporter 2 w/ Hyper-9
P.S.Mangelsdorf
Posts: 772
Joined: Tue Sep 17, 2019 8:33 pm
Location: Raleigh, NC, USA
Has thanked: 96 times
Been thanked: 96 times

Re: Sending Custom CAN messages from SDU openinverter board

Post by P.S.Mangelsdorf »

timbradley wrote: Fri Sep 15, 2023 11:18 am Thanks for your note. I have deleted all CAN mapping and tried for just the sole inverter temp and get nothing. Both by a direct entry in the table, and as a command. You're right, that is the only gauge I'm running for temperature around the motor.

Time to get it up on the rack and dig into the CAN wires to see if anything is coming out.

If there are any other ideas out there, I'm all ears!
Your inverter message looked correct, so the only thing I can think of is; if it's just the gauge and the drive unit on the bus, that causes an issue. But if there are other things on the bus, it should be working.
If at first you don't succeed, buy a bigger hammer.

1940 Chevrolet w/ Tesla LDU - "Shocking Chevy" - Completed 2023 Hot Rod Drag Week
jrbe
Posts: 288
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 99 times
Been thanked: 75 times

Re: Sending Custom CAN messages from SDU openinverter board

Post by jrbe »

It's easy to be looking in the wrong discipline with things like this. Is the electrical side of things correctly setup? You have termination resistor(s) in place?
jsimonkeller
Posts: 60
Joined: Sun Oct 30, 2022 2:21 am
Has thanked: 2 times
Been thanked: 5 times

Re: Sending Custom CAN messages from SDU openinverter board

Post by jsimonkeller »

Hi Tim. I am not sure if you are still working this out on the inverter temp gauge issue. I have the ORION 2 BMS and Speed Hut gauges. As a side note, I went to Speed Hut in 2019 to get them to help me make custom can gauges for my EV project and they were super reluctant and I had to pester them to work with me. I then connected them with ZERO EV to develop the EV modified gauges for my project. I am glad that it took off like it did :)

I am not sure if my settings carry over to your setup, but on the OI firmware, I am not using tmpm at all but only tmphs with 294 32 16 1 as you have done. The ORION and Inverter CANBUS are tied together in the ZERO EV lv junction boxes, but you could connect it all up yourself I assume. Here is a screenshot of my canbus settings in ORION as well but I don't think motor temp is addressed here or needs to be. I have inverter temp/battery temp on one gauge. (disregard the temp reading on the inverter in the photo, as this was when I was dealing with a coolant leak on the inverter reeking havoc on that gauge :o )
PXL_20220930_214944542.jpg
canbus orion.jpg
alexbeatle
Posts: 155
Joined: Sun Jan 03, 2021 6:12 am
Has thanked: 46 times
Been thanked: 15 times

Re: Sending Custom CAN messages from SDU openinverter board

Post by alexbeatle »

Hello.
Could somebody please give me a hint where am I going wrong here?
In the attached screenshot WebUI reads motor temp = 15.09C and heatsink temp 20.09C, but on the receiving end of the CAN bus, I'm reading motor temp = 12.80C, heatsink temp = 20.21C. Both SDU and my teensy talk at 500k.
This is my code on the receiving end:

Code: Select all

Drive_HtSnkTemp=(uint16_t)((incoming.buf[5] << 8) | (incoming.buf[6])); // scale 1/100
Drive_MotorTemp=(uint16_t)((incoming.buf[7] << 8) | (incoming.buf[8])); // scale 1/100
Screenshot_20240408_213500_com.android.chrome.jpg
User avatar
johu
Site Admin
Posts: 5792
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 158 times
Been thanked: 1028 times
Contact:

Re: Sending Custom CAN messages from SDU openinverter board

Post by johu »

You're indexes are off by one and you're decoding big endian. Try this

Code: Select all

Drive_HtSnkTemp=(uint16_t)((incoming.buf[5] << 8) | (incoming.buf[4])); // scale 1/100
Drive_MotorTemp=(uint16_t)((incoming.buf[7] << 8) | (incoming.buf[6])); // scale 1/100
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Post Reply