Alfa Romeo Giulia Forum banner

TC/ESC switch for my QV

53K views 119 replies 28 participants last post by  Gaucho  
#1 ·
I wanted some more granular control over the RDNA modes.....e.g. soft suspension in race mode, traction control on in race mode, traction control off in other modes, etc. I have quite a bit of C experience, but no experience with embedded devices or maker stuff, so did some research and ended up picking up an Arduino and a canbus shield. After some extensive logging, REing canbus traffic, and learning my way around (and fixing) the canbus libraries, I did manage to get the TC/ESC switch done.


Some Q/A:

Q: Is this dyno mode?
A: No. ABS is active, suspension selection still works, etc. It just toggles TC/ESC independently of the (R)DNA mode setting

Q: Does it work?
A: Yes. Did some nice donuts in N mode, and Race mode with TC/ESC enabled is a real blast (in a straight line at least). Will snag some 0-60 times when the weather is more conducive.

Q: Will it work on non-QV?
A: Probably, but I don't have one

Q: Will you release more info on this?
A: Probably not. If any of the tuners are interested and already ship products with canbus interface, hit me up and we can discuss. Ping @Terry@BMS
 
#46 · (Edited)
I wanted some more granular control over the RDNA modes.....e.g. soft suspension in race mode, traction control on in race mode, traction control off in other modes, etc. I have quite a bit of C experience, but no experience with embedded devices or maker stuff, so did some research and ended up picking up an Arduino and a canbus shield. After some extensive logging, REing canbus traffic, and learning my way around (and fixing) the canbus libraries, I did manage to get the TC/ESC switch done.


Some Q/A:

Q: Is this dyno mode?
A: No. ABS is active, suspension selection still works, etc. It just toggles TC/ESC independently of the (R)DNA mode setting

Q: Does it work?
A: Yes. Did some nice donuts in N mode, and Race mode with TC/ESC enabled is a real blast (in a straight line at least). Will snag some 0-60 times when the weather is more conducive.

Q: Will it work on non-QV?
A: Probably, but I don't have one

Q: Will you release more info on this?
A: Probably not. If any of the tuners are interested and already ship products with canbus interface, hit me up and we can discuss. Ping @Terry@BMS
I swear if you work with @Terry@BMS to get this to implemented in the JB4 on the 2.0, I am buying a JB4 yesterday.
 
#48 ·
I'm going to try this on my 2019, but I will have the SGW and need to do some reading about that aspect. If anyone can point me in the right direction on the SGW (I'm comfortable with the arduino aspects) that would be much appreciated.
 
#52 ·
It's been quite a while since I worked on any of this, but I think I put the hardware I used in the readme in the repo. I will say the hardest part is logging and identifying what messages do what. There are windows and linux tools widely available that work with cantact/canable, so I'd suggest one of those devices for the research/test phase and then arduino when you are ready to create. If you choose to reinvent the wheel by building arduino tools for analyzing traffic, you have to keep in mind that the SD interface is too slow to log everything. So you'll need to set up filters, etc.

There are several publicly available research documents with tips and tricks (and software) for sniffing can buses with cantact/canable.
 
#55 ·
@beaups Going to try my hand at this...

I'm looking at the file Escaped.ino.
There are some functions that are defined but never called.. such as:

void print_can_buf(int id, unsigned char len)
void setup()
void loop()

Where are they called? Is there something like a Main file?
setup() and loop() are an Arduino thing. setup() is called at startup (think main()) and loop is called when setup returns and loops infinitely.

print_can_buf() was just some leftover code I left in the source in case anyone found it useful for logging etc.

I will say that this does not work on 2.0 cars as-is, just an FYI.
 
#63 ·
I have all that I need to do some CAN bus sniffing. I should be able to figure it out for the 2.0T.
 
owns 2018 Alfa Romeo Giulia Ti Sport Q4
  • Like
Reactions: Ajax240k
#68 ·
Is the TV-connector (as described in TC/ESC switch for my QV) also present in the 2.0 cars?

I would assume that it isn't?!
Maybe the CDCM is another place to "tap in"?
Not sure if the TV connectors exist on the 2.0 cars, although almost certainly the module isn't there. In theory, you should be able to tap anywhere there are accessible CAN-CH bus lines. They are present in several locations.
 
#74 ·
Thanks to @beaups for your work so far. I've forked your git repo....
Thanks @msadie for your input aswell. A photo of your harness would be nice.

My Arduino and CAN-shield should arrive within the next few days.
I'll try playing around with the OBD port first.

For a more permanent solution, I've found several CAN-CH locations.
(At least according to the tech authority documents - I have "invested" in a 3 day subscription since I was looking for something else aswell)

A few examples:
  • front-facing camera (probably useless)
  • "can bus splice block 1" - located near the battery; this sounds promising since there's a lot of space and, ... well ... a battery
  • headlamp leveling module - located near the passenger side a-pillar. not relevant for me - my car hase the base 25W lights and no such module.
  • park assist module - located "opposite to the battery" - left side of the trunk
  • "can bus splice block 2" - located near the park assist module
  • body control module - located near the passenger footwell?
The two "splice blocks" look very promising.
I haven't started searching for them in the car yet, so we'll see how accurate the documentation is. Fingers crossed...
 
