Lil' Blackbox

General => General Discussion => Topic started by: mantonakakis on April 13, 2020, 11:41:40 AM

Title: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: mantonakakis on April 13, 2020, 11:41:40 AM
Hey, just wanted to post my thanks for all the info and open-source nature of Lil' Blackbox! It was a huge help in getting the turbo working on a 2.7 liter 2-valve 80's BMW gasoline engine (pretty much stock long block except for a 280/280 turbo cam). I'm not running speed control at the moment, but so far everything is working really well. I am, however, monitoring speed to help with tuning. The main reason for shoehorning a HE351VE into the car was to support high power without having to run a ton of boost, and with the VGT, being able to get reasonable spool/response (and better cruising economy and maybe decreased heat).

Setup is a Megasquirt 2 running the latest Extra code. Using the Megasquirt's boost control as the first stage in controlling the turbo vanes. Wastegate is using a simple manual boost controller. Set the target boost table to reasonable values, read the Megasquirt's boost solenoid duty cycle over CAN, modify the value on a microcontroller to prevent overspinning/surging, and send the command onto the turbo itself. I also send turbo position and speed back to the Megasquirt for datalogging. WOT boost target is set a little lower than wastegate pressure to get easy/consistent fully open vanes once the turbo is near target boost, to provide maximum power.

Here's a quick sample log from a second and third gear pull. Low boost for now as I work on the ignition map. I'm estimating ~270whp at the moment based on acceleration rate - not bad for 155kPa absolute pressure on an engine that made ~170bhp stock! "Turbo size" value is an estimate of cm^2 (assuming fully closed = 2.5cm^2, fully open 26cm^2).

