BMW Exhaust Valve Controller

Most (perhaps all?) modern internal-combustion-powered BMWs have an exhaust valve (or two) powered by an actuator, making the exhaust louder (when open) or quiet (when closed). My goal to get some traction and comfort with the Carloop is to begin working around exhaust valve control.

Ultimately, I’d like the behavior (i.e. loudness) to be determined by only two constraints:

if (transmission in gear X) or (location <0.25mi from home); close exhaust valves
else
keep exhaust valves open

I’m happy to say I was able to get the ‘else’ part of the app sorted out today; I’ve put the code in my fork of carloop-library.

I’m not a programmer (but have written my fair share of bash/puppet code) and, that said, I’m pretty excited already. I’m very eager to build some brains into this, and am really glad Carloop exists. :+1:

In this video, you can see (or hear, rather–listen for the actuators) that it takes about 6 seconds for the electron board to send the message, and about 20 seconds for the valves to close after removal.

Some more fun with can-utils and SocketCAN_serial on a photon:

1 Like

Cool work!

So, have you got the valves opening and closing under your control?

Sorry, did not look at the video while mobile.

Yep, at least under can-utils. I’ve got a ‘dumb opener’ app for the board but haven’t built any logic into it yet. Hopefully I’ll be able to soon after working out the barriers between me and being able to sniff 11-bit traffic, as I aim to hook into an unused selector dial on a version of the light switch that’s meant for a different variant of my vehicle.

1 Like

This is amazing! Nice work!

1 Like

Unfortunately, my OBDII port is filtered in that it’ll only spit out CAN messages with an associated PID request.

I was able to find two different buttons’ long-press changes, and they’re both buttons I could use for this, either one button as a mode switcher, or both buttons as a toggle, or either and both, which I prefer, explained below.

I’ll need to do some reading to figure out how to code different states of the exhaust valve control (no override, override open, override closed) and I think I’ll want to build it as follows:

default: no override
longpressButtonA: override open (loud mode)
longpressButtonB: override closed (quiet mode)
longpressBothButtons: stop override (stock operation)

Should anyone have any insights to share about how to achieve this, or other projects I could look at for inspiration (cough, lazyweb), that’d be great.

I’ve started to look at other Particle guides but they seem as yet only distantly helpful. (Reminder: I’m not a programmer, so please be kind.) :slight_smile:

If you use pushbuttons, look on the particle forums for switch debouncing.
Someone even did a button or click library (don’t remember the name) that might help you out.

EDIT: I was thinking about the clickButton library: