メインコンテンツ

UAV Guidance Model ブロックによる高忠実度 UAV モデルの近似

シミュレーションでは多くの場合、さまざまな開発段階で異なる忠実度が必要になります。ラピッドプロトタイピング段階では、パラメーターの実験と調整を迅速に行い、さまざまな自律アルゴリズムをテストすることが好まれます。製造開発段階では、忠実度の高いモデルに対するアルゴリズムの検証を行います。

この例では、Guidance Model ブロックによって高忠実度モデルを近似し、それを使用してウェイポイント追従ナビゲーション システムのプロトタイプ作成と調整を行う方法について説明します。固定翼 UAV 用のウェイポイント追従コントローラーの調整を参照してください。高忠実度モデルに対して同じナビゲーション システムをテストし、そのパフォーマンスを検証しています。

このモデル例では、プラント モデルおよび中程度の組み込み自動操縦で構成される、高忠実度の無人航空機 (UAV) モデルを使用しています。このモデルには 1000 近いブロックが含まれており、その作業はかなり複雑です。開発プロセスの第 1 段階として、この高忠実度モデルと UAV Guidance Model ブロックとの切り替えが可能なバリアント システムを作成しました。高忠実度モデルは、File Exchange エントリの Simulink Drone Reference Application から抽出しました。

異なる忠実度の UAV モデル

uavModel = 'FixedWingModel.slx';
open_system(uavModel);

このモデルに関連付けられているデータ ディクショナリに保存された MATLAB® 変数の値を変更することにより、低忠実度モデルと高忠実度モデルを切り替えることができます。

plantDataDictionary = Simulink.data.dictionary.open('pathFollowingData.sldd');
plantDataSet = getSection(plantDataDictionary,'Design Data');

% Switch to high-fidelity model
assignin(plantDataSet,'useHighFidelity',1);

High fidelity UAV subsystem with control input and state output

% Switch to low-fidelity model
assignin(plantDataSet,'useHighFidelity',0);

Low fidelity UAV subsystem with control input and state output

低忠実度ガイダンス モデルによる高忠実度固定翼モデルの近似

UAV Guidance Model ブロックによって高忠実度モデルを近似するには、モデルに入力するためのステップ制御信号を作成して、RollAngleHeight、および AirSpeed の各コマンドに対するステップ応答を観察します。

stepModel = 'stepResponse';
open_system(stepModel)

まず、ロール角の変更を指示します。

controlBlock = get_param('stepResponse/Step Control Input','Object');
controlBlock.StepControl = 'RollAngle Step Control';

assignin(plantDataSet,'useHighFidelity',1);

sim(stepModel);
### Searching for referenced models in model 'stepResponse'.
### Total of 2 models to build.
### Starting serial model build.
### Model reference simulation target for PlantModel is up to date.
### Model reference simulation target for FixedWingModel is up to date.

Build Summary

0 of 2 models built (2 models already up to date)
Build duration: 0h 0m 19.999s
highFidelityRollAngle = RollAngle.Data(:);
highFidelityTime = RollAngle.Time;

figure()
plot(highFidelityTime, highFidelityRollAngle,'--r');
title('Roll Angle Step Response')

Figure contains an axes object. The axes object with title Roll Angle Step Response contains an object of type line.

上のシミュレーション結果にズームインすると、高忠実度モデルに組み込まれたロール角コントローラーの特性がわかります。ロール角の整定時間は約 2.5 秒です。

xlim([75 80])
ylim([-0.1 0.548])

Figure contains an axes object. The axes object with title Roll Angle Step Response contains an object of type line.

2 次 PD コントローラーの場合、臨界減衰系でこの整定時間を実現するには、次のゲインを使用して、UAV モデルの低忠実度バリアント内にある UAV Guidance Model ブロックを構成する必要があります。この例では、複数回の実行速度を上げるために、"UAV Guidance Model" ブロックのシミュレーションにコード生成を使用しています。ブロック パラメーターを確認します。

zeta = 1.0; % critically damped
ts = 2.5; % 2 percent settling time
wn = 5.8335/(ts*zeta);
newRollPD = [wn^2 2*zeta*wn];

新規のゲインを設定して、低忠実度モデルのステップ応答のシミュレーションを実行します。これを元の応答と比較します。

