RegisterSearchFAQMemberlistUsergroupsLog in
Reply to topic Page 2 of 3
Goto page Previous  1, 2, 3  Next
987.1 Can Bus Mapping
Author Message
Reply with quote
Post  
Hey Boggie1688,
why do you have TPS specified with "Length 2" within the CAN mapping when you are just talking about a single byte?

Your actual scaling of 1/255+0 probably only generates numbers from 0-255 because you specified a 2 byte message, and therefore the byte you are actually looking for gets multiplied by 255 in the background because it's handled as the high byte of a 2 byte message.

If you are just looking for a single byte (byte 5 from your notes above) then this should come up with 0-255 naturally without scaling.
I think you need to set the length to 1 and then use the scaling raw/255*100+0 as Brent mentioned already.

View user's profile Send private message Visit poster's website
Reply with quote
Post  
MikeD wrote:
Hey Boggie1688,
why do you have TPS specified with "Length 2" within the CAN mapping when you are just talking about a single byte?

Your actual scaling of 1/255+0 probably only generates numbers from 0-255 because you specified a 2 byte message, and therefore the byte you are actually looking for gets multiplied by 255 in the background because it's handled as the high byte of a 2 byte message.

If you are just looking for a single byte (byte 5 from your notes above) then this should come up with 0-255 naturally without scaling.
I think you need to set the length to 1 and then use the scaling raw/255*100+0 as Brent mentioned already.


....
Embarassed
You sir deserve a beer.

Doubly excited to get home today.

View user's profile Send private message
Reply with quote
Post  
Good catch Mike!


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
I re-tested adding a CAN channel, and I was able to verify that I *did not* need to power cycle RCP after adding a CAN mapping.

First, on a 2nd RCP connected to the primary I created a script that broadcasted some values on CAN ID 1234:

Code:
foo1 = 0
foo2 = 0
setTickRate(10)
function onTick()
foo1= foo1 + 1
foo2 = foo2 + 2

txCAN(0, 1234, 0, {foo1, foo2})
end


Then created a mapping on the primary unit that extracted both values from that CAN message into two different telemetry channels. I was able to add the 2nd channel (FOO2) without having to power cycle the unit.

If you're still not seeing the correct behavior then let me know and we can dig deeper.

Thanks!

View user's profile Send private message Send e-mail
Reply with quote
Post  
Hey Fellas! Very Happy

Good news on multiple avenues:

Brent the dashboard issue may have been related to the "?", I was using to denote my suspicions. I removed all of the "?" and used the precanned channels provided, and everything seems to be working swimmingly.

MikeD, thank you much for the 1 byte catch. Because of that, I was able to map throttle (TPS?), rpm, and engine coolant.


Observation:

I use a small 11 inch laptop last night and was having an issue scrolling across the can mapping window. After I clicked to add a map, I couldn't get to the unit conversion section. I tried swiping the touchpad to scroll side to side while mousing over the bar, but it didn't move. I was previously using my android phone, and 13 inch laptop. On the android I was able to scroll, and on the 13 inch, I think the unit conversion label was just within reach.


WIP Update:

Engine oil temp appears to be none linear. The multiplier seems to change as the decimal value goes up. Unfortunately, I was gathering data points with the car in accessory mode, and the engine cooling down. Getting each decimal value, and correlating it to a temp(C) was taking forever. I'll try again tonight, and start gathering data as the car warms up.

With most of the stuff I really wanted map done, I'll move on to mounting the RCP3 and finalizing the wiring. After that, I'll take my time mapping the rest of what is available via durametric. With the autoX season in full swing, I'm not keen on putting myself in a position where the car could miss a event. I'll probably save the oil pressure and brake pressure sender projects for later this year.

View user's profile Send private message
Reply with quote
Post  
This is a great start and example for others to follow on how to custom-map a new system. Thank you!


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
A little more playing around tonight, is it wrong that this is a bit addicting? Very Happy

Steering 70~90 Degrees
https://docs.google.com/spreadsheets/d/1v7d-iMx0vMOiTK_N_QfaE539K9Uu2i6xJQg2pbC-yGk/edit?usp=sharing

