HE351VE CAN Broadcasting and General VGT Control

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

Moderators: jsmcortina, muythaibxr

mikey antonakakis
Helpful MS/Extra'er
Posts: 101
Joined: Sun May 29, 2011 5:23 pm

HE351VE CAN Broadcasting and General VGT Control

Post by mikey antonakakis »

Hi all, I've got a "2.7i" e30 with a Enem Z45 Turbo cam, and I'm planning to swap my turbo from a Super 20Gto a Holset HE351VE. I'm running MS2/extra firmware that has the HE351VE CAN broadcasting.

I have searched, mostly unsuccessfully, to try and figure out some of the details of actually getting it working on the vehicle, and working effectively.

First, I'd like to clarify the setup in TunerStudio. Obviously I need to connect the HE351VE signal input to the CAN broadcasting output pin on my Megasquirt, and set the output pin correctly (or do I only have one choice of MS pin?) and I need to enable the HE351VE broadcasting. Once I enable boost control, is that all that's involved in setting up the boost duty -> CAN output? Or am I missing any steps?

Secondly, I'd like to chat a little about actual control method/algorithm. It seems there are many ways to set this up, so I'd like to share my ideas and find out what you think. It can be a complicated topic, so this post will be pretty long, sorry!

Option A: open-loop boost control with a boost duty map.
Set up the duty table to get the desired characteristics, first by finding the max and min duty to give max and min stroke of the vanes (on the bench).
The way I would approach setting up the table is to first consider the extremes, like engine braking or low-load cruising (whichever is preferred), and WOT operation.
Engine braking (i.e. min throttle) could be set by experimentation -- setting the duty cycle vs. engine speed to get the desired subjective deceleration feeling.

If we prefer not to have the turbo making any impact to engine braking, then we can use the low-load cruising condition as our "bottom" extreme.
For best fuel efficiency, it's pretty simple -- open the vanes fully to reduce back pressure and pumping loss. From cruising throttle position and lower, set the map all the way open.

On the other extreme, we have WOT operation. My thinking here is that to get the best power (i.e. best torque, i.e. best V.E.), open the vanes as far as possible while still ensuring you hit your desired boost. This would be fairly easy to do experimentally: set the WOT values to full open, and do a WOT pull. Decrease the values until you hit your desired boost at each engine speed.

So far, things are pretty straightforward. The tricky part is what should be done in between cruising throttle and WOT, and this is the most important part, I think.
The advantage of a VGT turbo is in the transients, as well as improving WOT VE as described above -- but mostly in the transients. Closing the vanes increases boost response. So naturally, we'd like to close the vanes when we stomp the throttle, and have them open as we achieve our target boost. If we just make the partial-throttle column values the same as their corresponding WOT cells, then we will achieve a nice predictable response, but it won't give the fastest possible response. Maybe it would be adequate? But for best response, we would want the vanes to close as we transition out of our cruising throttle, but open again at WOT. If you slowly roll on the throttle, matching your throttle position to the spool, then this would work pretty well -- but that's a pretty inconsistent control method! And if you're going uphill, and your cruising throttle increases with the increased road load, and the vanes are closed, then you'd lose efficiency and build up quite a bit of exhaust temp with the closed vanes.

Another way to possibly set up the open-loop table in between cruise throttle and WOT would be to do a similar process to building the WOT curve -- accelerate at constant partial throttle positions above your cruise area, and close the vanes just enough to hit a target boost (perhaps the same, or less than, WOT boost target). I still think this method has a lot of compromises, but it's the best I can think of for open-loop control.

Option 2: closed-loop boost control with boost target map, and external wastegate with desired maximum boost
This might be much more straightforward to run, but I still have one main concern.

For cruise, just set a boost target lower than manifold pressure at that throttle/engine speed point -- the control loop would open the vanes to bring the pressure down. Perfect!
For WOT, set the boost target just below your wastegate boost. When you stomp the throttle, your boost error increases and the vanes snap open to spool the turbo. Once the boost reaches the target, the vanes open again, and even a big A/R (once spooled) should overboost above any unreasonably-low engine speed, so you will likely have your wastegate open and your vanes open fully, giving you the best VE and a great spool.

You can then set your partial throttle boost targets to whatever characteristic you want, and it should work well.

The main issue I see here compared to open-loop control is that the VE will be much less stable/predictable during transients. I'm not sure how much of an impact this would make in practice, with a well-tuned VGT control, but I think it's something to keep in mind.

I should be swapping the turbo into the car some time in the next few weeks, so I look forward to any discussion in this thread. Even if I posted a big wall of text that no one reads, at least I got my ideas down in one place :)
jsmcortina
Site Admin
Posts: 39614
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: HE351VE CAN Broadcasting and General VGT Control

Post by jsmcortina »

For CAN communications you need to connect the CANH and CANL wires. This is covered in the Hardware Manual.

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: 500
Joined: Mon Jan 22, 2007 7:58 pm
Contact:

Re: HE351VE CAN Broadcasting and General VGT Control

Post by Suprazz »

I'm using an HE351VE on a inline 6 3.0 liter 2jz-gte in a Toyota Supra.

I'm controlling the HE351ve with an external controller.

I'm using a pwm output from the MS to this controller to position the valve.

RIght now it work very well. By default, the valve is fully open. When I press on the throttle, the valve close and build up boost very fast and reopen slowly when it reach around 15 psi.

I'm also running an external wastegate with an indenpendant boost controller set to 20 psi.


On my external controller, I also have the option to switch in manual mode and I can control the exhaust van with a potentiometer. So most if the time when I'm crusing I set it manual mode and I close the van to reduce exhaust noise.
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: 39614
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: HE351VE CAN Broadcasting and General VGT Control

Post by jsmcortina »

Have you tried the Megasquirt CAN output?

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: 500
Joined: Mon Jan 22, 2007 7:58 pm
Contact:

Re: HE351VE CAN Broadcasting and General VGT Control

Post by Suprazz »

No I never took the time to try it...
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: 101
Joined: Sun May 29, 2011 5:23 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by mikey antonakakis »

jsmcortina wrote:For CAN communications you need to connect the CANH and CANL wires. This is covered in the Hardware Manual.

James
Thanks James, I will be sure to read over the manual to catch up on CAN.
mikey antonakakis
Helpful MS/Extra'er
Posts: 101
Joined: Sun May 29, 2011 5:23 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by mikey antonakakis »

Okay, so I got a JimStim and built it this week in order to test things out, but I seem to be stuck.

I jumpered JS6 to SPR1 (CANH) and JS8 to SPR2(CANL). I've connected the SPR1 and SPR2 outputs to the correct pins on the turbo, and gave the turbo 12V.

In TunerStudio, I enabled CAN broadcasting and only turned on the HE351VE option, and set the broadcast interval to 50ms.
I turned boost control on as open loop, with a simple rpm-based curve that increases duty cycle as engine speed increases. I set the boost control pin to "off" and the output polarity to "normal." Solenoid frequency is at 39Hz and control interval is at 50ms.

My JimStim seems to be working well. If I manually close the turbo vanes before powering on the control box, it pulls them full open as soon as it is powered on. If I apply an external force to the vanes, I can hear and feel the motor resisting it. But the CAN signal does not seem to be working -- nothing at all happens as boost duty changes.

I feel like I'm missing something... if anyone has any ideas of what I might be doing wrong, they would be much appreciated :)
jsmcortina
Site Admin
Posts: 39614
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: HE351VE CAN Broadcasting and General VGT Control

Post by jsmcortina »

:msq:
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".
mikey antonakakis
Helpful MS/Extra'er
Posts: 101
Joined: Sun May 29, 2011 5:23 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by mikey antonakakis »

Here's an msq and datalog :)
Again, this is just running on the JimStim on the bench.
JS6 jumped to SPR1, JS8 to SPR2. 12V from a battery supplied to the turbo, and the CANH and CANL supplied from the JimStim.
I can upload a video as well if that's helpful. Thanks for the help!
mikey antonakakis
Helpful MS/Extra'er
Posts: 101
Joined: Sun May 29, 2011 5:23 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by mikey antonakakis »

I've been doing lots of reading and testing since my last post... and I'm still stuck. As far as I've been able to tell, getting this to work should be as simple as jumping JS6 and JS8 to SPR1 and SPR2, and connecting that to the controller, then turning on CAN Broadcasting and the HE351VE option in TunerStudio (along with boost control). That said, I haven't been able to find any posts about actually using the HE351VE broadcasting feature, so I'm kind of flying blind right now.

