Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nose develop #7

Merged
merged 9 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Nose/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.vscode
source/trash
pullreq-memo.txt
Binary file added Nose/24thISE_nose.qproj
Binary file not shown.
72 changes: 72 additions & 0 deletions Nose/README.md
Original file line number Diff line number Diff line change
@@ -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/)

### 回路
<img src="images/circuit.png" width="100%">

### PCB
<img src="images/PCB1.png" width="300"><img src="images/PCB2.png" width="400">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この画像最新じゃないので更新してください

## ソフトウェア
### 依存関係
- Wire.h
- CCP.h

## 基礎知識

### ベルヌーイの定理
<img src="images/basic_knowledge/image.png" width="50%">

$$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








Binary file added Nose/dataqsheets/MPX5050.pdf
Binary file not shown.
Binary file added Nose/dataqsheets/mcp3421.pdf
Binary file not shown.
Binary file added Nose/images/PCB1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Nose/images/PCB2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Nose/images/basic_knowledge/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Nose/images/circuit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
244 changes: 244 additions & 0 deletions Nose/memo.ipynb
Original file line number Diff line number Diff line change
@@ -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
}
Binary file added Nose/quadcept_libraries/MCP3421.qcom
Binary file not shown.
Loading
Loading