Steering ~900 Degrees
https://docs.google.com/spreadsheets/d/1FpVK6nCh7VvGL3DHbNOg2AFbRNNGYHRD5CsXoKAoesY/edit?usp=sharing

I think Offset 0-3 have something to do with steering angle. The interesting part is that offset 1 seems to be the slowest changing and not offset 0. If I focus strictly on offset 1, it doesn't fully hit 255 or 0 at the 900 or 0 degree angle. The delta from 450 to 900, is ~42-43 and the delta from 450 to 0 is ~41. (I think I should have turn the wheel a little slower to get more resolution)

Is it wrong to assume that Offset 1 = hundreds place, Offset 2 = tens place, and Offset 3 = ones place?

It would be nice if 450 - 900 produced a delta of 45 and 0 - 450 produced a delta of 45. It seems entirely possible. I assumed the wheel had 900 degrees of rotation, and I have a suspicion is it slightly less. I need to do more research on the actual steering ratio of the car, assuming the wheel is completely centered.

I guess the test would be to create a mapping for just Offset 1 Length 1, scale it and see it it roughly makes sense from a hundreds of a degree rotation perspective?

What do you guys think?

View user's profile Send private message
Reply with quote
Post  
You have the right idea, but you're dealing with base 16 data, not base 10.

The E46 uses a sign - magnitude approach where the angle is the absolute value, and the highest bit indicates the sign - meaning, left or right off center. Your Porsche might be similar.

Try centering the wheel and moving it 5-10 degrees off center to see if the data looks similar if it's 10 degrees to the left, or 10 degrees to the right.


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
Quick reply, thanks.

I've been using the E46 script as a rough guide. I assume you are referring to this function:
function processSteering(data)
local steer = 0
if data[2] > 127 then
steer = -1*(((data[2]-128)*256)+data[1])
else
steer = (data[2]*256)+data[1]
end
setChannel(steerId, (steer*0.045))
end

I assume data[2] is left or right, and data[1] is the decimal angle. True angle is data[1]*.045. What is the 256?

I'll log as you suggest tomorrow.

Thanks Brent.

View user's profile Send private message
Reply with quote
Post  
The * 256 shifts that byte 16 bits to the left, so it can create a 16 bit message.

E46 uses sign-magnitude. if the Porsche does the same, the scheme would be like this:
https://chortle.ccsu.edu/AssemblyTutorial/Chapter-08/ass08_12.html


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
Hi boggie1688,

Do you know what range of years and model Porsche supported this CAN bus data? In particular, would the 2002 Porsche 986 S support this as well?


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
Hey Brent,

I don't think the 986 cars support CAN.

http://www.aim-sportline.com/eng/download/ecu-connections-stock.htm#porsche

It looks like CAN didn't appear in the Porsches until the 996.2. I know the 997 and 987 all share the same ECU, and engine swaps can be done with relative ease. The engine is just rotate 180degrees.

In any case this doc outlines finding the CAN wires in a 996.2. Should be easy enough to check on a 986 if someone was serious about getting a hard Yes or No.

http://www.aim-sportline.com/download/ecu/stock/porsche/1_Porsche_Bosch-Porsche911_996_+OBDII-ISO9141-2_102_eng.pdf



I'll try to get some time to play with the steering wheel today. I got side track mounting the RCP3, then peeking around looking for good ways to add a brake pressure and oil pressure sender. Very Happy

View user's profile Send private message
Reply with quote
Post  
Thanks for the help, that's great information. Other customers are interested as well!


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
Is there anywhere to put this info in the wiki?

View user's profile Send private message
Reply with quote
Post  
We can, but we have one better: In an upcoming app version we'll be able to add it to a list of preset CAN configurations, very similar to this video previewing the CAN mapping capabilities.

https://www.youtube.com/watch?v=zc1Bi__0IDk&feature=youtu.be&t=105


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Display posts from previous:
Reply to topic Page 2 of 3
Goto page Previous  1, 2, 3  Next
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum