1 2 3
Keith Tanner
Keith Tanner MegaDork
7/18/21 12:27 p.m.

Had a small roadside fix to do yesterday when the 36 year old throttle cable in the Vanagon decided it wanted a divorce and went for a trial separation. I was able to perform enough relationship counselling to get the van home (2.5 hours in the mountains!), but this is only temporary as I'm pretty sure any rapid pedal movement will cause immediate irreconcilable differences between all parties.

The van has a Subaru engine conversion, and part of that means that there's a piece of Subaru throttle cable on the intake manifold, clamped to the engine end of the stock VW throttle cable in a less than OE manner. This actually saved me yesterday as it allowed me to free up a little more cable to deal with the problem at the throttle pedal and it had nothing to do with the failure, but it's not what I'd call elegant. I'm also not convinced I've ever had 100% throttle available to me, but it's such a long walk from the driver's seat to the engine bay and back again that I haven't checked in a decade.

So of course, I started thinking about drive by wire to get rid of the whole lash-up, and not for the first time. Subarus have been using DBW for about 15 years and it looks like retrofitting a DBW throttle body should not be too painful. I'll also have to swap out the throttle pedal and whip up some electronics to basically make the butterfly mirror the motion of the pedal. Hopefully the IAC (Idle Air Control) plug is the same on both, I'll have to dig out some manuals to see.

So, this may or may not end up being a build thread as I'm currently at the stage of "this seems like a good idea to me" and looking at throttle bodies on eBay. Anyone with knowledge of Subarus and ideas is encouraged to pipe up. Anyone with a spare Subaru DBW throttle body, pedal and connectors is strongly encouraged to sell me parts. In the meantime, I have dropped $20 on a new cable to get the van running again.

Keith Tanner
Keith Tanner MegaDork
7/18/21 2:50 p.m.

I have checked wiring diagrams and of course a DBW car doesn't have a separate IAC. The sensor I was hoping was IAC turns out to be a MAP sensor mounted on the throttle body, which is interesting.

So I may have to either find a way to mount the existing (separate) IAC on the engine - perhaps on a separate block, feeding air into the intake manifold? - or I have to come up with my own standalone IAC code that either figures out what to do with the throttle using...something OR I feed the IAC signal from the stock ECU into my little DBW controller and then use it to add some throttle control. The last has promise, the first is relatively easy to do.

Based on the way this thing has idled since I got it, I suspect I don't actually have a functional IAC as it is.

Jesse Ransom
Jesse Ransom UltimaDork
7/18/21 5:24 p.m.

I think I'm probably forgetting six reasons this is a nonstarter, but... Could you use the ECU from the DBW application that's donating its throttle body so you get the TB-based idle control along in the bargain? Too many bits that aren't swappable?

I'm at least partly motivated by an overdeveloped sense that having factory error handling on the DBW throttle position stuff is safer that doing it from scratch. I suspect that's more a matter of really researching how to implement the fundamental concepts, which are probably in some engineering papers which can be dug up. OTOH, there's a reason why you never implement some things in software when there are thoroughly tested and vetted implementations available, more of whose bugs have been found and squashed than your implementation would benefit from.

I'm speaking in generic terms there, not asserting that you specifically will have bugs in your implementation... cheeky

Keith Tanner
Keith Tanner MegaDork
7/18/21 5:51 p.m.

Good questions. My van runs a wiring harness from a 1996 (I think) Legacy. Just new enough to have OBD-II. So in order to get a setup that runs native DBW, I'd have to bootstrap it up a decade at least and I wasn't really looking to rewire the whole van and deal with placating a newer ECU that had suddenly lost its CAN friends.

Ha, looking at the Smallcar conversion instructions, when they use a DBW setup they attach the Subaru throttle pedal to the engine and then use a cable to pull it. So, umm, I'm not going to be looking for pointers there. At least it looks like they run a whole new cable instead of clamping an extension on to the original one.

