The MegaSquirt Project has experienced explosive growth other the years, with hundreds of new MS installations occurring every week - a phenomenal success! MegaSquirt has been successfully used in all aspects of Internal Combustion engine applications including R&D, Industry, Race, and Research. The MS project has transformed itself from a simple R&D project into a full-featured mature engine control system. To reflect this the support structure has also changed to meet the needs of MegaSquirt Users.
Moving forward, the R&D forums for MegaSquirt project are in a read-only mode - no new forum posts are accepted.
However the forums will remain available for view, they still contain a wealth of information on how MegaSquirt works, how it is installed and used. Feel free to search the forums for information, facts, and overview.While the R&D forum traffic has slowed in recent years, this is not at all a reflection of Megasquirt users, which continue to grow year after year. What has changed is that the method of MegaSquirt support today has rapidly moved to Facebook, this is where the vast majority of interaction is happening now. For those not on Facebook the msextra forums is another place for product support. Finally, for product selection assistance, all of the MegaSquirt vendors are there to help you select a system, along with all of the required pieces to make it complete.
This forum is for discussing ignition setup, tuning, and troubleshooting for MicroSquirt (TM)
Forum rules
Read the manual to see if your question is answered there before posting. If you have questions about MS1/Extra or MS2/Extra or other non-B&G code configuration or tuning, please post them at http://www.msextra.com The full forum rules are here: Forum Rules, be sure to read them all regularly.
I cant switch the leads the have a common ground. They are hall effect sensors not VR. It works perfectly with the dyna 2000, I can not get both channels to behave the same. With trigger input set to rising edge and offset -320, channel one pules about 2-3 times at tdc and channel 2 is at -35 degrees. With input trigger set to falling edge it reverses. It does the same thing with calculated trigger rise or calculated. With 40 offset channel one fires at tdc and channel 2 fires at -35 and again it reverses when changing rising edge trigger to falling edge. I can not understand why the two channels should be connected in any way, they should work as two independent channels only looking at a common advance and dwell tables.
What I was saying. Is that if you are using the premade cable that came with your Microsquirt , the shield on the coax cable is the + input.
If you have this grounded this is wrong.
I'm using the opto in for the first channel so I think that is ok and vr2 for the second. If I remember correctly those two aren't using the shielded cable. I did notice the the vr2 input had different readings than the opto in when I measured them. Both have a 1 k pull up on them. Is there anything wrong with this setup?
What we have to focus on here is the spark output - the inputs are perfect. What can make the outputs occur at different times relative to TDC ? I assume the Offset Angle for the second output channel is 0, if not, this could do it, but I believe you have it at 0. This is the setting in the advanced ignition option. Even if it weren't, it still wouldn't explain the fact that the output wanders off. Nor does it explain why switching IC polarity causes the problem to go to the opposite output channel. The processor only sees delta times - it doesn't matter if they come fom falling or rising edges. But I will check that the processor configures both input capture pins identically. I also just realized that if one IC was detecting the rising edge and the other the falling edge, the deltaTs would be identical, but the phasing of the times would be offset by the tooth width. I know you can't change sensor polarity, but are the sensors identical and have color coded wires so you can be certain they are wired identically ?
What is your output setup - is it 2 identical coils, wired identically ?
Also, what is your IC trigger - is it a wheel with a single tooth on it ? If so what is the approximate width of the tooth in degress - just a really rough guess.
I will have to give this some thought and see if I can give you some special code that will give us more information. Because we are at low rpm, I can capture times of input and output from an independent lower resolution timer and dump these times to some spare variables which can be added to the datalog. We should be able to tell the timing, and any phase offsets from this data.
offset angle for channel is 0, yes
the trigger is a wheel about an inch across with a magnet in it.
When the magnet passes the sensor it opens (just like points)so it has a positive pulse with the pull ups.
Both sensors are wired identically as far as I can tell the wires are molded into the sensor.
Both coils are identical 3 ohm dyna's
If you can set it up so i can log the outputs, that would be great.
OK I put code in that takes present time - last spark time and puts it in a spare variable. The clock used is a .128 ms clock that is totally independent of the clock used for timing the spark (which has better than 1 usec resolution). I am attaching the code that does this. It generates a spare3 variable that is logged down one of the far right columns near deltaT. Use the attached MT ini file to be able to see this variable in the datalog. Make sure you close and reopen MT after you copy the attached ini into the normal megatune.ini file. The spare3 output needs to be multiplied by .128 to get ms.
I tried the code using your msq, but set to calculated, no 2nd channel offset angle, -320 deg trigger offset angle. All the deltaTs were 200,000 us (200 ms) and represents the time for one crank rev as seen by one sensor. But if you count both sensors, which are 180 deg apart, then a tach input arrives every 100 ms and there should be a firing every 100 ms. The spare3 column read consistently between 780 and 782, which when multiplied by .128 gives 100 ms consistently. If the sparks were not occurring at evenly spaced intervals, I would expect to see something like 700 and then 860, so they still add up to 200 ms, but have an offset.
What I realized was that for the dual tach input case, the deltaT is computed separately for each channel, so they will always be equal except for accel/ decel effects which don't apply to cranking without combustion. So all deltaT tells us is that your trigger wheel turns at a very constant rpm, but the sensors could still be out of phase - you could put them next to each other instead of 180 deg apart and get the same deltaTs. However, the code I gave you captures the times between sparks. Now that I rethink this, I'm sure you will get outputs in spare4 that are not the same. That would just be reflecting what you see on your timing light. I should have also calculated spare5 as the times between input captures, regardless of channel. This is what I expect to also be different and match the differences in outputs. So I would hold off until tonight when I will give you a new code version that does this. You won't need a new ini file because it already has a spare5 column, which right now will just show 0s.
If the data shows what I think it will, then it will show that the input signals are not 180 deg apart, but more like 150 - 210. Did you wire both sensors to VR1,2 inputs or to opto and VR2 inputs ? Bruce said it shouldn't matter, but he will double check.
It is wired to opt-in and vr2. If my sensors are not 180 apart why does it work with the dyna 2000 box? I wouldn't think Dyna would have set them up to not be 180 apart, but its possible i guess. Can you post pictures on here? I can take a pic of the sensors, they certainly look 180 apart.
You can post jpeg files, but you are in a better position than anyone to tell if they are 180 deg apart. What could cause an offset would be if the opto circuit inverted the signal and the VR didn't. You can only detect one edge, so one channel would be off by the tooth width - that's why I asked what was the approximate width of the tooth in degrees. Also, if the sensors were say 30 deg off from 180, this could be compensated for in the Dyna - just like it could be in microsquirt.
This is all speculation and doesn't explain why you can't see changes in timing when you change the chan2 offset angle. Let's get more data by running the attached program and datalogging spare4 and spare 5 with the previously attached MT ini. You don't have to do anything but load the attached code (forget about yesterday's version), reload your msq, make trigger offset = -320, chan2 offset = 0 and Calculated trigger. Then post the datalog.