#75 ·
@stocki
I investigated can splice block 2. It's relatively easy to get to, you just need to pull a few interior panels. On my 19 Ti+PP, the splice is not fully populated, so it could be a great option for a reliable and reversible tap. I was unable to identify the proper terminals, so I didn't follow through with this location.

There is a CAN-B splice at this location also, but I can't remember if it's fully populated.

Just a reminder: the CAN busses go active if the fob gets near the car, and stay active for a few minutes after. Best practice is to pull the battery negative with the handy post connector before disconnecting harness components.
 
#76 ·
@stocki
I investigated can splice block 2. It's relatively easy to get to, you just need to pull a few interior panels. On my 19 Ti+PP, the splice is not fully populated, so it could be a great option for a reliable and reversible tap. I was unable to identify the proper terminals, so I didn't follow through with this location.

There is a CAN-B splice at this location also, but I can't remember if it's fully populated.

Just a reminder: the CAN busses go active if the fob gets near the car, and stay active for a few minutes after. Best practice is to pull the battery negative with the handy post connector before disconnecting harness components.
OK - that's good news.
I've attached the splice block documentation.

I'm not really worried about any possible errors after disconnecting various components.
MultiEcuScan and all the adapters are readily available, should I need them ;)

What I'm more worried about is the arduino's power supply.
7-12V is recommended, 6-20V is the limit.
Is there any knowledge / experience out there about simply powering it off the battery?
 

Attachments

#80 ·
Here is the CDCM harness on the trunk floor just behind the rear seat. The three CAN-C and CAN-CH connectors in the second picture are the ones I added.
If you have interest in tapping CAN-C, it is available via unpopulated pins on the CDCM connector @ G4/H4. G4/H4 is bussed directly to E4/F4 on the CDCM ECU. The terminals can be purchased for cheap from mouser.

Image
Image
 
#81 ·
Thanks again to @beaups.

Just tried it - and it worked right away! :D Video proof
(2.0 "Veloce"; Race-Mode already installed prior to the CAN-Bus experiment)

It didn't work on a 100% standard 2.0 200hp car with the new (monostable) DNA-Knob.
I'll try and play around this weekend. (reset my own car to the standard config without race)

For a permanent solution, something like this might make sense: SparkFun AST-CAN485 Dev Board - DEV-14483 - SparkFun Electronics

94866
 
#82 ·
Thanks again to @beaups.

Just tried it - and it worked right away! :D Video proof
(2.0 "Veloce"; Race-Mode already installed prior to the CAN-Bus experiment)

It didn't work on a 100% standard 2.0 200hp car with the new (monostable) DNA-Knob.
I'll try and play around this weekend. (reset my own car to the standard config without race)

For a permanent solution, something like this might make sense: SparkFun AST-CAN485 Dev Board - DEV-14483 - SparkFun Electronics

View attachment 94866
Woah, wait a second... it DOES work on non-QV w/Race mode hack? I have been meaning to figure out what needs to be done on the 2.0 but just haven't gotten there.
 
owns 2018 Alfa Romeo Giulia Ti Sport Q4
#84 ·
I really hope that the byte 88 hack isn't a requirement, that would suuuck. I want to get the car back to stock and just have the switch for ESC/TCS off.
 
owns 2018 Alfa Romeo Giulia Ti Sport Q4
#86 ·
I don't have the Ti PP, but yeah, that's what I am also wondering. I'd like to have full flavor DNA modes.
 
owns 2018 Alfa Romeo Giulia Ti Sport Q4
#89 ·
I attempted some work over the weekend but realized my canbus board has a serial adapter integrated so I need to reinvent a lot of things or buy another dev board

-sigh-
Just a thought - the serial adapter you mention is probably just a DB9 connector (normally associated with serial/rs-232). It's the informal standard connector for CAN with low on pin 2 and high on pin 7. It's easy to find DB9 to diag port cables on Amazon etc for ~10 usd.
 
#91 ·
Can someone clue me in on this part of the code...

CAN.readMsgBufID(&id, &len, buf);
if(id == TCESC_CONTROL) {
memcpy(tcesc_buf, buf, 8);
if(tcesc_buf[3] & 0x40)
So we check for a message, read the message is available, check if the message ID is for the esc control, if so copy the data from the message into tcesc_buf array...

Then check for a 3rd byte in the array and what!?!? o_O
 
#92 ·
Can someone clue me in on this part of the code...



So we check for a message, read the message is available, check if the message ID is for the esc control, if so copy the data from the message into tcesc_buf array...

Then check for a 3rd byte in the array and what!?!? o_O
Check if the 7th bit is set in the 4th byte of the arrray (arrays start at index of 0 so but[3] references the 4th element). That particular but gets set when the lane departure button is depressed.
 
#94 ·
Yes and no and that's a great question. 1.) There is a lot of can traffic and I never bothered to test the Arduino enough to see how reliably it could handle checking packets with the floodgates opened. I can tell you the Arduino SD interface definitely can't keep up and we really don't want any missed packets here 2.) The code I was working with prior to uploading did more that just the ESC mod. So I set filters and masks to allow a few different messages and the did switch/case based in what type of packet we got.