The question of bugs is a good one. I just have to set mine up to close the butterfly if anything weird happens. The throttle pedal signal is typically two pots working in different directions, so you've got some nice error sensing built in there. Given that the current setup (pre-failure) had about six ways for things to stick and/or break, I don't think I would be increasing the odds of a failure resulting in WOT. Besides, WOT in this vehicle means rampaging to 60 mph in about 18 seconds.

Subaru people seem to want to convert these engines to a cable driven throttle when they put the engines somewhere else, so that community isn't a huge amount of help.

It's fundamentally pretty simple, moving one motor in response to a single input device. I don't need to integrate it into the rest of the engine management in any way, and if I can import the IAC code (should be a simple frequency, as it's likely a PWM-driven solenoid) then the complexity level is low. If I put the IAC on a separate block (how I handled idle control on a Miata with throttle bodies), then the complexity level is very low.

I could also build a custom throttle cable, but where's the fun in that? I am just offended by a push-pull cable running 15' under a vehicle and this is more interesting. I think I'll collect a few parts and play with it on the bench, and if it doesn't work then I'll chalk it up to education. I should be able to implement it in a completely reversible manner too.

Teh E36 M3
Teh E36 M3 SuperDork
7/18/21 6:18 p.m.

Would a hydraulic clutch master/slave system work? Might actually be easier, and waaaaaay smoother than a 15' cable.

Keith Tanner
Keith Tanner MegaDork
7/19/21 8:26 a.m.

That is such a weird idea I'm tempted to do it just because. 

bgkast
bgkast PowerDork
7/19/21 9:22 a.m.

Nothing like bleeding your throttle!

APEowner
APEowner SuperDork
7/19/21 9:26 a.m.

The DBW conversion could be a fun project.  I'd want to have a watchdog timer, redundant inputs and a feedback loop from the TPS to make it as safe as possible but you're correct in that it's not hard to be more reliable than a 15' cable.

I'd want to go with the IAC input into the controller and use the throttle for idle speed control just because it seems more elegant than two valves controlling airflow.

Keith Tanner
Keith Tanner MegaDork
7/19/21 9:44 a.m.

The DBW throttle bodies have an angle sensor. I've seen enough of how it's implemented by an OE to get the general gist of it.

Read throttle pot 1: 20%
Read throttle pot 2: 80% (the two should add up to 100%, as one increments and one decrements)
Decision: set butterfly to 20%
Move butterfly (two motors, I believe, set up like the two pots)
Check butterfly position

I have to figure out what kind of motors are in the TB. They might be steppers, which gives a slightly different flow - you basically keep looping through the last two steps until butterfly position equals the requested position. I think I'll go listen to an ND Miata start up, IIRC the noise it makes on boost sounds like a stepper doing a calibration sweep but I haven't paid close attention for a while.

I'll call the local Subaru specialty shop today (600 hp turbos for everyone, not the sort of place that can nerd out on throttle control strategies) and see if they have any throttle body pigtails I can use. Otherwise I might have to go junkyard spelunking. Luckily 15 year old Subarus are not rare in Colorado junkyards.

 

Keith Tanner
Keith Tanner MegaDork
7/19/21 10:22 a.m.

The DBW setup on my V8 Miata does a plausibility check on MAF - if the value is too high, it figures the throttle is stuck open and it slams the butterfly closed and refuses to open it again until you clear the codes. I found out the hard way that at sea level on a high rpm shift, I can trip this value because of my camshaft's appetites. Nothing like going for 4th coming off a corner at Laguna Seca and having the engine go to idle. Took a while to figure that one out, because it never happened at higher altitude with our lower density and the only way I could get it back to the pits was power cycle the kill switch to reset the ECU and clear all the codes...

MadScientistMatt
MadScientistMatt UltimaDork
7/19/21 1:07 p.m.

It's likely swapping to a DBW Subaru ECU would also entail swapping over its matching crank and cam triggers; the '90s ECUs used a 6 tooth crank trigger and 7 tooth cam trigger while the later DBW cars were completely different.

 

Jesse Ransom
Jesse Ransom UltimaDork
7/19/21 1:36 p.m.

I'm convinced. Also, I agree with APEowner about doing IAC with the butterfly.

Seems tidier, and I suspect once you start thinking about the fun to be had in tuning the algorithm to get a solid idle against all the varying conditions, you won't be able to resist...

Keith Tanner
Keith Tanner MegaDork
7/19/21 2:25 p.m.

If I use the butterfly for IAC, I'll let the stock ECU do all the algorithmics. I'll just take the IAC signal from there and interpret it for a few extra degrees of angle.

That said, using a block for the IAC isn't that messy. You just need a hose going to it from the intake piping and a hose going from there to the intake manifold. Nowhere near as klugey as using a throttle cable to pull on a DBW pedal, for example! I might start off with the remote IAC first to get things going, then work on developing an IAC replacement.

The engine in this thing is already a bit of a dog's breakfast, I'm not sure I want to start swapping sensors :) It's a 1999 Outback 2.5 block (which has the later big journals) with a set of 1996 2.2 heads (DOHC, I think), crank and pistons from a WRX and I don't remember the rods. WRX again, I think. The original plan was to just stick the 2.2 heads on the 2.5 block, but then I peeked inside and found a completely trashed set of moving parts because Subaru engines are basically a Schrodinger's Box experiment where the cat is always dead once you collapse the waveform.

