Applying offsets in CAN Mapping, and general CAN Mapping

Post Reply
EVsRock
Posts: 8
Joined: Wed Nov 30, 2022 8:01 pm

Applying offsets in CAN Mapping, and general CAN Mapping

Post by EVsRock »

Hi everyone,


I am trying to setup my motor to output certain messages on the canbus via the web interface.

For the Motor and inverter temperature, I want to apply a +40 modifier on the temperature reading. How would this be done?

Currently I am putting in the interface 1023 0 8 1 TX. Would the modifier be applied here or somewhere else?

Also, I am trying to setup the motor to report to me what gear its currently in. I am entering the following into the web interface 1023 32 8 1 TX.
However, when I turn the car on ID 1023 shows me 00, which would indicate reverse. I would expect to see 01 for Neutral.
What am I doing wrong here?

I'll attach a screenshot of the HEX Id's I'm trying to implement. if someone could help explain to me how to enter them and for the proper field to enter them into, I would be greatly appreciative.
Attachments
photo_2024-09-17_06-25-43.jpg
User avatar
tom91
Posts: 2293
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 199 times
Been thanked: 524 times

Re: Applying offsets in CAN Mapping, and general CAN Mapping

Post by tom91 »

EVsRock wrote: Tue Sep 17, 2024 10:37 am However, when I turn the car on ID 1023 shows me 00, which would indicate reverse. I would expect to see 01 for Neutral.

Wrong, neutral is 0 Reverse is -1 forward is 1. Not sure where on the wiki it should be.

Turns out offset is not in the web interface for some reason but should be configurable via SDO. https://openinverter.org/wiki/CAN_communication
Creator of SimpBMS
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
davefiddes
Posts: 277
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 61 times
Been thanked: 88 times

Re: Applying offsets in CAN Mapping, and general CAN Mapping

Post by davefiddes »

You can configure offsets through the web interface but you will have to use the "Send Custom Command" button.

I've put together a map for your 0x3ff message which should do what you want:

Code: Select all

can tx tmphs 1023 0 8 1.00 40
can tx tmpm 1023 8 8 1.00 40
can tx seldir 1023 32 8 1.00 1
can tx lasterr 1023 40 8 1.00 0
can tx speed 1023 48 16 1.00 0
If you copy-and-paste each line above, one at a time, into the text box to the left of the "Send Custom Command" it should map that parameter. The interface comes back with a message like "CAN map successful, 1 message active". After you have done this the web interface will show the CAN mapping as being configured but not the offset value. If you go on to modify the CAN map for a parameter it will clobber your offset and you'll have to delete and reconfigure via the custom command button again.

You might want to use "rotordir" rather than "seldir" in your map depending on what the message is being used for. One is the commanded direction, the other is what is actually happening.

As Tom alluded to the tools for configuring CAN maps over CAN (ESP32 CAN Web Interface or the openinverter CAN tool) both support configuring offsets when setting up CAN maps. No need to change the tool you are using though.

Unfortunately I can't see how to configure Byte 1 in your 0x136 message. It isn't possible currently to map arbitrary parameter values to CAN message values (i.e. seldir or rotordir is [Reverse=-1, Neutral=0, 1=Forward=1] but you want [Reverse=16, Neutral=0, Forward=8]). I also don't know how to provide the regen or torque limit values. Sorry.

Edit: Here's a DBC file
oic-EVsRock-topic-5617-example.dbc
(1.04 KiB) Downloaded 60 times
that decodes the mapping which might be useful.
Post Reply