Thursday, 18 August 2016

Back To Basics

I realise it is close to a year since I updated this but better late than never. Not much has happened in the way of real engine calibration since the last update but still some reasonable progress in terms of fine tuning settings. The bike got MOT’d right after the last blog entry and had a few outings afterwards but hasn’t really moved since Christmas.

I wanted to check a few things that were bothering me about the Microsquirt control and so ended up carrying out quite a lot of bench testing on the ignition side of things over several months.

I actually don’t remember where it all started but at some point during the last year I started to question the accuracy of ignition timing provided by the Microsquirt ECU. I carried out some tests using a crude trigger wheel simulator on the bench & then on a running engine which confirmed my suspicions; ignition timing appeared to drift as much as 5 degrees at 18,000rpm. On top of this I noticed two further uncertainties while testing.

  1. Battery voltage as read by the ECU did not track actual battery voltage. There appeared to be some hysteresis in the measurement as the ECU recorded a different offset depending on whether the battery voltage was rising or falling. This was obviously an issue as it would result in incorrect coil dwell times & injector dead times.
  2. During ignition coil testing using the ECU’s output test mode, coil dwell times measured did not match what was demanded by the ECU even with battery voltage compensation disabled.

When I first noticed the timing accuracy issue I figured I could simply get a new, higher resolution trigger wheel made to replace the standard 12-3 wheel. However I hadn’t reckoned with the fact that the Microsquirt doesn’t have the processing power to cope with a higher resolution wheel at the kind of engine speeds seen on the CBR250. The Megasquirt developers have stated that even with the low resolution wheel on the CBR250, 18,000rpm is pushing the boundaries of the Microsquirt hardware capability and that an MS3Pro ECU would do a far better job at controlling the engine at these speeds. Coming out of this, I will most likely be upgrading to an MS3Pro ECU sometime in the future but given the expense and the fact the wiring harness would need to be redesigned to work with the new ECU I tried to find a way to make the Microsquirt work acceptably until I was ready for the upgrade and so I continued with reasonably extensive bench testing in order to measure and understand how the ECU controlled the ignition side of things.


Ignition Timing Accuracy
Firstly I wanted to spend some more time bench testing the ignition control both to understand the issues better and to be able to present the issue properly to the Megasquirt developers which would help find out if the MS3Pro would actually fix the issues. That meant making sure that all other variables were as accurate as I could make them. The most important of these was the trigger wheel offset relative to TDC. I had determined this value early in the project using a timing light so it was potentially not as accurate as it could be.

To determine this properly with the oscilloscope, I needed to compare it directly with the output of the standard MC22 ECU at a known engine speed and spark advance. I wanted to have a way of accurately simulating the crank trigger signal as would be seen by the ECU in a running engine. There are lots of ways available to simulate hall effect trigger signals but I specifically wanted to simulate the VR type of signal that creates a zero crossing. After some research & trial & error I settled on using an Arduino board to create the signals using a modified version of the Ardustim code.

The Ardustim code normally generates a hall type signal by asking a single pin to go high at specific times. With some modification to the Ardustim code I ended up creating a VR type signal by switching two separate pins & merging them into a single channel. The voltage output from the merged channel would depend on the combined state of the two Arduino pins.

Both pins high = 5V; Both pins low = 0V; 1 pin high + 1 pin low = 2.5V.

The output is fed through a transformer to create the needed zero voltage crossing. The simulated VR signal could then be used to determine the 1st tooth angle offset to TDC from the standard MC22 ECU.

As I had a CBR250RR(R) ECU, the benchmark from the manual is spark demand at 20°BTDC at 1,500rpm. Measuring the time delay on the oscilloscope between the 1st tooth trigger & coil firing signal and converting to degrees at 1,500rpm gave me a 1st tooth angle of 70.5°BTDC. 0.5° closer than I had measured with the timing light.

