Rev match downshifting

Testing and development of Megasquirt 3

Moderators: jsmcortina, muythaibxr

rabid
Experienced MS/Extra'er
Posts: 303
Joined: Mon May 09, 2005 7:44 am

Rev match downshifting

Post by rabid »

I had another feature idea cross my mind as I was practicing heel toe downshifting (and failing). What if we could program it to rev the engine when I am pushing on the brake and clutch at the same time. For a mechanical throttle it could use a solenoid or actuator. Or perhaps use the idle control circuit somehow. If vss is enabled the ecu could target an rpm for the down shift. A similar function to idle control could be used. Or maybe a solenoid that opens the throttle plus a rev limiting method to match the rpm. Or maybe I just need to practice at heel toe more!
jsmcortina
Site Admin
Posts: 39615
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Rev match downshifting

Post by jsmcortina »

This was discussed just a few weeks ago.

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".
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Re: Rev match downshifting

Post by muythaibxr »

rabid wrote:I had another feature idea cross my mind as I was practicing heel toe downshifting (and failing). What if we could program it to rev the engine when I am pushing on the brake and clutch at the same time. For a mechanical throttle it could use a solenoid or actuator. Or perhaps use the idle control circuit somehow. If vss is enabled the ecu could target an rpm for the down shift. A similar function to idle control could be used. Or maybe a solenoid that opens the throttle plus a rev limiting method to match the rpm. Or maybe I just need to practice at heel toe more!
This requires throttle by wire. I suggest practicing heel-toe more. It isn't that difficult on most cars. Practice just rev matching downshifts first, then once you have that, move to heel toe.
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
AbatelliCristian
Super MS/Extra'er
Posts: 855
Joined: Sun Oct 10, 2010 6:33 am

Re: Rev match downshifting

Post by AbatelliCristian »

I have applied this strategy in V8 engine with 2 DBW. I have sequential-gear and 1 actuator for up and down shift.
When I press down shift, DBW open the throttle for "x"% and "x"time. The actuator insert down gear. Work very well, and the driver change gear without press the clutch
rabid
Experienced MS/Extra'er
Posts: 303
Joined: Mon May 09, 2005 7:44 am

Re: Rev match downshifting

Post by rabid »

I am testing code I put in ms3_misc.c. It sets the rev limit to whatever the next gear down rpm is while the clutch is pressed.

This is in the do_launch function

Code: Select all

        if (pin_launch && ((*port_launch & pin_launch) == pin_match_launch)) 
		{
            if (!(outpc.status2 & STATUS2_LAUNCHIN)) // gone from no-press to being pressed
			{ 
                outpc.status2 |= STATUS2_LAUNCHIN;
/////////////////////////////////////////////////////////////////////////////////////////////////////////mod code below			
				if (outpc.rpm <= ram4.flats_arm)
				{
					if((outpc.gear >= 2) && (outpc.vss1 >= 5))
					{
						outpc.gear = outpc.gear - 1;  //down shift
					}
				}
				else
				{
					outpc.gear = outpc.gear + 1; // up shift
				}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
                if ((ram4.launch_opt & 0x80) && (outpc.rpm > ram4.flats_arm) && (((ram4.vss_opt0 & 0x03) == 0) /* VSS off */
                    || ((ram4.vss_opt0 & 0x03) && (outpc.vss1 > ram4.flats_minvss)))) /* or VSS on and condition satisfied */
                {
                    flagbyte21 |= FLAGBYTE21_FLATS_ARM;
                } 
				else 
				{
                    flagbyte21 &= ~FLAGBYTE21_FLATS_ARM;
                }
            }
        } 
		else 
		{
            outpc.status2 &= ~STATUS2_LAUNCHIN;
///////////////////////////////////////////////////////////////////////////////////////////////////////////mod code below	
			RevLimRpm1 = ram4.RevLimNormal2 - ram4.RevLimNormal2_hyst;  // reset rev limiter
			RevLimRpm2 = ram4.RevLimNormal2;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////					
        }
This is in the gearpos function

Code: Select all

	if (outpc.status2 & STATUS2_LAUNCHIN)
	{
		if (outpc.rpm <= ram4.flats_arm)
		{
			unsigned int RevLimDownshift = (unsigned int)((ram4.gear_ratio[outpc.gear - 1] * (unsigned long)outpc.vss1 * gear_scale) / 10000);
			if (RevLimDownshift < RevLimRpm2) // make sure down shift rev limit doesn't exceed normal limit
			{
				RevLimRpm2 = RevLimDownshift;
				RevLimRpm1 = RevLimDownshift - 500;
			}				
		}
		return; // prevents code from detecting gear during forced up or down shift in launch code.
	}
Also I removed code from do_revlim_overboost_maxafr to prevent conflict. So this stuff is pretty ruff, only works with my settings, and the gear detection doesn't always go to correct gear. Sometimes is down shifts 2 gears instead of one. I don't know why yet. I'm still working on the details plus you still have to press the throttle to make this work. Maybe if I end up liking the changes I will add something to "blip the throttle" and inputs to better detect when I mean to use this code.
rabid
Experienced MS/Extra'er
Posts: 303
Joined: Mon May 09, 2005 7:44 am

