Phasing Angle Real-Time Measurement for Multi-Camshaft Combustion Engines in Production Hot Test Benches Using the CompactRIO Platform

  Print Print

"This system helped us save money because the CompactRIO was already present in the setup to perform PID calculations and set the dynamometer at the correct speed set point and/or torque."

- Daniele Gatto Monticone, Sistemi e Macchine di Produzione S.p.A. (SIMPRO), PhD, Research and Development of Test Systems

The Challenge:
Sistemi e Macchine di Produzione (SIMPRO) needed to develop a lean and cost-effective system that could measure the phase angle of a camshaft, with respect to the crankshaft, of automotive combustion engines in real time. The company would use the system in hot test benches for production test to detect errors in the assembly/machining processes, as well as electric issues involving the camshaft and crankshaft inductive sensors and their target wheels.

The Solution:
SIMPRO used a software solution created with the LabVIEW development environment and installed on a cRIO-9066 controller. The company combined this system with commercial off-the-shelf (COTS) components for signal conditioning. Electrical failures can also be intermittent, so the measure of the sensor’s output during the whole test of the engine will maximise the probability of detecting them.

Daniele Gatto Monticone - Sistemi e Macchine di Produzione S.p.A. (SIMPRO), PhD, Research and Development of Test Systems

We acquired signals from the camshaft position sensor and the crankshaft speed sensor in parallel, together with the ECU, to measure the phasing angle. We use high-input impedance amplifiers with adequate bandwidth to not introduce signal attenuation at the ECU input stages. We then regenerated the signal using an optoisolator equipped with a Schmitt trigger. This made it possible for the system to correctly process both Hall effect crankshaft sensors and old inductive sensors. The output of the optoisolator is a real TTL signal that feeds the inputs of the NI-9411 C Series Digital Module.


Software Architecture Overview

Our main software goal was to minimize the CompactRIO CPU load because that unit manages several aspects of the test bench (dynamometer PID control, throttle output signal toward ECU, and more). We also needed to minimize FPGA usage.

The acquisition sampling rate is variable, with a default setting of 100 kHz. We performed it with a dedicated loop in the FPGA abstraction level. We moved the results to the software real-time layer using dedicated DMA FIFOs represented in bunches of 64-bit integers. Every bit is a sampling point of one channel.

The software reads its settings from a set of configuration files (one for every engine model) that are stored in the CompactRIO internal drive. Every file includes the information necessary to reconstruct speed profiles and phase signals, based on the angular position of rising and falling edges. We run the control software, which we developed using LabVIEW, on a Windows PC. It communicates the correct engine model to the CompactRIO at the beginning of the test.

At run time, the real-time software evaluates the engine speed and the phase mismatch from the nominal signal profile and the detected one. Single mismatch angles, which refer to every tooth of the target wheel, are also calculated. We needed these last measures to detect errors in the machining process of the target wheels.


Algorithm Overview

The software was split into two processes executed alternatively one after the other. The first was dedicated to the speed signal and the second to the phase signal.

The first process is quite simple. We process the crankshaft signal for every sampling point to detect if a falling edge has occurred. If so, a value representing the engine unfiltered angular position is updated by 360°/N, N being the number of division in the target wheel. Instantaneous speed is calculated as well. Since we are dealing with four stroke engines, the angular position has to be represented in the interval 0-720°; therefore, a sole sensor on the crankshaft is not sufficient. We need to know the logic state of one camshaft sensor at a certain angular position. It is possible to show that for every arbitrary camshaft signal profile, at least one point changes logic state alternatively every turn of the crankshaft. Figure 1 shows a typical camshaft and crankshaft signal. The angular point used to detect the camshaft signal and the value that it must have are declared in the configuration file. This process also detects that no extra or missing pulses are present.


Figure 1. Typical Signal Profile From Crankshaft Sensor (upper, black line) and Camshaft Sensor (lower, blue line)


We execute the second process every sampling point as well to check for a rising or falling edge on one camshaft signal. If more camshaft sensors are present on the engine, we execute this process more than one time.

Every time the system detects an edge, the process takes the unfiltered angular position of the engine and performs a best estimate of the true angular position by a linear interpolation, using the speed information. The edge angle mismatch is then estimated, comparing to the nominal value stored in the configuration file. The overall angular shift of the camshaft is estimated from the average of all the edge positions. The number of pulses for every 720° is checked to detect missing or extra pulses, as well as what is done for the crankshaft signal.


Figure 2. Same Signal From Figure 1 - Highlighted Intervals Are the Ones in Which the Logic State of Camshaft is Alternatively High or Low Every 360°


Important aspects of the software are related with capabilities of self initialization and fault tolerance. The phase information is correct after the first two turns of the crankshaft. If a temporary noise in one of the signals is present, the speed and phase measures will be clearly affected. Once the noise ceases, measurements will be correct within two turns of the crankshaft. Many of the errors come from speed and phase signals (for example, a missing tooth, an extra pulse, or an inverted waveform). The software can detect these in real time because some plausibility check will fail. This makes it possible to detect intermittent failures. The measurements (speed, mismatch angles, as well as the result of plausibility checks) are sent to the control software through a TCP connection. Performances are well suited for the application and the update rate is about 10 ms, limited only by the control software layer. The CPU load is negligible, being a few percent of one core.



This system helped us save money because the CompactRIO was already present in the setup to perform PID calculations and set the dynamometer at the correct speed set point and/or torque.


Author Information:
Daniele Gatto Monticone
Sistemi e Macchine di Produzione S.p.A. (SIMPRO), PhD, Research and Development of Test Systems
Via Torino 446/A
Brandizzo (TO) 10032
Tel: +39 011 917 93 40

Bookmark and Share

Explore the NI Developer Community

Discover and collaborate on the latest example code and tutorials with a worldwide community of engineers and scientists.

‌Check‌ out‌ the‌ NI‌ Community

Who is National Instruments?

National Instruments provides a graphical system design platform for test, control, and embedded design applications that is transforming the way engineers and scientists design, prototype, and deploy systems.

‌Learn‌ more‌ about‌ NI