1st Tooth Offset Determination. Note The Simulated VR Signal
With the foundation settings correct in the Microsquirt I then proceeded to map the ignition angle error across the engine speed range to build up some data and understand what the exact nature of the error was. It was only when I actually wrote the error values down that I discovered that the errors were consistent in terms of time throughout the engine speed range. This led me to wonder if this was something that could simply be corrected for in the calibration by adjusting the spark hardware latency offset setting. I had not used this previously as I had understood that it was to be used to correct for any delays which might exist within external hardware and since the errors I had been seeing were from within the Microsquirt itself, I ignored this feature.

I made some small adjustments to the latency offset and rechecked ignition timing across the speed range each time until I was happy that the measured ignition timing was consistent with what was being demanded.


Voltage Reading
It was actually quite straightforward to fix the battery voltage reading error within the calibration. I used a digital benchtop power supply to vary the voltage supply to the ECU & noted the voltage readings within the ECU. I quickly found that the different voltage readings depending on if the voltage was increasing or decreasing was being caused by the smoothing function which I had set quite high initially. Once the smoothing was removed, the ECU voltage readings tracked consistently all the time but were offset slightly from the supplied voltage.
I used the measured error to determine new values for voltage at max & min ADC to change the voltage reading calibration which brought the voltage readings in line with the supplied voltage.


Coil Dwell Time
While testing and characterising the ignition coils using the controller’s output test mode to drive the coils, I found that the measured coil dwell tended to be longer than what was being demanded from the ECU by a factor of c.1.14. This did became a little worry at the time but I have since noticed that the error appears only when controlling the coils in the output test mode. When the engine is running (or simulated) the measured dwell time matches what is being demanded by the controller and so this became a non-issue.


Ignition Coil Characterisation
A major unknown in the ignition system was the dwell time required for the ignition coils.

First, the standard MC22 RR(R) ECU was mapped in order to determine what dwell times it was requesting at different engine speeds and then compared against how the Microsquirt code handles dwell.
Looking at the dwell times that were being requested by the standard ECU and how they changed as engine speed increases gave the impression that the coils may be performance limited at high speed as the dwell time at 17,000rpm is significantly shorter than at 5,000rpm for example and if the dwell being provided at lower engine speeds is necessary for good coil performance then it would mean that the coil is not getting fully charged at higher engine speeds and ignition performance may be compromised.

This observation prompted an investigation into trying to fit some higher performing pencil coils from a more modern machine to try and get consistent ignition performance throughout the speed range. The biggest issue was and still is finding coils which will physically fit in the MC22 plug bores.

All TCI coils found are too high and protrude quite a lot above the cam cover and foul the radiator fan.

CDI coils such as installed in ’97-‘99 Suzuki GSXR600/750s & 2009 Yamaha YZF250 seem to be the smallest coils physically and could be made work but even these are c.10mm longer than ideal for the MC22. The issue with the CDI coils then is that while they can be made work with a TCI ignition system, the charging current is far higher and the dwell times are far shorter than a normal TCI coil and the ECU and coil drivers would need to be capable of controlling them very accurately.
The charging current can be dealt with using an appropriate ignition IGBT specced for the high current & fly-back voltage. I did purchase a number of appropriate transistors which were capable of driving the CDI coils successfully during bench testing.

However it was found during testing that the Microsquirt firmware did not have the dwell demand resolution needed to accurately control the GSXR CDI coils. The Megasquirt firmware can only control dwell to the nearest 0.1ms but the GSXR coil nominal dwell is c.0.3ms so accurate control of the dwell is impossible with the Microsquirt controller. Due to this control limitation, the coil upgrade idea has been parked for the foreseeable future.

Given no alternative ignition coil solution was on the horizon, the standard MC22 wasted spark coils were tested to characterise them and ensure they were being driven properly by the ECU. The coils are nothing special for the MC22 as one might expect for an engine that was being asked to rev higher than most other engines at the time. They are TEC MP08 coils which seem to have been the standard Honda wasted spark coil of choice during the 1990s.