bluej (Forum Supporter)
bluej (Forum Supporter) PowerDork
7/19/21 3:10 p.m.

I came for the typical KT approach to figuring out a DBW setup (btw, have you poked around here yet?),  but now I'm firmly in the hydraulic throttle camp, just because. Seems like some MTB disc brake hardware would make that pretty straightforward??

nocones
nocones UberDork
7/19/21 3:20 p.m.

What about using a Cruise control motor with your existing TB/IAC(assuming it's fast enough).  Sure it keeps a cable but it's a stock cable and would mount in the engine bay.

 

Otherwise I'm intrigued to watch where this goes.  A straight replicate the foot over wires instead of pull cables sure would be easier and possibly cheaper.  

Keith Tanner
Keith Tanner MegaDork
7/19/21 3:34 p.m.

I did come across that DBWX2 site, but it's a little spendy at 429,00 € plus shipping from Finland. It's interesting seeing their spec sheet, that confirms that I'm going down the right path. I'm thinking I could do this with an Adafruit Feather because it's really not very complicated and it all works at a glacial pace from the viewpoint of a computer. Some of the work done on my analog race dash will come in handy here.

Hydraulic would be a pretty short parts list. A master, a slave and a big honkin' return spring attached to some sort of arm on the butterfly axle. The failure modes are all pretty good, as they almost always result in a closed throttle. It sounds like something Citroen would do and it really is kind of interesting. I'm not scared of electronics so I think that's easier, and I'll learn more with the DBW implementation. So someone else gets to do the Drive By Fluid build!

I could potentially add in a cruise capability to a DBW. I just happen to have a Dakota Digital aftermarket DBW cruise unit sitting on my bench. Not on version 1, though!

Keith Tanner
Keith Tanner MegaDork
7/20/21 7:18 p.m.
bluej (Forum Supporter) said:

I came for the typical KT approach to figuring out a DBW setup...

I'm a little worried about what a "typical KT approach" means :)

I was off in my description earlier. Looks like the throttle body has twin position sensors and a single motor. That's easier. I also mentioned this project to a Miata person with ITBs and he wants one too.

Tomorrow, we scavenge!

alfadriver
alfadriver MegaDork
7/20/21 7:34 p.m.
Keith Tanner said:
bluej (Forum Supporter) said:

I came for the typical KT approach to figuring out a DBW setup...

I'm a little worried about what a "typical KT approach" means :)

I was off in my description earlier. Looks like the throttle body has twin position sensors and a single motor. That's easier. I also mentioned this project to a Miata person with ITBs and he wants one too.

Tomorrow, we scavenge!

Glad you figured that out- two sensors for both demand and position to be more failsafe.  Use that for your own safety.   The idea of using a micro controller isn't a bad one- but I would for sure make sure you get the version you can solder onto the board.  And then make sure from the board to the main connector has good strain relief.  

Back in the day, it was 3 sensors for the pedal and throttle- as we were mimicking fly by wire planes.  Not sure when the transition to 2 happened.  Probably when all of the checks got good enough- there is literally a second chip in the module checking all of the inputs and outputs to make sure it's right on all OEM applications.  (and my first patent was a simple decision tree for 3 sensors- a very long time ago).

For idle, can you use the idle output into the arduino for idle control?  Then you can translate to a throttle position.  Oh, and make sure you have a decision tree where the idle control is only used at certain times.

Since you are only going to run a pedal follower set up, you can have some real fun with the pedal curve.  Make it feel real interesting.

Keith Tanner
Keith Tanner MegaDork
7/20/21 8:10 p.m.

It's a camper, I don't need "interesting" :) I've played with the curve on my Miata, I tend to prefer straight linear mapping on my throttle. I don't have to work around turbo spoolup or cat temperature control.

