|
Post Reply |
|
Thread Tools | Search this Thread |
03-21-2017, 06:20 PM | #1 |
Banned
56
Rep 104
Posts |
[CAN/UDS] Homebrew Exhaust Valve Controller using Carloop+Particle
I've begun a project that I hadn't expected traction on rather quickly, but alas it's working to a basic degree, and I figured I'd start a thread about it and hopefully inspire other tinkerers to play with a rather neat and cheap toy and, potentially, help build on my code.
The Intent For pretengineers like myself to do cool things with their car relatively easily, no expertise in programming nor electrical engineering required. (I'm in no way affiliated with, nor receiving free goods from, anyone involved with the hardware/software etc.) The Hardware I purchased a Carloop Pro ($150) from store.carloop.io, which includes a Particle (formerly spark) Electron development board and GPS receiver (GP 735). It comes with a micro-SIM that I've discarded, instead opting to use a Google Project Fi (Data-Only) SIM. It's worth noting that the Carloop Basic is only $55, so if you'd like to play around without GPS/3G connectivity, the barrier to entry is pretty low, not only on a technical expertise front. more photos here The Code Using a saleae logic analyzer and an OTS OBDII-connected EVC, I've been able to reverse the CAN messages for overriding the exhaust valve behavior. The 'force open' signal is in the two 8-byte CAN messages sent in the following code (also on github), which is my first take on EVC with the Carloop. To be clear, this is the only code (aside from imported open-source libraries) that turns a Carloop into a rather dumb "force my valves open" EVC. Of course, I hope to incorporate other logic into this project (e.g. close valves whenever in 6th gear, and whenever I'm close to home), but here's what I've got working for now: Code:
// This #include statement was automatically added by the Particle IDE. #include <carloop.h> #include "application.h" #include "carloop/carloop.h" // Don't block the main program while connecting to WiFi/cellular. // This way the main program runs on the Carloop even outside of WiFi range. SYSTEM_THREAD(ENABLED); STARTUP(cellular_credentials_set("h2g2", "", "", NULL)); SYSTEM_MODE(SEMI_AUTOMATIC); // Tell the program which revision of Carloop you are using. Carloop<CarloopRevision2> carloop; // Send a message at a regular time interval void sendMessage() { static uint32_t lastTransmitTime = 0; uint32_t transmitInterval = 5000; /* ms */ uint32_t now = millis(); if (now - lastTransmitTime > transmitInterval) { CANMessage message; // A CAN message has an ID that identifies the content inside message.id = 0x6F1; // It can have from 0 to 8 data bytes message.len = 8; // Pass the data to be transmitted in the data array message.data[0] = 0x12; message.data[1] = 0x10; message.data[2] = 0x08; message.data[3] = 0x2F; message.data[4] = 0x60; message.data[5] = 0xFD; message.data[6] = 0x03; message.data[7] = 0x19; // Send the message on the bus! carloop.can().transmit(message); // Pass the data to be transmitted in the data array message.data[0] = 0x12; message.data[1] = 0x21; message.data[2] = 0x99; message.data[3] = 0x0A; message.data[4] = 0xFF; message.data[5] = 0x58; message.data[6] = 0x00; message.data[7] = 0x00; // Send the message on the bus! carloop.can().transmit(message); lastTransmitTime = now; } } void setup() { // Configure the CAN bus speed for 500 kbps, the standard speed for the OBD-II port. // Other common speeds are 250 kbps and 1 Mbps. // If you don't call setCANSpeed, 500 kbps is used. carloop.setCANSpeed(500000); // Connect to the CAN bus carloop.begin(); } void loop() { sendMessage(); } Last edited by packet.pilot; 03-21-2017 at 10:05 PM.. |
03-21-2017, 06:42 PM | #2 |
Banned
56
Rep 104
Posts |
Audio's not super loud on the valves actuating, but here's a video showing how long it takes to power up and activate. |
Appreciate
1
stealth70mde375.50 |
03-21-2017, 08:04 PM | #3 |
Brigadier General
1593
Rep 3,945
Posts
Drives: 2015 M4 MG/SO
Join Date: Mar 2014
Location: MTL, QC
|
Not sure if you realize from the above snipplet that using 0x2F 03 60FD (UDS InputOutputControlByIdentifier), BMW has set a default timeout SW_TO_EAGK of 20s, and a max of 510s ... Maybe test your script again, and wait and see if the valves close again after 20s or not!
Given I care less about driving and controlling my valves in open state, I've never tested to see if the DME overrides this diag setting when it needs to control the exhaust valves. |
Appreciate
1
packet.pilot55.50 |
03-22-2017, 06:34 AM | #4 |
Private First Class
69
Rep 193
Posts |
From the code I gather that you resend the message every 5 sec. Isn't it likely that the valves will constantly be closing and opening with the DME interfering?
|
Appreciate
0
|
03-22-2017, 11:08 AM | #5 | |
Banned
56
Rep 104
Posts |
Quote:
As you can see in the video posted, it takes about 20s after removal of the device for the valves to go back to their normal state. |
|
Appreciate
0
|
03-22-2017, 06:13 PM | #8 |
Brigadier General
1593
Rep 3,945
Posts
Drives: 2015 M4 MG/SO
Join Date: Mar 2014
Location: MTL, QC
|
|
Appreciate
0
|
03-22-2017, 06:50 PM | #9 | |
Banned
56
Rep 104
Posts |
Quote:
Secondly, that involves wiring, and only does two of three modes afaik (out of three: override open, override closed, passthrough). Thirdly, because my intent here is not to build an exhaust valve controller, but rather to use EVC as a 'hello world' for this platform, which I'm new to, and wish to do more things with (both in cars and not in cars). ...and the CG Precision unit is not going to help me do IoT development. Also, as stated, cost is $55 (at the low-end), so it's nearly twice as awesome as you'd hoped. |
|
Appreciate
0
|
03-23-2017, 01:47 AM | #10 |
Captain
483
Rep 812
Posts |
If only something like this could play well with the JB4. I just want the valves to close in 6th gear. Every other gear it should be open.
__________________
2016 Azurite Black F80 6MT
|
Appreciate
0
|
03-23-2017, 04:52 AM | #11 |
Brigadier General
1593
Rep 3,945
Posts
Drives: 2015 M4 MG/SO
Join Date: Mar 2014
Location: MTL, QC
|
You can message the DME using another protocol than the one JB4 uses (see above), however it isn't known regardless of JB4, how does such backdoor EVC play with the DME during runtime. In order to do what you asked, you also need to know which gear you are in, that also can be read and you need to permanently keep the valves open, but it seems there is a maximum timeout... but I am curious, why do you want the valves open in all gears and closed in sixth? (Seven for DCT), i guess for cruising purposes?
|
Appreciate
0
|
03-23-2017, 05:00 AM | #12 |
Brigadier General
1593
Rep 3,945
Posts
Drives: 2015 M4 MG/SO
Join Date: Mar 2014
Location: MTL, QC
|
@packet pilot , IoT + car is super fun a very important aspect of IoT is power consumption and the Broadcom WICE used in the photon has nice power saving features. However I found out that that you need to pay attention to how our car handles devices attached to the OBD port, especially with ignition off. When you get to that stage, you can either rig your gizmo with tap in cable for an ampmeter and/or use ISTA's closed circuit monitoring to get some info.
|
Appreciate
1
packet.pilot55.50 |
03-23-2017, 10:57 AM | #13 |
Major
913
Rep 1,427
Posts |
For me it's exactly the point you mentioned. I would love for my valves to stay open in gears 1-5 and then close for 6 and 7 (DCT here). Give the car a little extra noise as you're accelerating away, instead of going into quiet mode the instant you hit 3rd.
|
Appreciate
0
|
03-23-2017, 11:02 AM | #14 |
Lieutenant Colonel
346
Rep 1,656
Posts |
|
Appreciate
0
|
03-23-2017, 11:14 AM | #15 | |
Brigadier General
1593
Rep 3,945
Posts
Drives: 2015 M4 MG/SO
Join Date: Mar 2014
Location: MTL, QC
|
Quote:
The ones that mechanically control the valves obviously don't timeout... $50 is the basic carloop wifi model or my home made gizmo which costs much less. |
|
Appreciate
0
|
03-23-2017, 11:44 AM | #16 |
Banned
56
Rep 104
Posts |
But your gizmo needs some computer at the other 'end' of it, no? My brusband (the embedded engineer) and I are focusing on CAN for now but are keeping Ethernet-capable packages in mind for the future.
A project to do all this sans Photon on our own board is underway. We've already got tick-timing ticking the OS and nearly have an RTOS running on it. We'll have an STM32f205 dev board with JTAG bright out to facilitate progress. I have a feeling one day there'll be an initial package offering BTLE and WiFi and doing two things: 1. EVC with user-configurable logic (over CAN/UDS) 2. Touchiness drive-off mode (throttle/steering/EDC/TC), also user-configurable. So, one old thing with new tweak capabilities, one new thing people have been asking for left and right, which would theoretically come free with the companion app. Other cool stuff developed could be offered with in-app purchases. Just spitballing here, no hard plans, clearly in R&D and I'm not selling anything... just sharing thoughts and ideas, which I think is still allowed 'round these parts... |
Appreciate
1
aboulfad1592.50 |
03-23-2017, 11:51 AM | #17 |
Brigadier General
1593
Rep 3,945
Posts
Drives: 2015 M4 MG/SO
Join Date: Mar 2014
Location: MTL, QC
|
My gizmo is a self running openwrt, that you build and run whatever you want on it your option 2 above is a like the search for the holy grail! trust me CAN is trouble, ENET opens up the world for realtime streaming and everything else we can do ... if your goal is to develop something for BMW, ENET is a unique way, CAN is supported on all vehicle makes...
|
Appreciate
1
packet.pilot55.50 |
03-23-2017, 12:02 PM | #18 |
Banned
56
Rep 104
Posts |
Unfortunately one of the constraints I have with my 'engineering staff' at present is no Ethernet (yet) because dayjob, flying cars, yada yada.
I do have two of those travel gizmos in the box collecting dust as of months ago, too, one torn apart and the other still sealed. A dayjob is only a problem for one of us, "thankfully"... so maybe I'll get to playing around with that. |
Appreciate
0
|
03-23-2017, 12:12 PM | #19 |
Brigadier General
1593
Rep 3,945
Posts
Drives: 2015 M4 MG/SO
Join Date: Mar 2014
Location: MTL, QC
|
Hahaha, I am up for hire and I am cheap: $ CDN btw, carpool is an IoT device, my home made gizmo isn't, its lowest power consumption is 80mA and doesn't support sleep or deep sleep.
|
Appreciate
1
packet.pilot55.50 |
03-25-2017, 12:44 AM | #21 | |
Captain
483
Rep 812
Posts |
Quote:
__________________
2016 Azurite Black F80 6MT
|
|
Appreciate
0
|
03-25-2017, 01:53 AM | #22 | |
Banned
56
Rep 104
Posts |
Quote:
|
|
Appreciate
0
|
Post Reply |
Bookmarks |
Tags |
can bus, carloop, evc, exhaust valve controller |
|
|