How do "Inverter" or "IGBT" welders control CC and CV output?
The comment by mkeith and Marko Bursic provide the basic answer. PWM control signals for the switching devices can be generated by Arduino type micro controllers with associated interface boards. An isolated current sensor and voltage sensor is also required. You should be able to find reference material that describes PWM voltage and current control methods including current limited voltage control and voltage limited current control. Look for both basic material about PWM current and voltage control and for PWM control as applied to welding. You will find a lot of material about PWM control for motors, heaters, lights and battery chargers. That might be of use, but there are probably specific requirements for welding.