[[RTAIの使い方]]

+ 時間応答実験用プログラム measure
+ 時間応答実験用プログラム measure(A/Dの 0 ch に入力された電圧を記録する)
-- 作業後のディレクトリ: [[/usr/src/rtai/showroom/v3.x/kern/measure/>/:RTAI/measure/]]
&br;
++ コンパイル
 # cd /usr/src/rtai/showroom/v3.x/kern/freqresp
 # mkdir data
 (必要に応じて、measure.h の SAMPLING_PERIOD と RECORDING_SAMPLES を変更。)
 # make clean
 # make
++ 実行
 # ../ldmod
 # /sbin/insmod freqresp_module_rt.ko
 # ./freqresp_app
 (2ch 分の周波数応答が出力されるが,一方がゲインがほぼ1, 位相が0になっていることを確認する)
 # rmmod _freqresp_module_rt
 # ../remod
 ERROR: Module rtai_mq does not exist in /proc/modules
 ERROR: Module rtai_lxrt does not exist in /proc/modules
 ERROR: Module rtai_smp does not exist in /proc/modules
 ERROR: Module rtai_mup does not exist in /proc/modules
 ERROR: Module rtai_up does not exist in /proc/modules
 (insmod していない module を rmmod しようとしてエラーになってるだけなので問題なし)
 # rmmod rtai_sched
 # rmmod rtai_hal
 # ./run
 説明に応じて、リターンキーを押すと先に進む。
 測定結果は result.dat に格納される。1列目が時間、2列目がアナログ入力電圧。

- RTLinux版とRTAI版の比較
&br;
 
| |RTLinux 版|RTAI版|
|period(実行周期を記録する)|[[period.h>/:RTAI/period.h]]|[[period.h>/:RTAI/period/period.h]]|
||[[period_module.c>/:RTAI/period_module.c]]|[[period_module.c>/:RTAI/period/period_module.c]]|
||[[period_app.c>/:RTAI/period_app.c]]|[[period_app.c>/:RTAI/period/period_app.c]]|
|period_da(DAボードから矩形波を出力する)|period.h(同上)|period.h(同上)|
||[[period_da_module.c>/:RTAI/period_da_module.c]]|[[period_da_module.c>/:RTAI/period_da/period_da_module.c]]|
||period_app.c(同上)|period_app.c(同上)|
||[[adc.h>/:RTAI/adc.h]]|[[adc.h>/:RTAI/period_da/adc.h]]|
||[[adc.c>/:RTAI/adc.c]]|[[adc.c>/:RTAI/period_da/adc.c]]|
|freqresp(周波数応答実験)|[[freqresp.h>/:RTAI/freqresp.h]]|[[freqresp.h>/:RTAI/freqresp/freqresp.h]]|
||[[freqresp_module.c>/:RTAI/freqresp_module.c]]|[[freqresp_module.c>/:RTAI/freqresp/freqresp_module.c]]|
||[[freqresp_app.c>/:RTAI/freqresp_app.c]]|[[freqresp_app.c>/:RTAI/freqresp/freqresp_app.c]]|

- プログラム作成の参考資料:
-- [[RTAI3.4 User Manual rev 0.3>https://www.rtai.org/index.php?module=documents&JAS_DocumentManager_op=downloadFile&JAS_File_id=46]]
-- [[RTAI API Documentation>https://www.rtai.org/documentation/magma/html/api/]]


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS