2. INFORME ECONÒMIC
2.2. Indicadors de la Pime
2.2.5. Període mitjà de pagament de les Comunitats Autònomes
The sensing mechanism for the rotating spool is shown in Fig. 3.1. The rotary optical sensor consists of a laser diode light source module, a photodiode and a code wheel with black sectors printed on a piece of transparent media. The code wheel is attached to one end of the spool. A low power laser module and a photodiode are mounted next to each other on one end of the sleeve. The code wheel is designed to include a small number of sectors and an index sector. As the spool rotates, the laser beam reflects off of either a black or a white (metal) sector, causing a measurable alternating signal from the photodiode. In our case, the spool has a small diameter (2.5cm), and the distance between the laser beam and the encoder is about 2.54cm, which is much larger than a typical distance between a light emitter and its receiver (< 3mm). As a result, the laser spot on the encoder is quite large. Under such circumstances, a low resolution code wheel (8 sectors per revolution) is required to ensure that the laser spot (≈ 5mm in diameter) lies completely within in one code sector (≈ 8mm).
light spot
code wheel
Figure 3.2: Ideal measurement detection
We define the situation when the center of the laser light spot overlaps with the code wheel sector boundary as a “transition event”. The time when this “transition event” happens is defined as the occurrence time of the “transition event”. When the light spot crosses the code wheel edge (as shown in Fig. 3.2), the output of the light receiver will change. Ideally, the photodiode outputs a discrete binary signal, as shown in Fig. 3.3, so that when a “transition event” is detected, a measurement of the spool angular position is received. In reality, a real photodiode output does not produce a perfect square wave signal with sharp edges. Instead, the sensor output will be discretized by comparing
)
( j
x
discrete threshold crossing location
Figure 3.3: Ideal rotary encoder outputits value to a threshold value to generate the signal with sharp edges. Moreover, the acquisition system of the sensor measurement is run in a discrete time manner, so that the “transition event” cannot be detected until the next sampling time after the “transition event” occurs. Both the discretization of the analog photodiode output and the discrete time nature of the data acquisition introduce noise on the measurement of the “transition event” occurrence time.
First, we describe the “transition event” occurrence time noise caused by the pho- todiode signal discretization. The analog measurement from a realistic photodiode ex- hibits a pattern similar to the upper figure from Fig. 3.4. The raw signal is discretized by comparing its value to a threshold value. If the raw signal is greater than the thresh- old level, a high signal (1) is output; if the raw signal is lower than the threshold, a low signal (0) is output. The sharp edges of the discretized sensor measurement represents the occurrence of the event that the center of the light spot crosses the code wheel edge. The event that the center of the light spot crosses the code wheel edge is defined as a “transition event”. The instant when a “transition event” occurs is defined as the “occurrence time” of a “transition event”. A “transition event” will be captured by the sensor’s output, when the discretized sensor measurement alternates. The instant when the sensor output alternates is defined as the “switching time” of the “transition event”. This switching will be acquired when the sampling occurs, and the sampling time after the discretized sensor measurement alternates is defined as the “detection time” of the “transition event”.
The discretization of the analog optical sensor measurement relies on the threshold value. The “switching time” of a transition event will differ from the “occurrence time”
11.164 11.18 11.2 11.22 11.24 11.26 5 6 7 8 photodiode response [v] 11.16 11.18 11.2 11.22 11.24 11.26 0 0.2 0.4 0.6 0.8 1 time [sec]
discretized and normlized signal
Threshold
Figure 3.4: Raw (top) and discretized (bottom) signal from the photodiode.
of the transition event, if the threshold is not set correctly. Figure 3.5 shows how the setting of the threshold value affects the discretization of the photodiode output, and further affects the “switching time” of the “transition event”. If the threshold value is set to be lower than the true value the transition event detection time will be delayed from the transition event occurrence time, but if the threshold value is set too high, the detection time will be advanced compared with the occurrence time.
The other measurement noise of the “transition event” occurrence time comes from the discrete time nature of the data acquisition. Since the sensor output is received at a finite sampling frequency, all the sensor information is communicated with the controller or the data acquisition system at one sampling instant. Therefore a “transition event” will be detected at the next sampling time after its occurrence. A low sampling frequency can cause a large error on the timing between the the occurrence time of the “transition event” and its measurement.
In the next section, the uncertainties of timing on the measurement of the “tran- sition event” occurrence time will be modeled mathematically by converting the time
11.154 11.2 11.25 5
6 7
Photodiode Output [volt]
11.15 11.2 11.25 −0.5 0 0.5 1 1.5
Sensor output discretization
time [sec]
sensor output alternation time is the same as the transition
event occurrence time
sensor output alternation time is later than the transition
event occurrence time
sensor output alternation time is earlier than the transition
event occurrence time
Figure 3.5: Effect of threshold bias on transition event detection. Top: photodiode measurements in black line and three thresholds denoted by green, blue, and red lines respectively. The threshold in blue is at the correct value, the threshold in green thresh- old is greater than the correct value, and the threshold in red is lower than the correct value. Bottom: discretized sensor measurements correspond to the three thresholds
measurement noise into a spool angular position measurement noise.