Sunday, July 10, 2016

The sad story of the batteries

Battery boxes came next, and so did may first set back. The TIG welder decided to pack it in, and the repair bill was just less than a new unit. Funny how they make that workout. The intent was to build aluminum boxes that would seal the batteries from the elements and provide a level of psychical protection.
The first design was for 100 CALB CA60 batteries. I went ahead and ordered 6 batteries to use as models to size the boxes. As soon as I finished construction of the last of the 7 boxes, I tried to placed the order for the remaning batteries only to find out that they where nolonger available. The next larger size however was still being manufactured. And here is where it went south. Each dimension of the larger battery was different the CA60 battery the boxes had been designed for. As hard as I tried, cut an little here, add a little there, it was no use. New boxes would be needed to house the batteries.

So this time I purchased all the batteries that would to be used in one order up front. CALB CA100 batteries this time around. The capacity of each cell had increased by 40%, but so had the size. As the car has limited space, and I am unwilling to give up cargo space, the number of batteries was reduced from the original plan of 100 cell, to 75 cell. Range will actually increase, as the pack kWh is has increased, but sad to say acceleration performance will suffer a little as the weight has also increased.


Building the box lip for a box that is to be fitted where the gas tank was.
The floor of the trunk was opened up and prepared for a pair of boxes. A single box would have been ideal, but a structural brace for the rear bumper was in the middle of the space.


Removing the engine
The engine is actually very cool, great engineering and a wonder to look at, but it had to go.
After engine, gas tank, exhaust, and last of other gas engine support stuff was removed, the cleaning started. Gas engines messy!

Friday, July 1, 2016

Completely forgot, but it does live on!

So, since the last post what has happened?
The conversion was put on hold for a year to allow the car to be used as a normal car. In the mean time plans were formulated, designs were made, ideas there dreamed up, and as time went on all was forgotten.

So before removing the engine I captured a lot of data from the CANBUS on the car. I though this would be helpful in the future in keeping the rest of the car happy without the engine installed, and to allow for the stock instrument cluster to be operated with spoofed messages. This is what I have so far.
BMW Z4 2003 PT-CanBus Messages
Not all message have been validated

Message label
0x153 (ASC1)
0x1F0 (DSC, ABS)
0x1F3
0x1F5 (LWS, Steering Angle)
0x280 (?)
0x316 (DME1, Digital Motor Electronics)
0x329 (DME2, Digital Motor Electronics)
0x501
0x545 (DME4, Digital Motor Electronics)
0x613(KOMBI, instrument)
0x615(KOMBI, instrument)


PT-CAN
DME – Digital Motor Electronics
DSC – Dynamic Stability Control
EPS – Electronic Power Steering
KOMBI – Instrument Cluster
LWS – Steering Angle Sensor

K-BUS
CID – Central Information Display
CVM – Convertible Top Module
EWS III – Electronic Immobilizer
GM 5 – General Module 5
HiFi – HiFi
IHKA – Automatic Climate Control
IHKS – Integrated Heating Control
IHS – Integrated Heating Control
LSZ – Light Switch Cluster
NAV – Navigation
PDC – Parking Distance Control
RADIO – Radio
RLS – Rain/Light Sensor
SM – Seat Module
SZM – Center Console Switch Cluster
TEL – Telephone
VM – Video Module

ARBID: 0x1F0 (ABS)
Individual wheel speeds:
-B0 Left front
-B1
-B2 Right front
-B3
-B4 rear
-B5
-B6 rear
-B7

Signal wheel 1: startbit 0, bit length 12, Intel LSB, unsigned, gain 1/16 (0.0625) (byte0 + next 4 bits of Byte1)
Signal wheel 2: startbit 16, bit length 12, Intel LSB, unsigned, gain 1/16 (0.0625) (byte2 + next 4 bits of byte3)
Signal wheel 3: startbit 32, bit length 12, Intel LSB, unsigned, gain 1/16 (0.0625)
Signal wheel 4: startbit 48, bit length 12, Intel LSB, unsigned, gain 1/16 (0.0625)

