Page 2 of 2

Re: CAN Bus display, speed questions

Posted: Wed Dec 07, 2016 7:00 am
by Nitroking
Back to topic, I am now using interrupts again with no problem..

Regarding VSS1, what do the ms-1 units mean??

Re: CAN Bus display, speed questions

Posted: Wed Dec 07, 2016 7:02 am
by Alfagta
Meter per second Power -1

Re: CAN Bus display, speed questions

Posted: Wed Dec 07, 2016 7:08 am
by Nitroking
Fastest answer ever..

Thanks!!

Re: CAN Bus display, speed questions

Posted: Wed Dec 07, 2016 7:23 am
by Nitroking
Dear Alfagta,

Are you sure it is Power(-1)? I just did:

VSS=(int)((((CANByte[0]*256.0+CANByte[1])/10.0)*18)/5);

And is reading perfectly, no power(-1)..

Edit: The above is for KMH...

Re: CAN Bus display, speed questions

Posted: Wed Dec 07, 2016 7:58 am
by jsmcortina
ms-1.png
James

Re: CAN Bus display, speed questions

Posted: Wed Dec 07, 2016 8:12 am
by Nitroking
Yeah I figured it out, like meters*Power(seconds,-1)=m*(1/s)..

I was wondering James, why do you use 2 bytes for VSS? Assuming 255m/sec equals to 918kmh or 570.42mph one byte should be enough..

Re: CAN Bus display, speed questions

Posted: Wed Dec 07, 2016 8:21 am
by jsmcortina
I feel that 1 ms-1 precision would be too coarse. To gain 0.1 ms-1 precision, two bytes are required.

James

Re: CAN Bus display, speed questions

Posted: Wed Dec 07, 2016 8:27 am
by Nitroking
Good point.. Then the only way would be to use mph but still, you may need finer resolution for the traction control etc..

Re: CAN Bus display, speed questions

Posted: Wed Dec 07, 2016 8:35 am
by jsmcortina
I wanted to use standard SI units internally so we could potentially compare the acceleration (ms-2) from accelerometers vs. wheel speed etc.

James

Re: CAN Bus display, speed questions

Posted: Fri Dec 09, 2016 9:33 am
by Nitroking
Guys, in the CAN manual for the 29-bit headers, it states in the RPM example:
Remote replies with:
id=0x903b8, DLC=2, Data = 0x14 0xfe (5374 RPM)
From id = 0, To id = 7, Table = 7, message type = 2 (MSG_RSP), offset = 2
Local device then stores this into table 7 at offset 2.
As MS CAN Id is 0, I guess that 0x903b8 is referring to something else, like maybe the whole 4 bytes of the header? What I would like to do is decode these bytes to BIN and examine them according the the packed 29bit protocol and find by myself the from and to ID values, Table, offset, message size etc.

But I am a bit confused about the 0x903b8. It looks to me like 3 bytes. Can anyone elaborate a bit more on this? Is it 4 bytes and which are them?

Thank you!
Nick

Re: CAN Bus display, speed questions

Posted: Fri Dec 09, 2016 1:09 pm
by Alfagta
Here is a decode excel sheet.
You can fill in id's or you can generate a id.
Decode MS Can ID (2).zip

Re: CAN Bus display, speed questions

Posted: Fri Dec 09, 2016 2:07 pm
by Nitroking
Thank you for your file, it is really helpful! :RTFM: :D :D

Meantime, I managed to decode the bits in the CAN Bus by analyzing the raw messages of humjaba as an example and using the manual. It is finally clear that the CAN Id of a can bus message is a different thing of MS or devices CAN Ids, however it is a bit confusing as we both call them CAN Ids...

The example I worked on is below:
humjaba wrote: See attached raw messages from my megasquirt, requesting EGO data on table 7 offset 252.

Code: Select all

Type: 1 To: 10 Table: 7 Offset: 252
 Data0: 111
 Data1: 1001010
 Data2: 10101000
 Data3: 0
 Data4: 0
 Data5: 0
 Data6: 0

 Raw ID: 100000100001000010100111000
Type: 1 To: 10 Table: 7 Offset: 260
 Data0: 111
 Data1: 1001011
 Data2: 10101000
 Data3: 0
 Data4: 0
 Data5: 0
 Data6: 0

Thanks!
So now I know what is going on and I have to check on how to set the registers correctly in the code and make a test.. I saw some code here and there on the internet doing the required shifts but I cannot understand how they know what shifts to do.. Is there any standard way of doing that according to the protocol?

Re: CAN Bus display, speed questions

Posted: Fri Dec 09, 2016 3:33 pm
by pit_celica
I think it would be easier if we call a "device ID" a "node" as per the CAN 2.0b spec. This could simplify the "ID" meaning.

Sam

Re: CAN Bus display, speed questions

Posted: Fri Dec 09, 2016 3:46 pm
by grom_e30
you need to decode the payload of the message as well so you know where to push the data back to. varbyt, my varoffset & my varblk

Re: CAN Bus display, speed questions

Posted: Fri Dec 09, 2016 11:13 pm
by Alfagta
Look into the ms 29bit spec Manual. Then you know how to shift the stuff.

Re: CAN Bus display, speed questions

Posted: Sat Dec 10, 2016 4:35 am
by Nitroking
pit_celica wrote:I think it would be easier if we call a "device ID" a "node" as per the CAN 2.0b spec. This could simplify the "ID" meaning.

Sam
I agree.. It needs a different name..
grom_e30 wrote:you need to decode the payload of the message as well so you know where to push the data back to. varbyt, my varoffset & my varblk
Yeap, I left that for later as I found the header to be a bit more diffcult and focused on that..
Alfagta wrote:Look into the ms 29bit spec Manual. Then you know how to shift the stuff.
Yes, I have totally understood the protocol, I just to do some reaseach on c code and understand how shifting works. Actually I want to understand how appending bits in bytes happens as it is not about adding bits but putting them correctly in a byte or 16bit variables.. :RTFM: :RTFM:

Re: CAN Bus display, speed questions

Posted: Sun Dec 11, 2016 1:28 pm
by Nitroking
I've made good progress so far so the next thing to ask is:

For the EGO Data via can, do I need to send the bytes like the LC-1 does? For example in my 2 cars I have a Zeitronix and an AEM wideband and I can read AFR via serial. I guess I have to translate that as f they were Innovate correct?

James, as a request, could you add an option like so that the MS requests one byte of data which is AFR*10? That way it is more generic and one has to read AFR from his device and just multiply by 10 and send it via CAN to ms.. It is a more universal solution I believe..

Thank you!

Re: CAN Bus display, speed questions

Posted: Sun Dec 11, 2016 2:39 pm
by jsmcortina
Nitroking wrote:James, as a request, could you add an option like so that the MS requests one byte of data which is AFR*10? That way it is more generic and one has to read AFR from his device and just multiply by 10 and send it via CAN to ms.. It is a more universal solution I believe..
Lambda is probably more universal.

CAN Receiving could be used to receive standard CAN messages and translate them into AFR/EGO inputs.

James

Re: CAN Bus display, speed questions

Posted: Sat Dec 17, 2016 8:21 am
by Nitroking
Hello again!

I made good progress and have came to the point where I would like to experiment with the Tunerstudio communication..

I am probably not aware of some manual that describes that part and the only thing I have found is in the CAN BUS protocol manual that describes briefly the MSG_BURN command..
I have already made a valid init that I can load to Tunerstudio and play with it but I need the actual part-the communication..

Can someone point me to the right direction or manual so I can learn how to communicate with TS and burn data from the project to my EEPROM?

Thank you!