I'm currently trying to simulate a PMSM DC motor with sensorless field-oriented control from scratch. I believe I have fixed my model (other than updating my PI controllers since adding senslorless FOC), but I'm now getting this nonlinear iteration error:
An error occurred while running the simulation and the simulation was terminated
Caused by:
- Solver encountered an error while simulating model 'PMSM_attempt_at_sensorless' at time 1.5027572535563431e-17 and cannot continue. Please check the model for errors.
- Nonlinear iteration is not converging with step size reduced to hmin (5.33887E-32) at time 1.50276E-17. Try reducing the minimum step size and/or relax the relative error tolerance.
Is something gaurunteed to be wrong with my model, or can this be fixed by simulation settings? I'm not expecting anyone to understand much of my design, but any general suggestions that could be relevant to this error would be much appreciated.
Edit: I used to have an algebriac loop error but I believe I have since fixed that and am only getting this non-linear error. As you can see, I'm using a derivative block to take the derivative for my rotor angle to get my rotor speed (without using the motor's operational equations for senslorless FOC). I've read derivative blocks can likely cause issues, so would this likely be the source of my problems?