The above translated to .xls syntax.
Wheel speed 1: (HEX2DEC(B0)+BIN2DEC(RIGHT(HEX2BIN(B1),3 maybe this 3 should be a 1))*256)/16*0.621
Wheel speed 2: (HEX2DEC(B2)+BIN2DEC(RIGHT(HEX2BIN(B3),3))*256)/16*0.621
Wheel speed 3: (HEX2DEC(B4)+BIN2DEC(RIGHT(HEX2BIN(B5),3))*256)/16*0.621
Wheel speed 4: (HEX2DEC(B6)+BIN2DEC(RIGHT(HEX2BIN(B7),3))*256)/16*0.621

ARBID: 0x153 (ASC1)
-B0
bit 0; 0x01 = tire pressure set is off
bit 1; 0x02
bit 2; 0x04
bit 3; 0x08
bit 4; 0x10 = Brake Pedal pushed
bit 5; 0x20
bit 6; 0x40
bit 7; 0x80

-B1
bit 0; 0x01 = tire pressure set is off
bit 1; 0x02
bit 2; 0x04
bit 3; 0x08 = LSB speed, bit 0
bit 4; 0x10 = LSB speed, bit 1
bit 5; 0x20 = LSB speed, bit 2
bit 6; 0x40 = LSB speed, bit 3
bit 7; 0x80 = LSB speed, bit 4

-B2 Speed MSB: start bit 0, bit length 8; MPH = (LSB+MSB)/16*0.621371
-B3
-B4
-B5
-B6
-B7
bit ? tire pressure warning light on red
DTC on

Speed MPH
=(BIN2DEC(LEFT(TEXT(HEX2BIN(B1),"00000000"),5))+(HEX2DEC(B2)*32))/16*0.621371

ARBID: 0x1F5 (steering Angle/Velocity Sensor)
-B0
            bit 0; 0x01 steering angle bit 4
bit 1; 0x02 steering angle bit 5
bit 2; 0x04 steering angle bit 6
bit 3; 0x08 steering angle bit 7
bit 4; 0x10 steering angle bit 0
bit 5; 0x20 steering angle bit 1
bit 6; 0x40 steering angle bit 2
bit 7; 0x80 steering angle bit 3
-B1
bit 0; 0x01 steering angle bit 8
bit 1; 0x02 steering angle bit 9
bit 2; 0x04 steering angle bit 10
bit 3; 0x08 steering angle bit 11
bit 4; 0x10 steering angle bit 12
bit 5; 0x20 steering angle bit 13
bit 6; 0x40 steering angle bit 14
bit 7; 0x80 sign bit steering angle
-B2
bit 0; 0x01 steering velocity bit 4
bit 1; 0x02 steering velocity bit 5
bit 2; 0x04 steering velocity bit 6
bit 3; 0x08 steering velocity bit 7
bit 4; 0x10 steering velocity bit 0
bit 5; 0x20 steering velocity bit 1
bit 6; 0x40 steering velocity bit 2
bit 7; 0x80 steering velocity bit 3
-B3
bit 0; 0x01 steering velocity bit 8
bit 1; 0x02 steering velocity bit 9
bit 2; 0x04 steering velocity bit 10
bit 3; 0x08 steering velocity bit 11
bit 4; 0x10 steering velocity bit 12
bit 5; 0x20 steering velocity bit 13
bit 6; 0x40 steering velocity bit 14
bit 7; 0x80 sign bit steering velocity
-B4
-B5
-B6
-B7

ARBID: 0x316 (DME1) 
-B0
Bit 0; 0x01= Key on
Bit 1; 0x02
Bit 2; 0x04 = Ignition on, DME ready
Bit 3; 0x08
Bit 4; 0x10 = starter on
Bit 5; 0x20
Bit 6; 0x40 = AC Clutch engaged

Bit 7; 0x80

-B1 current throttle opening
-B2 RPM LSB
-B3 RPM MSB [RPM=(hex2dec("byte3"&"byte2"))/6.4]
-B4 Desired throttle opening
-B5
-B6
-B7

ARBID: 0x329 (DME2)
-B0
-B1 coolant temperature in C = .75 * (hex2dec(byte01) - 48.373)
-B2
-B3
bit 0; 0x01 = clutch pressed
bit 1; 0x02
bit 2; 0x04
bit 3; 0x08 may appear after 30 seconds of engine operation
bit 4; 0x10 may appear after engine start
bit 5; 0x20 = Cruise control + button press, momentary
bit 6; 0x40 = Cruise control - button press, momentary
bit 7; 0x80 = Cruise control on/off, momentary
-B4 Cruse control throttle command
-B5 Throttle position (00-FE).
-B6
bit 0; 0x01 = Brake pedal depressed
bit 1; 0x02
bit 2; 0x04
bit 3; 0x08 = Cruse Control On
bit 4; 0x10 = Cruse Control Resume
bit 5; 0x20 = Cruse Control Being Activated
bit 6; 0x40
bit 7; 0x80
-B7

