CEM Bulb Failure Threshold Testing

I thought it might be useful to determine when exactly the Volvo P1 CEM decides that a bulb has failed, and what the behavior is at that threshold. As it turns out, the threshold is 2.0A, or about 25W, meaning a 5.0Ω resistor for an error-free relay harness.

CEM at 25W load and no error
Loaded to 25W, and no error.

To work this out, I  needed a way to try many different wattage bulbs, or better yet, a change variable wattage – also known as a dummy load. I had an 15o ohm 50W Soviet-surplus rheostat and some 3.9 ohm 75W wire wound resistors (full parts list below), so it didn’t take too much to throw a quick and dirty build together.

Continue reading “CEM Bulb Failure Threshold Testing”

SKBOWE Test Bench

With the first prototype complete, it was time to build a test bench to evaluate the real-world performance of the SKBOWE. I wanted this simulator to allow instrumentation, but also to be as accurate as possible without physically installing it in the car.

To that end, I decided to use one of the Infineon BTS443P 25A Smart Highside Power Switches out of the CEM that I took apart, and re-create the CEM circuitry that it uses for each low-beam exactly:

Location of one Infineon BTS443P on the CEM
Location of the sacrificed Infineon BTS443P

The CEM basically follows the datasheet verbatim, down to the 1k R_IS, so I did the same. Rather than try to mess with the tiny BCP54C SMT transistor I used an old school 2n2222A, which doesn’t affect the performance of the circuit at all, but other than that the circuit is identical to that on the CEM, down to the 7.5A fuse and the 1000uF capacitor.

Test bench control circuitry
Test bench control circuitry, showing the CEM analog and the Rugged-Circuits Rugged MEGA MCU

The MCU that emulates the CEM’s PWM is a Rugged Circuits Rugged MEGA which is pretty much bullet proof – a very good thing considering what’s coming for it! For those who are curious, there’s an 8-position rotary switch connected to pins 30-37 (for the duty cycle).

Rotary switch assembly
8 position rotary switch assembly for controlling PWM duty cycle, with pull-down resistors.

Interestingly, there is no way to make the Arduino hardware PWM run at 82 Hz without messing up all the timing libraries, so I had to get creative with a 122uS ISR. Pardon the ugly code…. This was like 7 minutes:

Testbench Code
// SKBOWE TestBench
// V1.0 2017-06-23
#include <TimerOne.h>
#include <elapsedMillis.h>
// output pin
#define PWM_PIN 7
// holds the target duty cycle percent
volatile uint8_t percent;
// Switch settings (in percent duty cycle)
const uint8_t LOOKUP[9] = { 0,
// 1 2 3 4 5 6 7 8
0, 50, 60, 80, 85, 90, 95, 100 };
void setup() {
  Timer1.initialize(122); // ~8200 hz
  Timer1.attachInterrupt(pwmisr); 
}
void loop() {
  delay(1500);
  uint8_t mode = getMode(), next = LOOKUP[mode];
  //sync with ISR
  noInterrupts();
  percent = next;
  interrupts();
}
// emulate 82hz PWM with percent (0-100)
volatile uint8_t counter;
  void pwmisr(){
  uint8_t cnt = ++counter, per = percent;
  if(cnt >= 100){
    counter = 0;
  }
  digitalWrite(PWM_PIN, cnt < per);
}
//debounce more
uint8_t getMode(){
  int8_t timeout = 64, count;
  uint8_t first, next;
  retry: while(timeout-->0)
  {
    first = readMode();
    for(count = 16; count-->0;)
    {
      next = readMode();
      if(next != first) goto retry;
    }
  return first;
  }
  return 0;
}
// debounce
uint8_t readMode(){
  int8_t timeout = 64;
  while(timeout-->0)
  {
    if(digitalRead(30)) return 1;
    if(digitalRead(31)) return 2;
    if(digitalRead(32)) return 3;
    if(digitalRead(33)) return 4;
    if(digitalRead(34)) return 5;
    if(digitalRead(35)) return 6;
    if(digitalRead(36)) return 7;
    if(digitalRead(37)) return 8;
  }
  return 0;
}

And it actually worked on the first try!

Anyway… The lower deck has a 12V 30A power supply (set to 14.2V) and a 55W dummy load (aka an old H7 bulb stuck in the end of a mason jar):

Lower deck of test bench
Lower deck of test bench, with dummy load and power supply

On the upper deck I added a ground bolt (simulating the chassis) and 5 feet of 16AWG wire (simulating the wiring harness), the selector knob, and a terminal block to make it easy to change out connectors.

Side view of test bench
Side view of test bench showing the super professional graduations on the control knob
Test bench running dummy load
Here’s the test bench running it’s H7 55W dummy load

