Page 2 of 14

Re: VW - Beetle 2003

Posted: Sat Dec 05, 2020 8:42 am
by Bigpie
There's only one way to find out. I think it'll be fine but who knows.

Re: VW - Beetle 2003

Posted: Sat Dec 12, 2020 6:17 pm
by Bigpie


Coupler and adaptor plate seem good.
Pressing a long screwdriver on to where the gearbox input shaft enters the box and the other end on to the ear while spinning doesn't highlight any excessive vibration when spinning.

Couple more holes to drill and then I can test fit to car

Re: VW - Beetle 2003

Posted: Sun Dec 27, 2020 1:13 pm
by Bigpie
Just been working on the VCU side of things.
I seem to have problems with the timings of the canbus messages using stm32-car

video of behaviour
https://photos.google.com/share/AF1QipN ... 8xTW9RWnVn

The can period is set to 10ms but there seems to be enough delay to make the needle very erratic. Using an arduino uno and can bus module it's stable at 10ms.

Re: VW - Beetle 2003

Posted: Sun Dec 27, 2020 4:08 pm
by johu
Look at stm32_can.cpp . I forgot to update that on github. In line 344 it should say "false" not "true" . So like this:

Code: Select all

	can_init(canDev,
		     false,          // TTCM: Time triggered comm mode?
		     true,           // ABOM: Automatic bus-off management?
		     false,          // AWUM: Automatic wakeup mode?
		     false,          // NART: No automatic retransmission?
		     false,          // RFLM: Receive FIFO locked mode?
		     false,          // TXFP: Transmit FIFO priority?
		     CAN_BTR_SJW_1TQ,
		     canSpeed[baudrate].ts1,
		     canSpeed[baudrate].ts2,
		     canSpeed[baudrate].prescaler,				// BRP+1: Baud rate prescaler
		     false,
		     false);

Re: VW - Beetle 2003

Posted: Sun Dec 27, 2020 4:35 pm
by Bigpie
That doesn't seem to have any affect.

Adding a 1ms schedule makes it a little more stable, but still bounces around.

Code: Select all

static void Ms1Task(void)
{
    if (Param::GetInt(Param::canperiod) == CAN_PERIOD_1MS)
         can->SendAll();
   
}
.
.
.
s.AddTask(Ms1Task, 1);
The param speedmod is stable in both the plot and if I stick an arduino on the can bus with

Code: Select all

void loop()
{
    unsigned char len = 0;
    unsigned char buf[8];

    if(CAN_MSGAVAIL == CAN.checkReceive())            // check if data coming
    {
        CAN.readMsgBuf(&len, buf);    // read data,  len: data length, buf: data buf

        unsigned int canId = CAN.getCanId();
        if (canId == 640) {
          Serial.println("-----------------------------");
    
          uint16_t rpm = (buf[3] << 8) | buf[2];
          Serial.print(rpm/4, DEC);
  
          Serial.print("\t");
         
          Serial.println();
        }

    }
}

Re: VW - Beetle 2003

Posted: Sun Dec 27, 2020 5:17 pm
by johu
Any other device sending the same message? CAN bus well layd out and terminated?
I had a stable display even with 100ms interval.

Re: VW - Beetle 2003

Posted: Sun Dec 27, 2020 5:59 pm
by mdrobnak
johu wrote: Sun Dec 27, 2020 5:17 pm Any other device sending the same message? CAN bus well layd out and terminated?
I had a stable display even with 100ms interval.
I agree 100%. Instrument cluster is a low-priority CAN bus item, 100 ms updates are a normal rate. 10ms should be more than sufficient. On a car with an engine, the fluctuations will actually make the needle move more, and OEMs dampen the response around idle to compensate (they usually zero out some of the least significant bits).

-Matt

Re: VW - Beetle 2003

Posted: Sun Dec 27, 2020 7:21 pm
by Bigpie
So I've pull it from the car, put a 120ohm on the cluster end and on the stm32 end.
With the one can bus map, for id 640, 16, 16, 4, plus the hardcoded message in stm32-car.

Seems stable now at 10ms, it twitches occasionally, 100ms still rising to ~700 then dropping, so will stick with 10ms.

I'm thinking the old ECU must have had a termination in it and the other is somewhere else in the car as it doesn't appear to be in the cluster.
Screenshot 2020-12-27 at 8.42.11 pm.png
The diagram doesn't make it obvious where the 2 ends are.
Thanks for the help.

Re: VW - Beetle 2003

Posted: Mon Dec 28, 2020 12:25 pm
by johu
Ok good, still surprised that it twitches. NART flag now low in can_init() call? I've updated it in the repo anyway.

Re: VW - Beetle 2003

Posted: Mon Dec 28, 2020 12:40 pm
by Bigpie
It is, I merged all your changes in, will experiment further. I've just put 120ohm on the stm32 end but documentation I've found suggests the ECU has 66ohm resistance.

I've also changed the oil pressure to use speedmod not speed mine seems to require it connected to gnd at 600rpm.

Re: VW - Beetle 2003

Posted: Mon Dec 28, 2020 2:37 pm
by ZooKeeper
Going way back in memory here, but if I recall my coursework correctly, BOSCH "invented" the modern CAN bus for automotive applications and there are essentially two critical measurements, key on, engine off & at the diagnostic port...

Resistance between CH & CL = 60 ohm +/-2 ohms; and secondly CHv + CLv = 5.00 +/-0.2v

