PDA

View Full Version : The MegaSquirt R6 Thread



markocosic
04-04-2007, 04:53 PM
For what it's worth I'll post useful titbits here:

Engine - 2005 Yamaha R6

Engine Management System - MegaSquirt Extra (www.msextra.com) based around a tweaked v3.0 board (details to follow) - MSnS

Electronic package - stock R6 injectors, stock R6 inductive crank angle sensor with modified trigger wheel, AB Electronics throttle position sensor, GM/Vauxhall/Opel/Saab intake air temperature sensor, GM/Vauxhall/Opel/Saab engine coolant temperature sensor, Yamaha R1 ignition coils.

Essentially the engine has been converted from CDI coil-on-plug to an inductive wasted-spark ignition (due to the cost of engine management systems capable of running CDI COP and the lower rev limits we anticipate running at). R1 coils chosen for cost and availability more than anything else.

No coil-on-plug means no need for cam synch. (hence simpler, less costly system that's easier to set up and maintain) MSnS has no problem detecting the stock crank angle sensor straight out the box (disclaimer - cranking speeds only thus far), but the pickup wheel needs modifying to a "4-1" wheel by filing off one tooth in order to provide a sync position for MSnS. It also requires moving relative to the crankshaft such that the teeth are detected at 60 degrees BTDC for the relevant cylinders - welding on a new indexing blob 38 degrees from the original and then removing the original works fine.

As far as the rest of the ignition goes, MSnS fires the R1 coilpakcs no bother. Current dwell is 5.5ms whilst cranking and 3.5ms otherwise, but this will be tweaked via the tried and tested mehtod of reducing dwell until it misses under load, increasing dwell until the coild become too hot to touch at high rpm/load, then setting the actual dwell in the middle of these two values. Sounds unscientific, is unscientific, but has been used by countless others to good effect in the past.

Throttle positon sensor - boring, works straight out the box and is auto-adjusting with the MSnS software.

GM coolant/intake air temperature sensors are the recommended ones for use with MSnS, and should require no calibration. Our experience says that they've got very wide tolerances though, and should be individually calibrated against a known temperature reference. More accurate at higher temperatures, less accurate at UK outdoor and indoor room temperatures.

Injectors - are high impedance as far as MSnS is concerned and work ok thus far. We are concerned about idle pulsewidths with such huge injectors (MSnS can only control these to the nearest 0.1ms) and so run them in pairs as you would a coil - "wasted injectors". Time will tell whether this is an issue or not. They can be switched to batch-fire as a four, or a hybrid sequential at lower revs/loads to get it to idle then batched at higher rpms/loads for responsiveness or delivery capability.

Oxygen sensor - there is currently a narrowband 4-wire heated Bosch sensor in the exhaust manifold, which will be used as an intital tuning aid for low-load/rpm/learning. Eventually this will be switched for a wideband and may or may not be installed on the final vehicle after mapping is complete.

Other titbits - Dell Latitude D410 running XP with a USB-Serial adapter works fine with MSnS, but you need to disable buffering on the serial port (head into device manager) in order to communicate with the MSnS reliably in realtime. Having flattened the battery cranking and with datalogging built into the MSnS software, we could see what MSnS can do in terms of battery voltage. Officially it should get 12V, but in reality if it's 7V or greater, MSnS couldn't care less which is good news. (certain ECUs are picky about battery voltage during cranking - ask Loughborough about their FS UK experiences with a DTA)

markocosic
04-04-2007, 04:53 PM
For what it's worth I'll post useful titbits here:

Engine - 2005 Yamaha R6

Engine Management System - MegaSquirt Extra (www.msextra.com) based around a tweaked v3.0 board (details to follow) - MSnS

Electronic package - stock R6 injectors, stock R6 inductive crank angle sensor with modified trigger wheel, AB Electronics throttle position sensor, GM/Vauxhall/Opel/Saab intake air temperature sensor, GM/Vauxhall/Opel/Saab engine coolant temperature sensor, Yamaha R1 ignition coils.

Essentially the engine has been converted from CDI coil-on-plug to an inductive wasted-spark ignition (due to the cost of engine management systems capable of running CDI COP and the lower rev limits we anticipate running at). R1 coils chosen for cost and availability more than anything else.

No coil-on-plug means no need for cam synch. (hence simpler, less costly system that's easier to set up and maintain) MSnS has no problem detecting the stock crank angle sensor straight out the box (disclaimer - cranking speeds only thus far), but the pickup wheel needs modifying to a "4-1" wheel by filing off one tooth in order to provide a sync position for MSnS. It also requires moving relative to the crankshaft such that the teeth are detected at 60 degrees BTDC for the relevant cylinders - welding on a new indexing blob 38 degrees from the original and then removing the original works fine.

As far as the rest of the ignition goes, MSnS fires the R1 coilpakcs no bother. Current dwell is 5.5ms whilst cranking and 3.5ms otherwise, but this will be tweaked via the tried and tested mehtod of reducing dwell until it misses under load, increasing dwell until the coild become too hot to touch at high rpm/load, then setting the actual dwell in the middle of these two values. Sounds unscientific, is unscientific, but has been used by countless others to good effect in the past.

Throttle positon sensor - boring, works straight out the box and is auto-adjusting with the MSnS software.

GM coolant/intake air temperature sensors are the recommended ones for use with MSnS, and should require no calibration. Our experience says that they've got very wide tolerances though, and should be individually calibrated against a known temperature reference. More accurate at higher temperatures, less accurate at UK outdoor and indoor room temperatures.

Injectors - are high impedance as far as MSnS is concerned and work ok thus far. We are concerned about idle pulsewidths with such huge injectors (MSnS can only control these to the nearest 0.1ms) and so run them in pairs as you would a coil - "wasted injectors". Time will tell whether this is an issue or not. They can be switched to batch-fire as a four, or a hybrid sequential at lower revs/loads to get it to idle then batched at higher rpms/loads for responsiveness or delivery capability.

Oxygen sensor - there is currently a narrowband 4-wire heated Bosch sensor in the exhaust manifold, which will be used as an intital tuning aid for low-load/rpm/learning. Eventually this will be switched for a wideband and may or may not be installed on the final vehicle after mapping is complete.

Other titbits - Dell Latitude D410 running XP with a USB-Serial adapter works fine with MSnS, but you need to disable buffering on the serial port (head into device manager) in order to communicate with the MSnS reliably in realtime. Having flattened the battery cranking and with datalogging built into the MSnS software, we could see what MSnS can do in terms of battery voltage. Officially it should get 12V, but in reality if it's 7V or greater, MSnS couldn't care less which is good news. (certain ECUs are picky about battery voltage during cranking - ask Loughborough about their FS UK experiences with a DTA)

murpia
04-05-2007, 03:33 AM
<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content">Originally posted by markocosic:
As far as the rest of the ignition goes, MSnS fires the R1 coilpakcs no bother. Current dwell is 5.5ms whilst cranking and 3.5ms otherwise, but this will be tweaked via the tried and tested mehtod of reducing dwell until it misses under load, increasing dwell until the coild become too hot to touch at high rpm/load, then setting the actual dwell in the middle of these two values. Sounds unscientific, is unscientific, but has been used by countless others to good effect in the past. </div></BLOCKQUOTE>
Dwell time is not hard to measure on the bench with a scope. Typically it will depend on battery voltage so either measure at your lowest expected battery voltage or if your ECU had a voltage compensation strategy then populate the tables accordingly.
Regards, Ian

markocosic
04-05-2007, 07:48 AM
Runs the other way around Ian - we can accurately set the dwell in software to whatever we please, but run the risk of overheating the coils with too much or a weak spark with too little.

Battery voltage compensation on the injectors, but none on the coils other than cranking and not cranking. Makes some sense, as spark output is digital by nature vs an analogue fuel output.

murpia
04-05-2007, 09:34 AM
<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content">Originally posted by murpia:
Dwell time is not hard to measure on the bench with a scope. Typically it will depend on battery voltage so either measure at your lowest expected battery voltage... </div></BLOCKQUOTE>
Sorry, obviously not clear enough... By dwell time I meant 'coil charging to saturation time'. You need to measure coil current, with a current probe or low-value series resistor. Set a 'long' dwell time to start with. You will see the current ramp up as the coil magnetic field builds up, then plateau as the field saturates the coil. Further coil charging from this point onward is just wasting current and generating heat. So set your dwell in the ECU software accordingly. Lower battery voltages will mean a correspondingly longer coil charge time (same principle as the injectors). Cranking will no doubt be the worst case scenario.
Personally, I think it's an oversight not to have battery-voltage dependent dwell timing at least as an option in an ECU.
Regards, Ian

markocosic
04-05-2007, 10:44 AM
<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content">Originally posted by murpia:
Sorry, obviously not clear enough... By dwell time I meant 'coil charging to saturation time'. You need to measure coil current, with a current probe or low-value series resistor. Set a 'long' dwell time to start with. You will see the current ramp up as the coil magnetic field builds up, then plateau as the field saturates the coil. Further coil charging from this point onward is just wasting current and generating heat. So set your dwell in the ECU software accordingly. </div></BLOCKQUOTE>

Gotcha!

Sorry - I had in mind measuring the ECU output-on-time rather than the coil's electrical properties.


<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content">Personally, I think it's an oversight not to have battery-voltage dependent dwell timing at least as an option in an ECU. </div></BLOCKQUOTE>

&lt;hunts through instruction manuals&gt; "Note: These (input) times are for 12V. Battery voltage correction is applied. At higher voltages the time is reduced and when low it is increased." &lt;/hunts through instruction manuals&gt;

A point to Ian - cheers mate. It doesn't mention how these change, though a C++ guru can probably find it even if it isn't written in another bit.


Daft question time: (spot the MechE...)

Can the same kind of approach be used to establish injector opening time? (Can you tell the diffrence electrically between a saturated field with a closed injector pin and a saturated field with an open injector pin? Maybe with an AC signal over the top of the DC?)

I guess the injector would still need to be fuel-filled and pressurised in order to simulate the situation accurately (the high pressure fuel squirting all over the place is the bit I'm not exactly over the moon about) so maybe this wouldn't help anyway.

murpia
04-05-2007, 11:21 AM
<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content">Originally posted by markocosic:
Can the same kind of approach be used to establish injector opening time? (Can you tell the diffrence electrically between a saturated field with a closed injector pin and a saturated field with an open injector pin? Maybe with an AC signal over the top of the DC?) </div></BLOCKQUOTE>
I don't think so. An ignition coil is a pure electromagnetic device, while an injector has a spring loaded mechanical element in control of the interesting part (the fuel flow). So I expect that what happens is that the injector solenoid coil only saturates after the injector has opened (with sufficient margin to ensure the mechanical part is hard open at peak magnetic force). No doubt there are many non-linearities to consider.
If you characterise the opening time experimentally, fuel pressure needs to be kept constant, and you need to be aware that changing fuel pressure will require a re-characterisation. This is because the fuel pressure acts against the spring holding the injector closed.
Regards, Ian

markocosic
04-05-2007, 03:47 PM
Quote from the other thread: (murpia)

<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content">Normally the pulsewidth generated by the ECU will consist of a 'response' portion (to open the injectors) and a 'delivery' portion (to deliver the required pulsewidth of fuel). The terminology varies from manufacturer to manufacturer, but typically the calculation is handled internally (and often depends on battery voltage also). Often the delivery during the opening time is considered to be half.
So, if you ask for 1ms and the injector response is 1ms also, the ECU might generate a 1.5ms pulse.
</div></BLOCKQUOTE>

Quotes from the MSnS literature:

<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content">
The tuning 101 part:

Injector Opening Time (ms)
The amount of time required for the injector to go from a fully closed state to a fully opened state when a 13.2 v signal is applied. Since fuel injectors are electro-mechanical devices with mass, they have latency between the time a signal is applied and the time they are in steady-state spraying mode.

Set Injector Opening Time to 1.0 ms and leave it there unless you are an expert and have information that indicates otherwise.

It is usually assumed that injector opening is linear with respect to the amount of fuel delivered, so it is easy to compute the amount of fuel delivered (rate * opening_time / 2). So, if you deviate too much from the correct value for opening time, this assumption is incorrect; for instance, if you set the opening time to 5.0 ms when it is really 1.2 ms, then too much fuel will be injected with respect to the computed value. The current MS controller code makes the simplifying assumption that zero fuel is injected during the opening (and closing) phases, so making this value larger will enrich the mix and will have a much greater effect at low pulse widths. MS also uses this value as an additive constant in pulse width calculation, thus making this the lower limit for pulse width.

Opening time is also dependent on the voltage applied to the injector coil, which is where the next value (Battery Voltage Correction) comes into play.

Battery Voltage Correction (ms/v)
The decay rate of the Injector Open Time with respect to battery voltage. When the system voltage deviates from the nominal voltage, the injector will take more or less time to open, this value corrects for this variation.

Set the Battery Voltage Correction rate to 0.1 ms/v and do not change it unless you are an expert and have specific data on your injector to the contrary.

-----

An extract from the how it works part:

Injector Opening Time (ms) is the amount of time required for the injector to go from a fully closed state to a fully opened state when a 13.2 volt signal is applied. Since fuel injectors are electro-mechanical devices with mass, they have latency between the time a signal is applied and the time they are in steady-state spraying mode. Typically, this value is very close to 1.0 milliseconds.

The MegaSquirt code assumes that NO fuel is injected during the opening (and closing) phases. However, it is very likely that a small amount actually is injected. Thus making this value larger will enrich the mix and will have a much greater effect at low pulse widths. MegaSquirt also uses this value as an additive constant in pulse width calculation, thus making this the lower limit for pulse width. </div></BLOCKQUOTE>


Another question on resolution now then:

Assuming 100% volumetric efficiency (full throttle), a single combustion event will want a 5ms injection pulse from a 250cc/minute injector. Given a 15,000rpm revlimit, that's 250 revs/second, so each cylinder will fire 125 times/second - an 8ms injection window. Add around that 1ms to open the injectors and the seemingly massive injectors (relative to 'ordinary car' engines) make some sense.

MSnS (the ordinary version) can control pulsewidths to 0.1ms - so only 50 steps between "nothing" and absolutely flat-out. Tweaks can get this to 0.035ms. The PE ECU appears to be able to control to 0.0625ms. (the values that you enter are to this accuracy - though the ECU then does some of it's own intpretation/interpolation and the step size it uses isn't obvious - Brian?)

50 doesn't seem like very many. What kind of resolution do your ECUs control to, and what resolution is sufficient (are you tuning to) for ~1500rpm idling and/or crisp and reasonable fuel efficient running at higher rpms/loads?

B Lewis @ PE Engine Management
04-16-2007, 06:22 PM
<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content">MSnS (the ordinary version) can control pulsewidths to 0.1ms - so only 50 steps between "nothing" and absolutely flat-out. Tweaks can get this to 0.035ms. The PE ECU appears to be able to control to 0.0625ms. (the values that you enter are to this accuracy - though the ECU then does some of it's own intpretation/interpolation and the step size it uses isn't obvious - Brian?) </div></BLOCKQUOTE>

Hi Marko,

Sorry for the late reply. I didn't see your question until just today.

The resolution of the open time has a step size of 2 microseconds once all of the compensations have been applied.

Please let me know if you have any other questions.

markocosic
04-19-2007, 12:47 PM
No worries Brian!

2 microseconds is pretty damn fine resolution there as versus the 100 microseconds/35 microseconds for the MSnS, which does have us slightly worried.

I'll keep the thread updated as/when we give the mapping a proper go.

markocosic
04-29-2007, 08:15 AM
Tuning initial attempts and observations...

Pictures from the afternoon:
http://www.cosic.org.uk/galleryv2/main.php?g2_itemId=14402

The setup engine and drivetrain are built onto a powered sled/trailer' so that then can be tuned/messed about with on any old rolling road in future and independently of the chassis. For this afternoon, the drivetrain/wheels were not fitted, so it is effectively just engine/intake/exhaust/cooling/electronics on a dolly. Large battery, permanently on charge and mains-powered cooling fan to avoid any battery voltage fluctuations and make our lives easier generally.

After much of this:
http://www.cosic.org.uk/galleryv2/main.php?g2_itemId=14422
due to the MegaSquirt not wanting to play ball at all and much probing of wiring, fiddling with comms settings and reinstallation of software, the cover was eventually taken off the ECU to find that it's CPU had fallen out doh! His initial table of settings are here:
http://www.cosic.org.uk/misc/MS%20Settings.xls
Most are drivel but the core hardware setup for sensing, coils, crank triggers and the likes are spot-on.
Setup sheets like this:
http://www.cosic.org.uk/misc/Engine%20Test%20Log%20Sheet.doc
Seemed like a good idea as some sort of change-management log.

Startup procedure:
Flat 10 deg BTDC ignition map
Flat 60% VE and nominally 14.7:1 fuel map

*Fuel pump prime: 2s (get shot of any air in the fuel lines)
*Injector priming pulse: 2ms (get shot of any air in the injectors)
*Number of revolutions to cut ignition before startup: 3 (to allow oil circulation and ensure that the ECU has measured the crank angle correctly)
*Flood clear: 2/3rds throttle (anything above 2/3rds throttle is flood-clear and will cut injectors)

ALL COMPENSATIONS set to zero.

Hit the button and she coughs encouragingly but doesn't go. Bump up the calibration factor for the injectors (easiest way to shift the entire fuel table up and down shape it later) and it comes to life, idling-ish at 2,500 on a 2ms pulsewith with some pretty obvious exhaust leaks.

Leaks fixed. Idling better, but still sounding like there are leaks. Its here we discover Yamaha's genius valve-stem seals...

The '05 R6 has, what we presumed to be, two crankcase breathers on its camcovers. These turn out to be reed valves that are setup to allow air IN but not OUT. Odd... Hunting about finds that these are usually connected to a solenoid valve controlled by the ECU, and are OPEN when the engine is cold and at idle but closed when the bike is warm and being driven. Why what sense does this make? More investigation, and it turns out that the valve stem seals on the R6 leak like a sieve the suction from a vacuum cleaner applied to the inlet/exhaust port with closed valves is enough to get airflow that you can feel through the breathers' on the camcover. It's the same on all eight ports and the engine looks/feels/appears in very good nick, so I doubt it's anything broken. The manuals for the bike say that these valves are an AIR INDUCTION SYSTEM that INJECTS AIR INTO THE EXHAUST PORTS to clean up emissions. Well, it doesn't it's just a crankcase breather valve that allows air IN only. Never seen anything quite like it.

Our thinking is that this is an ingenious way of combining fast-idle control and emissions control into one valve by using leaks (into the intake due to it's vacuum and into the exhaust due to the timing of pressure pulsations in the crankcase and the exhaust primaries) block the breathers' and the engine suddenly becomes MUCH easier to tune down to a low idle thanks to no intake/exhaust leaks. Uncover them and it fast-idles nicely. Try to tune down to a low idle with these breathers' uncovered is hellish, as the error air' from these breathers' is really significant compared with the air from your throttle.

So we had a guy stick his fingers over the holes and could tune for fairly sweet no-load running from 1500-4000rpm, with datalogs showing the engine firing up straight after that 3 revolution delay. Narrowband lambda was added to block the hole where the wideband is to go better than nothing but not spectacularly useful for reasons that'll be explained later. Noise the mechanical noise from the valvetrain (aren't engines made from cast irons and polymers great for damping noise compared to alloys!) and the thrumming plenum when it gets near its 4000rpm harmonic, drown out the exhaust at no load. (plenum moves far too much for our liking designed to strength limits rather than stiffness limits, and a little extra stiffness wouldn't go amiss) Throttle the Jenvey body has no compliance issues as described by Dan here:
http://fsae.com/eve/forums/a/tpc/f/125607348/m/99110198931
but boy are these engines snappy compared with car motors and they sure aren't shy about dialling in a lot of revs at no load with minimal throttle opening. Pulsewidths 0.1ms is insufficient resolution to map these engines nicely at low revs/load you can shape the fuel table as you please, but as far as outputs are concerned it ends up looking like a flight of stairs or the Himalayas for the engine at low revs/load, and the result is a definite set of 1.8ms', 1.9ms', 2.0ms' sweetspots at a certain rpm and ill-behaviour between those. The narrowband lambda should ordinarily make a good job of controlling idle to a stoich air-fuel ratio, but the available output steps are too big for it to do it's job and it'll just make the engine hunt between these sweetspots instead. Ignition-wise it'll still run with between zero and thirty degrees of ignition advance at idle, but around 25 gives the highest rpms for a given throttle opening and 10 (book spec) with a hump up to 20 as revs drop does help stability.

First cough to first "idle" about 15 minutes. First cough with sealed exhaust leaks to "idle" about 10 minutes. First rough idle to nice idle range with sealed breathers' about 20 minutes.

Ease of access and stable battery voltage was a definite bonus. More inertia (drivetrain and wheels on a rolling road drum) would have helped the steady-state mapping of the idle-region, and compensations would then be added with the engine running in neutral. Targeting rpm was very difficult at low revs/no load because of how little air these things need.

Future work has to sort these breathers' and an idle-bypass screw before idle can be tackled properly anybody doing this from scratch I'd definitely recommend the idle bypass. See new thread for the breather discussions the obvious solutions are either illegal, borderline, or undesirable it seems...

MSJ
05-04-2007, 12:22 PM
<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content">Originally posted by markocosic:
Essentially the engine has been converted from CDI coil-on-plug to an inductive wasted-spark ignition (due to the cost of engine management systems capable of running CDI COP and the lower rev limits we anticipate running at). R1 coils chosen for cost and availability more than anything else.
</div></BLOCKQUOTE>

I don't understand your statement there. The R1 doesn't have coilpacks like you say, it has COP just like the R6. I just checked the schematics on bikebandit. Unless I'm totally out to lunch, you must be using coilpacks from somewhere else?

RANeff
12-29-2009, 09:13 PM
Anyone have anything to add to this thread? We may be running an interesting MS2 setup this year on our R6.

jaca
12-30-2009, 10:41 PM
<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content">Originally posted by MSJ:
I don't understand your statement there. The R1 doesn't have coilpacks like you say, it has COP just like the R6. I just checked the schematics on bikebandit. Unless I'm totally out to lunch, you must be using coilpacks from somewhere else? </div></BLOCKQUOTE>

The R1 coils are still COP, but marko has them setup for wasted spark instead of full sequential ignition, so no cam sensor needed.

Addition - yes, MS2 is pretty awesome all around. Ran our F4i flawlessly last year and now we're playing around with launch control and flat shifting - pretty sweet stuff. Not an R6 but pretty much identical from an FI standpoint. Running a microsquirt this year which is even cooler.

jaca
12-30-2009, 10:48 PM
Also, regarding the discussion about injection window resolution, this matters a lot less than one would think on a port injected motor. In fact, all but the most recent MS uses batch injection anyway. I'm not comfortable going into details about sequential vs batch injection, but the differences are pretty small. Obviously running batch injection is going to negate any need for super fine resolution.

EDIT - woah, this thread was two years old??

RANeff
12-31-2009, 10:38 AM
Yea, I brought it back as its the only R6 thread with any info.


Were running an MS2 and im adding in sequential injection and individual coil control. I may have to use MS extra to work this correctly, but we will see.

We also have a choive between two crank trigger wheels, an 18-1 and a 24-2. Question for you MS guys, which will work better?
http://img707.imageshack.us/img707/8105/image008ex.jpg