I will post detailed data later, but Prototype #1A is performing flawlessly, exactly as designed! This was obviously expected but always nice to see theory turned into a hefty feeling block of capacitors 🙂

Here’s a video showing why you want to have a SKBOWE in a P1 car:

In the video, the yellow trace is the headlight voltage (PWM), and the red trace is the current flowing out of the CEM. You can see this ballast is definitely not happy about even 95% duty cycle PWM when hooked up directly. In the car, this may or may not trigger a short-circuit fault code before it takes out the WMM!

The test bench doesn’t emulate the open circuit (bulb fail) or over current (current fault) detection in the CEM – these levels are handled by an ADC in software, so I’d have to test on my car to see where they are at. Maybe another day…

Update 6/29/17: Test Bench Upgrade

Today I upgraded the SKBOWE test bench with a second can for an H11 HID bulb and mounted my flux meter.

H11 Rebased HID Bulb Test Fixture Mounting Detail
H11 Rebased HID Bulb Test Fixture Mounting Detail, showing how the top of a mason jar was modified to support the bulb.
Rebased H11 HID bulb test fixture, end view after assembly.
Rebased H11 HID bulb test fixture, end view after assembly. Not quite the efficiency of a true ellipsoidal reflector (as in a projector) but I’ll be looking at relative numbers so it doesn’t really matter.

The Dr. Meter LX1330B is designed for photography applications, so this is operating at the top end of it’s range (200000 lux). The absolute measurement won’t be meaningful (in terms of lumens, for instance) but it will do nicely as a relative measurement to ensure that the ballast is working at full capacity.

Lux meter setup on SKBOWE test bench.
Lux meter setup on SKBOWE test bench measuring the intensity of an HID bulb. The bulb is currently warming up, steady state the meter reads around 830.

This is with a new bulb, I’ll have to burn it in for a few hours before using it to compare HID ballasts in the upcoming Ballast Review Page.

Appendix A: Data

Oscilloscope trace showing current measurement
Measuring the current (red trace) using the cursors to mark peak and min values. I really need to get a new scope with USB data capture, taking iPhone pictures of the screens gets old fast.

