Sponsored

[Success] Automatically select previous GOAT Mode (Sport, Slippery, etc) using Arduino + Canbus

mpeugeot

Outer Banks
Well-Known Member
First Name
Mark
Joined
May 14, 2021
Threads
18
Messages
7,652
Reaction score
14,480
Location
Texas
Vehicle(s)
97 Ferrari F355, 11 Ford F-150, 21 OBX 2D
Your Bronco Model
Outer Banks
Correction, I found it...they call it a traction control switch...6th page.
EDIT: Looks like PCM is on VDB49/50 and ATCM is on VDB24/25, (FD1-CAN, HS2-CAN respectively), so the only way they can communicate would be through the gateway module
Corrected my post. Thank you.
Sponsored

 

mpeugeot

Outer Banks
Well-Known Member
First Name
Mark
Joined
May 14, 2021
Threads
18
Messages
7,652
Reaction score
14,480
Location
Texas
Vehicle(s)
97 Ferrari F355, 11 Ford F-150, 21 OBX 2D
Your Bronco Model
Outer Banks
Ford went a bit confusing on the names. I'm fairly positive that what we call "GOAT mode selector" is technically the ATCM, but some diagrams (and his list) call it the Traction Control Switch.

What we normally call the Traction Control Switch (disable advancetrac) above the radio is a part of the SIMA (Switch Input Module A?) on FD1-CAN.
Strange.. LOL

IMG_20230913_123222.jpg


But you are clearly correct.
 
Last edited:

mpeugeot

Outer Banks
Well-Known Member
First Name
Mark
Joined
May 14, 2021
Threads
18
Messages
7,652
Reaction score
14,480
Location
Texas
Vehicle(s)
97 Ferrari F355, 11 Ford F-150, 21 OBX 2D
Your Bronco Model
Outer Banks
Sort of. These diagrams show pin 7 to be the DRL circuit but I don't have a wire in pin 7 of my connector. I am assuming the non-signature headlamps have a wire in pin 7 though.
I would assume that maybe it communicates over pin 5 somehow. I would have to boot up my computer to pull out the workshop manual. I stupidly purchased the workshop manual CD after I purchased the wiring diagram book, not knowing that I was duplicating the wiring diagram information.
 
OP
OP
XirallicBolts

XirallicBolts

Outer Banks
Well-Known Member
First Name
Xira
Joined
Sep 27, 2020
Threads
11
Messages
887
Reaction score
1,613
Location
Wisconsin, USA
Vehicle(s)
2016 Flex EcoBoost, 2022 Silverado LT
Your Bronco Model
Outer Banks
Spent my lazy camping day rewriting code and using my fancy new crimper.
Everything is looking good so far.
Created a Y-cable so cutting/splicing isn't necessary. Using generic Dupont connectors, it doesn't actually lock into the GOAT switch like the factory pigtail. We could, of course, purchase a replacement pigtail if it's an issue.
Likewise the connection to the original pigtail isn't secured beyond friction. A little tape or hot glue is sufficient for that end.

The program seems to be working nicely. I haven't had any false positives in detecting the difference between 'vehicle off' and 'vehicle on OR accessory mode'.

Only issue I have right now is likely a solder blob. It's fine when on 5v through a laptop, but the regulator gets hot FAST when running off vehicle 12v. I have an identical board on the old setup that is working fine off 12v, so I know it's not the board design.

Here's the updated code, including the option to run a wire between DI5 and Ground to have it switch to 2WD automatically. I think I'm at the point where I need a volunteer with a Base/Non-Sasquatch to test it out.




Code:
// XirallicBolts
// 2021+ Bronco Always Select GOAT
// Constant +12v
// 09-16-2023


#include <mcp_can.h>
#include <SPI.h>

#define CAN_INT     2        // Hardwired for MCP2515
#define CAN_CS      10       // Hardwired for MCP2515
#define SELECT_2WD  5        // If LOW, wire is INTACT
MCP_CAN CAN0(CAN_CS);

long unsigned int message_ID;
unsigned char message_LENGTH = 0;
unsigned char message_DATA[8];
unsigned char message_Steering_OK[8] = {0x10, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00};   // ID 0x081
unsigned char message_2H_Request[8] = {0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};    // ID 0x460
unsigned char message_4H_Request[8] = {0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};    // ID 0x460
unsigned char message_4A_Request[8] = {0x30, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};    // ID 0x460

