i gain of PID controller has nan value.(simulink)

24 visualizaciones (últimos 30 días)
Daehee Lim
Daehee Lim el 20 de Mayo de 2020
Comentada: 勇刚 张 el 19 de Mayo de 2022
I'm controlling a segway with PID controller and I have a problem about PID controller block.
From the pic above, input of PID controller block(PI controller is in the picture, however, all controllers which contains integral gain have the same problem) is non nan value, however, the output of PID controller is nan.
I checked all data types and there are no problems.
Two inputs of Pitch controller is from the attitude of my hardware and they are also normal integer.
I don't know why the output of PID controller is nan value.
Also, when I change the input of pitch_angle into constant block(e.g. 0.1318), PID has normal value.
How can I solve my problem?
  1 comentario
Arkadiy Turevskiy
Arkadiy Turevskiy el 7 de Oct. de 2020
Strange. Hard to troubleshoot without your model. Can you please contact tech support?

Iniciar sesión para comentar.

Respuestas (1)

Ankur Bose
Ankur Bose el 28 de Sept. de 2021
This can be happening if for an initial brief period of time, any one of the inputs to PID was NaN. Even though the input values might have been fixed to some proper values, the PID block stores the states and hence you still see NaN.
Couple of ways to fix this
  1. Ensure that initial inputs are not NaN. in PX4 thing might happen when you are trying to read from vehicle attitude connected to rotation block. Initially the estimator might not have started which caues attitude not to be published and hence uORB block retutns [0 0 0 0] as quat which are invalid and hence rotation block computes NaN and passes to PID. Eventually this might be fixed but PID will still store NaN.
  2. Reset the PID block using and external signal when values are stored

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by