CAN Bus display, speed questions

This forum is for the discussion of other projects on Megasquirt/Microsquirt hardware that don't fit into any of the other forums

Moderators: jsmcortina, muythaibxr

Re: CAN Bus display, speed questions

Postby Nitroking » Wed Dec 07, 2016 7:00 am

Back to topic, I am now using interrupts again with no problem..

Regarding VSS1, what do the ms-1 units mean??
Miata NBFL 1.6 (EU), GT2560R, MS2Extra, Zeitronix.
Fiesta 1.25 Zetec-SE, N/A mods, MS3, AEM.
Nitroking
Helpful MS/Extra'er
 
Posts: 127
Joined: Fri Feb 28, 2014 6:03 am

Re: CAN Bus display, speed questions

Postby Alfagta » Wed Dec 07, 2016 7:02 am

Meter per second Power -1
Alfa 156 GTA
Alfa 75 Race Car MS III -- alway latest FW
Alfa 164 V6 Turbo
Alfa 155 2,5TD RIP
Test MS II --always latest FW
Tunerstudio V2.6.11 Registered
MegaLog Viewer V3.4.04 Registered
Alfagta
Experienced MS/Extra'er
 
Posts: 208
Joined: Wed Aug 21, 2013 2:54 am

Re: CAN Bus display, speed questions

Postby Nitroking » Wed Dec 07, 2016 7:08 am

Fastest answer ever..

Thanks!!
Miata NBFL 1.6 (EU), GT2560R, MS2Extra, Zeitronix.
Fiesta 1.25 Zetec-SE, N/A mods, MS3, AEM.
Nitroking
Helpful MS/Extra'er
 
Posts: 127
Joined: Fri Feb 28, 2014 6:03 am

Re: CAN Bus display, speed questions

Postby Nitroking » Wed Dec 07, 2016 7:23 am

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...
Miata NBFL 1.6 (EU), GT2560R, MS2Extra, Zeitronix.
Fiesta 1.25 Zetec-SE, N/A mods, MS3, AEM.
Nitroking
Helpful MS/Extra'er
 
Posts: 127
Joined: Fri Feb 28, 2014 6:03 am

Re: CAN Bus display, speed questions

Postby jsmcortina » Wed Dec 07, 2016 7:58 am

ms-1.png
ms-1
ms-1.png (4.43 KiB) Viewed 653 times


James
I can supply, repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 33984
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: CAN Bus display, speed questions

Postby Nitroking » Wed Dec 07, 2016 8:12 am

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..
Miata NBFL 1.6 (EU), GT2560R, MS2Extra, Zeitronix.
Fiesta 1.25 Zetec-SE, N/A mods, MS3, AEM.
Nitroking
Helpful MS/Extra'er
 
Posts: 127
Joined: Fri Feb 28, 2014 6:03 am

Re: CAN Bus display, speed questions

Postby jsmcortina » Wed Dec 07, 2016 8:21 am

I feel that 1 ms-1 precision would be too coarse. To gain 0.1 ms-1 precision, two bytes are required.

James
I can supply, repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 33984
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: CAN Bus display, speed questions

Postby Nitroking » Wed Dec 07, 2016 8:27 am

Good point.. Then the only way would be to use mph but still, you may need finer resolution for the traction control etc..
Miata NBFL 1.6 (EU), GT2560R, MS2Extra, Zeitronix.
Fiesta 1.25 Zetec-SE, N/A mods, MS3, AEM.
Nitroking
Helpful MS/Extra'er
 
Posts: 127
Joined: Fri Feb 28, 2014 6:03 am

Re: CAN Bus display, speed questions

Postby jsmcortina » Wed Dec 07, 2016 8:35 am

I wanted to use standard SI units internally so we could potentially compare the acceleration (ms-2) from accelerometers vs. wheel speed etc.

James
I can supply, repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 33984
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: CAN Bus display, speed questions

Postby Nitroking » Fri Dec 09, 2016 9:33 am

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
Miata NBFL 1.6 (EU), GT2560R, MS2Extra, Zeitronix.
Fiesta 1.25 Zetec-SE, N/A mods, MS3, AEM.
Nitroking
Helpful MS/Extra'er
 