A current clamp was connected to the oscilloscope to observe how the charging current increased with dwell time & determine the optimum dwell time for a range of battery voltages to provide consistent performance. Observing the way that current draw increased with time it was decided to limit the charging current to 2.75A. The standard ECU does not correct for battery voltage and dwells the coils for 6ms at idle and up to 4,000rpm. As can be seen in the current trace below, this level of dwell overcharges the coil and dwell times could be significantly reduced without too much of an effect on ignition performance. Reducing dwell times would also ensure the coils are performing consistently across as wide an engine speed range as possible. At 12V, the dwell time to 2.75A is 2.5ms and even at 10V there is no sense in dwelling the coils for more than 4ms although it does not reach 2.75A.

TEC MP08 Primary Current at 12V Supply, 6ms dwell
This investigation showed that as long as battery voltage is kept above 12V there would be no reduction in ignition performance across the full engine speed range. Another benefit is that by keeping the dwell as low as possible at lower engine speeds, this would reduce the load on the charging system compared to the standard settings. Also the old adage, “leave well enough alone” holds true as there is no point in chasing the COP coils option when there is nothing suitable on the market at the moment for reasonable money. For a bigger engine it would be worth it purely to free up some space and provide the option for sequential ignition at a later date.


While getting all this information took a lot of time and investment in new equipment, it is worth it to ensure that the basics of the system are working correctly otherwise it would make future calibration more difficult.

Tuesday, 10 November 2015

Re-Calibration

First off, the new fuel fittings have been installed and are a success. The install looks quite tidy now and I have adequate clearance between the frame and the banjo bolt. The 90degree fitting also directs the hose in the right way so that the quick release fitting is lined up with the pump spout. Installing and removing the fuel tank is now very straightforward.

Fuel Hose
As well as re-testing the injectors, I also took the opportunity to properly calibrate the Suzuki MAP sensor using a Druck calibrator I had available to use. This corrected any errors in the calibration at the start of the project which was done using a mechanics analogue vacuum gauge. The MAP sensor now tracks barometric pressure to +/-1mBar.


Due to the change in injector characterisation within the ECU software, I needed to revisit the calibration which had been carried out during road tests at the end of 2014. The estimated dead time previously had been too large which then meant that I ran into issues running the engine using the same fuel table & warmup settings as previously determined.

I had originally planned to go the route of timed semi-sequential injection as that has the potential to give more repeatable results and better fuelling control at idle and part throttle, low speed than untimed batch fire injection. This is how the ECU was programmed up until a few weeks ago and I had managed to get a relatively good idle and had a decent fuel table. However, as the previous calibration was based on incorrect injector dead-time, the fuel table values were skewed.

When I started the bike again a few weeks ago with corrected injector characteristics & a good MAP sensor calibration, engine idle was erratic and not very well controlled. Lambda readings were as high as 1.35 despite using the same fuel table as before and the idle bins needed a lot more fuel added in order to get the engine to idle at a sensible lambda. Even then readings were swinging constantly between 0.9-1.1. The issue was that the correct dead-time was quite a bit lower than the estimated value used previously and so that meant injector pulsewidths were now low enough to demand pulsewidths at the lower end of the non-linear flow region such that little to no fuel was actually being injected each time and leading to high lambda idle and lean misfire. This was compounded by the fact that the semi-sequential control required each injector to fire twice per cycle, halving the demanded pulsewidth for a given quantity of fuel.

Following this development I abandoned semi-sequential injection in favour of batch fire. While it is a more crude method of fuel delivery and does not usually yield as fine control as lower loads & speeds, the tradeoff in favour of longer, more predictable pulsewidths as idle and low load are worth it for my application

In the past two weeks I believe I have managed a much smoother, controlled idle than I had with the earlier 2014 calibration. So far I have not had any issues with repeatability on the batch fire sequencing and off-idle throttle response is far better than ever before.

I need to finish some other non-EFI conversion related work on the bike before I will be able to get the bike on the road and continue calibration work.

Thursday, 27 August 2015

Permanentisation!

The project came to a bit of a halt over the winter and spring due to the unexpected rebuild of another bike. Now though it is slowly coming back into line.

