Page 1 of 1

Independent CAN BUS transmitt on V2 board

Posted: Wed Jul 03, 2019 1:20 pm
by arber333
Hi

I would like to know if i can use inverter board to send my custom CAN messages when inverter is in operation.
What i desire is to send msg to DCDC converter which is Ampera part.
CAN ID is 01 D4, Msg is A0 B2 in 50ms period. Can i programm your Rev 2 board to do that when it is in operation Johannes?

tnx

Re: Independent CAN BUS transmitt on V2 board

Posted: Wed Jul 03, 2019 6:18 pm
by nailgg
This could easily be done with some minor software modification, by placing the lines below at the end of the Ms10Task in stm32_sine.cpp. But this would send your message in every 10ms of course.

Code: Select all

static void Ms10Task(void)
{
   ...
   
   if (MOD_RUN == opmode) {
      uint32_t myCanData[2] = { 0xA0B20000, 0x00000000 };
      uint32_t myCanId = 0x000001D4;

      Can::Send(myCanId, myCanData);
   }

Re: Independent CAN BUS transmitt on V2 board

Posted: Wed Jul 03, 2019 7:36 pm
by arber333
nailgg wrote: Wed Jul 03, 2019 6:18 pm This could easily be done with some minor software modification, by placing the lines below at the end of the Ms10Task in stm32_sine.cpp. But this would send your message in every 10ms of course.

Code: Select all

static void Ms10Task(void)
{
   ...
   
   if (MOD_RUN == opmode) {
      uint32_t myCanData[2] = { 0xA0B20000, 0x00000000 };
      uint32_t myCanId = 0x000001D4;

      Can::Send(myCanId, myCanData);
   }
No, what i meant was if i could setup any custom ID and MSG inside web interface to be output in the blind. It could just as easily be some inverter parameter, but i would like it to be that specific code. I could say it would be a CAN heartbeat for inverter.

Re: Independent CAN BUS transmitt on V2 board

Posted: Wed Jul 03, 2019 7:53 pm
by nailgg
With the current software you can only send the existing parameters like udc, speed etc. The software needs to be modified in order to be able to define arbitrary messages through the web interface (or console) other than the existing parameters. Maybe Johannes or someone else could implement sending arbitrary data over CAN other than already existing parameters. But I think the easiest solution for your case is hardcoding your custom data into the software, at least for current version.

Re: Independent CAN BUS transmitt on V2 board

Posted: Thu Jul 04, 2019 7:22 am
by arber333
nailgg wrote: Wed Jul 03, 2019 7:53 pm With the current software you can only send the existing parameters like udc, speed etc. The software needs to be modified in order to be able to define arbitrary messages through the web interface (or console) other than the existing parameters. Maybe Johannes or someone else could implement sending arbitrary data over CAN other than already existing parameters. But I think the easiest solution for your case is hardcoding your custom data into the software, at least for current version.
What about if i would declare parameter that is always on when inverter is working, like "din_forward"? Then i would assign ID MSG and interval whatever i like. Would that work?

Re: Independent CAN BUS transmitt on V2 board

Posted: Thu Jul 04, 2019 1:21 pm
by nailgg
Hmm. That sounds like a nice little hack. So your message is 0xA0 0xB2 which is 41138 in decimal. Maybe you can send din_forward or even better opmode with 41138 gain. Might be worth trying.

Code: Select all

can tx opmode 468 0 16 41138

Re: Independent CAN BUS transmitt on V2 board

Posted: Sat Jul 06, 2019 4:00 pm
by johu
Sorry gain is signed 16 bit but you could still do it byte-wise.
Of course to map one signal in multiple places you can't use the web interface but the command you suggest will work multiple times

Code: Select all

can tx opmode  468 0 8 160
can tx opmode  468 8 8 178
(I'm sure I swapped bytes ;) )

Re: Independent CAN BUS transmitt on V2 board

Posted: Mon Jul 08, 2019 6:58 pm
by arber333
So if i can understand how it works...

I need to broadcast ID 01D4 with byte0 A0 and byte1 B2.
This would then look like this?

can tx opmode 468 0 8 160
can tx opmode 468 1 8 178

why the 8? If this is two byte message shouldnt i use 2 instead?

tnx

Re: Independent CAN BUS transmitt on V2 board  [SOLVED]

Posted: Mon Jul 08, 2019 9:03 pm
by nailgg
arber333 wrote: Mon Jul 08, 2019 6:58 pm can tx opmode 468 0 8 160
can tx opmode 468 1 8 178

why the 8? If this is two byte message shouldnt i use 2 instead?

Code: Select all

can tx opmode       468    0          8          160
can tx opmode       468    8          8          178
can tx PARAMETER    CANID  START_BIT  LENGTH     GAIN
With the first line, you define a signal of 8-bit length that starts from the bit 0. So your data will be on bits 0:7. You are streaming opmode with 160 gain. That would give you 0xA0 on the first byte when opmode==1 and 0x00 when opmode==0

With the second line, you define a signal of 8-bit length that starts from the bit 8. So your data will be on bits 8:15. You are streaming opmode with 178 gain. That would give you 0xB2 on the second byte when opmode==1 and 0x00 when opmode==0

Re: Independent CAN BUS transmitt on V2 board

Posted: Wed Jul 10, 2019 6:30 am
by arber333
OK i see. I will try this.

tnx

Re: Independent CAN BUS transmitt on V2 board

Posted: Tue Jul 16, 2019 10:31 pm
by dima
I cannot find what is exact command for removing individual can tx? Not clear command - that clears everything.

Tried all combinations:

Code: Select all

can tx opmode remove
can opmode remove
can remove opmode

Re: Independent CAN BUS transmitt on V2 board

Posted: Wed Jul 17, 2019 8:39 am
by johu

Code: Select all

can del opmode
In fact just the 'd' is important, so 'd' 'del', 'delete' all work