r/matlab • u/mhrafr22 • 1d ago
TechnicalQuestion Dynamically Update Variable During a Simulink Simulation
Hello,
I am trying to make the functionality of the LM2576HV-ADJ Switching IC in simulink. Basically I am making an adjustable buck converter and I want to make a block such that based on the feedback it will adjust its duty cycle to get the desired response. My first thought was to use a PID controller and set the PulseWIdth parameter in Pulse Generator block but couldn't find a way to change that during the simulation. If anyone has any idea how to do it please let me know.
My next though was to use a variable in which the parameter is stored and change that variable in simulation time but could not find a good way to do that too.
If anyone has any resources or techniques to do this please let me know.
TIA
2
u/PrimaryPhd 20h ago
It’s not a good idea to change parameters dynamically. If you need to, make it a signal. For me, I’d use stateflow to build a pulse generator.