【追記あり】MEMSプロトコルのページ

【追記 2020.10.10】下記のbearinghead.comサイトが見られなくなっていた。検索したところ,こんなサイトを発見。

MEMS Monitor作成の際に参考にしているMEMS のプロトコルが記載されているサイト内でのURLが変更されていた1。サイトのリニューアルにともなうものらしい。

新URL http://www.bearinghead.com/car_stuff/mems_interface/

MEMSとは

MEMSとは, Modular Engine Management System のことで,Roverグループが自社の車の車載制御システムとしてモトローラグループと開発し,1990年代に使用していたもの。魚野が1992年に新車で購入していまだに乗り続けているRover Mini Cooper 1.3iも搭載している。

MEMS Monitorの現状

関数型言語Haskellの学習を兼ねて作成していたMEMSデータの常時読み出し・表示プログラムは,概ね動作するようになった。実装済みの機能としては,1)ECUデータやエラーデータの読み出しと表示(概ね0.4秒サイクル),2)ECUのエラーリセットコマンドの発行,3)ECUコマンド(アクチュエータ操作)の発行の3つ(ただし,3)についてはすべてのコマンドを実装したわけではなく,動作確認のためいくつか実装したのみ)。

(ミニが修理が終わってもどってきたら,動作中の画面を撮影して掲載します)

実装計画中の機能

  • 重ね合わせグラフでの表示
  • 冷却液温度急上昇などの異常検出と警告表示
  • IoT用のSIMで走行中のデータを順次クラウドに送信

動作環境としてはmacOS(High Sierra, Catalina),Haskell(stack)を利用して検証しており,現在,Raspberry Pi(Paspberian)環境下でも動作させられるかの実験中。実験が成功すれば,ラズパイを車載し,モバイルバッテリーあるいは12V電源の変圧で走行時は常時データを表示・採取できるようにしたい。

読み出しているECUデータ

ただし,うちのECU(型式不明)は,駐車またはニュートラルの信号がエアコンオンオフの信号になっている。

    engineSpeed :: Int   -- Engine speed in RPM (16 bits)
  , coolantTemp :: Int   -- Coolant temperature in degrees C with +55 offset and 8-bit wrap
  , ambientTemp :: Int   -- Computed ambient temperature in degrees C with +55 offset and 8-bit wrap
  , intakeATemp :: Int   -- Intake air temperature in degrees C with +55 offset and 8-bit wrap
  , fuelTemp    :: Int   -- Fuel temperature in degrees C with +55 offset and 8-bit wrap. This is not supported on the Mini SPi, and always appears as 0xFF.
  , mapSensor   :: Int   -- MAP sensor value in kilopascals
  , battVoltage :: Float -- Battery voltage, 0.1V per LSB (e.g. 0x7B == 12.3V)
  , throttlePot :: Float -- Throttle pot voltage, 0.02V per LSB. WOT should probably be close to 0xFA or 5.0V.
  , idleSwitch  :: Bool  -- Idle switch. Bit 4 will be set if the throttle is closed, and it will be clear otherwise.
  , unknown0B   :: Word8 -- Unknown. Probably a bitfield. Observed as 0x24 with engine off, and 0x20 with engine running. A single sample during a fifteen minute test drive showed a value of 0x30.
  , pnClosed    :: Int   -- Park/neutral switch. Zero is closed, nonzero is open.
                         -- Fault codes. On the Mini SPi, only two bits in this location are checked:             
  , faultCode1  :: Bool  -- : Coolant temp sensor fault (Code 1)
  , faultCode2  :: Bool  -- : Inlet air temp sensor fault (Code 2)
  , faultCode10 :: Bool  -- : Fuel pump circuit fault (Code 10)
  , faultCode16 :: Bool  -- : Throttle pot circuit fault (Code 16)
  , unknown0F   :: Word8 -- Unknown
  , unknown10   :: Word8 -- Unknown
  , unknown11   :: Word8 -- Unknown
  , idleACMP    :: Int   -- Idle air control motor position. On the Mini SPi's A-series engine, 0 is closed, and 180 is wide open.
  , idleSpdDev  :: Int   -- Idle speed deviation (16 bits)
  , unknown15   :: Word8 -- Unknown
  , ignitionAd  :: Float   -- Ignition advance, 0.5 degrees per LSB with range of -24 deg (0x00) to 103.5 deg (0xFF)
  , coilTime    :: Float   -- Coil time, 0.002 milliseconds per LSB (16 bits)
  , unknown19   :: Word8  -- Unknown
  , unknown1A   :: Word8  -- Unknown
  , unknown1B   :: Word8  -- Unknown
  , lambda_voltage:: Int  -- This lambda value is a calculated value (if it is the same as the British emissions test).     And a value of, say, 1.05, suggests it is 5% too lean.   But, if your oxygen (and CO and HC) readings are all good, then it suggests your high lambda reading is because of a leak in the exhaust wgich pulls in fresh air (and oxygen).     You could try starting your car when it is cold and put your hand over the exhaust pipe and look underneath to see if water is leaking from any if the joints. 
  , closed_loop'  :: Int  -- 0 : Open Loop, others : Closed Loop  
  , fuel_trim'    :: Int  

  1. 著作者の表記が当該サイトにはないので,誰がメンテナンスしているかは不明。当初は某大学のサイトに掲載されていたので,その大学の卒業生が運営しているのではないかと推測。