I think the idle control can be super-easy. Just take the output from the stock ECU - which will be a PWM frequency - and translate that into some extra throttle opening if the pedal is at 0%. If the pedal is depressed at all, ignore it. Which is effectively how it works with a cable. Or do the hardware option.

Not trying to reinvent the wheel here, just replace a cable with a wire.

I'll have my hands on a throttle body and pedal tomorrow if all goes well, then it's reverse engineering time. The Subaru docs aren't super-clear on which wire is which, but I can see one to the body is shielded so that's a significant clue.Then I'll see if I can deduce more from their troubleshooting tree. It's like a logical word problem in school. It's also more likely to be a servo than a stepper which I like better.  I haven't looked too much at the pedal but it should be pretty straightforward. 

It's funny how much concern there is about this thing being failsafe given 1) the utter klugeiness of how it's been working for the last decade with parts that are over three decades old and 2) the power/weight ratio we're dealing with here.

Keith Tanner
Keith Tanner MegaDork
7/21/21 5:31 p.m.

Wasted a bunch of my life at the junkyard today. You're not allowed to pull your own parts anymore, but an employee and I did tour the yard to find likely donors. One - a Crosstrek - had the throttle body sitting loose on a ravaged engine bay where only a partial long block remained.

The owner said no. He's convinced that engine is a $1k engine and won't let any parts be sold off it. He was also convinced the pedals are throttle position sensors and worth at least $100 each. And each pigtail would be $15.  Oh, and there was nobody available to pull parts so I would have had to buy the parts and come back to pick them up. 

 So instead of me pulling two parts with about 5 minutes of work and handing over cash money, I wasted 90 minutes of my time and walked away with nobody happy. I wish him luck in selling that $1000 engine that he's owned for 18 months and that is missing major parts.

Went on eBay, bought a throttle body for $50 shipped and it came with a pigtail. Also realized that we have some leftover GM pedals with pigtails at FM from V8 conversions, so there's the pedal sorted. The fact that the pedal and TB are not matched doesn't matter because I'm taking care of the part in the middle.

To be continued when the parts arrive...

Keith Tanner
Keith Tanner MegaDork
7/30/21 11:18 a.m.

Parts arrived, then so did a 5 year old nephew who doesn't want uncle Keith sitting at a workbench staring at little wires. But I got a chance to do a bit of work.

The pedal was a bit of a pain. GM being GM, they use the same basic design in a bunch of applications. But for some reason, the pinout changes with the same connector. Can some of those pins be swapped? I don't know. But eventually I found a pinout for my pedal (original application is CTS, apparently) and was able to confirm behavior. It is not, as I thought, two signals moving in opposite directions. It's two signals with a different range. Similar to what you can read about here: https://www.picoauto.com/library/training/electronic-throttle-control-drive-by-wire-or-fly-by-wire

