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

조회 수: 24 (최근 30일)
Daehee Lim
Daehee Lim 2020년 5월 20일
댓글: 勇刚 张 2022년 5월 19일
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
Arkadiy Turevskiy
Arkadiy Turevskiy 2020년 10월 7일
Strange. Hard to troubleshoot without your model. Can you please contact tech support?

댓글을 달려면 로그인하십시오.

답변 (1개)

Ankur Bose
Ankur Bose 2021년 9월 28일
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
  댓글 수: 1
勇刚 张
勇刚 张 2022년 5월 19일
your answer is good for me!
Out of PID is normal.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 PID Controller Tuning에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by