Speedometer conversion using NJM4151 Frequency Voltage Converter - Questions

Status
Not open for further replies.

jpanhalt

Joined Jan 18, 2008
11,087
At post 36, you were apparently editing while I wrote, then I turned off the PC. So, starting there and trying to summarize a little....

A nice power supply is good to have, but I don't think that is the problem here. Those devices (4151)take less than milliamps of power for signals. Even the supply currents are only a few milliamps. In terms of the quality of the power, the automotive environment is pretty bad. Yes there are power supplies that can regulate current, but they vary voltage to get a constant current. I suspect you don't want to do that, as these devices are sensitive to voltage. The ratings on the Mastech supply simply represent what it is capable of. That is, it cannot put 3 A through a 1K om resistor at 1 V. Ohm's law rules.

As for the op_amp, if you list what you have, we can help you select the "best." But, for this testing, any one of them should work, even the ancient 741. For ease of assembly and biasing, find one that will work on a single supply. The data sheet will tell you that information.

If your scope is making it sag, I would definitely try the op_amp between the F/V and V/F stages.

Capacitor types can make a difference because the equivalent internal resistance (ESR) and internal inductance (ESL) of tant and aluminum electrolytic capacitors is different. It sounds like you are causing oscillations when you couple the stages. Go back to the aluminum capacitors for now. When you get everything working, then you can try to reduce the size using tantalum. Yes, a picture would be nice. Do you have adequate decoupling capacitors across the supply pins of each chip?

BTW, With tantalums it is critical to get the polarity right. The marking is different than for aluminum electrolytics. In tantalum, the dark band or dot goes to POSITIVE, not ground as with aluminum caps. Tants will explode if reversed.

Here are a couple of links:
http://en.wikipedia.org/wiki/Electrolytic_capacitor
http://en.wikipedia.org/wiki/Tantalum_capacitor

John
 
Last edited:

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
ah crap. I said tantalums but thats not what I meant. sorry, I was really tired when I posted that. what I have are ceramic - at least I think so. axial leaded, Tv1 0418 k5u 105m... same color as my tantalums, so maybe thats what I was thinking... I took some pics but I have to run to work. Ill bring my camera and upload then if I can get a spare second.
 

jpanhalt

Joined Jan 18, 2008
11,087
I'd still go back to what worked before. Ceramic caps have low ESR and in some applications (e.g., certain voltage regulators) will cause oscillations. I looked at the data sheet some more. The Freq out of the V/F is open collector. That means you must have a pull-up resistor on it, which is shown on the datasheet.

Double check that you have the pull-up resistor there and the resistor capacitor on pin 1 (voltage output) of the F/V converter.

John
 

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
OK. I am sure I have that pullup resistor in both cases. in the case of the F/V the circuit will not work at all without it. Ive tried different values for that resistor and it is one of the parts that changes the ratio of F:V (the RbCb network)
the 5.1k pullup resistor on pin 3, Fout of the V/F is also present, as you may be able to see in my pics below. now that I mention it tho, the value printed on it is 5.12k, but the actual measured value is 5k exactly. I dont think that the .1k could be enough to screw up the circuit, but I suppose I could add another 100 ohms to it just to be sure.

But remember, the circuit works perfectly when supplied by another voltage. I have my proto board wired with 12v on top, 5v on bottom. if I grab the 5v from my bottom rail then the V:F conversion performs marvelously. nice even square wave. but if I grab the 5v from Vout of the F:V, thats when it acts weird.

here are some pictures for reference.

first, this picture shows the 90hz input from my benchtop funcgen. my scope is probing at the source.


this red gator clip ^^^ is going to my meter, reading 4.5 volts at 90hz.


Next is what my scope reads when I put my probe on Vout.
my voltage dips to 3.8v


now, if I move the probe over to Fout, this is the waveform I get.



In this next pic, I hooked up my drill to the actual speedometer sender I will be working with. I used a 100k resistor to pull the hall signal up to 12v when spinning so I could get a readable Fin signal. as you can see, the F:v conversion works correctly, reading a good stable signal at 100hz. (top speed of my drill just happens to be a little over 25 turns per second, which equates to a nice round 100hz output)