While I have not started the bike in months and progress would appear to be slow from looking at the semi-naked bike in the garage, some good and very important steps have been taken towards making sure the EFI system is fully integrated into the bike.

Firstly is wiring. During the early calibration and testing stages, I still had not fully finalised the wiring loom. While the EFI side of the loom is good and did not need to be touched, the auxiliary loom which forms part of the Koso dash installation had not been finalised. I pulled out the dash loom again and split it into two definitive sections which allows the dash to sit much better when the nose fairing is installed. One section feeds into the original loom via one of the original clock connector and the other which routes down the RHS of the bike taking the constant power source & fuel level signal to the dash. CLT & speed sensor wiring was also plugged into this side of the loom and I integrated the Eclipze headlight upgrade wiring into the auxiliary loom also.
That bit of tidying has fixed some items which I was not 100% happy with.


Revised Dash Harness Routing


The second and most important thing was to permanently turn the carburetors into throttle bodies. When I first fitted the throttle bodies I was unsure if removing the slides completely would cause issues with response & rideability at low throttle openings given that the throttle bores are so large in comparison to the inlet ports. In order to verify this, the slides were simply held in their fully open position using silicone sealant to test the rideability. During testing, no adverse characteristics were noted so the original plan to bond the slides in place permanently was carried out.

The slides were each filled with reinforced epoxy resin and bonded in the fully closed position with the same epoxy. The main slide area was then cut out using a dremel tool and cut back to meet the throttle bore wall. A brake cylinder hone was then used to grind any imperfections down and ensure bore roundness was maintained. After initial honing, epoxy resin was reapplied on any low spots and the honing procedure repeated. Once a good finish was achieved with the hone, the bores were finished by working up to 800grit emery paper. Right now, the gas path is smooth all the way through the throttle body with none of the imperfections of the carburetor left to disturb the air.

Epoxy Infill After Roughing

Finished Throttle Bore


I was not 100% happy with the injector testing which I had carried out before. Only one injector had been tested, the flow rate was a little approximate and the dead time calculations had been inconclusive so that my current calibration still contained the default figures. Getting the injector dead times right is crucial to a good idle, especially as the injectors are still a little on the large side for the mc22 so I opted to retest all four injectors using better equipment.

Short lengths of flexible tubing were slipped on over the end of the injectors to direct the flow and also to minimise vapour spray. The injector being tested was fired into a plastic container which was placed on a scales. Weighing the fuel injected was far more accurate than measuring it from a graduated cylinder as larger quantities of fuel could be used for the test and thereby minimise the effects of any errors in readings.

A variable bench power supply was used to power the ECU & injectors which allowed dead time tests to be conducted at 3 different voltage points and measure dead time variation with voltage. The fuel pump was still driven by the battery as the power supply did not have the current rating to support the fuel pump power demand.
Each injector was tested at 100% duty cycle for several periods of 1-2mins to get an average flow rate. Dead time tests were conducted using 10 different pulsewidths at 3 different voltage settings, with each data point test timed to last 2mins. This resulted in long test times although confidence in the results is very high.

Measuring Injector Discharge

Test Bench

Test Results


The fuel line fittings are also being upgraded. The initial testing was carried out with a standard steel banjo fitting feeding into the end of the fuel rail. A fibre reinforced fuel line had to be used due to space restrictions not allowing an aeroquip hose to bend around to meet the fuel pump. Space was also so limited that the banjo bolt fouled on the frame with the throttle bodies fitted. It was good enough for early testing but certainly not good enough to stay that way.

One solution was to cut 2-3mm from the end of the fuel rail and to shorten it. However, an alternative banjo fitting had to be found anyway to route the fuel pipe to the pump so modification of the fuel rail was held off until suitable fittings could be found.

Luckily enough, the good people at ATEC Autotechnic make a selection of quality motorsport grade fittings and will supply CAD models of everything on request. That allowed the packaging to be determined before buying and it was found that by using these quality fittings, the banjo stack height could be reduced by over 3mm meaning that no fuel rail modification was needed.

New Fuel Fittings

Old vs. New
 

Tuesday, 14 October 2014

