Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

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

シミュレーションでは多くの場合、さまざまな開発段階で異なる忠実度が必要になります。ラピッドプロトタイピング段階では、パラメーターの実験と調整を迅速に行い、さまざまな自律アルゴリズムをテストすることが好まれます。製造開発段階では、忠実度の高いモデルに対するアルゴリズムの検証を行います。この例では、Guidance Model ブロックによって高忠実度モデルを近似し、それを使用してウェイポイント追従ナビゲーション システムのプロトタイプ作成と調整を行う方法について説明します。Tuning Waypoint Follower for Fixed-Wing 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);

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

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

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);
### Starting serial model reference simulation build.
### Successfully updated the model reference simulation target for: PlantModel
### Successfully updated the model reference simulation target for: FixedWingModel

Build Summary

Simulation targets built:

Model           Action                        Rebuild Reason                             
=========================================================================================
PlantModel      Code generated and compiled.  PlantModel_msf.mexa64 does not exist.      
FixedWingModel  Code generated and compiled.  FixedWingModel_msf.mexa64 does not exist.  

2 of 2 models built (0 models already up to date)
Build duration: 0h 1m 5.1302s
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);
### Starting serial model reference simulation build.
### Successfully updated the model reference simulation target for: FixedWingModel

Build Summary

Simulation targets built:

Model           Action                        Rebuild Reason                            
========================================================================================
FixedWingModel  Code generated and compiled.  Model or library FixedWingModel changed.  

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 17.372s
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);
### Starting serial model reference simulation 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 2.5036s
lowFidelityAirSpeed = AirSpeed.Data(:);
lowFidelityTime = AirSpeed.Time;

assignin(plantDataSet, 'useHighFidelity', 1);

sim(stepModel);
### Starting serial model reference simulation build.
### Model reference simulation target for PlantModel is up to date.
### Successfully updated the model reference simulation target for: FixedWingModel

Build Summary

Simulation targets built:

Model           Action                        Rebuild Reason                                                          
======================================================================================================================
FixedWingModel  Code generated and compiled.  Variant control useHighFidelity == 1 value changed from false to true.  

1 of 2 models built (1 models already up to date)
Build duration: 0h 0m 26.633s
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);
### Starting serial model reference simulation build.
### Successfully updated the model reference simulation target for: FixedWingModel

Build Summary

Simulation targets built:

Model           Action                        Rebuild Reason                                                          
======================================================================================================================
FixedWingModel  Code generated and compiled.  Variant control useHighFidelity == 1 value changed from true to false.  

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

assignin(plantDataSet, 'useHighFidelity', 1);

sim(stepModel);
### Starting serial model reference simulation build.
### Model reference simulation target for PlantModel is up to date.
### Successfully updated the model reference simulation target for: FixedWingModel

Build Summary

Simulation targets built:

Model           Action                        Rebuild Reason                                                          
======================================================================================================================
FixedWingModel  Code generated and compiled.  Variant control useHighFidelity == 1 value changed from false to true.  

1 of 2 models built (1 models already up to date)
Build duration: 0h 0m 25.396s
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" ブロックによって高忠実度モデルを近似したので、Tuning Waypoint Follower for Fixed-Wing UAVの例でこれを UAV Guidance Model ブロックに置き換えてみることができます。異なる忠実度をもつこれらのモデルに対して、前方注視距離および機首方位制御ゲインの影響をテストします。

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

sim(navigationModel);
### Starting serial model reference simulation build.
### Successfully updated the model reference simulation target for: FixedWingModel

Build Summary

Simulation targets built:

Model           Action                        Rebuild Reason                                                          
======================================================================================================================
FixedWingModel  Code generated and compiled.  Variant control useHighFidelity == 1 value changed from true to false.  

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

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

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

assignin(plantDataSet,'useHighFidelity',1);

sim(navigationModel);
### Starting serial model reference simulation build.
### Model reference simulation target for PlantModel is up to date.
### Successfully updated the model reference simulation target for: FixedWingModel

Build Summary

Simulation targets built:

Model           Action                        Rebuild Reason                                                          
======================================================================================================================
FixedWingModel  Code generated and compiled.  Variant control useHighFidelity == 1 value changed from false to true.  

1 of 2 models built (1 models already up to date)
Build duration: 0h 0m 26.705s
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);

参考

| |

関連するトピック