A low pass filter removes the AC part of the signal and outputs the average, and gives you DC. From the PIC it probably will give a DC voltage of 0 to 5 volts. (if the VCC=5V)
Here is a neat calculator that you can use. Adjust R & C untill you get the ripple voltage low enough for your needs, then make sure you can live with the response time for a change. Go down the page until you see the PWM calculator.
It won't be exact because the output of the 317 is 1.25 volts above the adjust pin. So.... You will have to make this adjustment in your micro program I think.
It won't be exact because the output of the 317 is 1.25 volts above the adjust pin. So.... You will have to make this adjustment in your micro program I think.
If no one has mentioned it https://www.eevblog.com/episodes/
has an very good series of videos on designing a lab/bench supply. He walks you through the logic as he refines the design.
Watch them and be amazed.
Not only is it good information but it is an interesting look into the logic and motivation.
If you don't need much current you could just use the output of the op amp or you could use a higher power op amp. All depends on your needs. R1 provides a minimum load so the 317 will regulate even with very low or no external load.
Hi ron I simulated your circuit in Proteus,it worked nicely.
Giving PWM voltage from 50mV to 4.5V will give the output to 1.5V - 24V range that's great.
Of course for every gained voltage it must add 1.25V value.
Now I just modifying the PWM part.What about adding an unity gain buffer to the input to the op-amp?In other words I'm going to add low pass filter to the unity gain buffer & its output will connect to the gained op-amp!!