Can mapping question

Topics about inverter software, improvements and bug fixes. Also release announcements are found here
Post Reply
User avatar
Ev8
Posts: 236
Joined: Sat Jan 30, 2021 11:05 am

Can mapping question

Post by Ev8 »

Hi guys this will be an easy question for someone but
can messages are still a minefield in my brain not helped by the fact they are sometimes in hex, decimal etc, it makes my brain hurt and want to go back to welding something.

Anyway I’m trying to send out from the vcu the motor rpm to the RX8 can bus this info is needed importantly to start the PAS and run the Rev counter,

All information I’ve found indicates that the message needs to be sent to address 0x201 (513) and is determined by
Rpm x 3.85 with the resulting value is split across 2 8bit values highbyte to byte 0 and low byte to byte 1.

Now I presume as it wants to 2 separate 8bit values to work that this isn’t possible via the can mapping as I can only map one message per spot value and I can’t sent it a 16 but value starting at byte 0 because that’s a different format to the 2 8bit values it wants, this is where my head starts to hurt,

Im thinking I need to add another device on my can bus, send a can message for rpm to that from the vcu and have it spit it back out in the correct format for the car, this is the route I’ll be perusing unless anyone can see through the stupid and tell me stop your doing it wrong!
User avatar
Ev8
Posts: 236
Joined: Sat Jan 30, 2021 11:05 am

Re: Can mapping question

Post by Ev8 »

The more I read about can bus and 16bit messages being 2 8 bit messages with values of up to 255 each which are arrived at by bit shifting? The more confused I become! Seems like it should be possible
User avatar
johu
Site Admin
Posts: 3549
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Contact:

Re: Can mapping question

Post by johu »

hibyte, lobyte - Sounds like "big endian" to me. So not the native little endian of the stm32. That's why you cannot map it as one 16-bit value.
Not sure if it works, you can try sending speed*256*3,85 on hibyte and speedx3.85 on lobyte

I think the current CAN module doesn't allow gain>32 so may not work. I will release an updated CAN module soon.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Ev8
Posts: 236
Joined: Sat Jan 30, 2021 11:05 am

Re: Can mapping question

Post by Ev8 »

Thanks, I just had to look up what that meant but yes that makes sense,
Post Reply