Main Content

スキッドパッド テストの生成

この例では、Formula Student、Formula SAE、その他の組織が主催している国際的な学生コンペティションのイベントと同様の、スキッドパッド テストのシミュレーションを行う方法を説明します。これらのイベントでは、学生チームは各自が設計した車両の作成、操縦、プレゼンテーションを行います。

この例では、車両は停止状態から始動し、その後に次を行います。

  1. 加速してコースに進入する

  2. 時計回りに 2 ラップを完走する

  3. ステアリング方向を反転する

  4. 反時計回りに 2 ラップを完走する

  5. コースから出て、ブレーキをかけて停止する

モデルを開く

このスキッドパッド モデルには、参照パス、ドライバー、車両、および可視化支援が含まれています。モデルを開くには、次のコマンドを使用します。

open_system('vdynblksskidpad');

モデルのワークスペース変数 TrackPoints には、参照姿勢の定義に使用する参照ウェイポイントが含まれます。これらを編集したり、独自のウェイポイントに置き換えたりすることができます。ウェイポイントをプロットするには、次のコードを使用します。

mdlWks = get_param('vdynblksskidpad','ModelWorkspace');
TrackPoints = evalin(mdlWks,'TrackPoints');
figure;
plot(TrackPoints(:,2),TrackPoints(:,1),'ro-')
hold on
arrowLen = 1.5;
quiver(TrackPoints(:,2),TrackPoints(:,1),arrowLen*sin(TrackPoints(:,3)),arrowLen*cos(TrackPoints(:,3)),'b','LineWidth',1,'MaxHeadSize',arrowLen)
box on
grid on
xlabel('Y [m]')
ylabel('X [m]')
axis equal
legend('Waypoints','Path Direction')

Figure contains an axes object. The axes object with xlabel Y [m], ylabel X [m] contains 2 objects of type line, quiver. These objects represent Waypoints, Path Direction.

既定の車両パスは、コースの中心線に従います。車両は複数のラップを完走するため、いくつかの X、Y の点が重複します。Skidpad Reference サブシステムにあるブロックを使用して、ラップ数やスケーリングなどの係数を変更できます。また、パス ポイントを使用して実験を行い、ラップ タイムを改善することもできます。

モデルのシミュレーション

モデルを実行して、コースを完走する車両を観測するには、次のコマンドを使用します。

sim('vdynblksskidpad');

Figure Vehicle Position contains an axes object. The axes object with xlabel Y Distance [m], ylabel X Distance [m] contains 7 objects of type line, patch. One or more of the lines displays its values using only markers

Figure G-diagram contains an axes object. The axes object with xlabel Lateral Acceleration [G], ylabel Longitudinal Acceleration [G] contains 24 objects of type patch.

既定では、シミュレーション中に、車両の参照パスとシミュレートされるパスを示す上面図と加速度図が開き、更新されます。ラップ タイムが推定され、Display ブロックによりモデルの最上位に順番に表示されます。

車両は、Vehicle Dynamics Blockset ライブラリのブロックを使用して、2 つのバリアント サブシステム、Simulink Physics または Game Engine Physics のいずれかとしてモデル化できます。車両タイプを設定するには、Formula Student Vehicle ブロックをダブルクリックして、[Vehicle Type] リストから選択します。プログラムにより車両タイプを設定するには、set_param コマンドを使用します。

既定では、Simulink Physics の設定は理想的なパワートレイン、動力伝達装置、タイヤ、シャシーなど、複数のサブシステムおよびコンポーネントを含む 7DOF 車両を使用します。Game Engine Physics の設定には類似のパラメーターがありますが、シミュレーション 3D インターフェイスを使用して、事前定義された車両テンプレートの動的応答を構成して解きます。2 つの設定ではタイヤ モデルとソルバー エンジンが異なるため、結果に差異があることが予測されます。モデル化と可視化での優先事項に基づき設定を選択します。

ゲーム エンジンの車両を使用するようにモデルを設定するには、次のコマンドを使用します。

vehType = "Game Engine Physics"
vehType = 
"Game Engine Physics"
% set_param( 'vdynblksskidpad/Formula Student Vehicle','vehType',vehType);

3D 可視化の有効化

3D 可視化環境でモデルを実行する前に、Unreal Engine Simulation Environment Requirements and Limitationsを確認します。3D 可視化を有効にするには、次のコマンドを使用します。

 set_param('vdynblksskidpad/Visualization/3D Visualization','engine3D','Enabled - Simulink 3D Vehicle')
 

コーンとスキッドパッド車線境界線テクスチャを追加するには、次を使用します。

set_param('vdynblksskidpad/Visualization/3D Visualization','conesOn','on');

タイヤの力、車両、および動力伝達装置の注釈を含めるには、次を使用します。

set_param('vdynblksskidpad/Visualization/3D Visualization','annotOn','on');

それでは、シミュレーションを実行します。

sim('vdynblksskidpad');
Warning: The published message size 231 more than the declared size 222 of the topic publisher 'AnnotationActor3/AnnotationConfiguration_OUT'. Updating the publisher QOS.
Warning: The published message size 232 more than the declared size 231 of the topic publisher 'AnnotationActor3/AnnotationConfiguration_OUT'. Updating the publisher QOS.
Warning: The published message size 233 more than the declared size 232 of the topic publisher 'AnnotationActor3/AnnotationConfiguration_OUT'. Updating the publisher QOS.
Warning: The published message size 234 more than the declared size 233 of the topic publisher 'AnnotationActor3/AnnotationConfiguration_OUT'. Updating the publisher QOS.
Warning: The published message size 235 more than the declared size 234 of the topic publisher 'AnnotationActor3/AnnotationConfiguration_OUT'. Updating the publisher QOS.

Figure G-diagram contains an axes object. The axes object with xlabel Lateral Acceleration [G], ylabel Longitudinal Acceleration [G] contains 24 objects of type patch.

Figure Vehicle Position contains an axes object. The axes object with xlabel Y Distance [m], ylabel X Distance [m] contains 7 objects of type line, patch. One or more of the lines displays its values using only markers

3D 可視化エンジンを使用する場合、Simulink 3D Animation でコーンを配置して、スキッド パッド コースをより細かく定義できます。Simulation 3D Actor ブロックの初期化スクリプトにより、コーンの配置を調整できます。

参考

| (Simulink 3D Animation)

関連するトピック