Good afternoon,
I am trying to implement some fault detection using the submenu “Protection” on PLECS Coder. After defining the analog input and the threshold, I moved to real tests. I used a Powerstage block to shut down all my PWMs when a fault is detected. I use a GBF on the analog input and raise the voltage close to the threshold. I measured the PWM output with an oscilloscope and I saw that the PWM is shut down before the ADC input reaches the fixed threshold.
I also display the voltage measured by the ADC and the result is the same: the Powerstage block is triggered before the input voltage reaches the protection threshold.
To give some context, I fixed my threshold to 1.5V. When my GBF reaches 1.45V, the Powerstage shuts down all the PWMs and the ADC measures a voltage of 1.45V and not the 1.5V fixed.
Is there a solution to solve this problem?