(https://images2.imgbox.com/46/0b/xq3nXZ5i_o.png)
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: Rx7man on April 19, 2020, 06:13:29 PM
Nice!  keep us posted!
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: hakcenter on April 21, 2020, 06:07:17 PM
Where'd my post go lol ?

Anyways yeah that's pretty cool, what are you doing to control the turbo ? Is it just the squirt box via canbus to the turbo or are you using the lbb as an in between ??
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: mantonakakis on May 13, 2020, 09:22:02 AM
Oops, forgot to check this thread for a few weeks!

I've gone through a few iterations of ideas (before I had the car running) to actual implementations once the car was running. Originally, my general plan was to simply convert the Megasquirt boost duty output to vane position.

Then I added an rpm-based minimum nozzle size to prevent choking the engine and/or surging and/or overspinning the turbo (done on my microcontroller in 1000rpm increments).

Most recently I realized the Megasquirt boost control algorithm isn't entirely suited to this use, and that for my purposes, for the near future at least, purely proportional control would probably work pretty well. I added a complication to pure-P gain, though: I currently read the Megasquirt boost target (based on my boost target table in MS) and barometric pressure over CAN; I then have an offset factor in percent that reflects the point at which I'd like the vanes start opening from their rpm-based fully closed position; with the otherwise purely proportional gain, once I hit my boost target, vanes will be fully open, and if I tune my boost target at WOT to be slightly less than my wastegate setting, this will guarantee fully-open vanes once the turbo is spooled, maximizing power. The Megasquirt algorithm doesn't always result in predictable duty cycles even with I and D gains set to zero: for example, sometimes even if you're 20-30kPa above the boost target, you still end up with a high boost duty (even though with only proportional control, it should be at the minimum duty cycle).

In practice, this doesn't cause boost to drop, at least not at the moderate levels of boost I'm running (don't plan on running more than 210kPa MAP any time soon; here in Colorado, that's ~2.6 pressure ratio).

So as an example, in the attached datalog, you can see my baro is 80kPa and boost target is 165kPa. Currently my threshold percent is set to 65%, i.e. once I'm 65% of the way to my boost target (relative to baro), the vanes start opening; in this case, ~135kPa. Vanes are fully open once I hit the boost target of 165kPa.

With a relatively reasonably-tuned boost target table, the vanes should stay fully open until I actually need more boost. I probably need a little more tuning in the part-throttle areas, but at WOT it is working really well. If I change my wastegate settings, I just adjust the WOT cells on the boost target map and smooth the rest of the map accordingly.

Oh, one thing to point out - I'm running a JGS 40mm wastegate, and the stiffest spring JGS sells is worth about 12.5psi on my setup at sea level, or about 9.5psi up here at 6000 feet. In the attached datalog, the exhaust pressure with the vanes closed to ~7.5cm^2 at 4000rpm is enough to blow the wastegate wide open in the middle of the spool (i.e. raw value sent to the turbo is about 240 er, 770). I have a screamer pipe coming off the wastegate right under the passenger footwell, and I can hear the wastegate very loudly from about 3-6psi above atmospheric; once the vanes start to open it quiets down until I fully spool. Who knows how much it's bleeding off over the course of the entire spool! Hopefully I don't have to go to CO2 control, but I'm already running the stiffest spring and it's getting blown open at barely above atmospheric pressures, so there's not a way to plumb the wastegate with a boost solenoid in any way that will make a significant improvement...

Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: Rx7man on May 14, 2020, 11:18:09 PM
nice to see progress
On the wastegate, if you're using a 4way valve you should actually be able to put pressure on it to keep it closed too (your wastegate SHOULD have 2 ports on it, one to open it, one to close it).. all the logic is the same, once the solenoid starts to activate, it'll bleed pressure off the "closing" side while adding pressure to the "opening" side of it.  If you do it this way you can get by with a much weaker spring
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: mantonakakis on May 15, 2020, 03:06:09 PM
Quote from: Rx7man on May 14, 2020, 11:18:09 PM
nice to see progress
On the wastegate, if you're using a 4way valve you should actually be able to put pressure on it to keep it closed too (your wastegate SHOULD have 2 ports on it, one to open it, one to close it).. all the logic is the same, once the solenoid starts to activate, it'll bleed pressure off the "closing" side while adding pressure to the "opening" side of it.  If you do it this way you can get by with a much weaker spring
Yeah, I've thought about it, I don't think it would eliminate it completely, but it might help.
I did some testing today: last time I posted, I was running a line straight from the compressor outlet to the wastegate bottom port. Today, I plumbed my manual boost controller in line with it (ball/spring type). At first, it was set a little too high (I let off the throttle at 15psi, I was hoping for a little less than that). The wastegate did a much better job of staying shut! I decreased the boost controller setting a little, so I was getting about 11.5psi boost, and the wastegate started opening again.

At this point, I can take the single-solenoid output from the Megasquirt and run the solenoid to the top of the wastegate. A 4-port solenoid, or two 3-ports, might be best though. Just having the MBC in-line gave promising results.

Oh, quick video pointed at the exhaust outlet, from a few nights ago:
https://www.youtube.com/watch?v=M527uEQ6myU
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: Rx7man on May 20, 2020, 08:57:09 PM
Nice!
I'm trying to convince my buddy to put an HE351 on his FD Rx7 (My old car)
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: mantonakakis on May 21, 2020, 06:52:20 AM
I went ahead and ordered an on-board air compressor and another boost control solenoid (already have one on-hand that I used with the old turbo). To start with, I'll do a pretty simple control with hopefully just a single solenoid that applies the full regulated pressure to the top of the WG until I get close to boost target, at which point I'll vent it fully and let the MBC control the boost. Hopefully that'll get it spooling harder!
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: Rx7man on May 25, 2020, 02:00:06 PM
you probably don't need a whole lot of pressure from it,  have you measured your exhaust pressure?  I'd say if it's at about your peak exhaust pressure it should be fine
I'd probably try and make a system so it's got a holding tank fed by exhaust pressure and a check valve in it to hold it there,  I'm a cheap ass
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: mantonakakis on May 27, 2020, 12:32:00 PM
Quote from: Rx7man on May 25, 2020, 02:00:06 PM
you probably don't need a whole lot of pressure from it,  have you measured your exhaust pressure?  I'd say if it's at about your peak exhaust pressure it should be fine
I'd probably try and make a system so it's got a holding tank fed by exhaust pressure and a check valve in it to hold it there,  I'm a cheap ass
Haven't measured the exhaust pressure, been thinking about it but I don't really feeling like taking too much apart at the moment. I could probably tap into my wastegate feed tube pretty easily, it's stainless and welded to the turbine housing. But no real downside to running a lot of pressure. I use a JGS wastegate that is a piston/o-ring design, not a diaphragm, so it should be able to take lots of pressure (they're tested to 40psi, so I'll probably start there).

The compressed air setup wasn't very expensive, $130 for the whole kit with compressor, tank, wiring, mounting kit, etc. I don't have a ton of room under the hood, either, and knowing myself I would complicate an exhaust-pressurized system needlessly to get it routed to the trunk. And now my e30 can have air horns, too!

Flyby vid from the other day, I overlaid some gauges to show the turbo in action. These pulls were around 4500-5000' elevation, 85kPa ambient air pressure. The boost gauge is scaled to sea-level gauge pressure (i.e. 0psi on the gauge = 100kPa absolute = sea level ambient pressure).
https://www.youtube.com/watch?v=I8aVouczZFY
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: Rx7man on May 30, 2020, 04:25:22 PM
nice, looks like the turbo is in a pretty happy place too!
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: mantonakakis on June 02, 2020, 09:57:09 AM
Okay, did my first test last night with the compressed air. Wastegate is staying shut now, when my MAP gets within 10kPa of my boost target I vent the solenoid, otherwise it's pressurizing the wastegate dome to ~35psi. One weird thing I noticed is significantly lower wheel speed - I'll have to do a back-to-back test to compare for sure, but usually I'm at 80k-90k once I'm spooled and around 180kPa MAP. After the wastegate change I'm seeing more like 65k-75k with all else mostly equal except altitude - my last testing at the current boost level was 85kPa ambient pressure, last night was 80kPa; pressure ratio was higher last night, but turbo speed decreased???

EDIT: Must have been a fluke, maybe bad data or something? I just went for a quick test drive and the speeds are back to normal, mid 80k's.

In any case, I want to try an capture and maybe log the messages broadcast by the turbo - I see in the lilbb code there is command and actual position (makes sense), but also feedback and temp? Is that the controller's closed loop feedback and the actuator temperature?
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: Rx7man on June 03, 2020, 12:56:43 AM
correct, the feedback is essentially how hard and in which direction the motor is working, temp is usually pretty close to your coolant temp if you have that plumbed up
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: mantonakakis on June 03, 2020, 12:18:54 PM
Quote from: Rx7man on June 03, 2020, 12:56:43 AM
correct, the feedback is essentially how hard and in which direction the motor is working, temp is usually pretty close to your coolant temp if you have that plumbed up
Cool, got that working now, I was curious if there was any big error between command and actual - at least driving around a bit yesterday, they follow pretty tightly. Both are getting logged to the Megasquirt now (previously I was only logging the position command I sent, but now I'm logging the received command position as reported by the turbo, as well as the actual position).

One other question - in some other forum thread circa 2014, someone was posting that a command position of 140 or so was the actual usable most-open position, even though the vanes will still move down to about 50 or 60 (which is where I have my limit set now). Any advice on whether it's worth changing that max limit to 140?
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: Rx7man on June 08, 2020, 09:24:27 AM
I let mine use the whole range, even though it may not be doing very much opening wider than 140.. It may also depend on the size of turbine you have, perhaps on a 60mm, the turbine exducer becomes the flow limiting factor, but if you go to a 67mm, that's no longer the case?
I showed my buddy your video, he is a beamer fan too (until I convinced him to get a dodge/cummins)

one reason I let mine use the whole range is to keep the vane sliders clean and not let too much soot build up on them, on a gasser it's probably not as important though
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: mantonakakis on May 27, 2022, 02:36:40 PM
Long-term update: didn't do much with modifying the car or the code since the last update. It had been running good, but sitting a lot. A month or two ago I decided to fix a couple small coolant leaks on the car, and it snowballed. Among many other things I've built a closed-loop PID wastegate dome pressure controller, and pretty much totally revised my VGT control algorithm, as-yet untested. Hopefully I'll get a test drive in this evening to see if it's any better than what I was doing before!
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: hakcenter on May 29, 2022, 02:24:07 AM
Nice to see some movement on this
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: mantonakakis on May 31, 2022, 07:50:25 AM
New VGT algorithm mostly working well. Have a one or two little anomalies still, like some crazy VGT actuation when I'm within a short range of boost target. Still needs more tuning, but the algorithm is more model-based (kind of centered on mass flow, engine ECU is running speed density which makes for a decent mass flow estimate). In the not-too-distant future I will be adding pre-turbo EGT and pressure sensors. May work them into the algorithm, may just use for VGT tuning.
Wastegate dome pressure control using on-board compressed air is functional too, which is nice that I can drive both wastegate and VGT algorithms from the same target table on the engine ECU (been running a manual boost controller up to this point, and using the on-board air to hold the wastegate shut during spool, then fully vent the dome to let the manual boost controller take over). However, I still need to do a little refining here. The dead zone of the solenoids keeps moving on me, so even though the PID control is stable and responsive right now, it's still not doing a great job of hitting the targets.
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: hakcenter on May 31, 2022, 09:45:52 PM
Well target boost versus shaft speed is going to limit you.

My truck would hit 40psi @ 110k rpm and lower to 35psi but gain shaft speed to 125k. Total trip to watch happen.

But if max flow isn't sustaining I get it
Title: Re: HE351VE on 1987 BMW (gas) - inspired by lilbb!
Post by: mantonakakis on June 24, 2022, 12:17:04 PM
Quote from: hakcenter on May 31, 2022, 09:45:52 PM
Well target boost versus shaft speed is going to limit you.

My truck would hit 40psi @ 110k rpm and lower to 35psi but gain shaft speed to 125k. Total trip to watch happen.

But if max flow isn't sustaining I get it

That 40psi vs 35psi change implying that boost dropped but mass flow/power increased?
I'm nowhere near pushing the turbo right now, maximum shaft speeds I'll see are about 90k, running about 190kPa absolute for max boost at the moment (I'm at 6000-6500' above sea level, so this is about 16psi boost above barometric).