ARBID: 0x545 (DME4), 
-B0
bit 0; 0x01
bit 1; 0x02 = Service Engine Soon light on
bit 2; 0x04
bit 3; 0x08
bit 4; 0x10 = EML light on
bit 5; 0x20
bit 6; 0x40 = Check Gas Cap light on
bit 7; 0x80
-B1 Fuel consumption LSB
-B2 Fuel consumption MSB. Values just cycle from 0 to FFFF then start over at zero. Fuel consumption is the rate of change.
-B3
bit 0; 0x01
bit 1; 0x02 = Yellow Oil Level light set is off
bit 2; 0x04
bit 3; 0x08 = Coolant Temperature Alarm light on
bit 4; 0x10
bit 5; 0x20
bit 6; 0x40
bit 7; 0x80

-B4 Oil temperature in C = .75 * (hex2dec(byte04) - 48.373), formula not correct maybe hex2dec(byte4)-48.373
-B5
bit 0; 0x01 = Oil pressure light set is off
bit 1; 0x02
bit 2; 0x04
bit 3; 0x08 = A/C switch
bit 4; 0x10 = Battery light set is off
bit 5; 0x20
bit 6; 0x40
bit 7; 0x80

-B6
-B7
bit 0; 0x01
bit 1; 0x02
bit 2; 0x04
bit 3; 0x08
bit 4; 0x10
bit 5; 0x20
bit 6; 0x40
bit 7; 0x80 = Oil Pressure Light on

ARBID: 0x613
also sent from the instrument cluster if 0x615 is acknowledged.
-B0 Odometer LSB
-B1 Odometer MSB [Convert from Hex to Decimal. Multiply by 10 and that is Odometer in Km], only send data every 10 Km
-B2 is fuel level. Full being hex 39 Fuel light comes on at hex 8. Then values jump to hex 87 (or so) and then go down to hex 80 being empty.
-B3
-B4
-B5
-B6
-B7

ARBID: 0x615 sent from the instrument cluster. 
-B0
bit 0; 0x01
bit 1; 0x02
bit 2; 0x04
bit 3; 0x08
bit 4; 0x10
bit 5; 0x20
bit 6; 0x40
bit 7; 0x80 = A/C switch, could also be byte 1 bit 5
-B1
bit 0; 0x01
bit 1; 0x02
bit 2; 0x04 = headlight parking lights on
bit 3; 0x08
bit 4; 0x10 = AC fan speed
bit 5; 0x20 = AC fan speed

bit 6; 0x40= AC fan speed
bit 7; 0x80 = AC fan speed

-B2
-B3
bit 0; 0x01
bit 1; 0x02
bit 2; 0x04
bit 3; 0x08 = OAT, Convert from Hex to Decimal. Temperature in C. If decimal value greater than 128, then subtract 128 to get temperatures below 0C.
Examples
hex 30 = 48 degrees C
hex 0D = 13 degrees C
hex 84 = -4 degrees C

bit 4; 0x10
bit 5; 0x20
bit 6; 0x40
bit 7; 0x80 A/C on
-B4
bit 0; 0x01 = Driver Door open
bit 1; 0x02 = handbrake engaged
bit 2; 0x04
bit 3; 0x08
bit 4; 0x10
bit 5; 0x20
bit 6; 0x40
bit 7; 0x80
-B5
bit 0; 0x01
bit 1; 0x02 = Left turn Signal
bit 2; 0x04 = Right turn signal
bit 3; 0x08
bit 4; 0x10
bit 5; 0x20
bit 6; 0x40
bit 7; 0x80

-B6
-B7
bit 0; 0x01
bit 1; 0x02 = key information (if 1, key information available)
bit 2; 0x04 = key number (00 = Key 1, 01 = Key 2, 10 = Key 3, 11 = Key 4)
bit 3; 0x08
bit 4; 0x10
bit 5; 0x20
bit 6; 0x40

bit 7; 0x80