Post
by sweegie » Sun Feb 02, 2014 2:22 am
Aah, yep, that's what I was supposed to do.... I've not traced this in the code yet, but I'm pretty certain you're looking at dwnwsp_w there. I'm too tired to paraphrase so here it is in all it's Bosch glory....
DNWKW 3.40 Diagnosis alignment between camshaft and crankshaft
The section %DNWKW discribes the diagnosis of the alignment between the camshaft/s and the crankshaft. Therefore the adapted
position of the first phase edge (see %WANWKW) is compaired with its nominal position.
dnwkw-dnwkw-nw1
Determination of the deviation of the camshaft position from the setpoint position:
-----------------------------------------------------------------------------------
dwnwsp_w = WNWSPS*_0 - wnwsp*_w(0)
adjusted to advanced: dwnwsp* w > 0
retarded: dwnwsp* w < 0
DWNWSP_W = Deviation of the adap. angle from engine-spec. setpoint angle of the camshaft
WNWSPS_0 = setangle of the edge 0 of the camshaft in the reference position
WNWSP_W = Adaptation angle of the camshaft in retarded end position
WNWSP_W is set in the WANWKW function:
FB WANWKW 13.30 Detailed description of function
Angle detection of alignment between crankshaft and camshaft
------------------------------------------------------------
In the case CMS interrupt, the angle wnwkwas* w is measured relative to the zero point in the working cycle (R syn & zzyl=0):
wnwkwas* w = (tooth in working cycle + tooth improvement) * SY WNBM
Release of the adaptation:
--------------------------
The adaptation is only released if the first gap check was successful (B bm=1), if a engine speed window is not exceeded,
if the engine is idling and no longer in the start range and if the engine speed and phase signals are error-free.
On systems with camshaft adjustment the adaptation is only released if it is sure that adjustment is in the retarded position
(B nw s) and that the diagnosis for camshaft adjustment has not detected the advanced position (B nwsvf*).
Each adaptation of the CMS position to the software reference mark wnwsp* w(i) is performed in the CMS interrupt (R ph*) providing
that the condition B spsa* is fulfilled: The difference to the current adaptation value is given by the deviation wnwi* ad w.
With, e.g., a positive wnwi* ad w, the current value wnwkwas* w is greater than the adaptation value wnwsp* w(i). The adaptation
then tracks wnwsp* w(i).
The adaptation angle wnwsp* w(i) is tracked via a low pass with the time constant ZNWSP and is limited by the limit values WNWASMX
and WNWAFMX with reference to the setpoint value WNWSPS*(i). The adaptation value wnwsp* w(i) is stored in the permanent RAM.
In the event of powerfail, the RAM-cells wnwsp* w(i) are loaded with the fixed values WNWSPS*(i).
The floating average value wnwim* w of the angle wnwi* ad w is used to determine whether the adaptation condition can be applied.
The adaptation status is stored in the condition B phad*:
B phad* = 1: Adaptation of the phase edge is being performed and is valid
B phad* = 0: Adaptation of the phase edge is not valid
The adaptation for the second camshaft is performed in the same way as for the first camshaft. The adaptation is performed
separately for both sides, i.e. two adaptation angles wnwsp w(i), wnwsp2 w(i) exist as well as, two deviations wnwi ad w, wnwi2 ad w
from these adaptation angles, two floating average values of the adaptation value wnwim w, wnwim2 w, and two resulting
conditions B phad, B phad2. The values wnwkwas w, wnwkwas2 w und wnwspas w, wnwspas2 w are also both available in this case.
Recycling dinosaurs for fun