HE351VE CAN Broadcasting and General VGT Control

All questions about MS2/Microsquirt/Microsquirt module. See also MS2/Extra manuals

Moderators: jsmcortina, muythaibxr

farmerz24
MS/Extra Newbie
Posts: 8
Joined: Sat Mar 01, 2014 10:33 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by farmerz24 »

TinyIO is needed to get rpm signal from ms3. Ms3 is controlling a 06 GM v6 3.9 swapped into a 05 Subaru Legacy.
Tiny io then outputs the Subaru crank wheel pattern at the correct rpm into the factory Subaru ecu.
This also allows the fuel pump to work correctly and the factory tach to work.

I think I need another device to control the turbo if I need to keep the tinyIO
jsmcortina
Site Admin
Posts: 39587
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: HE351VE CAN Broadcasting and General VGT Control

Post by jsmcortina »

Does the Tiny-IO have to connect via CAN ? Perhaps it could be changed to read the MS3 tacho output as its engine speed input?

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: HE351VE CAN Broadcasting and General VGT Control

Post by racingmini_mtl »

I could look at adding an option to the code for different CAN speeds. James, does the MS3 code disable MS-CAN when the speed is changed from 500k?

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
jsmcortina
Site Admin
Posts: 39587
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: HE351VE CAN Broadcasting and General VGT Control

Post by jsmcortina »

From memory, that turbo uses 29bit CAN which is incompatible with Megasquirt-CAN and due to that the code requires that Megasquirt-CAN be disabled in addition to the baud rate change.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
farmerz24
MS/Extra Newbie
Posts: 8
Joined: Sat Mar 01, 2014 10:33 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by farmerz24 »

Would it be hard to make the Tiny-IO accept the tach output from the MS-PRO?
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: HE351VE CAN Broadcasting and General VGT Control

Post by racingmini_mtl »

I'll have a look at using the CAN realtime data broadcasting. That and the option to use 250k instead of 500k for the CAN bus speed should allow you to use the TIOx and the HE351

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
farmerz24
MS/Extra Newbie
Posts: 8
Joined: Sat Mar 01, 2014 10:33 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by farmerz24 »

Thanks Jean,

Let me know when i can test this. Will the TinyIO need to be sent back to be re-flashed after this change?

I have a he351ve here waiting to test.
farmerz24
MS/Extra Newbie
Posts: 8
Joined: Sat Mar 01, 2014 10:33 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by farmerz24 »

Another point of concern, mainly towards the MS3 programmers:

Ideally, Closed loop boost control would be used with a target boost table to control the veins. My one concern would be having a setting which is basically "minimum vein position". This is required as I believe the PID control loop would always try to slam the veins shut whenever target boost was above the current boost level. With this turbo at full closed it acts as an engine brake and without any stetting to limit the closed position it would basically end up closing too far and choke out the engine.

In the PID world i believe this is called PID output min/max limits. I think we would need something like this. Ideally perhaps another 2axis table for minimum vein position based on RPM and TPS/or boost, but this is going beyond the minimum required to get this working.

What do you guys think. I see we can adjust each of the P, I, and D terms for closed loop control which is good. I don't know if there are internal anti-windup limits on the I term, to prevent it from winding up too far when target and actual values do not match. If this was available it may also help allow more tuneability.

Thoughts?
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: HE351VE CAN Broadcasting and General VGT Control

Post by racingmini_mtl »

I'll do a few tests here and I'll get back to you. You shouldn't have to send the unit back.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
mikey antonakakis
Helpful MS/Extra'er
Posts: 100
Joined: Sun May 29, 2011 5:23 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by mikey antonakakis »

farmerz24 wrote:Another point of concern, mainly towards the MS3 programmers:

Ideally, Closed loop boost control would be used with a target boost table to control the veins. My one concern would be having a setting which is basically "minimum vein position". This is required as I believe the PID control loop would always try to slam the veins shut whenever target boost was above the current boost level. With this turbo at full closed it acts as an engine brake and without any stetting to limit the closed position it would basically end up closing too far and choke out the engine.

In the PID world i believe this is called PID output min/max limits. I think we would need something like this. Ideally perhaps another 2axis table for minimum vein position based on RPM and TPS/or boost, but this is going beyond the minimum required to get this working.

What do you guys think. I see we can adjust each of the P, I, and D terms for closed loop control which is good. I don't know if there are internal anti-windup limits on the I term, to prevent it from winding up too far when target and actual values do not match. If this was available it may also help allow more tuneability.

Thoughts?
There would be a few ways to do this. I'm finally getting back to working on the car soon (thanks, life!) and the plan is to use the stim on the bench to get the MS2 and HE351VE working with each other (via Arduino with a CAN board). Last year I got control of the HE351VE with the Arduino (just using a pot for position input command) and it worked really well. The plan is to have the Arduino read the MS boost control output, maybe using a simple converter to convert the PWM signal to analog voltage, or reading the PWM signal directly - that's my very next step!. As long as I can consistently read the MS boost signal, I'll be able to control the turbo without issue.

