Error in the PID blocks (Integrator doesn't accept initial condition?!)
Show older comments
Hello,
I have this error when i run the simulation in Matlab about some block to design a PID.

But i created a variable in workspace with initial condition ci_int_Tetha=0

I don't understand why it happen this error?
I have also decrease the sample time at the sin waveform like input to 1*10-6, but nothing is still present.
Thanks
Best Regards
5 Comments
Sam Chak
on 18 Feb 2025
Could you show the block diagram of the altitude control system? The error seems to be caused by a non-finite value at the very beginning of the simulation, which may indicate that your chosen initial values are the root cause.
Enrico Alessandro
on 18 Feb 2025
Sam Chak
on 18 Feb 2025
I cannot determine which state of the two integrators in the Subsystem PID theta block is generating the error. You need to click on the message so that the problematic integrator becomes highlighted. However, I suspect the error is caused by incorrect modeling of the equations inside the Logic Altitude Control Function block.
By the way, it is possible to set the initial conditions for the PID controller block; however, I usually leave them in default mode, as they generally do not lead the system to instability or divergence.

Enrico Alessandro
on 18 Feb 2025
Sam Chak
on 18 Feb 2025
Good job, @Enrico Alessandro! We have identified that the integrator in the integral action produced the error. This allows us to trace the incoming signal back to the second input port of the Subsystem block, which represents the difference between the theta_d and theta_uav signals.
If theta_d is a constant desired setpoint, then, through logical reasoning, the theta_uav signal must be carrying the non-finite value, thus stopping the simulation. Therefore, I need you to investigate the source of the theta_uav signal.

Answers (0)
Categories
Find more on Real-Time PID Autotuning in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


