I am trying to implement an ideal PWM controller in for an analog circuit I have in ORcad PSpice. Ideally I would use the SLPS tool for simulink, but unfortunatelly we do not have the licence for it so I have to look for a workarround.
The circuit is a Half-Bridge amplifier which gets four PWM signals to control the two transistors (two signas turn on the mosfets, and the two other turn them off and keep them that way). So what I would like is for the PID to give a control signal from 0 to 1 V or something like that and for that voltage level to control the duty cycles of the four square wave generators I have or to somehow make the PWMs I need. Something like if the PID signal is 0.4V the duty cycle is 40% (0.4). I tried something like in the image, but I get the following error:
.PARAM vin=2.5 t_tot=1.5us freq=32k t={1/freq} d={v(v_duty)}
--------------------------------------------------$
ERROR(ORPSIM-16131): Expression - use previously defined parameters only
Can anyone help me with this? It is for my master thesis.
Cheers, Camilo
edit: it was suggested to use a comparator. Unfortunatelly that does not solve the issue in my case as that way I would have only one PWM, I need to generate something like this:
the comparator idea (as I understand it) would only work for both "off" signals. The full period of all signals is 32 kHz, the duty clycle of both off signals is the same and could be generated by the comparator. The on signals have one 1.5 us pulse (the top is always 0V with a 5V pulse, the bottom is the contrary) and the pulse kicks in after the deadtime (1.5 us) has passed (deadtime starts on a flank of the off signal)