DSM CAS Lost Sync Analysis
TLDR - try changing the Ignition Capture to Falling and use a timing light to slightly adjust Tooth #1 Angle.
The underlying problem is that the more recent MSextra instructions for using the Opto-Isolator for the Cam input use a different circuit than the older instructions. The Official DSM CAS Guide was based on the older circuit.
The newer circuit connects the CAS inner wheel Cam sensor to the OptoIn pad and jumpers a couple diodes. The older circuit connects the CAS inner wheel Cam sensor to the XG1 pad. The newer circuit inverts the signal between the CAS and the CPU, the older circuit is non-inverting. As such, the MegaSquirt "2nd Trigger" edge needs to set to Rising when using the new circuit, and set to Falling when using the older circuit.
Your .msq has the "2nd Trigger" set to Falling. This causes the opening of the CAM slot to be used as the reference position instead of the closing edge of the CAM slot. This in turn causes the timing to be off by ~75degrees (the length of the CAM slot). Rotating the Aux shaft can help correct for this, but simply changing the 2nd Trigger edge should have resulted in the CAM slot ~half covered by the sensor when at TDC with a ~10degree offset.
The other problem with using the wrong Cam edge is that the rising Crank pulse edge occurs at almost the identical position. Your log initially shows the Cam falling edge occurring just barely after a Crank rising edge. These edges get closer later in the log. Eventually, the edges swap and the Cam edge occurs just before the Crank edge. This results in a short slot count -- 23 teeth counted between Cam events instead of the correct 24. When this is detected, a LostSync error is declared.
I've run out of time for tonight but I'll edit this post later to add some annotated screenshots from your composite log that show how the Cam/Crank edges shift and result in the LostSync.
Update: here are some screen shots from MegaLogViewer showing the composite log.
The log shows Cam events as Green spikes and Crank events as Blue spikes. The Green Cam spikes are going downwards because MS is configured for 2ndTriggerActiveOn = FallingEdge; the Blue Crank spikes are going upwards because MS is configured for IgnitionInputCapture = RisingEdge.
You can see a more accurate Cam waveform representation if you have the paid version of MLV and turn on Options-RenderIncludingNonInterruptData. [If you enable NoiseFiltering but leave the Crank and Cam options off, the composite log will also include both Crank edges -- I'm not sure if this is a feature for all MS versions or just MSextra 3.3.] You can get a rough idea what the Cam waveform looks like from the 2nd column of numbers, the "SecLevel Flag".
The 3rd column of numbers is the TriggerFlag or selected Cam edge when setup for a DSM CAS. The circled "1.0" value is the falling Cam edge at the white cursor in the waves. The 5th column of numbers is the elapsed time, in milliseconds, since the previous Crank or Cam event.
In this picture, from near the beginning of the log, the time per crank tooth is ~2.9ms or ~1700rpm. The cursor is on the Crank event just before the Cam event. In this case, the Cam event is only 0.01914ms after the Crank event. This is way too close for reliable operation.
Here's a picture from later in the log showing several occurrences of LostSync.
In this case, the cursor is on the Cam event just before the second LostSync region. If you click on each of the Cam events leading up to the cursor, you can find the delay between the previous Crank event and the Cam event (or just find the events with a 1.0 in the Trigger column). This is the equivalent of the 0.02ms number from the first (good) picture.
The delays, in milliseconds, are all
very very small:
6.6E-4
6.6E-4
0.0
6.6E-4
0.0
The failing Cam event at the cursor has a delay of 1.56228ms, instead of near 0. In this case, the Cam event shifted and occurred just before the Crank event (which occurred 6.6E-4ms later). This results in only 23 Crank teeth between Cam events, and causes the LostSync. If you notice, the top of the screen is the trigger event for the previous Cam (1.0 in Trigger column), and there are only 23 Crank entries before the failing Cam.
I know this is hard to follow, especially from a dense description, but can folks understand what's happening?
The selected Cam/Crank edges are almost on top of each other and, if they swap order, a LostSync occurs. I don't know why the events would swap order but a 6.6E-4 millisecond delta is
really small, probably less than 0.2 thousandths of an inch in distance on the CAS wheel (or ~5 microns for you metric types). Maybe temperature, vibration, and rpm are enough to give this mechanical shift.
The fix for this problem is to use the opposite edge of the Crank signal so that it will be far away from the selected Cam edge. The Crank pulses are a little less than 50% duty cycle so changing edges results in a ~0.4 tooth delay. With 24 teeth per 2 engine revs, this gives ~12degrees of timing delay. It's late so I won't say if the delay is + or - degrees of BTDC timing.
Let me know if there are questions, or egregious typos, and I'll address them tomorrow.
For 142 guy's questions, I think the MSextra guides must have changed again. The old MegaManual used the old Opto circuit. The MSextra 3.2 & 3.3 guides used only the new Opto circuit, but I do see that the latest 3.4 guide now includes both. Ahhh the joys of MegaSquirt and its ever changing recommendations.
-Bob