On the Road

The bike is now fully put back together again at last! i.e. all fairings, lights, mirrors, etc. This means I am no longer restricted to testing during daylight hours. A nice addition to have coming into dark winter evenings. This is the first time it has resembled a finished bike since the project started.

Over the last few weeks I have managed to take it out for a few long (2 hours plus) spins while logging and letting the tuning software refine the VE table. I have to say, I am very impressed so far with the injection system and how well it can cope with the wide rev range. Sure there are rough edges and areas which need further development but really I am delighted with the performance of the system. Above 8,000rpm the ride is very smooth and it honestly feels like it was made to be injected. 3,000 to 8,000 was very rough to begin with but over the last few rides it has smoothed out significantly. That area still needs more work but it is rideable. I suspect a lot of the issues at low revs may be caused by the fact I have acceleration enrichment settings disabled and a seemingly small change in throttle in that range results in a much larger change in relative airflow than the same change higher up the rev range.

I also fixed the issue with the Koso dropping revs at high engine speeds. It was simply a matter of changing a setting in the ECU to output the tach signal at half engine speed and then change the settings in the Koso to convert the half speed signal back to real engine speed. It seems the Koso has issues dealing with 2 ignition events per cycle at high engine speeds. Having a reliable speed readout also gave me the confidence to bring the engine all the way up through the revs. It has left me with no doubt whatsoever that the microsquirt can handle engine control at CBR250RR speeds.

There is a lot left regarding tuning the fuel table and then the ignition timing table but it now feels more like a bike and less like a project so that is a big positive.

The next big job on the bike is a new paint scheme. The new front fender and fuel tank don't match the rest of the bodywork.




Monday, 22 September 2014

Back at it again

So after a few months of not being able to work on the bike at all I am back at it again.

I haven't done any more physical work on the bike since, just tuning and refining the control side of the injection.

Below is a quick video of one of some of the first rides running with injection.



I was relatively sure I had populated the fuel table to be safely rich to begin with but I did a slow run up through the revs at first, attempting to hold relatively steady throttle and revs at various points in order to build up a log of the fueling. After that, I stopped and checked the log for any lean areas or overly rich areas. and adjusted the fueling in that part of the table to compensate. There were a few areas that needed attention. The rev range log and adjust was repeated a good few times that aren't shown in the video until I was absolutely sure I wasn't getting any lean areas.

I then attempted a few runs that contained a mix of coasting, gradual and hard acceleration to see how the engine reacted under normal riding conditions. It doesn't like very quick throttle openings but that is to be expected as I have acceleration enrichment disabled for the initial tuning process. Acceleration enrichment adds additional fuel during acceleration depending on the rate of throttle opening. The lack of this is most evident while trying to blip the downshifts.

Circa 6-7,000rpm at small throttle openings sounds quite rough (0:30-0:45 in the video). It has improved since that clip in the video but hasn't disappeared so that will need further work.

Also the Koso dash does not seem to like the high revs and drops signal anywhere between 10-14,000rpm as you can see in the video. It looks like it misinterprets and loses sync with the signal coming from the ECU and then catches it again. The point which the loss happens seems to vary as well as the time before it picks up again. I have had no chance to investigate this yet but first on the cards is to fit an inline resistor as this cleared up my VR signal issues going to the ECU last year. I have also discovered a setting in Tunerstudio that allows TACHOUT to output half speed signals. There is a chance the Koso will like these slower signals better and it can then do its own internal multiplying to get back to the correct RPM reading.

Over the last few days I have been logging full cold starts (engine stopped for more than 12 hours) and summarising various initial conditions such as cranking PW, idle VE, coolant temp and time to engine start. I am defining engine start as the point at which engine speed rises above 1,000 RPM. The summary results will hopefully build up a good database on which to base changes to the cranking PW curve to get the quickest possible starts. So far I have not had any real cold starts. The last 3 starts ranged from 15degC up to 22degC. Each achieved engine start within 0.95-1.52 seconds. Starts were achieved with zero throttle and no choke.