long int MessageCounter = 0;
int      VehicleIsOff = 0;

void setup() {
  pinMode(SELECT_2WD, INPUT_PULLUP);
  pinMode(CAN_INT, INPUT);
  Serial.begin(115200);
   Serial.println("XirallicBolts");
   Serial.println("Bronco GOAT Auto-OK");
   Serial.println("09-16-2023");
   Serial.println("---------------------");

  // If using an unmodified prebuilt module, change 16MHz to 8MHz
  if(CAN0.begin(MCP_STDEXT, CAN_500KBPS, MCP_16MHZ) == CAN_OK)
    Serial.println("MCP2515 Initialized Succesfully");
  else
    Serial.println("Could not initialize MCP2515 (CS 10, INT 2, 500KBPS, 16MHz)");
  CAN0.setMode(MCP_NORMAL);
}

void loop() {
  if(!digitalRead(CAN_INT))
  {
    CAN0.readMsgBuf(&message_ID, &message_LENGTH, message_DATA);


    if(message_ID != 0x18A && MessageCounter < 10000)
      MessageCounter++;

    if(MessageCounter >= 9000 && VehicleIsOff == 0)
    {
      Serial.println("No 18A Detected in 9,000 messages.");
      Serial.println("Vehicle is assumed to be OFF.");
      VehicleIsOff = 1;
    }

    if(message_ID == 0x18A && VehicleIsOff == 0)
    {
      Serial.print("18A Detected. Resetting counter. Last value: ");
      Serial.println(MessageCounter);
      MessageCounter = 0;
    }

    if(message_ID == 0x18A && VehicleIsOff == 1)
    {
      Serial.println("-----------------------------");
      Serial.println("18A Detected, Vehicle was Off");
      delay(2500);
      Serial.println("Sending [OK] Messages");
      for(int i=0; i < 10; i++)
      {
        Serial.println("Sending OK Button");
        CAN0.sendMsgBuf(0x081, 0, 8, message_Steering_OK);
        if(digitalRead(SELECT_2WD) == LOW)
        {
          Serial.println("2WD Select Requested");
          CAN0.sendMsgBuf(0x460, 0, 8, message_2H_Request);
        }
        delay(1000);
      }

      VehicleIsOff = 0;
      MessageCounter = 0;
    }
  }
}
PXL_20230916_175214105.jpg
 

Sponsored
OP
OP
XirallicBolts

XirallicBolts

Outer Banks
Well-Known Member
First Name
Xira
Joined
Sep 27, 2020
Threads
11
Messages
887
Reaction score
1,613
Location
Wisconsin, USA
Vehicle(s)
2016 Flex EcoBoost, 2022 Silverado LT
Your Bronco Model
Outer Banks
New sockets arrived, I'm happy with the results so far. Now I just need to give it a few days to verify the program is good.
Couldn't remove the connector OR goat switch easily so it was a lot of guess-and-check for making my own connectors.

But hey, it's now a 5-minute install with 0 cutting or splicing.

Current draw is 25mA which is basically nothing to these cars


Ford Bronco [Success] Automatically select previous GOAT Mode (Sport, Slippery, etc) using Arduino + Canbus PXL_20230923_205049629


Ford Bronco [Success] Automatically select previous GOAT Mode (Sport, Slippery, etc) using Arduino + Canbus PXL_20230923_210559246
 

Bmadda

Badlands
Well-Known Member
First Name
Brian
Joined
Jul 18, 2020
Threads
20
Messages
2,735
Reaction score
6,303
Location
Wisconsin USA
Vehicle(s)
1990 Bronco eddie bauer
Your Bronco Model
Badlands
New sockets arrived, I'm happy with the results so far. Now I just need to give it a few days to verify the program is good.
Couldn't remove the connector OR goat switch easily so it was a lot of guess-and-check for making my own connectors.

But hey, it's now a 5-minute install with 0 cutting or splicing.

Current draw is 25mA which is basically nothing to these cars


Ford Bronco [Success] Automatically select previous GOAT Mode (Sport, Slippery, etc) using Arduino + Canbus PXL_20230923_210559246


Ford Bronco [Success] Automatically select previous GOAT Mode (Sport, Slippery, etc) using Arduino + Canbus PXL_20230923_210559246
Where did you get the connectors?
 
OP
OP
XirallicBolts

