FS: VR - VY BCM Simulator

Hardware and Software. If you have something to sell, post it here.
Posts: 353
Joined: Thu May 03, 2012 10:50 pm
Location: Castlemaine, Vic

Re: FS: VR - VY BCM Simulator

Postby pman92 » Wed Sep 25, 2019 9:57 pm

So you want to be able to independently swap the cluster to the LPG fuel sender/dist to empty, while keeping the PCM on petrol? (Or keep the PCM on LPG but make the cluster use petrol sender)
VR-VY Holden BCM Simulator: LINK
Ford Smartlock Bypass Module: LINK

Posts: 30
Joined: Mon Dec 24, 2012 1:35 pm

Re: FS: VR - VY BCM Simulator

Postby Nathen » Fri Sep 27, 2019 4:01 pm

Something like that. With aftermarket LPG the system uses the standard petrol maps and injector drivers to drive the LPG injectors.
So the PCM always thinks it is delivering petrol. The aftermarket ECU manages the injection length to manage the LPG fuel injection close to the PCM petrol map.
The factory LPG is carburetted so the PCM turns off the injectors, turns on the tank and swaps the dash to LPG. ect. It also tells the dash to swap fuel senders ect. In the factory tank the sender is closely calibrated to the petrol sender. There is also a map in the dash for the LPG 0,1/4,12/3/4, and full just like petrol. The problem with the factory system is it is very restrictive and decreases the engine power output considerably.
I looked at trying to disassemble the pcm code and find the relevant bits, but its not that easy with a 128K bin. Particularly the reassembly.
Thats when I stumbled across your device and thought that might be a potential option.
So I was thinking, If I can intercept the PCM message, change the code dependent on an input which would be linked to using LPG I could get back the functionality of the dash, which is way better than the 3 leds you get on the aftermarket system to indicate level.
I'm happy to do most of the work, Just hoping for some pointers in the right direction with circuit diagrams and code ect.,

Posts: 353
Joined: Thu May 03, 2012 10:50 pm
Location: Castlemaine, Vic

Re: FS: VR - VY BCM Simulator

Postby pman92 » Fri Sep 27, 2019 6:56 pm

When I get a chance I'll post up some more info that should help you
VR-VY Holden BCM Simulator: LINK
Ford Smartlock Bypass Module: LINK

Posts: 353
Joined: Thu May 03, 2012 10:50 pm
Location: Castlemaine, Vic

Re: FS: VR - VY BCM Simulator

Postby pman92 » Sat Sep 28, 2019 8:11 am

Heres an ALDL read function. Credit goes to VL400 for this.
Code: Select all
#define ALDL_BUFFER_SIZE 170  //255-0x55  =>  255-85  =>  170 max frame length
#define ALDL_BASE_LENGTH 0x55 //base size for message length (2nd byte)
HardwareSerial &ALDLserial = Serial1;
byte bufferRX[ALDL_BUFFER_SIZE];
unsigned long _lastActivity; //last ALDL bus activity (for detecting bus silence etc)
boolean ALDL_read() {
  static int RXchecksum = 0;
  static byte ByteCount = 0;
  static byte PayloadCount = 0;
  static boolean ChecksumOnly = false;
  if ((millis() - _lastActivity) > 100) { //If there have been no bytes received for 100ms, assume no receive activity and reset. Helps bus sync
    ByteCount = 0;
  }
  while (ALDLserial.available() > 0) {
    _lastActivity = millis();
    byte inByte = ALDLserial.read();
    if (ByteCount == 0) { //Device ID byte
      bufferRX[ByteCount] = inByte;
      RXchecksum = inByte;
      ByteCount = 1;
      ChecksumOnly = false;
    } else if (ByteCount == 1) {  //Packet length byte
      if (inByte < ALDL_BASE_LENGTH) {  //invalid byte, packet length byte below minimum
        ByteCount = 0;
        return false;
      } else if (inByte > (ALDL_BASE_LENGTH + ALDL_BUFFER_SIZE - 1)) {  //packet will be too big for our buffer
        ChecksumOnly = true;
      }
      bufferRX[ByteCount] = inByte;
      RXchecksum = RXchecksum + inByte;
      PayloadCount = inByte - (ALDL_BASE_LENGTH - 1);
      ByteCount++;
    } else if (ByteCount > 1) {
      bufferRX[ByteCount] = inByte;
      RXchecksum = RXchecksum + inByte;
      PayloadCount--;
      if (ChecksumOnly == false) {
        ByteCount++; //will just write to same byte over and over if its too big for our buffer
      }
      if (PayloadCount == 0) {  //upto checksum
        if (byte(RXchecksum) == 0) {  //Valid checksum
          ByteCount = 0;
          if (ChecksumOnly == false) {
            return true;
          }
        } else {
          //checksum was bad
          ByteCount = 0;
        }
      }
    }
  }
  return false;
}