I haven't traced out the full curve of the pedal yet, so I don't know if it's linear or not. This one might be the challenge.

The Subaru throttle body, on the other hand, is easy because I am blessed with the factory service manual - Subaru will give you all-you-can-eat access to their manuals for a few days for a good price, and you can download manuals for later use. So here are the relevant pages for a 2006 Legacy.

Awesome. That gives me the expected range and helps identify exactly what wire is what, although the wire colors are a little different in mine. Even the PWM frequency for the servomotor! And interestingly, again the two sensors are in parallel but the voltage range is similar. Time for a little confirmation. Pink is power, blue is ground, the two light green wires are the two sensor outputs.

So here's a fun thing. I'm planning on doing this with an Adafruit Feather, which uses 3.3 volt logic. The car uses 5v. So I did a little playing around with different voltages. Bench power supplies are awesome.

The pedal seems to work just fine with a 3.3v input. But the throttle body does not - the circuitry stops working at about 4v, so I need to feed 5v into it to make it work properly. No problem, I will have 5v on hand to power the Feather anyhow. But I can't feed a 0-4.17v signal into the Feather without breaking something. Simple scaling down of an analog signal is easy enough with a couple of resistors. I ran the numbers and came up with some that give me a peak of just over 3v. Perfect.

Here it's prototyped with a breadboard and running off an RP2040 Feather. I thought about using a Pi Pico which uses the same chip and I am eager to play with, but they don't natively take analog inputs so I'd have more futzing around to do with analog to digital conversion.

It didn't take long before I had some test code running. I started with the assumption that these were a linear signal (the peak values certainly seem to imply it) so I wrote a little script that would display the current throttle position for each sensor, as a percentage, based on that assumption. Doing a quick run through the range showed the two TPS % values to be identical almost all the time and never more than 1% off. I think I can work with that.

Got tired, went to bed. Tonight, I see if I can do the same with the pedal. And then it's motor control. Right now, I'm also thinking about packaging. Do I want to run the pedal signal through wires that run the length of the car, or does it make more sense to convert it to a digital signal and have a Feather at each end? Perfect use for CAN :) Maybe I'll try it this way first.

I also have to make sure my pedal will install in the van's less-than-typical footwell. If not, I have a wide variety of GM DBW pedals from which to choose.

Karacticus
Karacticus Dork
7/30/21 12:17 p.m.

A question out of ignorance on "linear mapping"--

Is it pedal position to throttle body plate angle, or is it something that (I'm guessing) would be  more proportional to power, like the open area through the throttle body?

Tom Suddard
Tom Suddard Director of Marketing & Digital Assets
7/30/21 12:30 p.m.

In reply to Karacticus :

In an OE application, the throttle pedal and the plate aren't necessarily related at all. Modern cars will turn the pedal into a torque request (something like "the driver wants 50% torque") and then the computer will employ fuel/timing/throttle opening/valvetrain timing/etc. to most efficiently create 50% torque. We'll see if Keith gets that fancy with his Vanagon. cheeky

MadScientistMatt
MadScientistMatt UltimaDork
7/30/21 12:35 p.m.

Once you have the throttle tracking with the pedal 99.99% of the time, the real fun starts: Proving that last 0.01% isn't going to go crazy.

Tom Suddard
Tom Suddard Director of Marketing & Digital Assets
7/30/21 12:40 p.m.

I vote for a fun surprise inside every pedal application. Random number generator on the arduino runs once every startup, and that percentage of pedal equals 100% throttle opening.

1 2 3

You'll need to log in to post.

Our Preferred Partners
UHs5nGBVxev4SIFcioTB0ekKRRkQR09SFiLkWOZgqqGhR4fyWzfJr2VwjLf3M6k0