Introduction
I will be editing and adding a lot of info for the past progress and what I have done so far, the engine was previously turbo'd and tuned on its stock internals & engine management (MS43) by myself, I recently decided to build it completely and go full standalone.
So far: Engine starts and the tuning process has started :)
I took the stock harness out of the car and modifying it to fit the ecu. Some mods to the harness include removal of SAP, Purge Valve, PCV, front & rear O2 sensors, deletion of MAP controlled thermostat, fitting a drive-by-cable throttle body instead of the DBW because of the limitation of VEMS. Still more fine tuning and additions to come.
I will remove this introduction once I feel the documentation is complete or I added enough information
- I would like to thank the moderator of the wiki for his quick, helpful, and precise help :) Keep it up:)
Car
- BMW E46 330i
Engine
M54B30:
- Inline 6, 2979cc, double VANOS, Al block & head
- Bored to 84.50 mm for CP forged pistons 8.5:1
- SP components con rods
- raceware main and head stud kits, block timeserted
- Cometic stock thickness HG
- GT35R 0.63 turbine with 50mm BOV, 38mm WG, 600x300x76 mm IC
- 2.5" before IC, 3" after, custom piping
- 850cc Siemens DEKA injectors
VEMS V3.6
- IGBT: 8
- LCD: Y
- Knock sesors: 2
- EGT: 2
- Flyback: 30 v
- MAP: 400 kPa
- No SD card, no 1-wire, no PS2
- Trigger
- primary trigger: HALL sensor 60-2 mounted on the block
- secondary trigger: HALL sensor (intake cam)
- third trigger: HALL sensor (exhaust cam)
- Above info are taken from BMW engine manuals
Note on HALL & VR sensors:
Measure resistance for each sensors (both VR and HALL typically has 3 pin. 2 pin is rare, but that is always VR). If you find 2 pins which measures same resistance in both directions (normally between 300..1400 Ohm) that is VR, otherwise HALL.
M54 triggers note: contradiction here !
- primary trigger: Crank Position Sensor: 60-2 HALL
- sectrig, third trig: Cam I & Cam II in the M54 are HALL sensors
- Double Vanos configlet is not correct, cam triggers are VR (=coil) type (single pulse per cam rev). You can easily setup your trigger configuration with trigger setup visual. And verify timing with timing light.
- Just delete/replace wrong info instead of appending the new findings (and causing confusion) !
Several questions arise:
- For the three sensors, voltage supply is switched +12v from the harness. I have just wired the signal wires of each to its pin.
A: Keep stock wiring for trigger sensors.
- For the setup:
- CPS: I just plugged in the default #s from the 'double vanos' defaults in the software, is that correct?
- Cam I&II: The trigger wheel on both cams is a half moon circle, is that considered as VR (='coil type') or is it just one long tooth?
- Tried to start the engine, with the secondary trigger enabled, I got no RPM reading at all, I disabled the sectrig I got a reading at once. My setup is for fully sequential.
- EDIT: I let it ignore pulses above 255 and I got a steady reading with enabling 2nd & 3rd trig. Secondary and Third will be used to be able to control the double VANOS later when the engine idles and I am done with the break in period.
Now I got a nice cranking with RPM reading & sensors are ok, but the engine just doesn't start. I am kinda not sure what to do, as I believe I revised them all, I am almost sure it is a problem with the primary trigger, I tried TDC as 54, 64. I read somewhere that the TDC is 324 after the missing tooth, which is 54 teeth. So it should work, but it didn't. I uploaded my cfg & triggerlog files at:
http://vems.hu/vemstune/sharingcenter/reports.php?cmd=view&key=UXvOoK
Your configuration looks good enough to start (i have the same engine but m54b25) but reduce dwell (1.5 msec is enough for these coils) most likely cause is firing order does not match configuration. My first cylinder to fire in sequence is 5, rotate real cylinder order right (once) and make sure the outputs match cylinder number e.g. cyl5, ignition output goes to cyl#5 coil en so on. - DB
- I have the TDC after trigger set to 64 deg, engine runs fine, but I suspect it because the car runs really rich. Could it be set wrong and ignition occurs in real so late that some unburnt fuel gives me that rich reading???
- Also a very silly problem: The car starts just fine, when right after start I have to give it a throttle blip and smoothen the idle with my foot for couple of second, then it stabilizes and idles just fine (rich though). And at ANY time, if I press the throttle and let it, the RPM just drops and engine stalls. I have to "support" it with the throttle and let it decrease slowly so it catches up. I played around with idle settings, and with VE with the same results...What can I do??
http://vems.hu/vemstune/sharingcenter/reports.php?cmd=view&key=dMGslM
A: Hints provided in sharing center report, more hints - DB
VANOS
Perhaps the most interesting specific engine application in BMW
The M54 is a double VANOS engine, each cam is controlled by a single solenoid that pushes in & out to varies the time. That's different from the ///M engines that use 2 seloinds/cam for an independent push/pull.
Each solenoid is connected directly to switched ign +12v & is PWMed from the DME to move it in/out.
My box came populated with 4 pFETs on P259s. I used P259 ch6&7; 36-31 & 36-30; to control the intake/exhaust solenoids respectively.
- M54 Vanos solenoids need switched GROUND to be activated, not pFET (which is swiched VBAT), please revise your wiring. When suitable GND switched outputs are available switch from pFET to those (leftover INJ/IGN outputs). If not available: Revise wiring on solenoid side: cut switched vbat from dme relay (the wire not going to the Vems and connect to gnd on solenoid side). - DB
- Q1: What are other uses for these ports???
- A1: With some rewiring they can be used for DISA and/or Boost control solenoid.
- Q2: I have two extra IGN ports that I used one already for the DISA, the other was planned for the boost solenoid. If I use them for the VANOS sols, where can I plug the DISA & boost??
- A2: If you have free injector channel (and you do not want to do rewiring to use pfet outputs) you could use those.
The last resort (&probably the easiest) would be hooking the +ve supply from the harness to the GND instead as you mentioned.
- Now that I am trying to control the VANOS, they don't move. I tried different DC for each. I noticed that making the DC 100 for the EX cam (connected to IN control) make it move to a certain position that's not related to the table, on its own. I don't know what to do actually. I uploaded yesterday's log file to the sharing center, here is the link:
http://vems.hu/vemstune/sharingcenter/reports.php?cmd=view&key=Mcu1Os
E-Fan
The radiator fan is controlled by a final stage box mounted on the fan shroud, it has three wires coming in:
1. +12v
2. GND
3. PWM signal from the ECU, this one is confirmed to be from 10-100Hz, fan is only on between 10%-90% duty (From BMW catalogues)
Then two wires coming out to the fan motor, +12v & GND from the final stage.
- Confirmed: modern digital TEMIC or Bosch fans can be controlled by a simple ground-switching PWM signal in the ~100Hz frequency range. Virtually no load on this wire, it is logical signal, any VEMS output can be used. Some fans even have an RPM feedback signal on a 4th wire. On supply wires the load can be ~40A for 600W fans, so soft start/stop is a must here, but it is partially implemented in the fan's eletronic control box
- PWM wire (thin black x yellow) hooked to EC36-16 (P259 ch1), configured in secondary PWM boost control, abosulte & relative modes work, tried 94Hz & 125Hz they both work, 125Hz looks more linear, I noticed on 94Hz the fan tends to turn off then again on when changine the DC, on 125Hz it doesn't, I will use the absolute & 125Hz
We need extra software support from VEMS firmware to get coolant-temperature dependent PWM signals.
- I hope there is an incoming update for that very specific purpose, what's needed is a CLT/PWM table to control the fan, I currently control it manually (turn it on & off & vary the PWM depending on the CLT which is not practical, and I don't want to change everything all over again to fit a normal fan with a relay, PWM is cool)
The above sentence is VERY true, and although I can drive the fan (hardware works perfect), software is handicapped, the secondary PWM DC table is a function of kPa & RPM, I've have been thinking of a way to drive the fan based on that, as to be reliable for the time being, how can I do that? Ideas?
- one idea I have, seems to me not practical though, is fixing fan speed over each RPM point regardless of coolant fan, I don't really like the idea, any more possibilities?
Firmware support for the E-Fan function is being implemented, expect support for this in the next upcoming firmware release - DB
- I just wanna add that in BMW, the coolant signal for E-fan activation comes from a sensor on the outlet radiator hose, as there is no point of turning on the fan if the radiator is below the temperature. The CLT temperature used for the ECU calculations is mounted in the cylinder head, so in implementing the feature, it would be nice to have the trigger configurable like in the misc dialogue for ex.
DISA
DISA is the variable intake system implemented by BMW. At low speed (up to ~3750-4000 RPM) the solenoid is energized by +12v switched to ground from the DME, at higher speeds it is released (0v) so the flap opens & the itake manifold volume increases.
- DISA requires an ON/OFF, RPM triggered switch, which port should I use? I thought about I259 or P259 (pFET populated), would that be ok or should I use a lower output port S259 or normal P259??
Since DISA requires switched ground i would recommend using either a free injector or ignition channel, switched using one of the misc output channels to switch in the desired range - DB
Wheelspeed
Concerning the wheel speed input1 (EC18-8) & wheel speed input2 for traction control, I would like to have more info about it, specifically regarding the input signal:
- the ABS wheel speed in sensor is VR, it goes to the ABS control module
- this control outputs a processed square wave that I think varies from 0-~10V. Can I take this input directly to 18-8 or do I take the input from the ABS sensor directly?
- 0-10V is good for the wheelspeed input (which has resistor and diode protection).
- Tapping the ABS sensor signals is NOT recommended, and that would require VR-to-HALL adapter anyway
IAC
BMW's IAC is a double solenoid that is PWMed @ 100Hz.
- IAC open -> 36-17 Injector H
- IAC close -> 36-6 Injector G
CAN Bus
As I am now preparing to start my engine for the first time (crossing fingers, I am actually too worried, first start on a fresh built engine, with a new controller); I was thinking the last two days about the CAN abilities of VEMS. I've been searching up & down about the topic, especially the AIM protocol which looks to me as CAN protocol with a different taste. I am not sure about this.
The E46 instrument cluster receives the coolant temperature (&possibly RPM signal via CAN, is there a way to implement this? The other solution would be either to live with a coolant gauge in the red, & may be a non working RPM gauge, or trying to get more work done with an Arduino with a CAN shield, & am not that experienced in electronics.
Also the A/C unit powers up the compressor via a CAN msg to the DME which is apparently not there
Can I use the AIM output somehow?
I feel lost about this
- CAN currently does not exist and may not ever be implemented.
- A VEMS CAN Analog/Digital expansion box would be extremely well suited here expanding the whole ecu. A VEMS CAN Power output box also a great option for when you run out out of outputs on 8+ cylinder engines.
- Multiple more analog/digital channels, not reliant on VEMS hardware configuration (MAP over CAN, Wheelspeeds (straight from Bosch ABS modules for instance, ABS modules also contain accelerometers), suspension, steering, strain gauges, pito tubes, Antilag switch over CAN, A/B map switch over CAN the options are endless).
- Easy stream export of great magnitude to a CAN logger, where Vemstune can then interpret the CAN stream after downloading. VEMS CAN logger could have USB for greater download speeds. a 1MBIT stream can contain a great deal of channels and or high frequencies which is currently lacking at only 25Hz-ish (adjustable frequency for each channel to save bandwith for air temp and such).
- Electronic dash/device compatibility , not only aftermarket but automotive as well.
- Making VEMS 3.x more competitive and compatible as it moves forward.
- CAN does not have to be complicated for the user interface either - Bosch RaceCon software shows that. Manual is available on the Bosch Motorsport website.
Electronic Throttle
I am still not yet done with the build, meanwhile, I was very happy to see the new firmware 1.2.14 implementing ETC. I updated the v3 to 1.2.15 and here is a plan for the ETC:
In BMW the electronic throttle body is called EDK, and the pedal module is PWG
EDK: 6-pin module:
1. TPS signal 1 BR/VI: 0.5v @0% to 4.5v @100%
2. Power BR/WS: +5v??
3. Motor Drive 1 GR/WS
4. TPS singal 2 BR/BL: 4.5v @0% to 0.5v @100%
5. Motor Drive 2 BR/SW
6. GND BR/GR
PWG: 6-pin module:
1. GND
2. GND
3. Power 2 GE/GN: +5v??
4. Signal 1 WS: 0.5v to 4.5v
5. Power 1 GE: +5v??
6. Signal 2 WS/GN: 0.5v to 2v
Plan & questions:
- TPS signal 1 to 36-1, signal 2 to analog channel 6(18-6)
- Pedal signal (driver's wish) to analog CH 1&2 (18-16&3)
- 2 power signals to EDK & 2 to PWG, are these confirmed +5v so should I have them all from TPS Supply (36-29) or +5v (36-28)? Or do I take the throttle body power from TPS supply & the pedal from +5v?
- 3 GND to 36-26
- Throttle body motor drive:
- Must order ECU with order comment: "H-bridge output stage for throttle (DC motor resistance=...)" (uses an internal signal OC0, not available normally... if injector-H is not configured in any injgroup, then ETC available on that if configured: but still need H-bridge output stage...)
- Is that why the output from the PPS is reading reversed? I tried hooking the PPS yesterday and it gave me a linear voltage output that decrease when pressing the pedal, although it is normal when measured with the voltmeter:)
- My box was ordered without the H-bridge, any possibilities to update it??? Injgroup G&H were used for IAC
- Must order ECU with order comment: "H-bridge output stage for throttle (DC motor resistance=...)" (uses an internal signal OC0, not available normally... if injector-H is not configured in any injgroup, then ETC available on that if configured: but still need H-bridge output stage...)
NOTE
- S259, I259, P259 are NOT configurable for ETC
- Using ETC will use the three analog in channels left, so now I have no in for any additions I might need (like oil T or P)