From your diagram, it seems VW is essentially using internal terminating resistors for each module, a clever way to detect a missing one.

Re: VW - Beetle 2003

Posted: Mon Dec 28, 2020 5:10 pm
by mdrobnak
ZooKeeper wrote: Mon Dec 28, 2020 2:37 pm Going way back in memory here, but if I recall my coursework correctly, BOSCH "invented" the modern CAN bus for automotive applications and there are essentially two critical measurements, key on, engine off & at the diagnostic port...

Resistance between CH & CL = 60 ohm +/-2 ohms; and secondly CHv + CLv = 5.00 +/-0.2v

From your diagram, it seems VW is essentially using internal terminating resistors for each module, a clever way to detect a missing one.
I think that's more implying the effective resistance of the transceiver. Usually the ECU is one end of the bus, I'm not sure what's usually on the other, but whenever messing with them I've always had to put a 120 ohm resistor on the bus where the ECU was. That _should_ be all that's necessary here. And your memory is right regarding the relationship with Bosch and CAN.

I'm not sure about that voltage measurement. That would imply an idle bus I think?

-Matt

Re: VW - Beetle 2003

Posted: Mon Dec 28, 2020 5:47 pm
by Bigpie
I'd stuck 66 ohm on the ECU replacement. There's no inverter in there at the moment so the brake pedal mimics the speed coming from the inverter.

https://photos.google.com/share/AF1QipP ... 1NVU1qYnB3

100ms still fluctuates, but 10ms works fine.

I've got the power steering pump wired in now, one of the large fuses on top of the battery was for the fans so repurposed that.
Hopefully the vacuum sensor will be here in the next few days and I can start looking at that next.

Also need to checkout why the ASR and AirBag lights remain on.

Re: VW - Beetle 2003

Posted: Sun Jan 17, 2021 4:28 pm
by Bigpie
Made some more progress this weekend. I now have brake assist, though the pump is just rammed in there at the moment, so I need to make a bracket up. It comes on and off as required. Very pleased with this. Power steering also fires up when the key is turned to 'start'.

Re: VW - Beetle 2003

Posted: Sun Jan 17, 2021 5:52 pm
by johu
Bigpie wrote: Mon Dec 28, 2020 5:47 pm Also need to checkout why the ASR and AirBag lights remain on.
In Touran, ASR light was a matter of sending the right CAN messages as denoted in the stm32-car readme. My airbag light went on when I plugged the "front bumper sensor" into the reverse output of the transmission :) They use an equally coded plug and are on the same loom. I had to use a cheap OBD adapter to clear the fault.

Re: VW - Beetle 2003

Posted: Sun Jan 17, 2021 6:15 pm
by Bigpie
I'll have to check those out. I think the airbag light was on before I removed the engine. Apparently the loom under the passenger seat is a common cause.

I've not got the gearbox back in yet. I had some runout on my coupler and I've made friends with a cnc machinist who is making me a coupler and adaptor plate. So looking forward to seeing what he comes up with.

Re: VW - Beetle 2003

Posted: Tue Feb 09, 2021 6:36 pm
by Bigpie
Battery pack arrived. It's 8.8kwh from a Golf GTE
It took some opening. The top was plastic and must have had a full tube of silicone round it.

The pack is sitting at 350v.

Re: VW - Beetle 2003

Posted: Sun Feb 21, 2021 1:43 pm
by Bigpie
I've now got my pack charing with an outlander charger, current savvy can is sending the frames, but looking at integrating in to simpBMS
Screenshot 2021-02-21 at 1.16.52 pm.png
20210221_131614.jpg

Re: VW - Beetle 2003

Posted: Sat Mar 13, 2021 5:55 pm
by Bigpie
While I'm still waiting on the adaptor plate from the CNC bloke, I did get my coupler from him, so I've got on with re-mounting the gearbox and positioning the motor, and starting on getting the inverter in place.
20210313_111135.jpg
20210313_111139.jpg
20210313_134844.jpg
20210313_143608.jpg
20210313_143717.jpg

Re: VW - Beetle 2003

Posted: Sat Mar 20, 2021 5:46 pm
by Bigpie
20210320_155638.jpg
20210320_160126.jpg
Outlander charger is mounted now. Battery modules next. Hopefully my CNC'd adaptor plate will be done soon so I can get the mounts finished for the motor.

Re: VW - Beetle 2003

Posted: Mon Apr 05, 2021 8:20 am
by Bigpie
I little more progress on the battery mounting.
The are going in a L shape, once the mounting frame is done, I'm planning on making a fibreglass tub for them to sit in.
20210404_162203.jpg
20210404_162432(0).jpg
20210404_162255.jpg
20210404_162252.jpg
Still need to make up a mount for the motor side to the old engine mount.

Re: VW - Beetle 2003

Posted: Wed Apr 21, 2021 12:05 pm
by Bigpie
My adaptor plate has just been delivered.
20210421_124814.jpeg
20210421_124822.jpeg

Re: VW - Beetle 2003

Posted: Wed Apr 21, 2021 12:18 pm
by bobby_come_lately
I have CNC envy.

Re: VW - Beetle 2003

Posted: Wed Apr 21, 2021 4:34 pm
by Alibro
bobby_come_lately wrote: Wed Apr 21, 2021 12:18 pm I have CNC envy.
Having just looked at my DIY effort so do I. :D

Re: VW - Beetle 2003

Posted: Wed Apr 21, 2021 7:50 pm
by JaniK
Very Nice. 👍