Heres how to use it in the main program loop:
Code: Select all
if (ALDLserial.available()) {
    if (ALDL_read()) {
      ALDL_process(); //Process a received ALDL frame with your function here
    }
  }
VR-VY Holden BCM Simulator: LINK
Ford Smartlock Bypass Module: LINK

Posts: 353
Joined: Thu May 03, 2012 10:50 pm
Location: Castlemaine, Vic

Re: FS: VR - VY BCM Simulator

Postby pman92 » Sat Sep 28, 2019 8:34 am

Heres a send function

Code: Select all
byte bufferTX[ALDL_BUFFER_SIZE];
boolean ALDLactive = true; //this can be set to false to prevent sending frames (I use it when something has requested BCM silence on my BCM simulator)
boolean ALDL_send(byte CSpos, boolean CSskip = false, byte waitTime = 3) {
  //send data in TX buffer. returns true if sent, false if send failed.
  //CSpos = Checksum position in the buffer (frame length)
  //CSskip = Normally checksum is calculated and added automatically, if this is true that wont be the case
  //waitTime =  how many milliseconds of bus inactivity before we should start sending
  byte checksum = 0;
  if (CSpos < 2 or CSpos > ALDL_BUFFER_SIZE) {
    //Invalid packet length
    return false;
  }
  for (byte i = 0; i < CSpos; i++) {
    checksum += bufferTX[i];
  }
  checksum = 0x100 - (byte(checksum) % 0xFF);
  if (CSskip) { //don't add the checksum
    if (checksum != bufferTX[CSpos]) {
      //The calculated checksum doesn't match what is already in the buffer (checksum is invalid - you would be sending an invalid frame)
    }
  } else { //add the checksum
    bufferTX[CSpos] = checksum;
  }
  if (ALDLactive) {
    while ((_lastActivity + waitTime) > millis()) { //wait for our period of inactivity (default 3ms since last frame)
      if (ALDLserial.available()) {
        //something else has started transmitting. At this stage you have to let it go back to the main loop and read new frame before trying again
        return false;
      }
    }
    ALDLserial.write(bufferTX, (CSpos + 1));
    ALDLserial.flush(); //wait until sent
    _lastActivity = millis();
    return true;
  } else {
    //Transmitting is disabled
  }
  return false;
}


To use it basically load up a frame in bufferTX, you don't have to worry about calculating and adding the checksum, then call the function with CSpos where the checksum should go. If it returns true it sent, if false it didn't send.
It could be made even simpler. You could remove the option to send without adding checksum and have a hard coded amount of silence before sending. You could have it calculate the checksum position from the 2nd byte (message length) in the buffer so you don't have to specify it each time you call the function.
VR-VY Holden BCM Simulator: LINK
Ford Smartlock Bypass Module: LINK

Posts: 353
Joined: Thu May 03, 2012 10:50 pm
Location: Castlemaine, Vic

Re: FS: VR - VY BCM Simulator

Postby pman92 » Sat Sep 28, 2019 8:43 am

Heres the UART-ALDL interface circuit:
thumbnail_20190928_083612.jpg


I can't find where I originally found it but here's where I found someone who had the same problem as me (and hence the solution):
https://electronics.stackexchange.com/q ... low-enough

The receive control pin can be set high when you are sending (inside the ALDL_send function) so that you won't get the echo received back. I'm not worried about that so its permanently joined to ground. But that could be useful for you.
You can remove the one transistor, 100 ohm resistor and LED if you don't want an activity LED
VR-VY Holden BCM Simulator: LINK
Ford Smartlock Bypass Module: LINK

Posts: 10
Joined: Mon Sep 09, 2019 9:59 pm

Re: FS: VR - VY BCM Simulator

Postby picvrss » Sat Sep 28, 2019 11:54 am

Transistors used in the receive portion of ALDL interface circuits can give unpredictable and sometimes frustrating results, as described by pman92 and the link he referred to.
The transmit portion is usually no problem; an open-collector NPN will always drive the bus reliably by switching fully to ground.

I've used the following comparator-based circuit for many ALDL projects and it has proven absolutely reliable. Both comparators in the 8-pin package are referenced to 2.5V, with positive feedback around the initial stage to provide a degree of hysteresis. The second stage simply maintains polarity of the received bus logic state.

There's no hardware gating to suppress echo, as I deal with this if necessary in my software.
Attachments
ALDL interface.jpg
ALDL interface.jpg (134.22 KiB) Viewed 531 times

Previous

Return to For Sale

Who is online

Users browsing this forum: No registered users and 3 guests