Re: Rev match downshifting

Post by rabid »

I haven't worked on this idea in a month. The biggest issue was with the occasional gear miscalculation. I figured it was the clutch switch bouncing and causing multiple gear subtractions. Now I figured out why. The actual gear calculations are called every 10ms. I moved everything to the gear function and created a counter to delay the gear downshift code to be sure the clutch switch was pressed solidly. So far it hasn't missed the intended gear position and works very well. Now I need a way to rev the engine. A throttle kicker, idle valve, air solenoid. For now my right foot works and this makes it much easier to rev match a down shift.

This is at the beginning of the gearpos function.

Code: Select all

	if (launchin_count == 2)
	{
		if (outpc.rpm <= ram4.flats_arm)
		{
			if((outpc.gear >= 1) && (outpc.vss1 >= 5))
			{
				outpc.gear = outpc.gear - 1;  //down shift
			}
		}
		else
		{
			outpc.gear = outpc.gear + 1; // up shift
		}
	}

	if (outpc.status2 & STATUS2_LAUNCHIN)
	{
		if (launchin_count < 3)
		{
			launchin_count = launchin_count + 1;
		}
		if ((!(flagbyte21 & FLAGBYTE21_FLATS_ARM)) && (launchin_count == 3))
		{
			if((outpc.gear >= 1) && (outpc.vss1 >= 5))
			{
				unsigned int RevLimDownshift = (unsigned int)(((ram4.gear_ratio[outpc.gear - 1] * (unsigned long)outpc.vss1 * gear_scale) / 10000) + 200); // last addition is to bump up rpm for smoother shift.
				if (RevLimDownshift < RevLimRpm2) // make sure down shift rev limit doesn't exceed normal limit
				{
					RevLimRpm1 = RevLimDownshift - ram4.RevLimNormal2_hyst;
					RevLimRpm2 = RevLimDownshift;
				}	
			}			
		}
		return; // prevents code from detecting gear during forced up or down shift
	}
	else
	{
		launchin_count = 0;
	}
rabid
Experienced MS/Extra'er
Posts: 303
Joined: Mon May 09, 2005 7:44 am

Re: Rev match downshifting

Post by rabid »

I think the code is getting good now. I've changed it to cancel rev limiting at about 3 seconds. Now the idle valve opens fully to rev the engine. Unfortunately it can only get the rpms up around 3500rpm. I even ported the valve which was a waste. Also I set the alternator low to take load off the engine. I need a solenoid that will open the throttle a bit, which means another output on the cpu. If anyone has an idea for a solenoid, I'd like to hear it.

Code: Select all

 	if ((launchin_count > 0) && (!(outpc.status2 & STATUS2_LAUNCHIN))) // cases where launchin_count never made it to 300
	{
		if (throttle_blip == 1)
		{
			IACmotor_pos = als_iacstep; // restore target that was saved previously in launch function
			throttle_blip = 0;
		}		
		launchin_count = 0;
	}
 
	if ((outpc.status2 & STATUS2_LAUNCHIN) && (launchin_count < 300)) // clutch in and ~3 seconds
	{
		launchin_count = launchin_count + 1;		
		if (launchin_count == 2)
		{
			if (outpc.rpm <= ram4.flats_arm)
			{
				if((outpc.gear >= 1) && (outpc.vss1 > 5))
				{
					outpc.gear = outpc.gear - 1;  //down shift
				}
			}
			else
			{
				outpc.gear = outpc.gear + 1; // up shift
			}
		}
		if ((!(flagbyte21 & FLAGBYTE21_FLATS_ARM)) && (launchin_count >= 2) && (outpc.gear >= 1) && (outpc.vss1 > 150) && (outpc.rpm > 1500) && ((((*port_n2oin & pin_n2oin) == pin_match_n2oin) && pin_n2oin) || (throttle_blip == 1))) // brake pedal is activating nitrous in
		{			
			unsigned int RevLimDownshift = (unsigned int)(((ram4.gear_ratio[outpc.gear - 1] * (unsigned long)outpc.vss1 * gear_scale) / 10000) + 200); // last addition is to bump up rpm for smoother shift.
			if ((RevLimDownshift < RevLimRpm2) && (RevLimRpm1 > 1500)) // make sure down shift rev limit doesn't exceed normal limit
			{
				RevLimRpm1 = RevLimDownshift - ram4.RevLimNormal2_hyst;
				RevLimRpm2 = RevLimDownshift;
				IACmotor_pos = 255;
				throttle_blip = 1;				
			}				
		}
		return; // prevents code from detecting gear during forced up or down shift in launch code.
	}
	else if (launchin_count == 300)
	{		
		IACmotor_pos = als_iacstep; // restore target that was saved previously in launch function
		throttle_blip = 0;
		launchin_count = 301;
		return;
	}
	else if (launchin_count == 301)
	{		
		return;
	}
thokes82
Helpful MS/Extra'er
Posts: 102
Joined: Mon Apr 27, 2009 5:02 am
Location: Munster, Germany
Contact:

Re: Rev match downshifting

Post by thokes82 »

I like this idea for replacing the throttle stop screw by a vacuum driven actuator.
https://grassrootsmotorsports.com/forum ... 068/page1/


I do not know how to build a universal system though. It will allways be a custom setup for your throttle body. Something cable-based could also be interesting. Aren't there these vacuum actuators for cruise-controll? Would they work?

btw: I like your code. Will try it.
Image
Race car building documentation: www.kessel.tk (nice pics but only german laguage so far...)
rabid
Experienced MS/Extra'er
Posts: 303
Joined: Mon May 09, 2005 7:44 am

Re: Rev match downshifting

Post by rabid »

Thanks.
Try it at your risk. Let me know how it goes. :lol:

I found a potential solenoid. It's an oem woodward 1502 made for fuel shutoff. I'll see if I can adapt it somehow.
thokes82
Helpful MS/Extra'er
Posts: 102
Joined: Mon Apr 27, 2009 5:02 am
Location: Munster, Germany
Contact:

Re: Rev match downshifting

Post by thokes82 »

Cool one. Powerless it is pulled in or out? can't figure it out.
Image
Race car building documentation: www.kessel.tk (nice pics but only german laguage so far...)
rabid
Experienced MS/Extra'er
Posts: 303
Joined: Mon May 09, 2005 7:44 am

Re: Rev match downshifting

Post by rabid »

It is out normally and in when powered.
Blades Rally Team
MS/Extra Newbie
Posts: 28
Joined: Tue Nov 29, 2011 8:36 am
Location: Grantham England
Contact:

Re: Rev match downshifting

Post by Blades Rally Team »

Built a little development unit based on an Arduino see it at https://youtu.be/yNAnTdoznBI
Still needs a little development but as you can see the small pneumatic kicker will suit for your system
rabid
Experienced MS/Extra'er
Posts: 303
Joined: Mon May 09, 2005 7:44 am

Re: Rev match downshifting

Post by rabid »

Very nice. I thought about using my vacuum pump to do the same thing. What is that little cylinder called so I can search for something like it?
Blades Rally Team
MS/Extra Newbie
Posts: 28
Joined: Tue Nov 29, 2011 8:36 am
Location: Grantham England
Contact:

Re: Rev match downshifting

Post by Blades Rally Team »

It's a 6mm Bore 15mm Stroke CJPB6-15 Model Pneumatic Components Air Cylinder from Ebay number 291505674928 only £4.08 from China
Works very well
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

Re: Rev match downshifting

Post by MWPau »

So one (or even two) of these Bosch 2 wire IACs wouldn't be large enough?
They are the largest idle solenoid ive seen, and they are very easy to get and control.
It would be far simpler than some kind of pneumatic or otherwise throttle kicker.

Image
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
rabid
Experienced MS/Extra'er
Posts: 303
Joined: Mon May 09, 2005 7:44 am

Re: Rev match downshifting

Post by rabid »

This looks like a good option. I wonder really how much air those flow. How big are the hose fittings on there?
After receiving the solenoid I was planning to use, I can see it will be too bulky to make it work in a practical manner.
grom_e30
Super MS/Extra'er
Posts: 4459
Joined: Thu Mar 08, 2012 12:44 pm
Location: UK

Re: Rev match downshifting

Post by grom_e30 »

my car uses a valve like that the barbed ends go in to a 19mm (3/4 inch) pipe
1990 bmw 320i daily driver with m20b25 ms3 sequential fuel, 380cc injectors, d585 coil near plug, home made cam sync, launch control, fan control, vss, homebrew egt logging what's next????
thokes82
Helpful MS/Extra'er
Posts: 102
Joined: Mon Apr 27, 2009 5:02 am
Location: Munster, Germany
Contact:

Re: Rev match downshifting

Post by thokes82 »

For ITBs this will definitely not work. The bypass channels are to small.
On top with a blipper you are not needing additional mapping and tuning. I think the use of these valves require additional fuel adjustment possibilities
Image
Race car building documentation: www.kessel.tk (nice pics but only german laguage so far...)
rabid
Experienced MS/Extra'er
Posts: 303
Joined: Mon May 09, 2005 7:44 am

Re: Rev match downshifting

Post by rabid »

I hooked up a bosch two wire valve. It should do the trick. By itself it will rev the engine to 4500 rpm. It will even run the car at 60 mph with nothing else. Cruise control anyone? Hopefully both valves together will be enough. I played with it using generic pwm output. It is connected to js11. I need to figure out how to code the output now.
rabid
Experienced MS/Extra'er
Posts: 303
Joined: Mon May 09, 2005 7:44 am

Re: Rev match downshifting

Post by rabid »

outpc.duty_pwm = duty;
Simple enough way to set the bosch idle valve to a duty cycle.

Now one thing I'm confused about is how outpc.vss1 works. I thought outpc.vss1 > 150 would mean greater than 15 mph. It seems to be acting like 30 mph though. Can anyone explain how the conversion from outpc.vss1 to mph works?
Post Reply