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?

モンスターボール開閉モデル

0
Last updated at Posted at 2025-07-10

🔌 CMOSスイッチの電圧動作式と解説


🔹 NMOSスイッチのオン条件(サンプリング時)

$$
V_{\text{GS}} = V_{\text{ctrl}} - V_{\text{in}} > V_{\text{th}}
$$

  • 意味:NMOSトランジスタは、ゲート電圧 $V_{\text{ctrl}}$ がドレイン/ソース電圧 $V_{\text{in}}$ より十分に高いとき導通する。
  • $V_{\text{GS}}$:ゲート-ソース間電圧(スイッチ操作の鍵)
  • $V_{\text{th}}$:NMOSのしきい値電圧(0.3〜0.7V程度)

✅ よって、NMOSスイッチがオンになる条件は:

$$
V_{\text{ctrl}} > V_{\text{in}} + V_{\text{th}}
$$


🔹 PMOSスイッチのオン条件(逆極性)

$$
V_{\text{SG}} = V_{\text{in}} - V_{\text{ctrl}} > |V_{\text{th}}|
\quad \Rightarrow \quad
V_{\text{ctrl}} < V_{\text{in}} - |V_{\text{th}}|
$$

  • PMOSは 低電圧でオン、NMOSは 高電圧でオン
  • 通常、NMOSだけでは高い電圧域を扱えないため、両者を 伝送ゲート(Transmission Gate) として並列使用する

🔋 サンプリング誤差とスイッチオン抵抗の関係

時定数 $\tau$ の定義(CMOSスイッチの遅れ要因):

$$
\tau = R_{\text{on}} \cdot C
$$

  • $R_{\text{on}}$:スイッチがオンのときの等価抵抗(数百Ω〜kΩ)
  • $C$:サンプル&ホールドのキャパシタ

サンプリング電圧の時間変化:

$$
V_{\text{sample}}(t) = V_{\text{in}} \cdot \left( 1 - e^{-t/\tau} \right)
$$

  • 時間 $t$ をかけないと正しく電圧が蓄積されない
  • $t \gg \tau$ で $V_{\text{sample}} \to V_{\text{in}}$

🔄 サンプル&ホールドを含む全体式

$$
\text{Open} =
\begin{cases}
1 & \text{if } \left\lfloor \dfrac{V_{\text{sample}}(t)}{V_{\text{ref}}} \cdot 2^N \right\rfloor \geq D_{\text{th}} \
0 & \text{otherwise}
\end{cases}
\quad \text{with } V_{\text{sample}}(t) = V_{\text{in}} \left( 1 - e^{-t/\tau} \right)
$$


✅ 工学的ポイント

項目 内容
CMOSスイッチ NMOS: $V_{\text{ctrl}} > V_{\text{in}} + V_{\text{th}}$
スイッチ誤差 抵抗成分によりサンプリングが遅延
正確なAD変換条件 $t \gg R_{\text{on}} \cdot C$ のタイミングでADC起動
対策 PMOSと並列にして伝送ゲートに、またはバッファ挿入


🔧 例:実装(Python関数)

# Program Name: poke_ball_open_logic.py
# Creation Date: 20250710
# Overview: Simulate Poké Ball open/close logic from analog input force using ADC thresholding
# Usage: Call is_open(F_input) with a force value to determine if the ball opens (1) or stays closed (0)

def is_open(F_input, k=0.01, Vref=1.0, N=8, Vth=0.6):
    """
    モンスターボール開閉判定関数 / Determine if the Poké Ball opens based on input force.

    Parameters:
    F_input : float
        アナログ入力の物理量(例:押し込み力) / Input force or pressure
    k : float
        センサの変換係数 [V/N] / Sensor gain
    Vref : float
        ADCの基準電圧 [V] / Reference voltage for ADC
    N : int
        ADCのビット数 / Number of ADC bits
    Vth : float
        開くためのしきい電圧 [V] / Voltage threshold to open

    Returns:
    int : 1 (open) or 0 (closed)
    """

    # --- アナログ入力から電圧へ変換 / Convert force to voltage ---
    Vin = k * F_input

    # --- ADC変換 / Analog-to-Digital Conversion ---
    D = int((Vin / Vref) * (2 ** N))  # ADC出力値(整数)

    # --- 開閉しきい値 / Digital threshold corresponding to Vth ---
    Dth = int((Vth / Vref) * (2 ** N))

    # --- 開閉判定 / Digital comparison ---
    return int(D >= Dth)

# --- テスト例 / Example usage ---
if __name__ == "__main__":
    forces = [10, 30, 50, 70, 90]  # N単位の入力力
    for F in forces:
        status = is_open(F)
        print(f"Force: {F} N → {'Open' if status else 'Closed'}")


🧠 応用視点:

フェーズ 技術的構成 物理量 備考
入力 センサー $F$(力など) MEMS加速度/圧力センサ
電圧化 $V = k \cdot F$ 電圧 増幅回路で調整可
スイッチ CMOS 電荷 $Q$ $Q = CV$
ADC SAR, pipeline デジタル $D$ 8bit 推奨
制御判定 論理回路 0 or 1(開閉) マイコン内蔵可能

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?