CANBUS Receiving

General support questions and announcements for MS3. See also MS3 manuals.

Moderators: jsmcortina, muythaibxr

Post Reply
SordFish
Helpful MS/Extra'er
Posts: 62
Joined: Sat Jul 07, 2007 7:53 pm
Location: blackpool - uk

CANBUS Receiving

Post by SordFish »

Hi All,

I've been looking at Implementing support for Mk6 Fiesta Dashboard Via canbus, I have all the basics working apart from the Speedo.
The Dashboard Get its VSS from the ECU but the ECU gets is VSS data from the ABS module via canbus broadcast.

Now I've seen the canbus Receive feature but it seems it can only handle each byte separately.

Ford ABS from what I've researched broadcasts all 4 wheels speeds in 4 words with the formula (km/h * 100) + 10000

Is there a way to specify high and low bytes of each can VSS or will I need to modify the canbus receive code?
MY BLOG
NOT WORKING ON ANY MEGASQUIRT PROJECTS CURRENTLY
jsmcortina
Site Admin
Posts: 39619
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: CANBUS Receiving

Post by jsmcortina »

Please post the full technical details.

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

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
SordFish
Helpful MS/Extra'er
Posts: 62
Joined: Sat Jul 07, 2007 7:53 pm
Location: blackpool - uk

Re: CANBUS Receiving

Post by SordFish »

Ford ABS broadcast each wheel speed on id 0x4B0

Each Wheel speed is a 16bit value as follows

Byte 0 & 1 = Left Front wheel speed
Byte 2 & 3 = Right Front wheel speed
Byte 4 & 5 = Left Rear wheel speed
Byte 6 & 7 = Right Rear wheel speed

The wheel speed values needs a formula to get KM/H (km/h * 100) + 10000

This information was taken from http://sergeyk.kiev.ua/avto/ford_CAN_bus/ (Sadly in russian)
MY BLOG
NOT WORKING ON ANY MEGASQUIRT PROJECTS CURRENTLY
jsmcortina
Site Admin
Posts: 39619
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: CANBUS Receiving

Post by jsmcortina »

The CAN receiving code already supports 16bit values with either big-endian or little-endian. The existing code should enable one received packet to match multiple rules so you can pick out the four 16bit speed values.

Perhaps in the future, pre-coded receiving rules would be useful.

Not sure how to interpret this:
The wheel speed values needs a formula to get KM/H (km/h * 100) + 10000
MS3 needs ms-1 * 10. i.e. a raw value of 123 means 12.3 metres per second.

James

PS. Don't forget to enable CAN Receiving with the master enable at the top of the pane.
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
SordFish
Helpful MS/Extra'er
Posts: 62
Joined: Sat Jul 07, 2007 7:53 pm
Location: blackpool - uk

Re: CANBUS Receiving

Post by SordFish »

Ahh I get it now, I hadn't read the help bubble properly.

Speed works out as

0 km/h = 10000 or 0x2710
50km/h = (50*100)+10000 = 15000 or 0x3A98
or
(15000 - 10000) /100 = 50KM/H

I don't think the order of the maths will be able to convert the data into the correct values.
For now I don't actually need to have the ECU interpret the values(that can be done later), I just need it to re broadcast one of them (or an average) back to the dash.
MY BLOG
NOT WORKING ON ANY MEGASQUIRT PROJECTS CURRENTLY
jsmcortina
Site Admin
Posts: 39619
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: CANBUS Receiving

Post by jsmcortina »

SordFish wrote:I don't think the order of the maths will be able to convert the data into the correct values.
How so?

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

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
SordFish
Helpful MS/Extra'er
Posts: 62
Joined: Sat Jul 07, 2007 7:53 pm
Location: blackpool - uk

Re: CANBUS Receiving

Post by SordFish »

I need to take 10000 off first then devide by 100.

According to the help bubble the formula is

Result = ((raw_data * mult) / divide) + add

I would need

Result = (raw_data + add) / divide)* mult

add = -10000
devide = 100
mult = 0.277778 (to get meters per second)
MY BLOG
NOT WORKING ON ANY MEGASQUIRT PROJECTS CURRENTLY
SordFish
Helpful MS/Extra'er
Posts: 62
Joined: Sat Jul 07, 2007 7:53 pm
Location: blackpool - uk

Re: CANBUS Receiving

Post by SordFish »

Got it working to some degree, I have an Arduino broadcasting the ABS data which is controlled with a pot.

I've setup CAN receiving on the MS3 with B2U for each wheel and set vss1-4 to digital input type "can vss".

The data hasn't been processes yet so MS3 thinks I'm doing 7000mph but for now it doesn't matter.

I have it re broadcasting vss3 verbatim back to the dash on another ID. Video below

Image
MY BLOG
NOT WORKING ON ANY MEGASQUIRT PROJECTS CURRENTLY
Post Reply