CAN Communication Settings

Post Reply
User avatar
johu
Site Admin
Posts: 5769
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1013 times
Contact:

Re: CAN Communication Settings

Post by johu »

Why gain of 10000?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
damian.lo
Posts: 123
Joined: Sat Dec 22, 2018 12:46 pm
Location: Poland

Re: CAN Communication Settings

Post by damian.lo »

I had no idea what gain should be, so I tried to put any value from 1000-10000 with step 1000 and with this one needle moves :)
Probably if motor speed is from 0-10000 rpm
and
expected by instrument cluster value is 0 to 28000 (7krpm *4) but coded like:
Hex 0D34 = 3380
3380/ 4 = 845 RPM
So right, gain should be 2 to 4, but it doesn't move the needle.

Byte[4] = 34 hex = 52 dec
Byte[5] = 0D hex = 13 dec

Arduino Forlmula = ((Byte[5] * 256) + Byte[4] ) / 4
Example Above = (( 13*256 ) + 52 ) / 4 = 845 RPM

EDIT: now it works!
Not perfect, because from time to time needle goes to 0 and then after some time goes back. Gain = 4
Reason, why previously wasn't good? canperiod should be 10ms for BMW E87 instrument cluster

Johannes, how did You solve, when on idle You have 800rpm, and then if motor increases speed needle goes up? You are using another arduino?
And another: Johannes You should be a teacher! Your one question "why gain 10000" puts my brain into deep searching mode :) Thank You.
User avatar
johu
Site Admin
Posts: 5769
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1013 times
Contact:

Re: CAN Communication Settings

Post by johu »

Nice!

I indeed have a separate VCU generate the speed message and that just never drops below 800rpm while inverter is in run mode.
Some older firmwares had wrong CAN configuration, it did not resend lost messages. Recent 4.76 certainly has that fixed. That used to be the reason why I got a droppy needle.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
damian.lo
Posts: 123
Joined: Sat Dec 22, 2018 12:46 pm
Location: Poland

Re: CAN Communication Settings

Post by damian.lo »

I have the newest firmware 4.76.R, so it should be fixed? So maybe something wrong will be in mine setup, You think?
I found on Your repo, that You used stm32 to talk with VW? Have You some small schematic, informations, anything about this except data in github?
Regards,
D.lo
User avatar
johu
Site Admin
Posts: 5769
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1013 times
Contact:

Re: CAN Communication Settings

Post by johu »

Yes then it's another issue.
I use a Rev2 main board that is partly populated as VCU.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
damian.lo
Posts: 123
Joined: Sat Dec 22, 2018 12:46 pm
Location: Poland

Re: CAN Communication Settings

Post by damian.lo »

Since, that I don't have free Rev2 board, can I use STM32 bluepill + MCP2515 to only emulate CAN signals and use Your code?
I need also Olimex Wifi board to configure rest of CAN messages?
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: CAN Communication Settings

Post by jon volk »

This thread seems relevant so Ill include my inquiry here.
I've been successfully sending inverter CAN messages to my VCU to control gauges and some other things but I'm struggling a bit to fully understand the CAN IO.

What I am trying to achieve is a CAN message that well set brake on and start on. What I am looking to do is in the event of an overcurrent shut down...that my VCU can detect via the status message and then send a CAN IO message to auto-restart...since it only ever seems to do such things with traffic around in an intersection for example haha.

What should that CAN IO parameter look like along with the resulting message.
Formerly 92 E30 BMW Cabrio with Tesla power
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: CAN Communication Settings

Post by jon volk »

jon volk wrote: Thu Jul 30, 2020 7:49 pm This thread seems relevant so Ill include my inquiry here.
I've been successfully sending inverter CAN messages to my VCU to control gauges and some other things but I'm struggling a bit to fully understand the CAN IO.

What I am trying to achieve is a CAN message that well set brake on and start on. What I am looking to do is in the event of an overcurrent shut down...that my VCU can detect via the status message and then send a CAN IO message to auto-restart...since it only ever seems to do such things with traffic around in an intersection for example haha.

What should that CAN IO parameter look like along with the resulting message.
Please correct me if Im off base here.
So in the above example of looking to set brake and start on, would the following be correct?
can rx canio 300 0 5 12 (12 being == 01100)
then can message (I'm using flexcan on a teensy)
msg.id = 0x12C;
msg.len = 1;
msg.buf[0] = 0xC;
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
johu
Site Admin
Posts: 5769
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1013 times
Contact:

Re: CAN Communication Settings

Post by johu »

Too many 12s :) So

Code: Select all

can rx canio 300 0 5 32
32 will move it past the decimal point. The rest should work as you wrote
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: CAN Communication Settings

Post by jon volk »

Great! Now I know enough to be dangerous. As usual.
Formerly 92 E30 BMW Cabrio with Tesla power
m.art.y
Posts: 557
Joined: Sat Jun 06, 2020 6:54 pm
Location: UK
Has thanked: 25 times
Been thanked: 16 times

Re: CAN Communication Settings

Post by m.art.y »

Hello. I have read over and over the CAN message mapping description but still can't achieve a thing.

There is this command: can rx canio 300 0 5 32 where I understand 300 is ID and 32 is scaling whatever it does. What is 0 and what is 5? What this command does? Where is the actual CAN message that I can set the inverter to look for?

I want to map start, forward, reverse and brake to CAN. If need be I can mangle all of that info to one message. I just don't understand how to program the inverter to look for that message?

To test the above commands I have message in hex: ID 0x480, Data 0x04 0xFB * * * * * *. How do I map first byte 0x04 to start the inverter, and 2nd data byte 0xFB to put the inverter in forward direction?
User avatar
Bigpie
Posts: 1594
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: CAN Communication Settings

Post by Bigpie »

Did you get anywhere with the CAN settings? I'm struggling with canio also.
Screenshot 2021-04-29 at 9.42.46 am.png
Screenshot 2021-04-29 at 9.46.10 am.png
Sending ID: 0x01 Data: 0x00 0x20 0x00 0x00 0x00 0x00 0x00 0x00

I have the same canio setup for stm32-car but tx instead and that's what is producing the above, it's not moving out of WAITSTART

EDIT, sorted. I needed a gain of 32 and not 1 on the inverter.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Post Reply