I'm not familiar with MS3Extra, but on MS2E boost control settings I can set a "open duty" and "closed duty" which I believe limits the range of duty cycles sent, with the idea being that at some non-0/100 duty cycle the solenoid will be fully closed, and at another, fully open, meaning any values above and below will induce no further change. So if you're planning to use the boost control output, you've got that option to keep the nozzle from fully closing.

In addition, the turbo controller itself has similar characteristics. You send a 10-bit value to the controller over CAN, but at some non-zero value the turbo is fully closed, and at some value less than 1024 it's fully open (the full range depends on the turbo itself and the rest of your hardware, but the range is something like 100-900). If, for example, I wanted the turbo to always be at least 10% open, then I would write the Arduino code to never send a value less than, say, 190 to the turbo.

Putting it together, the command you send over CAN to the turbo should already have limits at both end, so you could do the tuning there. You can also set a MS output limit in TunerStudio (which would be the easier and more practical way to tune this value). In any case, with PID control, how strongly it reacts depends on your tuning of each value - it wouldn't always "slam" them shut, thanks to the P value (smaller error gives smaller control). And you can tune that into your map as well (i.e. low RPM/high throttle, don't target the same max boost as at peak power, use a realistic value that gets the turbo to spool without choking the engine). I think any way you look at it, you should have more than enough control with the closed loop programming to avoid this issue :)

-Mikey
fpvmustang
Helpful MS/Extra'er
Posts: 109
Joined: Sat Oct 13, 2012 11:17 pm
Location: Quincy CA. USA

Re: HE351VE CAN Broadcasting and General VGT Control

Post by fpvmustang »

in closed loop there is no boost control until a few kpa before boost. turbo lag
I set min and max vein in the arduino.curently using ADC
min vein posistion is a compromise between low engine rpm spool and high rpm spool
best position for low rpm response chokes motor at higher rpm.
I then have a generic pwm output tied to boost output. To close veins partially out of boost to increase response.
I also have a switch on shiftier to force veins to min setting. useful for passing on the windy mountain roads i drive.

but for my next build I'm really leaning to going with lil black box using turbo shaft speed to tune from. then let ms3 control waste gate.

compressor surge line limits how soon engine can build boost also veins can be warped by running too closed vgt. they warp away from turbin wheel
33 psi boost on lpg
Suprazz
Master MS/Extra'er
Posts: 499
Joined: Mon Jan 22, 2007 7:58 pm
Contact:

Re: HE351VE CAN Broadcasting and General VGT Control

Post by Suprazz »

FYI,
I'm using a BansheeController from SteedTech that convert PWM to turbo control position. 0 = fully opened, 100 = fully closed. I never took the time to try the control with the MS3 directly.

I'm using the MS3 boost control output to control the turbo position and I have a second electronic controller that is controlling my wastegate few psi over the ms3 boost control. I could also use the second boost controller inside the ms3 instead...

Here are what my settings look like. It works perfectly.
Turbo is fully opened during cruise. When I press throttle over 35%, it activate the boost control and the turbo close the van to rise the boost. When the boost hit the target, the valve start to open while maintaining boost pressure.
When pressure is over the target and turbo fully opened, the electronic boost controller start to open the wastegate to prevent overboost.

I also have a switch to manually control the turbo with a potentiometer. (there are 2 inputs on the steedtech controller). It's very useful for crusing when you want to reduce the exhaust noise so I can close the valve to a fixed position. Then the ms3 boost control does nothing and only my electronic boost controller control the wastegate if the boost goes too high.
Best looking and most advanced CAN-bus gauge
Toyota Supra 7MGE, 7M-GTE and 1JZ-GTE Plug and play ECUs: http://www.perfecttuning.net
Serial to Bluetooth or Serial to WiFi
DIYAutotune Canadian, EFI Source and ECUMaster reseller!
jsmcortina
Site Admin
Posts: 39587
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: HE351VE CAN Broadcasting and General VGT Control

Post by jsmcortina »

Suprazz wrote: I never took the time to try the control with the MS3 directly.
Makes me wonder why I added the support!

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Suprazz
Master MS/Extra'er
Posts: 499
Joined: Mon Jan 22, 2007 7:58 pm
Contact:

Re: HE351VE CAN Broadcasting and General VGT Control

Post by Suprazz »

jsmcortina wrote:
Suprazz wrote: I never took the time to try the control with the MS3 directly.
Makes me wonder why I added the support!

James
You added the support after my initial setup was finished so I never took time to undo what I did to try the ms3 control. And also with the MS3, I didnt had the option to switch to manual control with a potentiometer like I do and I always use the manual control.
Best looking and most advanced CAN-bus gauge
Toyota Supra 7MGE, 7M-GTE and 1JZ-GTE Plug and play ECUs: http://www.perfecttuning.net
Serial to Bluetooth or Serial to WiFi
DIYAutotune Canadian, EFI Source and ECUMaster reseller!
mikey antonakakis
Helpful MS/Extra'er
Posts: 100
Joined: Sun May 29, 2011 5:23 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by mikey antonakakis »

