Loaded new mass and inertial characteristics into sim, ported sim arch into arduino code

This commit is contained in:
2026-02-26 12:45:27 -06:00
parent 725f227943
commit 010d997eef
16 changed files with 450 additions and 473 deletions

View File

@@ -2189,14 +2189,14 @@
"id": "21babeb3",
"metadata": {},
"source": [
"### Now, let's find the equilibrium height for our pod, given mass of 5.8 kg. \n",
"### Now, let's find the equilibrium height for our pod, given mass of 9.4 kg. \n",
"\n",
"5.8 kg * 9.81 $m/s^2$ = 56.898 N"
"9.4 kg * 9.81 $m/s^2$ = 56.898 N"
]
},
{
"cell_type": "code",
"execution_count": 50,
"execution_count": 1,
"id": "badbc379",
"metadata": {},
"outputs": [
@@ -2204,23 +2204,27 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Loading maglev model from /Users/adipu/Documents/guadaloop_lev_control/RL Testing/maglev_model.pkl...\n",
"Model loaded. Degree: 6\n",
"Force R2: 1.0000\n",
"Torque R2: 0.9999\n",
"======================================================================\n",
"EQUILIBRIUM GAP HEIGHT FINDER (Analytical Solution)\n",
"======================================================================\n",
"Pod mass: 5.8 kg\n",
"Total weight: 56.898 N\n",
"Target force per yoke: 28.449 N\n",
"Pod mass: 9.4 kg\n",
"Total weight: 92.214 N\n",
"Target force per yoke: 46.107 N\n",
"Parameters: currL = 0 A, currR = 0 A, roll = 0°\n",
"\n",
"using scipy.optimize.fsolve:\n",
" Gap: 16.491742 mm → Force: 28.449000 N\n",
" Gap: 11.857530 mm → Force: 46.107000 N\n",
"\n"
]
}
],
"source": [
"# The following was generated by AI - see [13]\n",
"# Find equilibrium gap height for 5.8 kg pod using polynomial root finding\n",
"# Find equilibrium gap height for 9.4 kg pod using polynomial root finding\n",
"import numpy as np\n",
"from maglev_predictor import MaglevPredictor\n",
"from scipy.optimize import fsolve\n",
@@ -2228,15 +2232,15 @@
"# Initialize predictor\n",
"predictor = MaglevPredictor()\n",
"\n",
"# Target force for 5.8 kg pod (total force = weight)\n",
"# Target force for 9.4 kg pod (total force = weight)\n",
"# Since we have TWO yokes (front and back), each produces this force\n",
"target_force_per_yoke = 5.8 * 9.81 / 2 # 28.449 N per yoke\n",
"target_force_per_yoke = 9.4 * 9.81 / 2 # 28.449 N per yoke\n",
"\n",
"print(\"=\" * 70)\n",
"print(\"EQUILIBRIUM GAP HEIGHT FINDER (Analytical Solution)\")\n",
"print(\"=\" * 70)\n",
"print(f\"Pod mass: 5.8 kg\")\n",
"print(f\"Total weight: {5.8 * 9.81:.3f} N\")\n",
"print(f\"Pod mass: 9.4 kg\")\n",
"print(f\"Total weight: {9.4 * 9.81:.3f} N\")\n",
"print(f\"Target force per yoke: {target_force_per_yoke:.3f} N\")\n",
"print(f\"Parameters: currL = 0 A, currR = 0 A, roll = 0°\")\n",
"print()\n",