With the SBKOWE installed and driving a 55W ballast (HID50), I measured current draw for each duty cycle by monitoring the feedback pin (#4) on the BTS443P. The current to ground through that pin is proportional to the current flowing through the switch, with around an 8200:1 ratio. Since I used IS = 1kΩ, the current is about 121.95 times the voltage (mV) on that pin. The Input and Output voltages are measuring the Mean RMS, the “battery voltage” is a constant 14.2V. Pk-Pk ripple was measured with AC coupling on the highest sensitivity.

PWM Duty Cycle (%)RMS Input (V)RMS Output (V)Peak Current (A)Min Current (A)Ripple P-P (mV)
50%7.0412.729.766.49624
60%8.4812.888.205.51560
80%11.213.125.715.08336
85%11.9213.205.254.07296
90%12.6413.204.483.80232
95%13.2813.284.203.74168
100%13.9213.283.613.4824

As you can see, at the DRL-level duty cycles (50% and 60%), the peak currents are extremely high (8-9A) and while the minimum current is below 7.5A (the fuse), it might be above what the CEM is willing to provide before soft-shutdown. Also, the SKBOWE is working 2x-3x harder (both caps and diodes), which means more heat and shorter lifespan.

That said, running with DRLs will not instantly kill the SKBOWE, and depending on your ballasts it may actually work fine. Just don’t complain if they don’t!

DRL Disable Alone NOT SAFE for Aftermarket HID Retrofits

New testing has shown that DRL-Disable software (30679690) does disable DRL PWM, but does does NOT eliminate PWM completely. The PWM issue is discussed in detail on the issues page.

In effect, when running HID retrofit on OEM wiring, the DRL software update is no safer for the WMM than leaving the LSM in position II at all times. So if you have a retrofit using a BOW3 or similar error code eliminator and DRL disabled, you are on borrowed time! Even if your setup is currently working, I suggest you add additional grounding and inspect/replace the eliminators on a regular basis (3-6 months with 55w, 3-12 months with 35w) to avoid burning out the WMM.

For the sake of posterity, the actual results of the new and old testing are combined below:

With DRL Enabled

Light Switch Module Position = 0 (off)

Day: 60% duty cycle / 8.5V Average (nominal)
Night: 80-90% duty cycle (variable) / 13.2V (nominal)

Light Switch Module Position = 1 (markers)

Day and Night: 0% duty cycle (aka off)

Light Switch Module Position = 2 (on)

Day and Night: 80-90% duty cycle (variable) / 13.2V (nominal)

With DRL Disabled

Light Switch Module Position = 0 (off)

Day and Night: 0% duty cycle (aka off)

Light Switch Module Position = 1 (markers)

Day and Night: 0% duty cycle (aka off)

Light Switch Module Position = 2 (on)

Day and Night: 80-90% duty cycle (variable) / 13.2V (nominal)

Many thanks to Nick0matic and LizardOfBodom for their help in finally systematically establishing the operating parameters of the P1 CEM.

Original Post:http://forums.swedespeed.com/showthread.php?398353-DRL-Disable-Alone-NOT-SAFE-for-Aftermarket-HID-Retrofits

Volvo P1 CEM Teardown

The headlights of Volvo P1 vehicles1 are controlled by the Central Electronic Module (CEM), located inside the passenger compartment just below the glovebox. You probably know it as just the “fuse box”, but the CEM is actually a sophisticated computer module that is the backbone of the vehicle’s interior and exterior electrical system.

To understand why HID retrofits are so difficult on the P1 chassis vehicles,  we must explore how the vehicle controls the headlights. So let’s dive in!

Role of the CEM in the P1 CAN

The Volvo P1 chassis has a complicated Controller Area Network (CAN) with many different computer modules that perform all electrical functions from rolling down the windows to running the blinkers to coordinating anti-lock breaking.

The CEM is the central hub of this network, and communicates with all other vehicle modules over High Speed and Low Speed CAN and with diagnostic tools like Volvo DiCE over the OBD-II connector.

The modules chat with a pre-determined set of regular messages compiled by a software called Volcano, which establishes “virtual wires” between modules. At design time, the non-networked sensor (signal), actuator (output) and activation (boolean flag) are defined for each electronic module. The Volcano Network Architect (VNA) design software does a static timing analysis of all signals and their required update rate and packs them into frames which are transmitted in time slots to meet the requirements. When modules need a signal, they get a configuration file which tells the Volcano Target Package (VTP) which frames to decode, and what type of data is in those frames (if a expected signal is missing from the timeslot, the module stores a DTC).

For example, if there is an error with one of the headlight circuits, the CEM sends a message to the DIM (Driver Information Module), which then displays the dreaded “Low Beam Failure” warning to the driver.

In addition to passing messages between modules, the CEM also directly controls many of the 12V outputs in the vehicle, from interior lighting to climate control. The two outputs we are interested in are for the left and right low beam circuits, which produce the problematic 82HZ PWM signal that prevents HID ballasts from working correctly. It also reads many sensor inputs, like the exterior temperature sensor, the interior climate sensor, headlight switch (LSM) position, and the twilight sensor (among many others). It is the twilight sensor that is responsible for enabling the DRL program that drops the PWM duty cycle down to 50-60%.

Before now, we knew from the owners manual that there were 7.5A fuses on the headlight circuit, and that there was PWM voltage regulation from the electrical design document, the wiring diagram, and real-world experiments. But beyond that, there was not much to go on in terms of how the thing actually worked.

So I picked up a CEM on eBay specifically to destroy it (carefully) and share the glorious innards with you…

CEM Teardown

So without further ado, here are the pics from the CEM teardown…

Top view of CEM, as it sits when installed in vehicle. Under the upper plastic cover is the power board, which holds all fuses and relays. It pivots upwards into the space under the glove box, protecting the components from kicking feet.

Here is the bottom of the CEM, that you see when looking up at it when installed in the vehicle. Under the lower plastic cover is the logic board.

Just a friendly reminder that Volvo sold their soul to FOMOCO:

The CEM from the top with all the fuses, relays, and screws removed. We’re going in!

In my experience, the best way to open this sort of case without breaking anything is to carefully disengage one locking tab at a time with a thin spudger (or screwdriver). Then, insert a paper clip or zip tie to prevent it from locking back together. Once all tabs are shimmed out, the case just falls apart. Here we see all the zip-ties inserted, ready to dismantle the top and bottom cases.

With the bottom of case removed, we expose the multi-layer logic board. There is a small, 2 layer auxiliary power board for the Floor-1 connector, which is both electrically and structurally connected using thick jumper pins to the logic board. This odd construction is presumably due to limitations on their pick-and-place or reflow setup – or for cost savings by reducing the multilayer area – or for better noise isolation, by physical separating ground planes – who knows… It’s strange for sure.

Close-up of logic board side, still in installed in the upper case. This is a 5 layer PCB (3 layers, 2 planes) with a conformal coating, making it very difficult to follow traces and identify components. Notice the thick pins around the perimeter which structurally support the board – more on this later.

Here is the power side, with the PCB assembly removed from the upper case. Strange that there are five hardwired mechanical relays (non-replaceable), in addition to the two replaceable relays R15 and R16 – probably a cost-saving measure. The power board has only 2 layers and no conformal coating, so it super easy to follow traces. All contacts are tin plated (rather than silver or gold) as would be expected for an interior component. The more expensive platings are reserved for the corrosive environment of an engine bay.

At this angle, we see the complete CEM internal PCB assembly as seen from the side. It is a very elegant design, there are no additional connectors or lead wires. It is entirely self-contained, mechanically self-supporting, and includes all pin/terminal contacts. The lower and upper PCBs are structurally and electrically connected using thick jumper wires which provide significant rigidity in both compression and tension, and there is a plastic insulator/spacer which provides some additional compression strength towards the center to prevent deflection when plugging in connectors.

A closeup of sandwich assembly shows the insulating spacer and connecting terminals .

Now comes the point of no return – slicing the sandwich apart by cutting each of the connecting pins. This allows a view of the reverse of logic board and it’s tag-along auxiliary power board.
“The

And the back of the power board – clearly designed by a different team using different layout software – just look at how organic the traces are! Very pretty.
“The

All of the parts of the Volvo P1 CEM have been unmasked. This CEM isn’t going back together any time soon.
“This

Next, I separated the logic PCB from the auxiliary power board. This is really the brains of the CEM.
“Isolated

Neither heat nor solvent would affect the conformal coating, so I resorted to good-old-fassion scraping away. It took several hours to expose and identify all of the major components (click to enlarge):

Volvo P1 CEM main logic board component identification
Component Identification – Click to Enlarge!
CPUs
  • NXP MC9S12DG256 @ 4 MHz (2 CAN modules) -> low speed only
  • NXP MC9S12DT256 @ 8 MHz (3 CAN modules) -> high speed and low speed
Dual Inline
  • 1 – Infineon BTS443P 25A Smart Highside Power Switch
  • 2 – Infineon BTS724G 4 x 3.3A Smart High-Side Power Switch
  • 3 – Infineon BTS5210G 2 x 2.4A Smart High-Side Power Switch
  • 4 – Infineon TLE4269 5V 150mA Automotive Qualified Regulator
  • 5 – Infineon TLE4299 3.3V 150mA Automotive Qualified Regulator
  • 6 – ON Semi MC14538B Dual Precision Retriggerable/Resettable Monostable Multivibrator
  • 7 – NXP MC33399 LIN Physical Layer Interface
  • 8 – NXP TJA1040 CAN Physical Layer Interface
  • 9 – NXP HEC4013B Dual D-Type Flip-Flop
  • 10 – NXP HCF4081 Quad 2-Input AND Gate
  • 11 – ST Micro L9823 Octal low-side driver for bulb, resistive and inductive loads with serial input control, output protection and diagnostic
  • 12 – ON Semi MC74HC4851A Octal analog mux/demux with injection current effect control (Automotive)
SOT (Triangles)
  • 1 – BCP53 -1.2A PNP GP Transistor
  • 2 – Infineon BSP78 3A Smart Low Side Power Switch
  • 3 – BCP55 1.5A NPN GP Transistor
  • 4 – Infineon BSP75N 1A Smart Low Side Power Switch

Commonality with other Ford C1 Chassis Vehicles


As noted on Wikipedia: the Ford C1 chassis vehicles (including the Volvo C30, S40, V50, C70 , Mazda 3, and Euro Ford Focus / cMAX) share many common electrical system component production lines, including the tooling and connectors for the CEM (outside of Volvo, it is usually called a Body Control Module or BCM). However, there are differences between the Volvo version and the Ford/Mazda version – notably the Volvo version has different relays blanked off. In the 2009+ Focus, they kept the same mounting location but reworked the layout. The lineup below shows the different styles:

While the tooling, mount location are common, there are major differences in the internal guts – the fuse values are all different, the Mazda version is missing most of the pins which shift between each, relays positioned differently – so it’s not exactly fair to say that the C-platform cars “share an electrical system” in that entire components are the same between makes. However, the 10-year Ford-Volvo-Mazda C1 alliance did achieve a high degree of commonality which helped keep the price of all three lines down.

To be clear though, the Ford Focus BCM and Mazda 3 BCM are totally different beasts than the Volvo P1 CEM, both in hardware and software, and only the Volvo C30/S40/V50/C70 need the SKBOWE PWM Filter for HID retrofits when doing an HID conversion. I’m no expert on Ford and Mazda, but from a quick Google search, both seem to work fine with a standard relay harness… Leave it to Volvo to come up with a ridiculous 80Hz PWM Voltage Regulation system.