So, after disappearing for wayyy too long, I pulled out all my parts, got the MS2 running on a JimStim, and set about learning how to read a PWM signal with an Arduino. Take the boost control PWM signal directly from JS11 on the MS2, read it in as a duty cycle variable in the Arduino, and convert/send it as a CAN message to the turbo via a SparkFun CANBUS shield, and... it works!

Closed loop seems to work pretty well on the bench. Boost target map is built from low-TPS boost targets near-vacuum to open the nozzle for good fuel economy during cruise, WOT boost target slightly below simple WG spring setting so vanes open once turbo is spooled. It will be difficult to tune further without actually installing the turbo in the car and taking some real datalogs (which will require a new exhaust manifold/downpipe, intake/oil/water plumbing, wiring). The actuator responds VERY quickly to boost duty cycle with a strong 12V power supply:

Bench Testing Youtube Vid
mikey antonakakis
Helpful MS/Extra'er
Posts: 100
Joined: Sun May 29, 2011 5:23 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by mikey antonakakis »

Datalog and .msq attached. Happy to provide my Arduino sketch and wiring if anyone wants it, with the caveat that I have very little formal training in programming, so it is likely not terribly optimized... but it seems to work reliably!

One note, that I think does not have anything to do with the turbo/arduino setup:
  • -When boost target < current MAP, as I increase MAP from some level of vacuum, when I cross 75kPa, boost duty momentarily spikes and then goes back to min
    -When boost target > current MAP, as I increase MAP from some level of vacuum, boost duty shoots up when I cross 75kPa, and shoots down when MAP decreases from high boost, once it gets down to 75kPa
I thought this might have something to do with Boost Control Lower Limit Delta, but adjustments there don't seem to have an effect. But it does seem that boost control is enabling/disabling at this threshold. At my current altitude, ambient pressure reads as 78kPa on the MAP sensor. Datalog attached.
Attachments
2019-02-17_12.56.30_HE351VE_working.msq
(119.65 KiB) Downloaded 32 times
2019-02-17_13.25.32.msl
(419.57 KiB) Downloaded 31 times
fpvmustang
Helpful MS/Extra'er
Posts: 109
Joined: Sat Oct 13, 2012 11:17 pm
Location: Quincy CA. USA

Re: HE351VE CAN Broadcasting and General VGT Control

Post by fpvmustang »

i run a generic output for out of boost vgt control. I also programed Arduino so it won't fully close vgt. i warped a set of vans over driving the turbo.
33 psi boost on lpg
mikey antonakakis
Helpful MS/Extra'er
Posts: 100
Joined: Sun May 29, 2011 5:23 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by mikey antonakakis »

fpvmustang wrote:i run a generic output for out of boost vgt control. I also programed Arduino so it won't fully close vgt. i warped a set of vans over driving the turbo.
Thanks for the input. Realized since I already have CAN communications, it would be maybe "better" to just use MS to do CAN data broadcasting instead of trying to read the PWM boost control output (although that did work!). That way it's easier to integrate other variables into the control if needed/wanted.
I'm thinking I will at the very least do an engine speed-based minimum nozzle position, maybe just linear, maybe with a bit of a curve. I've successfully gotten the Arduino to read the MS CAN output, not too difficult, so now I have RPM and boost duty cycle being read directly by the Arduino. Not sure I would need anything else from the MS to get pretty effective control.

The plan at the moment is to have engine speed-based max and min nozzle position curves, and scale the boost control signal between them - for example, at, say, 4000rpm, let's say I want the max vane position to be 90% and min to be 30%. If MS boost duty is 0%, then it should be converted to 30% by the Arduino at 4000rpm. If MS duty is 100%, then Arduino converts to 90%. If MS duty is 50%, then Arduino converts to 60%, etc. Should be a pretty straightforward algorithm to code up.

The only other main variable that might be worth taking into consideration is shaft speed, since the HE351VE has a sensor built in. Don't know how much I would need that in a control loop once it's tuned properly, but it would probably at least be helpful for initial tuning of the max/min curves and boost target table.
mikey antonakakis
Helpful MS/Extra'er
Posts: 100
Joined: Sun May 29, 2011 5:23 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by mikey antonakakis »

Car is now running with a HE351VE controlled (mostly) by Megasquirt boost duty :) More details, including data logs, in the not-too-distant future! So far just idling and confirming system functionality.
mikey antonakakis
Helpful MS/Extra'er
Posts: 100
Joined: Sun May 29, 2011 5:23 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by mikey antonakakis »

Quick datalog, 2nd and 3rd gear pull, not hitting the rev limiter. The vane position makes a huge difference. This motor is a 2-valve 2.7l straight six, with a 280deg cam and low compression ratio. This vane tuning was not very aggressive (I use an rpm-based minimum nozzle size to prevent surge/overspinning, and the setting for this run wasn't very aggressive).
2-3_uphill_155kPa_2020-04-10.png
2-3_uphill_155kPa_2020-04-10.png (24.71 KiB) Viewed 602 times
Post Reply