MPC linearization error: "NaN's cannot be converted to logicals"

7 次查看(过去 30 天)
I have an XT28 model. I have tried to add a MPC controller (MPC toolbox) to one of the legs.
In the wheel2roadConnection block (green text) there is a sensing block.
During compilation, 1.0e-05 and -1.0e-05 (in pair) are sent from the sensing block to the wx, wy, vx and vy inputs of the forces block. I printed the value of these signals using a matlab function. These signals eventually reach the slipvel subsystem
The signals does NOT change even if there is a gain or square block. When it comes to the sqrt in the slipvel subsystem, a NaN error occurs due to trying to take the square root of a negative value.
I tried the MPC toolbox with another simple model. I added a sqrt block to the mv port of the MPC and got the same error (during compilation, the pair of -1e-05 and 1e-05 is sent out from the mv port of the MPC and I cant change these values).
Without the MPC toolbox the value of the signals gets changed correctly when it enters for example a square block or gain block.
I use the version: MATLAB R2019b
Do anyone know why I get this problem when I use the MPC toolbox?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Controller Creation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by