To remove the near rail fault I add a 1n4004 diode to the output amp and Bias the input with the Vin+ refference.
So I convert 0-3.3 from digipot to 0-10V.
share you the schematic with some formula I used. I've basic understanding on electronic there is much chance I have done a mistake. So I need some advice. And I know I chose the hard way...
I would use a DAC, like this one and a suitable amplifier. There is probably an SPI bus equivalent, and most certainly, similar chips with 0-10V output.
I've seen the post about level booster on PWM, But it did fit fine to my need. I want better definition and predictability.
I am sure you are misunderstanding something fundamental. Predictability? Only a badly designed circuit is not predictable. Definition - simply the wrong word to use, it conveys nothing.
So I convert 0-3.3 from digipot to 0-10V.
That is a very very strange "round the houses" way of doing this. I would have used simply a SN7406 open collector inverting buffer. Two in series if you don't want the voltage inversion.
I append a suitable 3 times amplifier - if you want EXACTLY 3.3 ... 10 v, add a 1k variable.resistor in series with R2
Note I've included a low pass input filter from the presumably 3.3v PWM input to greatly reduce ripple.
Note also a 100 ohm in the amplifier's output to improve stability and protect from noise and excessive capacitance on the output line.
the opamp will have an input offset of a few mV - this will result in a further error of up to 0.1% worst case - but since the resolution of the PWM signal is only about 0.4% it shouldn't be a worry.
And if the 3.3v is derived from arduino, I doubt if it's regulator will be better than +/-5% if you're lucky.
Circuits like this are fine, and frequently posted on this site.
You can improve reaction speed by using a smaller cap and pin 5 or 6 (~1kHz PWM).
Or code for a higher PWM frequency.
Leo..
The LM358 world be fine - but not with just a single +ve supply - it's not rail to rail
on it's output - and can't be with that emitter follower PNP pull-down. (look at it's outline schematic on the datasheet).
Nitrof - if you can arrange a negative supply for your opamp your choice becomes huge and
cheap. Everything else remains the same. Only a few volts is necessary. - 5 would be plenty
You're limited both by a single supply, and (presumably) a DIP - ie non-surface mount package.
The AD820 would be an excellent choice... it's a matter of which is cheaper - that or a -ve supply.
I take you're advise. Ad820 is not expensive enough to Justify a negative supply. And it will make schematic more simple.
About it.. In the +12V supply boost, I find a big error in wiring... I correct it with recommendation from datasheet. But if you don't mind to retake a look in case I missed something...
Also, I add a jumper to select another value for Rin (R3), making the output 0-5V or 0-10V.
If you're worried about the output swing of the LM358.
The opamp doesn't have to sink (load is grounded).
From the TI datasheet:
Low voltage output <0.01volt in that case. About the same as a rail2rail opamp.
High output is > VCC-1.2volt at those feedback resistor values (load will be 1Megohm).
So no problem to get 10volt out on a 12volt supply.
Leo..
Supply seems to be ok now. Didn't calculate the R values though.
I would use 18k for R5, and a 4k7 (5k) pot.
You also have the problem that 3.3volt is not always 3.3volt, so a bit more adjustment range is good.
Leo..
To be shure a recalculate the resistor.. look good so that will be. I chose the closes value available at digikey in 0805.
I will change value of resistor. Seem a good range of adjustment (around +-0.8V@0-10V, +-0.2V@0-5V math checked).
I tough I was over with new question and finally a got one more.. What could be the best approach to protect the output from device connected on it. it will be mostly 24Vac actuator. So it should be from both hi and reverse voltage if possible...
So it should be from both hi and reverse voltage if possible...
That circuit is called a H-bridge, you could make one yourself but the deceptively simple schematics you find on line are not as good as they might seem. I would recommend you get a H-bridge chip. There are plenty about.
I think OP means protecting the opamp circuit from accidently 24volt (both polarities) on the opamp output.
Not easy.
Maybe a 12volt TVS diode across the 12volt supply.
And two 1N4004 clamping diodes from output to ground and 12volt.
Too much current could still release the magic smoke and send parts to silicon heaven.
Leo..