AN2897 Freescale Semiconductor / Motorola, AN2897 Datasheet - Page 12

no-image

AN2897

Manufacturer Part Number
AN2897
Description
Using the eTPU Angle Clock
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
System Design
Typically, the detection of the tooth edge causes the Channel 0 logic to request service from the eTPU
engine. This service request is granted by a scheduler in a manner determined by the following:
Presumably, the service thread will determine the previous period and calculate a new TRR value. Then,
at some point in the thread, the TRR will be written. However, depending on latency, the new tick stream
may have started counting before the updated TRR was written. In that event, all ticks that have been timed
during the latency period will presumable be slow and, after the TRR is corrected, the current period may
run late as well.This effect is actually rather small in real automotive systems, except perhaps during the
very first firing while cranking.
12
1. If the eTPU is idle and no other channel is requesting service, the scheduler will grant the Channel
2. If more than one channel is requesting service, the scheduler will arbitrate the requests according
3. If another channel is being serviced, the eTPU will complete the thread being serviced, then revert
0 request immediately. The eTPU will require 6 system clocks to start executing the service thread.
to the priorities and recent history of the scheduler. See the Reference Manual for a detailed
treatment of the scheduler process.
to 2.
A 36-1 (35 ten-degree teeth with one missing tooth) tooth wheels is running at 720 RPM when the
engine is accelerated at a rate of 5000 RPM per second. If the Angle Clock was inserting 100 ticks
per tooth, and the latency for the tooth service was 10 microseconds, what is the tick distribution
in the first two gaps after acceleration starts? (system clock = 100 MHz)
Original TRR value:
720 RPM * 1/60 * 36 = 432 teeth per second => 2.315 msec/tooth => 23.15 µsec/tick
Speed change over the first tooth:
5000 RPM/sec * 0.002315 sec = 11.6 RPM
Second TRR value:
(720 + 11.6) RPM * 1/60 * 36 = 439 teeth per second => 2.278 msec/tooth => 22.78 µsec/tick
Second tick count:
2.278 msec/23.15 µsec = 98.4 ticks
The edge arrives when the count is 98, therefore count 99 and 100 (tooth count) occur at 0.08 and
0.16 µsec after the tooth arrives. The largest tick error would be tick 98 which would occur about
(100 - 98.4) 1.6 ticks (0.16 degrees) late.
Speed change over the second tooth:
5000 RPM/sec * 0.002278 sec = 11.4 RPM
Third TRR value:
(731.6 + 11.4) RPM * 1/60 * 36 = 446 teeth per second => 2.243 msec/tooth => 22.43 µsec/tick
Third tick count:
2.243 msec/22.78 µsec = 98.5 ticks
...which we must adjust for the high rate counts plus the error in the first tick position:
(0.16 µsec + (22.78µsec - 22.43µsec))/ 22.43 µsec/tick = 0.02 ticks
The edge arrives when the count is about 98.5, therefore count 99 and 100 (tooth count) occur at
0.08 and 0.16 µsec after the tooth arrives. The largest tick error would be tick 98 which would
occur about 1.5 tick positions (0.15 degrees) late.
Using the eTPU Angle Clock, Rev. 0
EXAMPLE
Freescale Semiconductor

Related parts for AN2897