Back calculating Ki from test data
古いコメントを表示
Hello,
I have a simple PI loop that I am tying to back calculate Ki using test data. From the loop, Ki is given by the below equation:
[Current Trim Value - Previous Trim Value] / Error*Kp*Ts. I have test data for the Error and Trim in the form or an m x 1 array. Any idea ow I can do this? The main challenge I am having is how to calculate [Current Trim Value - Previous Trim Value] from the data. I tried using the following for loop to do it, but I get an error saying "Array inddices must be positive integers or logical values"
for j = 1: length(TrimArray)
Ki(j) = [TrimArray(j) - TrimArray(j-1)] / Error(j)*Kp*Ts
end
I see why I get that error I'm getting because at J = 1, you can have index number = 0. Note that TrimArray and Error are test data recorded at 50Hz.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!