I think there are a few possible causes of the lack of response of the turbo to changing boost duty:
-"boost duty" is not being properly converted to the 29-bit CAN (mistake in my settings?)
-CAN signal is not being output to SPR1 and SPR2 (mistake in my settings?)
-something is wrong with the controller (although it does currently seek and keep an open position when powered up, whether connected to MS or not)
-broadcast interval is incorrect

If someone could check the msq I posted above and let me know if my settings look correct, that will help a ton in steering me in the right direction. If I should shut up and be patient, I can do that too :)
mikey antonakakis
Helpful MS/Extra'er
Posts: 101
Joined: Sun May 29, 2011 5:23 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by mikey antonakakis »

Well, after a few more hours of messing around, I have confirmed that the VGT actuator on my turbo works well. I used an Arduino and CAN-bus Shield with some simple code using a potentiometer to command position, and it works great. These vanes move really fast if you want them to!! They'll snap full open to full close in a fraction of a second!

So I know the issue is somewhere in the Megasquirt at least. With it currently working on the Arduino, worst case (i.e. I can't get MS to send the CAN signal) it will be very simple to use MSExtra boost control as a PWM input to the Arduino, which I can then send through the CAN-bus shield to the turbo. I might actually like that idea better, because I can set up a bunch of different algorithms that way. For example, set up a shaft speed control algorithm on the Arduino, but leave the PWM from MS hooked up, and switch between the two. Lots of possibilities now!
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 »

keep us updated.
been running he351ve on daily driver for 2 years now. using pneumatic cylinder and spring return.
working on a he551ve build.
33 psi boost on lpg
mikey antonakakis
Helpful MS/Extra'er
Posts: 101
Joined: Sun May 29, 2011 5:23 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by mikey antonakakis »

No updates yet. It will be a while, the turbo e30 is hibernating until winter is over and there's no more salt on the roads. I'll do some bench testing before then, but I'm in no rush. Next step is to convert MS boost duty PWM output to an Adruino input and test it on the bench with JimStim. Then I need to clean the garage so I can make some space to weld up the plumbing for the new turbo...
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 »

http://community.lilbb.com/index.phpThere a lot of good info here on stand alone arduino vgt control.
33 psi boost on lpg
jsmcortina
Site Admin
Posts: 39614
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: HE351VE CAN Broadcasting and General VGT Control

Post by jsmcortina »

Due to the baud rate incompatability, I'm going to remove this option from the MS2/3 firmware. Perhaps a future product will have multiple CAN buses at different speeds and it can be re-enabled.

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".
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 »

Sounds good
Thank you James
33 psi boost on lpg
mikey antonakakis
Helpful MS/Extra'er
Posts: 101
Joined: Sun May 29, 2011 5:23 pm

Re: HE351VE CAN Broadcasting and General VGT Control

Post by mikey antonakakis »

Hi James, hopefully a quick question -- let's say I wanted to use boost duty as an input to an Arduino/CANBUS shield setup... could I just connect a wire up to the boost duty output pin (i.e. JS11 or similar)? Or should I take the signal after the boost duty circuit, at the signal input to the boost control FET? Sorry, my brain is a little fuzzy on this, haven't messed with it in several months.

I guess I'd just be using an Arduino input to measure the duty cycle, and once I have that as a variable in the code, it should be trivial to scale it to a 10-bit value to use with the following code, just replacing "val" with the 10-bit value. Once I figure it out, I'd be happy to make a new thread with a write-up of how to implement it. It's not terribly complicated or expensive, less than $50 for a capable Arduino board and CANBUS shield. Also gives the benefit of easily adding extra features and flexibility, like switch or potentiometer inputs -- eg. using a switch to keep the vanes open fully if you're just going to cruise around and don't need boost. I'll probably mess around with it this coming week, anyway.

And fpvmustang, I've attached the zip file I mentioned in the PM.

-Mikey

Code: Select all

#include <SPI.h>

#include <can.h>
#define mode NORMAL // define CAN mode
#define bitrate 250 // define CAN speed (bitrate)
MCP CAN1(10); //Create CAN Channel
int potPin = 0; // select the input pin for the potentiometer
int val = 0; // variable to store the value coming from the sensor
//unsigned int counter1 = 0;
int outputValue = 0;

void setup(){

Serial.begin(115200); // Initialize Serial communications with computer to use serial monitor

//Set CAN mode and speed 

CAN1.begin(mode, bitrate);


if ((CAN1.readMode () == mode) && (CAN1.readRate() == bitrate)) // Check to see if we set the Mode and speed correctly. For debugging purposes only.
{
Serial.println("CAN Initialization complete");
Serial.print ("CAN speed set to: ");
Serial.print (bitrate);
Serial.print ("kbit/s");
}
else
{
Serial.println("CAN Initialization failed");
Serial.println("CAN speed failed");
}
}
// Create a fuction to load and send an extended frame message

void extendedMessage(){
val = analogRead(potPin); // read the value from the sensor
outputValue = map(val, 0, 1024, 35, 999); // the last two values are your limits -- you may need to adjust 
byte lobyte = lowByte(outputValue);
byte hibyte = highByte(outputValue);
unsigned long ID = 0x0CFFC600; // Random Extended Message ID
byte length = 8; // Data length
byte data[] = { lobyte, hibyte, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
CAN1.send (ID, extID, length, data); // Load message and send
// counter1++; 
}
// Finally arduino loop to execute above functions with a 500ms delay


void loop(){

extendedMessage();
delay(5);
Serial.print (outputValue);

}
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 »

We could just use a 10k pull up on the Arduino. boost duty from ms3 pulls it low.
With reading pwm duty I think we will get 10 step movements. Unless MS does 1/10 of duty like fueling. 50.5% = position 505vgt position, 50.8% duty = 508 vgt postion.
ms3 output boost duty 0-100% VGT 0-1000 position recognized 40-960 usable.
but if we use the Arduino ADC with a CAP we could get full resolution.
The CAP could slow vgt movements in cruise taking load off turbo.

SO is boost duty in 1% or 1/10% ?
33 psi boost on lpg
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 »

inverted output so higher boost duty = higher boost closed vgt
tested at 488hz and 9??hz Arduino using 4k 5v pull up with a low pass filter 10k with 10uf Cap.Image
Can Bus shield i'm using has 9-32v power supply built in.
http://www.ebay.com/itm/331454820579?_t ... EBIDX%3AIT


Code: Select all

#include <SPI.h>

#include <can.h>
#define mode NORMAL // define CAN mode
#define bitrate 250 // define CAN speed (bitrate)
MCP CAN1(10); //Create CAN Channel
int potPin = 0; // select the input pin for the potentiometer
int val = 0; // variable to store the value coming from the sensor
//unsigned int counter1 = 0;
int outputValue = 0;

void setup(){

Serial.begin(115200); // Initialize Serial communications with computer to use serial monitor

//Set CAN mode and speed 

CAN1.begin(mode, bitrate);


if ((CAN1.readMode () == mode) && (CAN1.readRate() == bitrate)) // Check to see if we set the Mode and speed correctly. For debugging purposes only.
{
Serial.println("CAN Initialization complete");
Serial.print ("CAN speed set to: ");
Serial.print (bitrate);
Serial.print ("kbit/s");
}
else
{
Serial.println("CAN Initialization failed");
Serial.println("CAN speed failed");
}
}
// Create a fuction to load and send an extended frame message

void extendedMessage(){
val = analogRead(potPin); // read the value from the sensor
outputValue = map(val, 0,1023, 880, 10); // the last two values are your limits -- you may need to adjust 1000 full closed 0 full open(960-40 typical usable)
byte lobyte = lowByte(outputValue);
byte hibyte = highByte(outputValue);
unsigned long ID = 0x0CFFC600; // Random Extended Message ID
byte length = 8; // Data length
byte data[] = { lobyte, hibyte, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
CAN1.send (ID, extID, length, data); // Load message and send
// counter1++;
 //byte data[2] = {0x02, 0x00}; //for recalibrating gearbox 
}
// Finally arduino loop to execute above functions with a 500ms delay


void loop(){

extendedMessage();
delay(5);
Serial.print (outputValue);

}
33 psi boost on lpg
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 »

Finally got to do a test drive yesterday. the 880 closed setting increased EBP 20 kpa at idle on a 2.3L. changed duty to 90% gave only a slight EBP increase.
I'm going to change to a 710 closed setting and 10 open. I was getting 2 psi boost at 1700rpm with 20kpa EBP over boost. With vgt around 700 position.
Around position 440 i was getting around 1 to 1 12psi boost 3500 rpm.
33 psi boost on lpg
Post Reply