load_system(uavModel)
set_param('FixedWingModel/FixedWingModel/LowFidelity/Fixed Wing UAV Guidance Model',...
    'PDRollFixedWing',strcat('[',num2str(newRollPD),']'))
save_system(uavModel)

assignin(plantDataSet, 'useHighFidelity', 0);

sim(stepModel);
### Searching for referenced models in model 'stepResponse'.
### Total of 1 models to build.
### Starting serial model build.
### Successfully updated the model reference simulation target for: FixedWingModel

Build Summary

Model reference simulation targets:

Model           Build Reason                              Status                        Build Duration
======================================================================================================
FixedWingModel  Model or library FixedWingModel changed.  Code generated and compiled.  0h 0m 24.619s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 25.204s
lowFidelityRollAngle = RollAngle.Data(:);
lowFidelityTime = RollAngle.Time;

hold on;
plot(lowFidelityTime, lowFidelityRollAngle,'-b');
legend('High-Fidelity Response', 'Low-Fidelity Response', 'Location','southeast');

Figure contains an axes object. The axes object with title Roll Angle Step Response contains 2 objects of type line. These objects represent High-Fidelity Response, Low-Fidelity Response.

低忠実度モデルは同様なステップ応答を実現しています。同様に、他の 2 つの制御チャネル HeightAirSpeed を調整できます。ここでは、制御応答を目視で検証する代わりに、より高度な方法を使用して制御ゲインを最適化できます。高忠実度の UAV モデルの動作解析をさらに進めるには、System Identification Toolbox® の使用を検討してください。

controlBlock.StepControl = 'AirSpeed Step Control';
assignin(plantDataSet, 'useHighFidelity', 0);

sim(stepModel);
### Searching for referenced models in model 'stepResponse'.
### Total of 1 models to build.
### Starting serial model build.
### Model reference simulation target for FixedWingModel is up to date.

Build Summary

0 of 1 models built (1 models already up to date)
Build duration: 0h 0m 1.7137s
lowFidelityAirSpeed = AirSpeed.Data(:);
lowFidelityTime = AirSpeed.Time;

assignin(plantDataSet, 'useHighFidelity', 1);

sim(stepModel);
### Searching for referenced models in model 'stepResponse'.
### Total of 2 models to build.
### Starting serial model build.
### Model reference simulation target for PlantModel is up to date.
VarDim N, SF N, concat N, TLC YVarDim N, SF N, concat N, TLC YVarDim N, SF N, concat N, TLC YVarDim N, SF N, concat N, TLC Y### Successfully updated the model reference simulation target for: FixedWingModel

Build Summary

Model reference simulation targets:

Model           Build Reason                                                            Status                        Build Duration
====================================================================================================================================
FixedWingModel  Variant control useHighFidelity == 1 value changed from false to true.  Code generated and compiled.  0h 0m 31.406s 

1 of 2 models built (1 models already up to date)
Build duration: 0h 0m 38.299s
highFidelityAirSpeed = AirSpeed.Data(:);
highFidelityTime = AirSpeed.Time;

figure()
plot(lowFidelityTime, lowFidelityAirSpeed,'-b');
hold on;
plot(highFidelityTime, highFidelityAirSpeed,'--r');
legend('Low-Fidelity Response', 'High-Fidelity Response', 'Location','southeast');
title('Air Speed Step Response')
xlim([70 80])
ylim([17.5 19.2])

Figure contains an axes object. The axes object with title Air Speed Step Response contains 2 objects of type line. These objects represent Low-Fidelity Response, High-Fidelity Response.

controlBlock.StepControl = 'Height Step Control';
assignin(plantDataSet, 'useHighFidelity', 0);

sim(stepModel);
### Searching for referenced models in model 'stepResponse'.
### Total of 1 models to build.
### Starting serial model build.
### Successfully updated the model reference simulation target for: FixedWingModel

Build Summary

Model reference simulation targets:

Model           Build Reason                                                            Status                        Build Duration
====================================================================================================================================
FixedWingModel  Variant control useHighFidelity == 1 value changed from true to false.  Code generated and compiled.  0h 0m 19.668s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 20.106s
lowFidelityHeight = Height.Data(:);
lowFidelityTime = Height.Time;

