0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

概要

TunerStudioを、究める。
一から、iniファイルを作ってみる。

一から、iniファイルを作ってみる手順

やり取りするデータを決める。

オフセット (Byte) サイズ (Byte) データ型 チューナーズスタジオ側変数名 説明 / 単位
0 ~ 1 2 U16 ENGINE_RPM エンジン回転数 (RPM)
2 ~ 5 4 F32 CURR_TDC_POS 現在の上死点位置 (deg)
6 ~ 9 4 F32 NEXT_IGN_TIMING 次回点火時期 (deg BTDC)
10 ~ 13 4 F32 IGN_DWELL_TIME_MS 点火通電時間 (ms)
14 ~ 17 4 F32 INJ_START_ANGLE 噴射開始時期 (deg ATDC)
18 ~ 21 4 F32 INJ_DURATION_MS 燃料噴射時間 (ms)
22 ~ 23 2 U16 AIR_FLOW_RAW エアフローセンサー生値 (ADC)
24 ~ 25 2 U16 CLT_TEMP_RAW 水温センサー生値 (ADC)
26 ~ 27 2 U16 TPS_RAW スロットル開度生値 (ADC)
28 ~ 29 2 U16 MAP_RAW 吸気圧センサー生値 (ADC)
30 ~ 31 2 U16 BATT_VOLT_RAW バッテリー電圧生値 (ADC)
32 ~ 33 2 U16 O2_SENS_RAW O2センサー生値 (ADC)
34 ~ 35 2 U16 statusFlags ステータスフラグ(下記ビットフィールド)
36 ~ 39 4 - (予約領域) 残り4バイト(サイズ40に合わせる空き)

statusFlags (オフセット34) のビット割り当て

  • Bit 0: CRANK_PULSE_IN (クランクパルス入力)
  • Bit 1: INJ_DRV (インジェクター駆動)
  • Bit 2: IGN_DRV (イグニッション駆動)
  • Bit 3: ISV_CW_OPEN (アイドルバルブ正転・開)
  • Bit 4: ISV_CCW_CLOSE (アイドルバルブ逆転・閉)
  • Bit 5: STATUS_LED (ステータスLED)
  • Bit 6: FUEL_PUMP_DRV (燃料ポンプ駆動)

iniファイルを書く。

セクション[OutputChannels]は、リアルタイム受信データの対応表です。
セクション[TunerStudio]は、signatureを書くところ。

[TunerStudio]
    queryCommand    = "F"
    signature       = "MShift v0.01"
[OutputChannels]
    ochGetCommand   = "O"
    ochBlockSize    = 40 
    ENGINE_RPM          = scalar, U16,   0, "RPM",      1.0, 0.0
    CURR_TDC_POS        = scalar, F32,   2, "deg",      1.0, 0.0
    NEXT_IGN_TIMING     = scalar, F32,   6, "deg BTDC", 1.0, 0.0
    IGN_DWELL_TIME_MS   = scalar, F32,  10, "ms",       1.0, 0.0
    INJ_START_ANGLE     = scalar, F32,  14, "deg ATDC", 1.0, 0.0
    INJ_DURATION_MS     = scalar, F32,  18, "ms",       1.0, 0.0
    AIR_FLOW_RAW        = scalar, U16,  22, "ADC",      1.0, 0.0
    CLT_TEMP_RAW        = scalar, U16,  24, "ADC",      1.0, 0.0
    TPS_RAW             = scalar, U16,  26, "ADC",      1.0, 0.0
    MAP_RAW             = scalar, U16,  28, "ADC",      1.0, 0.0
    BATT_VOLT_RAW       = scalar, U16,  30, "ADC",      1.0, 0.0
    O2_SENS_RAW         = scalar, U16,  32, "ADC",      1.0, 0.0
    statusFlags         = scalar, U16,  34, "",         1.0, 0.0
    CRANK_PULSE_IN      = bits,   U16,  34, [0:0]
    INJ_DRV             = bits,   U16,  34, [1:1]
    IGN_DRV             = bits,   U16,  34, [2:2]
    ISV_CW_OPEN         = bits,   U16,  34, [3:3]
    ISV_CCW_CLOSE       = bits,   U16,  34, [4:4]
    STATUS_LED          = bits,   U16,  34, [5:5]
    FUEL_PUMP_DRV       = bits,   U16,  34, [6:6]
    Battery_Voltage     = { BATT_VOLT_RAW * 0.0156 }, "V"
    Manifold_Pressure   = { MAP_RAW * 0.3 }, "kPa"

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?