View Single Post
      05-01-2019, 10:53 AM   #3
blipton
Registered
2
Rep
3
Posts

Drives: 2007 BMW 328xi
Join Date: Apr 2019
Location: florida

iTrader: (0)

Thanks, using a fork I propped off the needles and tack'd the wires on the other side! It draws about 170ma. The RPM needle is sitting below 0, so have a feeling I'll need to open it and re-adjust.

But in terms of digitally moving the needles, I'm using a PI with a CAN hat, however there seems to be some conflicting or missing information on the exact format of the data*. I suspect it's going to require some experimenting, so I'd like to do this using SavvyCAN and a DBC file.. since it may be faster to edit that, rather than re-compiling code.

Or perhaps there's an easier way to tinker with the transmit data in order to find out what works?


*
Code:
K-CAN 100kbps 
---------------------------------------- 
CAN BUS ID: 0x130 (TERMINAL T15) 
ratems : 100ms 
KEYPOS KEYSLOTPOS CLUTCH ?? ?? ?? (6 Bytes) 

ex. 
0x45 0x42 0x69 0x8F 0xE2 0xFE // ON 
0x00 0x40 0x21 0x8F 0x50 0xFE // OFF 
0x42 0x40 0x21 0x8F 0xE2 0xFE 
---------------------------------------- 
CAN BUS ID: 1A6 (VELOCITY) 
ratems : 100ms-300ms 
SPEEDLSB SPEEDMSB SPEEDLSB SPEEDMSB SPEEDLSB SPEEDMSB COUNTERLSB COUNTERMSB (8 Bytes) 

Where SPEEDMSB:SPEEDLSB = ( ratems/50 * MPH/2 ) + PreviousSPEED 
or    SPEEDMSB:SPEEDLSB = ( ratems/50 * MPH ) + PreviousSPEED 

Where COUNTERLSB = 0x00FF & (COUNTERMSB:LSB + ratems) 
      COUNTERMSB = 0x00F0 | ((COUNTERMSB:LSB + ratems)>>8)
or    COUNTERLSB = 0x00FF & (COUNTERMSB:LSB + 100*(ratems/50)) 
      COUNTERMSB = 0x00F0 | (((COUNTERMSB:LSB + 100*(ratems/50))>>8)
ex. 
13 4D 46 4D 33 4D D0 FF // Speed and Counter 
13 4D 1F 00 1F 00 30 F2 
0F 00 0F 00 0F 00 10 FF 
1F 00 1F 00 1F 00 30 F2 // ((( 1334 - 1134 ) / 50 ) x 4mph ) + 15 
---------------------------------------- 
CAN BUS ID: 0xAA (RPM) 
ratems : 10ms 
?? ?? TPSLSB:TPSMSB RPMLSB RPMMSB ?? ?? (8 Bytes) 

ex. 
0xFE 0xFE 0xFF 0x00 RPMLSB RPMMSB 0xFE 0x99 
0x5F 0x59 0xFF 0x00 RPMLSB RPMMSB 0x80 0x99
Appreciate 0