assignin(plantDataSet, 'useHighFidelity', 1);

sim(stepModel);
### Searching for referenced models in model 'stepResponse'.
### Total of 2 models to build.
### Starting serial model build.
### Model reference simulation target for PlantModel is up to date.
VarDim N, SF N, concat N, TLC YVarDim N, SF N, concat N, TLC YVarDim N, SF N, concat N, TLC YVarDim N, SF N, concat N, TLC Y### Successfully updated the model reference simulation target for: FixedWingModel

Build Summary

Model reference simulation targets:

Model           Build Reason                                                            Status                        Build Duration
====================================================================================================================================
FixedWingModel  Variant control useHighFidelity == 1 value changed from false to true.  Code generated and compiled.  0h 0m 29.576s 

1 of 2 models built (1 models already up to date)
Build duration: 0h 0m 36.618s
highFidelityHeight = Height.Data(:);
highFidelityTime = Height.Time;

figure()
plot(lowFidelityTime, lowFidelityHeight,'-b');
hold on;
plot(highFidelityTime, highFidelityHeight,'--r');
legend('Low-Fidelity Response', 'High-Fidelity Response', 'Location','southeast');
title('Height Step Response')
xlim([70 150])
ylim([49 56])

Figure contains an axes object. The axes object with title Height Step Response contains 2 objects of type line. These objects represent Low-Fidelity Response, High-Fidelity Response.

低忠実度モデルによるナビゲーション アルゴリズムのテスト

"UAV Guidance Model" ブロックによって高忠実度モデルを近似したので、固定翼 UAV 用のウェイポイント追従コントローラーの調整の例でこれを UAV Guidance Model ブロックに置き換えてみることができます。異なる忠実度をもつこれらのモデルに対して、前方注視距離および機首方位制御ゲインの影響をテストします。

navigationModel = 'pathFollowing';
open_system(navigationModel);
assignin(plantDataSet,'useHighFidelity',0);

sim(navigationModel);
### Searching for referenced models in model 'pathFollowing'.
### Total of 1 models to build.
### Starting serial model build.
### Successfully updated the model reference simulation target for: FixedWingModel

Build Summary

Model reference simulation targets:

Model           Build Reason                                                            Status                        Build Duration
====================================================================================================================================
FixedWingModel  Variant control useHighFidelity == 1 value changed from true to false.  Code generated and compiled.  0h 0m 29.41s  

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 29.852s
figure
visualizeSimStates(simStates);

Figure contains an axes object. The axes object contains 204 objects of type patch, line.

高忠実度モデルによる検証

assignin(plantDataSet,'useHighFidelity',1);

sim(navigationModel);
### Searching for referenced models in model 'pathFollowing'.
### Total of 2 models to build.
### Starting serial model build.
### Model reference simulation target for PlantModel is up to date.
VarDim N, SF N, concat N, TLC YVarDim N, SF N, concat N, TLC YVarDim N, SF N, concat N, TLC YVarDim N, SF N, concat N, TLC Y### Successfully updated the model reference simulation target for: FixedWingModel

Build Summary

Model reference simulation targets:

Model           Build Reason                                                            Status                        Build Duration
====================================================================================================================================
FixedWingModel  Variant control useHighFidelity == 1 value changed from false to true.  Code generated and compiled.  0h 0m 44.879s 

1 of 2 models built (1 models already up to date)
Build duration: 0h 1m 2.9506s
figure
visualizeSimStates(simStates);

Figure contains an axes object. The axes object contains 204 objects of type patch, line.

まとめ

この例では、低忠実度での固定翼 UAV 抽象化を使用して、高忠実度モデルを近似できる方法を示しました。同様に、逆のアプローチを使用して、高忠実度モデルの自動操縦制御ゲインの選択に役立てることもできます。まず、さまざまなテスト シナリオで低忠実度モデルのシミュレーションを実行することにより、自動操縦の制御応答について許容される特性を決定してから、それに応じて高忠実度モデルの自動操縦を調整できます。

discardChanges(plantDataDictionary);
clear plantDataSet
clear plantDataDictionary
close_system(uavModel, 0);
close_system(stepModel, 0);
close_system(navigationModel, 0);

参考

| |

トピック