Here is that captured waveform again closeup, with 100hz input from the drilled hall sensor., probed at Fout. 200hz - sort of...



Note, I did not get results even remotely close to this, with the electrolytic caps.
 

jpanhalt

Joined Jan 18, 2008
11,087
Those pictures make a huge difference. That is not spurious oscillation that I thought from your earlier description. Those "extra" or split peaks are meaningful.

First, congratulations on a very neat breadboard.

Second, that picture of the output from the F/V tells me that you have about 2.5V with about 0.5V of ripple. But, it is not random ripple. It appears synced to the input freq, which is expected.

Here's my hypothesis: The input pin of the V/F is into a comparator. That amount of ripple on the input is just enough to cause the comparator to change states, thus giving an extra or split peak.

Solutions:
1) Add more filtering to the voltage out from the F/V converter. You could simply add a resistor in series and a capacitor to ground, i.e., a low-pass filter (say 1K and 10uF -- just guessing) to see if that helps. Note, there are already low -pass filters on the output of the F/V converter and input to the V/F converter. If on the V/F input, you just increased the 0.01 uF to 0.1, 1.0, or 10 you might see an improvement. Response will go to pot when you do that, but if you can get it to work with that simple change, then we know where the problem is.

2) You could jump into the design shown in Figure 3 of the datasheet. That has an integrator to smooth out the input.

Keep the capacitors you have that are working Cb/Rb in the simple design, if you do idea #1.

John

Edit: Note that the frequency of the triangle wave ripple is the same as the frequency of the added blip on the output.
 
Last edited:

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
thanks, I like to keep my circuit designs tidy when I am prototyping. I use a pair of fine tweezers to get my components in and out of position. makes it a lot easier to trace a fault or check the value of a component.

I did a couple tests at home during lunch. I didnt get any improvement on the output tho.

Now, hold on a second. if I look at the output pin 1 of the F:V (in figure 5) I have 1uf and 100k for Cb and Rb going to ground. the Vout here then goes through another 100k resistor, to pin 7 Vin of the V:F (figure 2) - it is also pulled to ground with a .01uf cap here... is there a way to simplify that?

here is a pic of the two diagrams side by side. notice the little red wire connecting them :)



