Thanks, I learned a lot about fuell injection systems
.
So as I assume that the general consensus is to just feed the digital signal (the output of stage 2) to the controller
Are you unable to connect directly to one of the phases from the generator? All three of them essentially bounce from one diode drop below your ground to one diode drop above your supply voltage.
All you need is to divide and clamp that voltage and you can process it digitally. Add a Schmitt trigger if you want the cherry on the cake.
Thanks!
Yes I can connect directly to a phase, but I don't exactly know what you mean. Do you mean like rectify the signal of one phase, followed by a sufficiently big condensator. Than add a voltage divider to this result and use the lower voltage to calculate the RPM?
No, feed it into a microcontroller input pin and then inside use a counter module to measure the frequency. Newer microcontrollers usually have very adaptable timers/counters which will allow you to do that efficiently, without wasting CPU cycles on countless interrupt routines.
I read that for this purpose you can use the 'Input capture feature'. I got it from John Wasser's answer on this post:
https://forum.arduino.cc/t/how-do-i-measure-the-time-between-voltage-pulses-accurately-with-an-arduino-for-diy-efi-project/947830/2I guess that is what you mean with an 'efficient way of counting'.
The downside of the direct input in to the controller is that the controller is also busy with a lot of other stuff which blocks interruptions (eg during I2C or SPI communication, the interrupts are blocked). So with the regular interrupt, the time registered time could be 'delayed'. As I understand the Input Capture feature correctly: the timestamp is stored in a separate Input Capture register outside your CPU. So whenever a pulse comes during a moment the interruptions are blocked, the correct value is still stored and will the interruption flag will be processed when the interrupts are alowed again. You just need to retrieve it before the next pulse hits the input, because it'll overwrite the register. Since the fastest pulse train has delays of 15ms, the maximum time the CPU can do for one loop is than also 15ms, which should be manageable.
Yes this is how I would do it.
Block the DC with a cap and then zero-bias the signal (perhaps at 1/2 rail) so you can detect zero crossings, and feed them to a comparator.
You can extract a very small ripple that way so no issue with caps after the alternator. In most alternator scenarios there is a battery there doing the smoothing.
Then you can use whatever method to measure the period. Measuring the frequency will also work but will take longer to achieve a given resolution, so this is for you to work out.
Most CPUs today have loads of timers which can be set up to measure the period automatically. I've done exactly that to measure a 400Hz signal (for LVDT emulation, emitting two other signals which are phase-locked to this reference). Minimal software involved - just an ISR on the zero crossings.
Just to be sure, you mean something like the circuit in attachment?
The downside is that at generating factor of 10%, only the noise is left (if you compare it to the output_stage1 of the original post, it's quite messy).
As for processing of the output signal, I guess you mean the same as the Input Caputre feature mentioned above?
I was looking myself some more in the direction of converting it to a analogue signal, like an ADC. I asked it to chatGPT, just for testing, and it actually gave some good hints:
- a frequency to voltage converter (FtoV): the chips alone are already quite expensive and way too precise for my application, in general they are also for higher frequencies (khz - Mhz)
- different implementations of (different kinds of )integrators followed by low frequency pass filters. But these are too slow in adapting/response
So in order to implement the integrator I need to get something which is of 'faster frequency' than the original, in order to maintain responsiveness.
Therefor I was considering to use the time lag between the output_stage1 and output_stage2. If you compare pictures on100percent_2 and on10percent from the original post, you see that the time lag of hitting a certain voltage, is proportional to the frequency. This is a pretty short time, so when you fill up a small capacitor (start of filling = output_stage1 above a threshold voltage, stop = output_stage2 above the same threshold voltage) and afterwards measure the voltage, you have a voltage inverse proportional to the frequency. After this filling up you can use a simpe sample-and-hold circuit (sample = output_stage2 at max voltage, hold = output_stage2 = 0V) which feeds the analog input of your controller.
I don't know if the above makes any sense or would work. Anyone an idea?