Page 2 of 2

Re: V Twin Ignition Woes

Posted: Tue May 27, 2008 6:06 pm
by grippo
I'm not sure your msq is right. But let me explain how the ECU works for your ignition mode (single crank wheel, missing tooth, 2 cylinder wasted spark, odd-fire, 2 coils, which are necessary for odd-fire). Then you can probably figure out what the settings should be. Skip teeth = 4 is correct, so you will be firing a coil and plug every 180 deg. Lets' forget about the offset angle for cyl 2 right now and assume it is even fire (for which you would need a single wasted spark coil if it really were odd-fire). The processor sets up to fire as soon as it gets a tach pulse. The tach pulse is determined as the first tooth after the missing tooth (since you have specified a delay tooth of 0 deg). When this happens it is going to set up for firing coil/cyl 1, but to do so it will look down to 360 deg (=2 x skip teeth = 8 teeth) and use that tach pulse as the timing reference. You have specified the trigger offset as -175 deg, meaning that Tach1 will occur 175 deg after TDC of the first cylinder. The timing diagram looks as follows:

---------TDC2------------------TDC1------------------TDC2------------------TDC1------------------TDC2------------------TDC1
-----------^----------------------^-----------------------^-----------------------^-----------------------^-----------------------^

--------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|
------Tach1------------------Tach2-----------------Tach1------------------Tach2-----------------Tach1------------------Tach2
--------|--------180 deg------|--------180 deg------|-----------------360 deg---------------------|--------180 deg------|
-----------------------------------------------------------------------------xxxxxx-----------------yyyyyy

Tach1 is 175 deg AFTER TDC1. It occurs at tooth 1, the first tooth after the missing tooth.
xxxxxx, yyyyyy = approx spark region for cyl1 and cyl2 if cyl 2 were NOT odd-fire. The xxxs end at TDC1 and the yyyys end at TDC2. Now by inserting an odd_angle we will move yyyyyy either left, if odd = +90 deg advanced, or right if odd = -90 deg retarded. What you are doing is pushing yyyyyy out beyond the last tach2, which you can't do. Cylinder 2 must be set up starting at a tach2 point and must dwell and spark before the next tach2, which is 360 deg away. Bottom line is that I believe Odd angle should be + or - 90 deg, not -270 deg.

Re: V Twin Ignition Woes [SOLVED!]

Posted: Thu May 29, 2008 4:46 am
by hwright
Ok it's finally working!!

Firstly a big thankyou to everyone who replied, you really helped.

So how did I do it?

First I borrowed a Fluke 2 channel scopemeter. 100% reccomend anyone having trouble with their ignition uses a scope.

2nd I checked the wiring of the VR circuit, sure enough pins 32 and 33 on the uS were backwards. Fixed that.
I connected the stock ECU and microsquirt in parralel, initally my RPM signal dropped out above about 1500RPM so I added resistors in line with the Vr+ signal untill I could get RPM to 13000. Ended up with 26KOhms.

Then I rigged up some more resistors and connected the ignition 1 output of the uS to these and 12V to simulate a coil (used about 200Ohms). Then running the bike off the stock ECU at idle it was a simple matter to adjust the ignition offset untill the rising edge of both signals matched up. (note my spark map was set at 0) The edge was initally a bit noisy in time so I switched the input capture to rising edge and the signal got alot more accurate.

Then I added dwell untill the falling edge of the signal matched up. Amazingly it was 5.5ms in the end! (I would never have gone this far normally!). After that I revved it up and adjusted the spark duration so the signals still matched as the revs rose. I also mapped a bit of the original ecu's spark timing.

From there I switched to output 2 and confirmed that that one matched up. As per Grippo's advice above i set the offset to +90 deg and this was correct. -270 would stuff up the dwell calculation.

And from there I switched back to the microsquirt and she started right up!

Now to start tuning on the weekend!

.msq with final settings attached.

Re: V Twin Ignition Woes [ok nearly solved!]

Posted: Fri May 30, 2008 8:10 pm
by hwright
Well perhaps I spoke too soon.

It was idling well but wouldn't rev over 3600RPM (popping and spluttering). I decided to remove the co-ax wire and capacitors driving the coils and go back to the stock wiring (this allowed me to drive my tacho which reads off one of the coil inputs). Anyway after that there was no effect on the RPM signal in uS but I could rev higher.
Note for people having tach problems, try the resistor first before re-wiring your car/bike!

However the timing seams to be wandering around. At idle it's fine, then at about 4000-7000RPM i get random pops and backfires and from here to 10000 it feels very retarded. It won't rev above 10000 RPM at all, all the torque just dropps away.

This is strange as I get no problems with my tach signal or dwell or trigger +-. Tried rising edge and falling edge, there is a difference but both have the same symptom of torque falling away and popps.

Anyway I will have to wait untill I can borrow the scope again next week to find out exactly what is going on.

attached datalog for now.

Re: V Twin Ignition Woes

Posted: Fri May 30, 2008 8:48 pm
by SQLGUY
At really high RPM's I see your advance eating into your dwell. The dwell reduces to as low as 2.5ms. It seems to start reducing dwell at 4800 or so. Below that, everything in the datalog looks OK.

If you really need 5ms of dwell on your coils, then I would suggest trying to adjust your pickup to just after TDC, as that's the only way you'll have enough time for advance and 5ms of dwell.

Otherwise, are you sure you're delivering enough fuel at higher RPMs? Have you tried raising the VE values around 5K and up?

Re: V Twin Ignition Woes [problem!]

Posted: Tue Jun 03, 2008 3:36 am
by hwright
Ok. So I attached the scope.
First I matched the ignition timing curve with the stock ECU through the rev range (its RPM based only). The point at which the stock ECU and uS let the coil go back to 12 V is the same. I checked this on both coils. Also there are no dropped signals and the timing looks accurate, with no variation.

For Cyl 1 (ignition 1) the dwell matches up at idle around 5.5-6ms. By 10000RPM though the uS is delivering about 2.5ms of dwell where the stock ECU is delivering 3.5ms.
For Cyl 2 (ignition 2) the dwell also matches up at idle, however by 8000RPM the dwell has reduced to nothing!

I have tried a combination of +ve and -ve offsets on both the inital advance (if I do this the ignition outputs go nuts) and the offset advance (if I do this it's much worse). Also skipping teeth before a tach pulse results in a more -ve inital advance which makes the problem worse.

Is this a bug in the code? I don't want to chop up my trigger wheel, and even if I did it might not fix output 2. Grippo can you test my MSQ to confirm?

P.S. Just to remind everyone this bike is running ignition only, no fuel control.

Re: V Twin Ignition Woes

Posted: Tue Jun 03, 2008 5:05 am
by grippo
At 10000 rpm the approx 180 deg span between Tach1 and TDC1 represents 3 ms, which allows for a 2.3 ms dwell at a 40 deg advance. So that jibes with what you are seeing. To increase dwell time what is needed is to push the distance between the two to something closer to say 300 deg. I think you can do this by setting delay teeth to 4, which will push Tach1 to the 5th tooth, a little past TDC1, so trigger offset will be say -40 deg. The xxxxx spark range will then be moved out to the last TDC1 in the above figure, and the setup for firing will occur shortly after the next to last TDC1. So you will have about 320 deg within which to dwell and spark. I think you can leave the odd angle at +90 deg.

Re: V Twin Ignition Woes

Posted: Tue Jun 03, 2008 2:58 pm
by hwright
Ok, but why am i seeing a difference in dwell between the two cylinders? Cyl 2 is 90deg after cyl1. Wouldn't that mean I have 90deg more time for dwell on that cylinder?

Also if I delay 4 teeth won't that cause a problem with the timing when the missing tooth comes around right when I want to fire the coil?
I will give it a try tonight.

Re: V Twin Ignition Woes

Posted: Tue Jun 03, 2008 3:51 pm
by grippo
Delay 4 will cause the tach to come in on tooth 5 (tooth 1 =1st tooth after missing one). Four teeth later will be tach2, which is tooth 1. So this should work - what won't work is if the tach occurred on the missing tooth, which would be the case with tooth delay = 3.

I believe odd = +90deg will move the yyyyy spark region leftward, closer to the start of tach2, making it worse.

Re: V Twin Ignition Woes

Posted: Wed Jun 04, 2008 4:16 am
by hwright
Ok, we are looking good!

I tried 4 delay teeth first but this required an offset of +10deg. It looked ok but to be safe I used 5 delay teeth and -35deg.

Dwell on both cylinders is correct (and the same within 0.5ms) all the way to 13000Rpm.

I took it for a test ride and it felt good, the same as the stock bike. No more pops or anything (they are runnning the same maps so this is a good thing!)

Thanks for your help.

Attached is the final msq and .vex of the stock bike ignition map. Should be a good starting point for other low capacity twins. Mine is DOHC 4 valve 250cc.