Author Topic: "Normalize" a variable amplitude sine wave  (Read 2927 times)

0 Members and 1 Guest are viewing this topic.

Offline dannydnlTopic starter

  • Newbie
  • Posts: 2
  • Country: ro
"Normalize" a variable amplitude sine wave
« on: February 21, 2020, 05:07:04 pm »
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.
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: "Normalize" a variable amplitude sine wave
« Reply #1 on: February 21, 2020, 05:25:03 pm »
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.
 
 

Online nfmax

  • Super Contributor
  • ***
  • Posts: 1624
  • Country: gb
Re: "Normalize" a variable amplitude sine wave
« Reply #2 on: February 21, 2020, 05:25:39 pm »
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.
 

Offline Tomorokoshi

  • Super Contributor
  • ***
  • Posts: 1212
  • Country: us
 

Offline jesuscf

  • Frequent Contributor
  • **
  • Posts: 503
  • Country: ca
Re: "Normalize" a variable amplitude sine wave
« Reply #4 on: February 21, 2020, 06:13:15 pm »
Can someone point me in the right direction on how to proceed with this, and what type of circuit do i need?

"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.
Homer: Kids, there's three ways to do things; the right way, the wrong way and the Max Power way!
Bart: Isn't that the wrong way?
Homer: Yeah, but faster!
 

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 5571
  • Country: us
Re: "Normalize" a variable amplitude sine wave
« Reply #5 on: February 21, 2020, 06:38:42 pm »
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.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: "Normalize" a variable amplitude sine wave
« Reply #6 on: February 21, 2020, 06:44:08 pm »
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"
 

Offline dannydnlTopic starter

  • Newbie
  • Posts: 2
  • Country: ro
Re: "Normalize" a variable amplitude sine wave
« Reply #7 on: February 21, 2020, 07:19:52 pm »
So,  i have a Schmidt trigger circuit that outputs a square signal, from the crankshaft sensor.
I use that to calculate the rpm.
Can someone point me in the right direction on how to proceed with this, and what type of circuit do i need?

"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.

I 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.

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.
I would like the sine wave to be "unclipped".
The sine wave is just for demonstration purposes.

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"

Well,  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.


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.

I will try to research what you propose, @nfmax.


Thanks everyone, for the input.
 

Offline Mr Evil

  • Regular Contributor
  • *
  • Posts: 76
  • Country: gb
    • mrevil.asvachin.com
Re: "Normalize" a variable amplitude sine wave
« Reply #8 on: February 21, 2020, 07:27:41 pm »
I 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.
If 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.

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 372
  • Country: fr
Re: "Normalize" a variable amplitude sine wave
« Reply #9 on: February 21, 2020, 07:56:08 pm »
I 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.

Note 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
 

Offline imacgreg

  • Contributor
  • Posts: 15
  • Country: us
Re: "Normalize" a variable amplitude sine wave
« Reply #10 on: February 21, 2020, 08:05:34 pm »
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.
 

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 5571
  • Country: us
Re: "Normalize" a variable amplitude sine wave
« Reply #11 on: February 22, 2020, 12:48:00 am »
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).
 

Offline Andreas

  • Super Contributor
  • ***
  • Posts: 3350
  • Country: de
Re: "Normalize" a variable amplitude sine wave
« Reply #12 on: February 22, 2020, 04:27:57 am »
So, i want to take the sinusoidal signal from a crankshaft sensor,

The 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.png

with best regards

Andreas
« Last Edit: February 22, 2020, 05:52:32 am by Andreas »
 

Online Circlotron

  • Super Contributor
  • ***
  • Posts: 3366
  • Country: au
Re: "Normalize" a variable amplitude sine wave
« Reply #13 on: February 22, 2020, 05:37:41 am »
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.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: "Normalize" a variable amplitude sine wave
« Reply #14 on: February 22, 2020, 05:54:58 am »
I 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.
If 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.

And for that matter, depending on sensor type, it may not even be a sine wave, so displaying it as such could be disingenuous.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf