diff --git a/Nose/.gitignore b/Nose/.gitignore new file mode 100644 index 0000000..539d235 --- /dev/null +++ b/Nose/.gitignore @@ -0,0 +1,3 @@ +.vscode +source/trash +pullreq-memo.txt \ No newline at end of file diff --git a/Nose/24thISE_nose.qproj b/Nose/24thISE_nose.qproj new file mode 100644 index 0000000..3ce7dbf Binary files /dev/null and b/Nose/24thISE_nose.qproj differ diff --git a/Nose/README.md b/Nose/README.md new file mode 100644 index 0000000..c624172 --- /dev/null +++ b/Nose/README.md @@ -0,0 +1,72 @@ +# ノーズ電装 + +## 概要 +- This component has role of sensoring airspeed,temperature and barometic pressure. +- This component communicates with the main electrical compnent via the CAN protocol. +## ハードウェア +### BOM +#### MCU +- Seeduino Xiao RP2040 + +#### Sensor +- AE-BME280 +- MPXV5050DP +#### ADC +- MCP3421 +#### CAN +- MCP25625 +#### Component +##### Capacitor +- [100uF16V 電解コン](https://akizukidenshi.com/catalog/g/gP-05002/) +- [100uF10V 3216](https://akizukidenshi.com/catalog/g/gP-15633/) +- [1uF25V 1608](https://akizukidenshi.com/catalog/g/gP-14526/) +- [0.01uF50V 1608](https://akizukidenshi.com/catalog/g/gP-13387/) +- [470pF50V 1608](https://akizukidenshi.com/catalog/g/gP-09268/) +##### Resisiter +- [100k 1/10W 1608](https://akizukidenshi.com/catalog/g/gR-11792/) +- [49.9k 1/10W 1608](https://akizukidenshi.com/catalog/g/gR-11804/) +- [4.7k 1/10W 1608](https://akizukidenshi.com/catalog/g/gR-14121/) + +### 回路 + + +### PCB + +## ソフトウェア +### 依存関係 +- Wire.h +- CCP.h + +## 基礎知識 + +### ベルヌーイの定理 + + +$$p_1+\frac{1}{2} \rho v_1^2+\rho g z_1=p_2+\frac{1}{2}\rho v_2^2+\rho g z_2=\mathrm{const.}$$ + +https://www.cradle.co.jp/glossary/ja_H/detail0038.html + +ここで空気密度$\rho$について考える.大気の標準組成は + +- $O_2=20.99$ % +- $N_2=78.04$ % +- $CO_2=0.03$ % +- $Ar=0.94$ % + +そこから求まる大気の分子量は +$$M=28.966[\mathrm{g/mol}]$$ +となる.気体の質量密度は, +$$\rho=M\frac{n}{V}=\frac{MP}{RT}$$ +ここで,$R=8.314[\mathrm{Nmmol^{-1}K^{-1}}]$,とすると, +$$\rho=\frac{28.966\times P}{8.314\times T}$$ +とわかる. + +http://sasaki.g1.xrea.com/powerpoint/vaporization-heat/03-Air-density.pdf + + + + + + + + diff --git a/Nose/dataqsheets/MPX5050.pdf b/Nose/dataqsheets/MPX5050.pdf new file mode 100644 index 0000000..3c614c6 Binary files /dev/null and b/Nose/dataqsheets/MPX5050.pdf differ diff --git a/Nose/dataqsheets/mcp3421.pdf b/Nose/dataqsheets/mcp3421.pdf new file mode 100644 index 0000000..fc5bb35 Binary files /dev/null and b/Nose/dataqsheets/mcp3421.pdf differ diff --git a/Nose/images/PCB1.png b/Nose/images/PCB1.png new file mode 100644 index 0000000..e2ee715 Binary files /dev/null and b/Nose/images/PCB1.png differ diff --git a/Nose/images/PCB2.png b/Nose/images/PCB2.png new file mode 100644 index 0000000..133b77c Binary files /dev/null and b/Nose/images/PCB2.png differ diff --git a/Nose/images/basic_knowledge/image.png b/Nose/images/basic_knowledge/image.png new file mode 100644 index 0000000..535ce09 Binary files /dev/null and b/Nose/images/basic_knowledge/image.png differ diff --git a/Nose/images/circuit.png b/Nose/images/circuit.png new file mode 100644 index 0000000..4aed486 Binary files /dev/null and b/Nose/images/circuit.png differ diff --git a/Nose/memo.ipynb b/Nose/memo.ipynb new file mode 100644 index 0000000..7bb9ce6 --- /dev/null +++ b/Nose/memo.ipynb @@ -0,0 +1,244 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Nose関係メモ" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 必要な知識\n", + "### ベルヌーイの定理\n", + "$$p_1+\\frac{1}{2} \\rho v_1^2=p_2+\\frac{1}{2}\\rho v_2^2$$\n", + "\n", + "つまり\n", + "$$v=\\sqrt{\\frac{2|p_1-p_2|}{\\rho}}$$\n", + "\n", + "https://www.cradle.co.jp/glossary/ja_H/detail0038.html" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "ここで空気密度$\\rho$について考える.大気の標準組成はO2:20.99%, N2:78.04%,CO2:0.03%, Ar:0.94%であり,そこから求まる大気の分子量は\n", + "$$M=28.966[\\mathrm{g/mol}]$$\n", + "となる.よって機体の質量密度は,\n", + "$$\\rho=M\\frac{n}{V}=\\frac{MP}{RT}$$\n", + "ここで,$R=8.314[\\mathrm{Nmmol^{-1}K^{-1}}]$,とすると,\n", + "$$\\rho=\\frac{28.966\\times P}{8.314\\times T}$$\n", + "とわかる.\n", + "\n", + "\n", + "http://sasaki.g1.xrea.com/powerpoint/vaporization-heat/03-Air-density.pdf" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "pdiff 17.400954329001497 kPa\n" + ] + } + ], + "source": [ + "#差圧センサ選定用プログラム\n", + "import math\n", + "M=28.966\n", + "R=8.314\n", + "P=101325\n", + "celsius=20\n", + "T=celsius+273.15\n", + "#tagert airspeed\n", + "v=340*0.5\n", + "\n", + "ro=M*P/(R*T)/1000\n", + "# print(\"ro\",ro,\"kg/m^3\")\n", + "P_diff_Pa=(ro*v*v)/2\n", + "P_diff_kPa=P_diff_Pa/1000\n", + "\n", + "print(\"pdiff\",P_diff_kPa,\"kPa\")\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "これを測定できるいい感じの差圧センサはMPXV5050DPだと思う\n", + "\n", + "https://www.digikey.jp/ja/products/detail/nxp-usa-inc/MPXV5050DP/1168433?s=N4IgTCBcDaILIAUAaA1ArABkwEQSAugL5A \n", + "\n", + "このセンサが測定できる最大大気速度は" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v= 288.16908661510917\n" + ] + } + ], + "source": [ + "#差動圧力\n", + "import math\n", + "M=28.966\n", + "R=8.314\n", + "P=101325\n", + "celsius=20\n", + "T=celsius+273.15\n", + "###############\n", + "P_diff_kPa=50\n", + "###############\n", + "P_diff=P_diff_kPa*1000\n", + "\n", + "ro=M*P/(R*T)/1000\n", + "v=math.sqrt(2*P_diff/ro)\n", + "\n", + "print(\"v=\",v)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "よって今回のロケットマッハ0.33を超えていて大丈夫そう." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## ADCの選定\n", + "\n", + "今回用いる5050DPはアナログ値を返すので,それなりのADCが欲しい.でこれ買った\n", + "\n", + "https://akizukidenshi.com/catalog/g/gI-16585/\n", + "\n", + "\n", + "- 電源電圧:2.5~5.5V\n", + "- 消費電流:155μA\n", + "- スタンバイ時電流:0.1μA\n", + "- 分解能(最低):12bit\n", + "- 分解能(最高):18bit\n", + "- データレート(最低):3.75sps\n", + "- データレート(最高):240sps\n", + "- INL:10ppm\n", + "- 内部基準電圧:2.048V\n", + "- インターフェース:I2C\n", + "- 変換方式:デルタシグマ\n", + "- 入力タイプ:差動入力\n", + "- 動作温度範囲:-40~125℃\n", + "- パッケージ:SOT-23-6" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "差圧センサは0~50kPaで0~5Vまで出力する.\n", + "MAXの5Vのとき,ADCにかかる電圧が2.000V位であってほしい\n", + "\n", + "$$V_{adc}=\\frac{R_1}{R_1+R_2}V_{out}$$\n", + "\n", + "のように分圧すればよく,\n", + "$$R_1:R_2=V_{adc}:(V_{out}-V_{adc})$$\n", + "であることがわかる." + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R1:R2=1: 2.048 : 2.952\n" + ] + } + ], + "source": [ + "Vadc=2.048\n", + "Vout=5\n", + "\n", + "print(\"R1:R2=1:\",Vadc,\":\",Vout-Vadc)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "とにかく高精度な抵抗を使って2:3を作り出したい.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1.6644429619746495\n" + ] + } + ], + "source": [ + "R1=100\n", + "R2=49.9\n", + "R=R1+R2\n", + "Vout=5\n", + "print(R2/R*Vout)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "よってGNDよりが $49.9\\mathrm{k \\Omega}$,差圧センサのVout側が $100\\mathrm{k \\Omega}$\n", + "\n", + "https://akizukidenshi.com/catalog/g/gR-11804/\n", + "\n", + "https://akizukidenshi.com/catalog/g/gR-11792/" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/Nose/quadcept_libraries/MCP3421.qcom b/Nose/quadcept_libraries/MCP3421.qcom new file mode 100644 index 0000000..7ceab60 Binary files /dev/null and b/Nose/quadcept_libraries/MCP3421.qcom differ diff --git a/Nose/quadcept_libraries/MCP3421A3T-E_CH.xml b/Nose/quadcept_libraries/MCP3421A3T-E_CH.xml new file mode 100644 index 0000000..5112518 --- /dev/null +++ b/Nose/quadcept_libraries/MCP3421A3T-E_CH.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Nose/quadcept_libraries/MPXVseries.qcom b/Nose/quadcept_libraries/MPXVseries.qcom new file mode 100644 index 0000000..3626e5c Binary files /dev/null and b/Nose/quadcept_libraries/MPXVseries.qcom differ diff --git a/Nose/quadcept_libraries/a.qcom b/Nose/quadcept_libraries/a.qcom new file mode 100644 index 0000000..78e425f Binary files /dev/null and b/Nose/quadcept_libraries/a.qcom differ diff --git a/Nose/quadcept_libraries/xiao_original.qcom b/Nose/quadcept_libraries/xiao_original.qcom new file mode 100644 index 0000000..4b23f96 Binary files /dev/null and b/Nose/quadcept_libraries/xiao_original.qcom differ