# Plot Vout drift/stability of the voltage logged by using Hioki's RmLogger and DM7276
# Rev.1.1 (Sep. 28, 2022) Written by Takayuki HOSODA
#
# Arguments | Examples | Unit
# TARGET | 1W2D | Serial number
# NAME | F0101VR | Name of the DUT
# DATE | 2022-09-14 | year-month-day # 開始年月日
# TIME | 13:43:54 | hour:minute:second # 開始時刻
# XDIV | 1 | hour # 時間刻み 1 hr / div
# YDIV | 10e-6 | Volt # 電圧刻み 10 μV / div
# YNOM | 2.5 | Volt # 公称電圧 2.5 V
# TDIV | 1 | deg.C # 温度刻み 1 ℃ / div
# TNOM | 25 | deg.C # 公称温度 25 ℃
#
# Data format: Examples
# # date time Vout Ta
# 2 2022-09-15 02:10:44 +02.500002E+00 +25.06
#
reset
set encoding iso_8859_1
set grid
set style data lines
set key left Left
set key spacing 1.5
readdt(date, time)=(strptime('%Y-%m-%d', strcol(date)) + strptime('%H:%M:%S', strcol(time))) # 年月日・時刻データから秒への変換関数の定義
### Drift characteristics ###
#
set xrange [ * : * ] noreverse writeback
set xtics XDIV # Makefile から渡された引数 XDIV から xtics を設定
set xlabel "Elapsed time [hr]"
Vcenter = YNOM
Vdiv = YDIV
set yrange [ Vcenter - 10 * Vdiv : Vcenter + 10 * Vdiv ]
set ytics Vdiv
set format y "%6.5f"
set ylabel "{/Helvetica-Oblique V}_{out} [V] (".sprintf("%g", Vdiv * 1e6)."{/Symbol m}V / div, 100 PLC)"
set y2range [ 20.000 : 30.000 ]
set y2tics 1
set format y2 "%2.1f"
### DUT dependent
#
DUT = NAME." #".TARGET # . で文字列の連結
set terminal dumb # ダム端末へ表示
stats TARGET.".dat" u ($5):($4) # stats で $5, $4 を X, Y側データとして統計処理。統計結果は STATS_mean_y 等の変数で参照できるようになる
hr_0 = strptime('%Y-%m-%d', DATE) + strptime('%H:%M:%S', TIME) # strptime で秒に変換
set title "{/Helvetica-Oblique V}_{out} drift at room temperature (DUT : ".DUT.")"
set y2label "{/Helvetica-Oblique T}_{a} [\260C]"
set terminal postscript solid color enhanced # enhanced でギリシャ文字等が使えるようになる
set output TARGET.".ps" # ファイルのオープン
plot \
TARGET.".dat" u ((readdt(2, 3) - hr_0) / 3600):($5) axis x1y2 t "{/Helvetica-Oblique T}_{a}" lt 3,\
TARGET.".dat" u ((readdt(2, 3) - hr_0) / 3600):($4) t "{/Helvetica-Oblique V}_{out}" lt 1,\
STATS_mean_y t "{/Helvetica-Oblique V}_{/Symbol m} = ".sprintf("%7.7f", STATS_mean_y) lt 2,\ # Y側の平均値 STATS_mean_y を sprintf で文字列に変換
STATS_mean_y + 3 * STATS_stddev_y t "{/Helvetica-Oblique V}_{{/Symbol m \261} 3 {/Symbol s}} | {/Symbol s} = ".sprintf("%3.3g", STATS_stddev_y) lt 4,\
STATS_mean_y - 3 * STATS_stddev_y t "" lt 4 # STATS_mean_y は Y側の標準偏差
#set output
hr_elaps = GPVAL_DATA_X_MAX # GPVAL_DATA_X_MAX には最後に plot した X側データの最大値が入っている
### Stability in scatter graph ###
# 2ページめのプロットの準備
set xrange [ TNOM - 10 * TDIV : TNOM + 10 * TDIV ]
set yrange [ Vcenter - 10 * Vdiv : Vcenter + 10 * Vdiv ]
set xlabel "{/Helvetica-Oblique T}_{a} [\260C]"
set ylabel "{/Helvetica-Oblique V}_{out} [V] (10 {/Symbol m}V/div, 100 PLC)"
set xtics TDIV
set ytics Vdiv
set format y "%7.5f"
set y2label ""
unset y2tics
set title "{/Helvetica-Oblique V}_{out} stability at room temperature (for ".sprintf("%4.1f", hr_elaps)." hours, DUT : ".DUT.")"
set label 1 "{/Helvetica-Oblique V}_{/Symbol m} = ".sprintf("%7.7f", STATS_mean_y) at graph 0.05, graph 0.125 tc lt 3
set label 2 "{/Helvetica-Oblique V}_{/Symbol s} = ".sprintf("%3.3g", STATS_stddev_y) at graph 0.05, graph 0.075
set label 3 "{/Helvetica-Oblique T}_{/Symbol m} = ".sprintf("%5.2f", STATS_mean_x) at graph 0.45, graph 0.125 tc lt 3
set label 4 "{/Helvetica-Oblique T}_{/Symbol s} = ".sprintf("%3.3g", STATS_stddev_x) at graph 0.45, graph 0.075
set style data dot
#set terminal postscript solid color enhanced
#set output "stability".TARGET.".ps"
plot TARGET.".dat" u ($5):($4) t "{/Helvetica-Oblique V}_{out}"
set output # ファイルのクローズ
# EOF
|