Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
Contact us about
Sound Card Engine Crank/Cam Sensor Simulation Principles
You can use the Daqarta Generator to simulate the signal from the engine crankshaft or camshaft position sensor. This can be used for testing an Electronic Control Unit or Module (ECU or ECM) without an engine present. (Note that for certain sensors with rectangular pulse outputs, such as Hall types, you may also need a DC Pulse Output Circuit, or the simple and cheap 2 Channel USB Plug-Type Sound Card option discussed under Simple Sound Card Unipolar DC Modification.)
Note: The following Discussion describes the fundamental approach for using the Daqarta Generator to simulate the signal from an engine crankshaft or camshaft position sensor. However, real-world engines typically have both crank and cam sensors, which must remain in sync during simulations. The Engine_Sim Engine Crank and Cam Sensor Simulator mini-app is included with Daqarta to automate the creation of stereo Arb files with different numbers of teeth, gap width or extra teeth, and waveform type for Crank and Cam profiles. It provides easy control and visualization of tooth patterns, plus simple Arb saving.
It also allows complete simulation using the sine-wave FM method discussed below, but applied to both Crank and Arb simultaneously so that they stay in sync at all RPMs. In addition, it can run arbitrary RPM test schedules which have been created from simple lists via the Arb_From_List macro mini-app.
Thus, use the Discussion below to understand the fundamentals as applied to the crank sensor only, but use the mini-app for real-world testing. You don't need to read or understand any of the following to use Engine_Sim.
A crank sensor detects teeth on a gear, typically with one or two missing teeth to provide a Top Dead Center reference mark. To simulate this, the basic approach is to create an Arb wave file for the chosen tooth pattern... for example, a 25-tooth gear with one tooth missing (25-1) would be a train of 24 identical pulses plus a 25th zero-amplitude "pulse" of the same duration as a real pulse.
Creating Pulse-Train Arbs gives step-by-step instructions on creating such an Arb file. The example file is included with Daqarta as Crank25-1.DQA for you to experiment with.
When you load the created file as an Arb waveform, one full cycle of the wave (25 pulse positions) represents one crank revolution. The main Tone Freq control sets the number of cycles per second (hertz). For RPM you need to remember that there are 60 seconds in a minute, so 10 Hz is 600 RPM and 100 Hz is 6000 RPM.
Daqarta allows you to modulate the frequency of a tone using FM or Sweep options, which is equivalent to changing the engine speed. The CrankFM.GEN Generator setup included with Daqarta automatically loads the above-mentioned Crank25-1.DQA Arb file and sets up the FM parameters to smoothly vary the engine speed back and forth between 600 and 6000 RPM.
The CrankFM.GEN speed control is a pure sinusoid. Change Main Freq (Tone Freq) to set the midrange RPM, where the sine is accelerating or decelerating fastest. The default is 55 Hz, which is 3300 RPM. The +/-Deviation control sets how far it will go above and below that; here, that's 45 Hz or 2700 RPM so that the full range will be 600 to 6000. The FM Modulation Frequency (Mod Freq) is set to 0.1 Hz, which means one test cycle will take 10 seconds.
Creating Pulse-Train Arbs mentions ways to create a second Arb file to control the RPM according to some predefined test schedule, such as via a text file that is created from a list of time and RPM points and loaded directly as an Arb, or first converted to .DAT, or by creating it using the Generator itself.
But you may prefer to have a more flexible test schedule than one that uses a fixed Arb controller. You can use the same Burst techniques discussed in Creating Complex Arb Waves, only don't create an Arb with them. Use Streams 0, 1, and 2 (as desired), and then select them as the FM Source in Stream 3.
The CrankRamp.GEN setup included with Daqarta uses Streams 0 and 1 to create linear ramps and holds, which are summed together by setting the Stream 3 FM Source to use both L.0 Stream and L.1 Stream.
The Burst Cycle is set for the total test cycle duration, not a fixed 8192 samples as for Arb creation. This example uses a 10 second test cycle. Starting from 600 RPM it takes 2 seconds to ramp up to 3300 RPM, holds that for 2 seconds, takes 1 second to ramp to 6000 RPM, holds that for 1 second, takes 2 seconds to ramp down to 600 RPM, then holds that for 2 more seconds before repeating the whole cycle again.
The overall cycle shape is obtained by summing two trapezoidal bursts with different heights and widths. To create these, the first step is setting the Wave to Sine, the Main Phase to 90 degrees, and the Tone Frequency to zero. The sine of 90 degrees is one, so without the Burst operation these "waves" would be constant levels.
The Burst Cycle is set to 10 seconds, and the Burst Shape is set to 0 to give linear Rise and Fall segments. (You may want use another Shape to get smoother transitions, especially if you opt for steep slopes.)
Each stream has its Level set to 50%, so where both High sections overlap, the total Level is 100%. You could, of course, use different proportions.
Stream 3 holds the Crank25-1.DQA Arb, just like the CrankFM.GEN setup. But there are some key differences: As mentioned, the FM Source is set with both L.0 Stream and L.1 Stream active, which adds those two streams together and uses the sum to control the frequency. However, note that the CrankRamp.GEN Burst shapes only run between 0 (when both bursts are off) and a total of 100% when they are both on. They don't go negative like the sinusoid used as the FM Source in CrankFM.GEN.
Thus, the +/-Deviation is really only positive, so the Main Freq value is set to the minimum desired frequency (10 Hz = 600 RPM) instead of the center. The Deviation value is 90 Hz instead of 45 Hz, to take the total frequency up to 100 Hz (6000 RPM).
You may want to experiment with different shapes and durations, as well as using Stream 2 (which is unused here). If you do use Stream 2, remember to set the Stream 3 FM Source to use L.2 Stream along with L.0 Stream and L.1 Stream.
Tip: When you are designing your test schedule, start out with Stream 3 set to Off, and its FM Source set to Sine. This will cause the remaining streams to be summed together directly so you can see the shape as actual ramps and levels.
But realistic test sequences are way too slow to get a good feel for the shape of the control ramps. So, do your design with much faster Burst parameters; use milliseconds instead of seconds or minutes, so the entire cycle is continually visible on the screen at one time.
For example, in CrankRamp.GEN the design prototype was created with msec instead of seconds, giving a total Burst Cycle of 10 msec, which easily fit on the screen. After all the details were worked out on this high speed version, it was a simple matter to replace 0.001 sec (1 msec) with 1.000, 0.002 with 2.000, and so forth.
See also Automotive Applications
Questions? Comments? Contact us!We respond to ALL inquiries, typically within 24 hrs.
Over 30 Years of Innovative Instrumentation
© Copyright 2007 - 2017 by Interstellar Research
All rights reserved