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!