I need to design a switching voltage regulator, all parts work fine but I am having trouble figuring out the feedback, on the negative terminal of my comparator i have a triangular wave that cycles between 5-10 volts. on the negative terminal have have the output from the error amplifier. the error amplifier takes a reference voltage which is to be controlled by the user, and change it to a scale which can be compared to the output from the triangular wave.
I have tried many things but I cannot seem to get the feedback right, I will appreciate any and all help and suggestions.
below is a simulation of the circuit from OrCad and also from falstad.i believe my trouble comes from the part circled in red.