"Normalize" a variable amplitude sine wave - Page 1
Forum section: electronics / beginners

author: dannydnl
author_rank: Newbie
timestamp: February 21, 2020, 05:07:04 pm
content: Hello everyone,So, i want to take the sinusoidal signal from a crankshaft sensor, that outputs a "variable" amplitude, then "normalize" it to about 3V peak to peak and offset it, so it doesn't go negative.At low RPM the signal is about 1V pk-pk , and at max RPM it goes a little over 20V pk-pk.Can someone point me in the right direction on how to proceed with this, and what type of circuit do i need?To be honest, i don't know what to search for, cause "normalize a sine wave, circuit" doesn't yield anything good.Thanks for any input.

author: retrolefty
author_rank: Super Contributor
timestamp: February 21, 2020, 05:25:03 pm
content: Lots of speed sensors were used on large compressors and other machines where I worked (large oil refinery) used passive and active sensors, typically variable reluctance pick-ups that wired to zero crossing differential op-amp comparator input circuits, effectively transforming sine wave to digital (voltage limited) square wave.

author: nfmax
author_rank: Super Contributor
timestamp: February 21, 2020, 05:25:39 pm
content: This looks like an inductive pickup, so the output voltage is proportional to the rate of change of magnetic flux, which is proportional to speed. So if you use an OPAMP integrator, you will get a sine wave of constant level regardless of speed. You can set the output amplitude by setting the time constant of the integrator. You will need a feedback resistor in parallel with the integrating capacitor, to stop the integrator saturating when the engine stops. The time constant Rf*Cf should be about 50s time the integrator time constant Rin*Cf.You can then offset the output by applying a fixed current to the inverting input of the integrator OPAMP. The value of Rf, together with the input current, sets the output bias voltage.

author: Tomorokoshi
author_rank: Super Contributor
timestamp: February 21, 2020, 06:12:23 pm
content: Try something like this:https://www.digikey.com/product-detail/en/texas-instruments/LM1815N-NOPB/LM1815N-NOPB-ND/228997

author: jesuscf
author_rank: Frequent Contributor
timestamp: February 21, 2020, 06:13:15 pm
content: Quote from: dannydnl on February 21, 2020, 05:07:04 pm"Logarithm amplifier" + "DC restorer"? What are you trying to measure? If you are interested just in the frequency of the signal, there are very simple circuits you can use.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: February 21, 2020, 06:38:42 pm
content: Anything wrong with just clipping the signal with a zener diode? Two components, a resistor and the zener. If your sensor has enough output impedance you can even eliminate the resistor.

author: ogden
author_rank: Super Contributor
timestamp: February 21, 2020, 06:44:08 pm
content: Why you need sine in the end? Why don't you tell what you are going to do with that "normalized" 0-3V sine? If you are interested only in frequency, then you don't need sine and simple zerocrossing detector is sane solution here. Otherwise you need automatic gain/attenuation control. Shifting is easy, internet search keywords "dc offset shift opamp"

author: dannydnl
author_rank: Newbie
timestamp: February 21, 2020, 07:19:52 pm
content: So, i have a Schmidt trigger circuit that outputs a square signal, from the crankshaft sensor.I use that to calculate the rpm.Quote from: jesuscf on February 21, 2020, 06:13:15 pmI want to use the sine wave just for displaying purposes.I will send both signals,the square wave and the sine wave, to a CAN transceiver, then i will display them on a PC.Quote from: CatalinaWOW on February 21, 2020, 06:38:42 pmI would like the sine wave to be "unclipped".The sine wave is just for demonstration purposes.Quote from: ogden on February 21, 2020, 06:44:08 pmWell, i get the frequency from the square wave output of the Schmidt trigger.So, the sine wave is just to show, over CAN bus, what an inductive crankshaft sensor outputs.Quote from: nfmax on February 21, 2020, 05:25:39 pmI will try to research what you propose, @nfmax.Thanks everyone, for the input.

author: Mr Evil
author_rank: Regular Contributor
timestamp: February 21, 2020, 07:27:41 pm
content: Quote from: dannydnl on February 21, 2020, 07:19:52 pmIf it's just to look pretty, then I wouldn't bother trying to display the actual signal. Since you know the frequency, just generate an image of a sinewave at that frequency and the desired amplitude, and draw it on the screen.

author: pwlps
author_rank: Frequent Contributor
timestamp: February 21, 2020, 07:56:08 pm
content: Quote from: dannydnl on February 21, 2020, 07:19:52 pmNote that if you want to measure the amplitude of the sine wave a RMS converter will give much more accuracy compared to simple voltage clipping.https://www.analog.com/en/products/analog-functions/rms-to-dc-converters.html

author: imacgreg
author_rank: Contributor
timestamp: February 21, 2020, 08:05:34 pm
content: What you're asking could be performed using AGC (automatic gain control) or VCA (voltage controlled amplifier) - in audio these are called compressors and/or limiters. Essentially, a variable gain element is controlled in a feedback loop in order to control amplitude. Your application sounds like it would be a lot simpler than most audio applications.The variable gain element can be a lot of different things: light dependent resistor (opto/LDR), Integrated VCA (see THAT corp), JFET.The forward path contains the variable gain element. The feedback path does some processing to the output signal (full-wave rectification, peak detection, filtering, scaling) to create a voltage to control the variable gain element.I'm being intentionally vague, as there are tons of ways to attack this. Perhaps this gives you some ideas/terms to search.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: February 22, 2020, 12:48:00 am
content: Given your purpose I would think the simple integrator as proposed by nfmax will be your best bet. It is simple and robust and still passes on some of the flavor of the signal (variations from a perfect sine).

author: Andreas
author_rank: Super Contributor
timestamp: February 22, 2020, 04:27:57 am
content: Quote from: dannydnl on February 21, 2020, 05:07:04 pmThe signal is not "sinusoidial" especially at "the gap" of a 60-2 tooth wheel there are some anomalies.(undershoot at the beginning of the gap and overshoot at the first tooth after the gap).https://www.picoauto.com/images/uploads/agt/_lrg/gt017-example-waveform-01.pngwith best regardsAndreas

author: Circlotron
author_rank: Super Contributor
timestamp: February 22, 2020, 05:37:41 am
content: I once used a stepper motor as a tachometer generator, attached to a motor for speed feedback control. I put the generated sine wave straight into an RC (no active components) and it worked just perfectly. Above a certain minimum rpm the amplitude was constant. One thing that might matter to you is phase shift from input to output. If you are just measuring rpm this is no big deal, but if it is some kind of position sensor then it may matter.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 22, 2020, 05:54:58 am
content: Quote from: Mr Evil on February 21, 2020, 07:27:41 pmAnd for that matter, depending on sensor type, it may not even be a sine wave, so displaying it as such could be disingenuous.Tim