my next plan will be to use figure 3 as you suggested to try to smooth out the input. hopefully that will clear things up. unfortunately, it will have to wait till I get home from work. :(
 

jpanhalt

Joined Jan 18, 2008
11,087
I did a couple tests at home during lunch. I didnt get any improvement on the output tho.
What did you do?

Now, hold on a second. if I look at the output pin 1 of the F:V (in figure 5) I have 1uf and 100k for Cb and Rb going to ground. the Vout here then goes through another 100k resistor, to pin 7 Vin of the V:F (figure 2) - it is also pulled to ground with a .01uf cap here... is there a way to simplify that?
That is exactly the part of the circuit I am talking about. What do you see with your scope right on Pin 7 of the V/F converter? I would be tempted to increase that filtering.

Now, I don't see anywhere where the max output of Pin 1 is given. The datasheet does say 138.7 uA as a current source, but I am not exactly sure what that means in terms of its use as a F/V converter. It says it increases 1 uA per volt, but its load is a 100K resistor, which would imply 10 uA per volt.

I would leave that part of the circuit alone for the time being and play with the input to the V/F converter. If you increase the 0.01 capacitor, it should slow the response to change a lot, but if it makes the circuit work as you want, then there are other ways to fix the problem. Maybe a 0.1 is too much, then try 0.047 or 0.022.

Once you get rid of the extra peak artifact, you will know the problem, and solving that while retaining responsiveness to changes will be like coasting downhill. That is where the op_amp comes into play. But, swapping capacitors and maybe the resistor (maybe 10K)is easier for a start.

John
 

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
What did you do?
I tried swapping the 100k resistor (between pin 6 and ground on the V:F) with a 200k pot and turning it up and down. I tried replacing the capacitors again with brand new 1uf electroplytic caps. I tried 4.7uf caps instead of 1uf.

I did go look through my parts bin to see what I had for opamps.




as it turns out, I have a few LM301 and LM324's. among some other assorted bits.


That is exactly the part of the circuit I am talking about. What do you see with your scope right on Pin 7 of the V/F converter? I would be tempted to increase that filtering.
I see the exact same thing. a 100hz (or whatever my Fin is) triangle wave oscilasion. naturally, its offset from ground by Vout. it looks like at 80-100hz that the oscilasion is about 240mV

Now, I don't see anywhere where the max output of Pin 1 is given. The datasheet does say 138.7 uA as a current source, but I am not exactly sure what that means in terms of its use as a F/V converter. It says it increases 1 uA per volt, but its load is a 100K resistor, which would imply 10 uA per volt.

I would leave that part of the circuit alone for the time being and play with the input to the V/F converter. If you increase the 0.01 capacitor, it should slow the response to change a lot, but if it makes the circuit work as you want, then there are other ways to fix the problem. Maybe a 0.1 is too much, then try 0.047 or 0.022.
I swapped out the .01 with a .1 and it made it not work at all.

Once you get rid of the extra peak artifact, you will know the problem, and solving that while retaining responsiveness to changes will be like coasting downhill. That is where the op_amp comes into play. But, swapping capacitors and maybe the resistor (maybe 10K)is easier for a start.

John
 

jpanhalt

Joined Jan 18, 2008
11,087
Go to this thread: http://forum.allaboutcircuits.com/showthread.php?t=25542

There is a lot of useful information there, in particular the links by bertus in posts #2 and #7. They will tell you how to use an op-amp that is designed for split supply on a single supply. Another way is to run at 9V and just use a 9V battery for the negative supply. It will last a very long time. A small 12Vbattery will also work. Just be sure your negative supply is the same as the positive supply.

Do you have a smaller capacitor (e.g., 0.047 or 0.022) to try on the input to the V/F converter? Remember, it's not for the final design but just to get rid of that extra peak.

Do you go by Jonny?

John
 

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
OK. where were we.... I didnt get a chance to look at that thread last night.

I will sit down and give that Document from post#7 a thorough reading. it looks quite informative. I also have been assembling an order for parts from Mouser.com and Ive thrown an assortment of opamps in there. (including the NJM3403A as suggested by the NJM4151 datasheet figure 3 schematic.)

can you suggest anything else I should include?

 

jpanhalt

Joined Jan 18, 2008
11,087
Good morning Johnny,

I've got some time today, so i think I will breadboard what you have done. I don't have the NJM4151, but I have some of its sisters.

Just to confirm the values you are using:

F/V Converter
Rs=100K pot
Co= 0.1 uF (not 0.01)
Rb= 100K
Ro= 34K (not 6.8K)
Cb= 1.0 uF ceramic (1.0 uF Aluminum electrolytic didn't work)
Other values same as datasheet

V/F Converter
Same as datasheet posted above

Are those assumptions correct?

John
 

jpanhalt

Joined Jan 18, 2008
11,087
There are so many op amps out there, it is hard to choose. Some get pretty expensive. I have the TLV2462 as a nice, single-supply version. SgtWookie (on this site) has recommended the LM6132. I believe the latter is dual supply but didn't read its datasheet that carefully. All dual supply op amps can be run with a single supply as mentioned earlier.

I was writing while you posted #51.

John
 

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
Good morning Johnny,

I've got some time today, so i think I will breadboard what you have done. I don't have the NJM4151, but I have some of its sisters.

Just to confirm the values you are using:

F/V Converter
Rs=100K pot
Co= 0.1 uF (not 0.01)
Rb= 100K
Ro= 34K (not 6.8K)
Cb= 1.0 uF ceramic (1.0 uF Aluminum electrolytic didn't work)
Other values same as datasheet

V/F Converter
Same as datasheet posted above

Are those assumptions correct?

John

not quite. I posted the values for V:F earlier. they are not even close to the ones in the schematic.
for the F:V heres what I THINK I put in for each part, following the figure 5 simple schematic. adjusted for a full scale freq of 200hz at 10v. forgive me, I am not in front of the protoboard.
Ro=34k
Co=.1uf (104)
Cb=1.0uf (105)
Rb=100k
Rs=100k pot? I think I swapped this out, but not sure.

for the V:F I I followed the "programming the NJM4151" instructions to get the values. I believe I was trying for a full scale ouput of 400hz at ten volts. I kept notes, but they are on my PC at home. :(
 

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
I did some looking at my pictures closeup, it looks like I have for values of the V:F

pin1 shunt to pin 6,
pin 2, Rs consists of 10k and a 20k pot. adjusted to give me 200hz at 5v Vin.
pin 3 has 5.1k to V+
4 to ground,
pin 5 has .1uf to ground, and 15k to V+ (Co and Ro)
pin 6, has the CbRb network, of 1uf and 100k in parallel to ground (as well as that wire to pin 1.)
pin 7 - 100k between Vin and pin 7, pulled down with .01uf just as in the figure 2 schematic.
pin 8 to V+

I think thats right. thats the best I can do from the pictures.


EDIT: Correction, pin 5 has FIFTEEN k to V+. I just did all the math again. I had worked my figures for a full scale frequency of 500hz, not 400 as I may have said earlier.
 
Last edited:

jpanhalt

Joined Jan 18, 2008
11,087
I have the F:V running using resistors I had, but pretty close to yours. The output is very sensitive to load as expected. It doesn't take much to knock it way down. My ripple seems a little less. I will keep playing with it. After I get the V:F up and running, I will let you know.

John
 

jpanhalt

Joined Jan 18, 2008
11,087
Well, I have been messing with it. It is kind of a sensitive circuit, but I have it running. Please note, I did not have the NJM4151 , and I had only one RC4151. I had lots of RC4152's that are very similar, if not identical according to the datasheet. So, I used the RC4152's. Second, I did not pay much attention to the scaling factor. That is, I did not try to set an exact ratio. I just wanted to get some ratios that were non-whole numbers. One thing to watch out for is that the chips can get into "sync" so you get a 1:1 ratio that is very stable. Removing Co tends to break that resonance up, and then on restarting, the frequency is what it is supposed to be.

First change was to get rid of the ripple in the output of the F:V converter. I changed Cb from 1uF to 10 uF. Now that everything is running, if I go back to 1 uF, the output gets into sync with the input frequency. The larger capacitor may affect response time. Eventually, when you add the Op Amp, it may not be necessary.

Second change was to add a filter capacitor (0.01 uF) from the output at pin 3 of the V:F converter to ground. This got rid of spiking in the output. You might go smaller, but a larger one causes too much distortion.

Edit: Disregard the following. It was an artifact. Third change was to adjust Rs to get a stable duty cycle. I made it larger (220K) so the positive peaks appeared to be <0.5 of the total cycle.

What works for the third change may vary with the ratio that you use. Mine happens to have the output frequency less than the input. I think the first and second changes were the most important for the simple circuit and might let you at least get some usable results. If you then use the circuit in Figure 3 with the Op Amp integrator on the input to the V:F converter, you may not need either change. That converter is very sensitive to noise on its input, which I think is the main problem you are having.

In the attachment, the top trace is the output from the V:F converter. The bottom is the voltage from the F:V. Note the effect of the larger capacitor to smooth it out.

John
View attachment 26992
 
Last edited:

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
this should be helpful, I will tryt to replicate your suggestions when I get home. one thing of note however, is that if I remember right my circuit doesnt give me much trouble when Fout is lower than Fin. its only when I start amplifying... when I have Fout up around 2(Fin) that I really see the trouble. I know that this circuit will need to be able to more than double the input.

you mentioned in your first paragraph about the chips getting into sync, I am not quite sure what you mean there... you said removing Co breaks up that resonance, but do you mean, F:V Co? or V:F? and then you said that after restarting the frequency is what it is supposed to be, but do you mean with Co in or out?

thanks again for all your help.
 
Status
Not open for further replies.
Top