XirallicBolts

Outer Banks
Well-Known Member
First Name
Xira
Joined
Sep 27, 2020
Threads
11
Messages
887
Reaction score
1,613
Location
Wisconsin, USA
Vehicle(s)
2016 Flex EcoBoost, 2022 Silverado LT
Your Bronco Model
Outer Banks
Where did you get the connectors?
3d printed them. Not an exact match but fit both ends well enough. Terminals inside are standard dupont connectors

Ford Bronco [Success] Automatically select previous GOAT Mode (Sport, Slippery, etc) using Arduino + Canbus image_search_1695561740304


Program still only works 50/50. I'm not sure what I'm doing wrong. Maybe 9000 messages is too high and the canbus goes to sleep before hitting that amount.

While running, it averaged ~400 messages between each 18A appearance. I'll try something like 1500.
 
Last edited:
OP
OP
XirallicBolts

XirallicBolts

Outer Banks
Well-Known Member
First Name
Xira
Joined
Sep 27, 2020
Threads
11
Messages
887
Reaction score
1,613
Location
Wisconsin, USA
Vehicle(s)
2016 Flex EcoBoost, 2022 Silverado LT
Your Bronco Model
Outer Banks
Updated the #1 post. As it got colder, realized my original code would not work with remote starts.

New design, new code, everything. 3D printed parts, no wire cutting necessary if you have the right tools. Hopefully I was able to describe the idea and overall method well enough.

Still in need of someone with a base/non-sasquatch to verify the code works. I'll build and ship the whole works out to you, just report back if it does the thing. I have no idea if the messages I'm watching occur on ALL Broncos, or just Lux package. It's possible something like the 120v inverter is generating some of these and a Base won't have it.
 

swamp2

Raptor
Well-Known Member
Joined
Dec 19, 2022
Threads
88
Messages
2,069
Reaction score
1,773
Location
San Diego
Vehicle(s)
911 Carrera S / 4Runner TRD Pro
Your Bronco Model
Raptor
Good stuff. There is a product/business idea here for sure.

1. Recall all mode settings when vehicle turned off and set those when restarting. This is much more than just GOAT mode in the Raptor, where there is steering boost, throttle sensitivity, exhaust mode, etc. I have a plug and play product that does this in my Porsche and it saves a ton of button presses on every start. Very valuable.

2. In the Raptor you could do also do something like this by (IIRC) simply pressing the R button twice after start up. I.e. go into the memorized "Raptor mode" upon starting.

3. Disable ASS when starting (harder to do in '23s).

I'm sure the community could come up with more!
 
Last edited:

Sponsored
OP
OP
XirallicBolts

XirallicBolts

Outer Banks
Well-Known Member
First Name
Xira
Joined
Sep 27, 2020
Threads
11
Messages
887
Reaction score
1,613
Location
Wisconsin, USA
Vehicle(s)
2016 Flex EcoBoost, 2022 Silverado LT
Your Bronco Model
Outer Banks
Automating double-pressing R
2. In the Raptor you could do also do something like this by (IIRC) simply pressing the R button twice after start up

3. Disable ASS when starting (harder to do in '23s).
Should be pretty easy to automate pressing R, I'm sure it's very close to the OKAY message.

I'm not sure what makes disabling ASS so difficult, but I also haven't looked at what network the radio panel is on. You'd think it'd be as simple as broadcasting whatever message pressing that button generates. It's probably on MS-CAN, assuming the stereo controls are integral to the hvac panel.

I poked around a little bit before, trying to see if I can suppress the "Hands on Steering Wheel" alert -- the lane assist camera is on the same network as the goat switch, so no additional wiring would be needed. It's just really difficult to find the correct messages.
It'd be really easy if I used two modules to isolate just messages coming from the camera, but I'm hesitant to disconnect it
 

swamp2

Raptor
Well-Known Member
Joined
Dec 19, 2022
Threads
88
Messages
2,069
Reaction score
1,773
Location
San Diego
Vehicle(s)
911 Carrera S / 4Runner TRD Pro
Your Bronco Model
Raptor
Thanks @XirallicBolts . Just FYI the product (it is plug and play) for Porsche that always institutes last settings on start is $229 😉. Might be higher priced than the sweet spot for many Bronco owners, but on the flip side many Raptor peeps would probably pay a significantly % of this amount.
Sponsored

 
 



Top