sine analog compare triangle signal to pwm

how about if i want make PI controller? then make pwm pulse as output? i show schematic need advice...