CARÁCTER SOCIAL DE LA EDUCACIÓN
4. EL PAPEL DEL ESTADO EN MATERIA EDUCACIONAL
Detecting the engine status is essential for autonomous control of the quad bike, as the system needs to control the speed of the bike as well as adjusting the selected gear depending on speed and engine load. Measuring the RPM of the engine is one way of detecting if the engine is operating, where a human operator could tell with their ears but a robot (without ears) needs other method of detection.
There are several methods to implement RPM detection including having a mechanical pickup mechanism on the camshaft in the engine, or off the gearbox using a hall effect or other such sensors. A relatively simple method used in automotive testing is having a pickup wire around one of the spark plug wires on the engine. This is done by wrapping a wire around the spark plug wire leaving one end unconnected from a circuit(capacitive coupling), or by connecting both sides of the wire to a circuit (inductive coupling).
A capacitive coupling method was selected as it only required one side anchored of the wire to be connected, and thus would be easy to wrap around the spark plug wire. Each time a spark plug fires a large voltage is sent from the induction coil to the spark plug. To protect and provide reliable spark detection to the microcontroller, the large voltages that can be induced in the pickup wire the signal must be converted to a logic level signal. This is done using a resistor and transistor to provide a 5V signal for detection with the resistor connecting the pickup wire to the base of the transistor so that the current driving the base pin on the transistor is limited. This results in a signal that oscillates at high frequency coupled with a low frequency on-off signal as seen in Figure 6-1.
Figure 6-1 Raw 5-volt inductance signal
To smooth this signal in Figure 6-1, a capacitor was placed in parallel to the resistor on the emitter side of the transistor to smooth the high frequency signals and provide the stable signal shown in Figure 6-2.
Figure 6-2 Capacitor Smoothed inductance signal, plus noise width at 3-volts
Connecting to an interrupt pin on the Arduino microcontroller allowed the number of pulses to be counted every second. After testing the integrity of the signal at higher RPM, it was discovered that the initial pulse of 2.0ms shown in Figure 6-2 above, is actually noise or a misfire signal that only occurs when the engine runs at speeds close to idle. This was confirmed after the noise was absorbed into the desired signal once the engine exceeded a fixed RPM, which was higher than the idle speed of the motor.
This is noise absorption is shown in Figure 6-3 and Figure 6-4, with the oscilloscope screen shots having the identical time scales, with the higher RPM signal captured being free of such noise.
Figure 6-3 Low RPM
Figure 6-4 High RPM, with noise absorption.
Using an oscilloscope to measure the pulse width of the noise and the actual signal at the 3V level shows that the width of the noise at 3V is 2.0us (Figure 6-2) and the width of the signal pulse is 6.6ms (Figure 6-5).
Figure 6-5 RPM Signal width at 3-Volt level
To provide a reliable signal the noise 2.0ms noise had to be removed from the output signal. To ensure this, any pulse that was shorter than 3ms (at 3V) had to be filtered out. This was achieved via an RC circuit that was implemented to ensure that any pre filter signal detected would have to be at 5-volts for greater that the 3us to ensure the 2us pulse in Figure 6-2 was absorbed, before the post-filter signal would exceed the 3V threshold. To filter the 3us pulse a RC filter was designed with an RC value of 3us with a 330nF capacitor requires a resistor value ≈ 10KΩ.
9.09KΩ 6.1
The resulting post RC-filter waveform shown in Figure 6-6 shows the resulting waveform with the true RPM signal represented where the waveform exceeds 3-volts as represented by the yellow line.
Figure 6-6 RPM signal, post RC filtering
A comparator is used to convert this filtered signal back into a clean 5V pulse that can be detected by the microcontroller, with the reference voltage on the comparator set to 3V, a clean digital pulse, devoid of unwanted noise is generated as shown below. The yellow pulse is the final output signal after the comparator and is seen below overlaid over the filtered signal.
Figure 6-7 Digitized RPM signal post filtering
Figure 6-8 below shows the RPM detection circuit, with pin two on the H-Pickup header acting as the attachment point for the pickup wire, with pin 1 providing a ground pin for testing purposes. The inducted signal switches the transistor (Q5), with the voltage drop over the resistor (R17) producing the signal in Figure 6-1 which is smoothed by capacitor 1 (C1) to produce Figure 6-2. The RC filter (R18, C2), filters out the false signal noise producing Figure 6-6, and is finally digitized by the LM339 comparator (U1D) using the reference voltage provided by the variable resistor (R19) to produce the digital signal shown in yellow in Figure 6-7 above.
Figure 6-8 RPM Detection Circuit