Practicality of this LM317T PWM Voltage and Current control circuit
Some practical concerns...


Q1 should have some base resistance to limit the current feeding it (when U3 is behaves as a comparator, in constant-voltage regulation).
The "gain" of the constant-current loop formed by R1, U2, U3, and Q1 will vary depending on load current (because Q1's transconductance is proportional to current). In particular, evaluate the stability of this loop at maximum programmed load, because the loop gain will be highest then. The dominant pole is in U3's compensation, although U2 adds a pole, as does U3's \$Z_O\$ feeding Q1's base capacitance. You might consider making U3 an integrator to reduce the crossover frequency to a certain programmed value (e.g., 1kHz).
Power supplies are usually built with voltage regulation and current limiting in the "high side" -- that is to say, one terminal of the load is connected to ground. Since you've already given up your ground connection (with Q1), it's more practical to place R1 below Q1 (between Q1's emitter and ground). Thus, U3 could regulate the Iset current without needing the U2 difference amplifier.
The output voltage regulation isn't going to be especially accurate. This is because of the voltage drop across R1, as well as Q1's \$V_{SAT}\$, which is typically ~0.2V. You can improve this somewhat by making Q1 a MOSFET. Generally, though, it's better for the voltage regulator to measure (and regulate) the voltage directly across the load, bypassing the sense resistor. The LM317 doesn't give you the option to do this, but other regulators do. This will usually require a high-side sense resistor (like the way your R1 is now), meaning you'd need a difference amplifier again.
You can find high-side current sense amplifiers that will be quite a bit more accurate than an op-amp difference amplifier is. Just look on Digikey for current sense amplifiers.
Since the voltage regulator already provides a power device, having a second power device (i.e., the current regulation transistor) is somewhat redundant. If you do it right, you can measure the current through a sense resistor, and if the current exceeds the setpoint then you can throttle back on the voltage setpoint.
You should always have capacitors bypassing the input and output pins of voltage regulators.
When evaluating stability, you should run a transient simulation with some sort of impulsive perterbation to give the circuit a "kick." A popular choice is a current step. If it oscillates after the kick, then it's unstable. You should re-run the simulation under various load conditions.
Before committing to the PCB, you should perform a simulation with reasonably accurate models of all the devices you're using. In particular, U2, U3, and Q1 are going to behave very differently from the [almost] ideal model you're using right now. Also, be aware of input common-mode range; if you powered U2 from the regulator's output, without a rail-to-rail input common-mode range then it wouldn't work at all.


In summary, if it were me I would redesign the whole thing. That said, making a PCB is cheap enough that you can just try it and see for yourself. After all, seeing how things work in real life is more educational than any gibberish I can generate.



All that said, you might consider just buying a pre-made solution. Try the LT3081 on for size. It includes built-in current regulation. The application on Page 24 of the datasheet shows a sophisticated programmable CV/CC regulator. I'm sure the ILIM pin can be readily hacked to make it controllable from a MCU.