I have noticed also that my logs are recording INJ2 timing of 0deg constant during engine running although the semi sequential injection should make it 180deg offset from INJ1 timing. The INJ1 timing shows correctly as per table so it may either be a glitch in the software or elsewhere to say that INJ2 appears not to be timed. If this is the case it may explain the slightly rougher than expected running.

More to come as refinement progresses.

Friday, 20 June 2014

Up and Running

Bit of a delay between posts I'm afraid due to not getting to the bike to do further work.

The PLX SM-AFR controller and sensor arrived and got installed as soon as I got at the bike. It's a nice bit of kit and install was very simple! The way its set up is that you only end up installing the wires into the plug that you will use so in my case it was just the wideband analogue output and the 12V & GND wires go through a separate plug. 5 minute job to fit these three into the same connector as I had on the wiring loom and plug it in.

Compared to the LC-1 too there is no free air or heater calibration needed. Once the engine was started, the AFRs were reading nicely and consistent with what the LC-1 used to tell me before giving up. All good for a spin!

I spent about 2 hours riding, logging, adjusting and then repeating the process. Most of the testing was carried out in 1st & 2nd gear initially on a sloped road in order to get the highest variance of throttle position and RPM. To begin with the VE table was much too rich (better than being the other way around). Over the course of a few runs, some tweaking brought the AFRs across the range up to between 12.5:1 and 14.5:1. More refinement will be required to get the AFRs more consistent across the table. I am going to use TunerStudio's VE Analyse software to get the table to within 90-95% of where I want it to be and I will leave the final refinement to be done on the dyno at the same time as creating a 3D ignition map.

Unfortunately testing was cut short when I went to pump the rear tyre and noticed a damaged valve stem. Too dangerous to keep going until it could be fixed. I didn't get a video either because of that. After the tweaking though, the engine seemed nice and crisp, response was good and it pulled nicely through the revs. As mentioned, more refinement left but it's definitely better than expected at this early stage in the tuning process. 

Thursday, 8 May 2014

Faulty Lambda Sensor/Controller

After my last post I have got to further tuning the idle on the engine.

The last video was using 2 injection events per engine cycle in an alternating pattern. Basically, cylinders are grouped in pairs and controllable independently. Cylinders #1 & #4 are grouped as INJ1 and cylinders #2 & #3 are grouped as INJ2. 2 squirts alternating means all the required fuel for an engine cycle is injected in one go with the 2 banks alternating by 360 degrees and injector firing is untimed.

I then tried 4 squirts alternating which splits the required fuel into 2 injection events per cycle per cylinder with the two banks alternating by 180 degrees and firing is still untimed. My engine responded much better to 4 squirts alternating and was able to idle much smoother and also the off-idle response seemed sharper so I had found my base injector setting.

Once I had established that, I moved to trying timed, semi-sequential injection. At cranking I have timed the injection event to happen while the intake valve is open so that the fuel is being sprayed directly into the cylinder. At idle, the injection event is timed to end just as the intake valve opens and then this is advanced a little as the revs rise up until c.8,000RPM. This is going by recommendations in the megasquirt documentation and may be subject to adjustment as things progress.

The disappointing thing about it is that my Innovate LC-1 lambda sensor is showing faulty and so I haven't had the chance to test ride the bike yet. The sensor will read ok, if a little touchy, for about the first ten minutes of running and then it will display a full lean condition even though the idle is set to slightly rich. I have calibrated the heater and also carried out free air calibration on the sensor several times but with no results.

About 2 years ago before I started this project, I used the same sensor & controller in the same position in the exhaust to successfully monitor and tune my AFRs with the stock carb setup so I can only conclude that either the sensor or controller is faulty. After researching a little, it appears that many people have had the same problem with the LC-1 and in most cases changing the controller seems to have solved the issues.
 
In light of this, and rather than spend time troubleshooting either one or the other, I have bought a new PLX SM-AFR controller and sensor and so hopefully that will solve my sensor issues.

Now I just need to get back in the same country as the bike so I can continue testing with the new sensor.