Posts: 127
Joined: Fri Feb 28, 2014 6:03 am

Re: CAN Bus display, speed questions

Postby Alfagta » Fri Dec 09, 2016 1:09 pm

Here is a decode excel sheet.
You can fill in id's or you can generate a id.

Decode MS Can ID (2).zip
(16.81 KiB) Downloaded 44 times
Alfa 156 GTA
Alfa 75 Race Car MS III -- alway latest FW
Alfa 164 V6 Turbo
Alfa 155 2,5TD RIP
Test MS II --always latest FW
Tunerstudio V2.6.11 Registered
MegaLog Viewer V3.4.04 Registered
Alfagta
Experienced MS/Extra'er
 
Posts: 208
Joined: Wed Aug 21, 2013 2:54 am

Re: CAN Bus display, speed questions

Postby Nitroking » Fri Dec 09, 2016 2:07 pm

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?
Miata NBFL 1.6 (EU), GT2560R, MS2Extra, Zeitronix.
Fiesta 1.25 Zetec-SE, N/A mods, MS3, AEM.
Nitroking
Helpful MS/Extra'er
 
Posts: 127
Joined: Fri Feb 28, 2014 6:03 am

Re: CAN Bus display, speed questions

Postby pit_celica » Fri Dec 09, 2016 3:33 pm

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
pit_celica
Master MS/Extra'er
 
Posts: 631
Joined: Tue Jul 18, 2006 3:12 pm

Re: CAN Bus display, speed questions

Postby grom_e30 » Fri Dec 09, 2016 3:46 pm

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
1990 bmw 320i daily driver with m20b25 ms3 sequential fuel, 380cc injectors, d585 coil near plug, home made cam sync, launch control, fan control, vss, homebrew egt logging what's next????
grom_e30
Super MS/Extra'er
 
Posts: 4004
Joined: Thu Mar 08, 2012 12:44 pm
Location: UK

Re: CAN Bus display, speed questions

Postby Alfagta » Fri Dec 09, 2016 11:13 pm

Look into the ms 29bit spec Manual. Then you know how to shift the stuff.
Alfa 156 GTA
Alfa 75 Race Car MS III -- alway latest FW
Alfa 164 V6 Turbo
Alfa 155 2,5TD RIP
Test MS II --always latest FW
Tunerstudio V2.6.11 Registered
MegaLog Viewer V3.4.04 Registered
Alfagta
Experienced MS/Extra'er
 
Posts: 208
Joined: Wed Aug 21, 2013 2:54 am

Re: CAN Bus display, speed questions

Postby Nitroking » Sat Dec 10, 2016 4:35 am

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:
Miata NBFL 1.6 (EU), GT2560R, MS2Extra, Zeitronix.
Fiesta 1.25 Zetec-SE, N/A mods, MS3, AEM.
Nitroking
Helpful MS/Extra'er
 
Posts: 127
Joined: Fri Feb 28, 2014 6:03 am

Re: CAN Bus display, speed questions

Postby Nitroking » Sun Dec 11, 2016 1:28 pm

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!
Miata NBFL 1.6 (EU), GT2560R, MS2Extra, Zeitronix.
Fiesta 1.25 Zetec-SE, N/A mods, MS3, AEM.
Nitroking
Helpful MS/Extra'er
 
Posts: 127
Joined: Fri Feb 28, 2014 6:03 am

Re: CAN Bus display, speed questions

Postby jsmcortina » Sun Dec 11, 2016 2:39 pm

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
I can supply, repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 33984
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: CAN Bus display, speed questions

Postby Nitroking » Sat Dec 17, 2016 8:21 am

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!
Miata NBFL 1.6 (EU), GT2560R, MS2Extra, Zeitronix.
Fiesta 1.25 Zetec-SE, N/A mods, MS3, AEM.
Nitroking
Helpful MS/Extra'er
 
Posts: 127
Joined: Fri Feb 28, 2014 6:03 am

Previous

Return to Other Development

Who is online

Users browsing this forum: No registered users and 1 guest