Miscellaneous progress
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"execution_count": 27,
|
||||
"id": "76a230d3-e50b-450e-bd40-47d7a9632043",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -33,7 +33,7 @@
|
||||
"sympy.core.symbol.Symbol"
|
||||
]
|
||||
},
|
||||
"execution_count": 2,
|
||||
"execution_count": 27,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
@@ -226,7 +226,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"execution_count": 24,
|
||||
"id": "46c5af02-fc38-4630-a3ab-11275d5c0c0e",
|
||||
"metadata": {
|
||||
"tags": []
|
||||
@@ -234,23 +234,23 @@
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/latex": [
|
||||
"$\\displaystyle \\frac{j_{max} t_{j} \\left(t_{a}^{2} + 3 t_{a} t_{j} + 2 t_{j}^{2} + 2 t_{v} \\left(t_{a} + t_{j}\\right)\\right)}{2}$"
|
||||
],
|
||||
"text/plain": [
|
||||
"{'dt': t_v,\n",
|
||||
" 'da': 0,\n",
|
||||
" 'dv': 0,\n",
|
||||
" 'dp': j_max*t_j*t_v*(t_a + t_j),\n",
|
||||
" 'ae': 0,\n",
|
||||
" 've': j_max*t_j*(t_a + t_j),\n",
|
||||
" 'pe': j_max*t_j*(t_a**2 + 3*t_a*t_j + 2*t_j**2 + 2*t_v*(t_a + t_j))/2}"
|
||||
" ⎛ 2 2 ⎞\n",
|
||||
"jₘₐₓ⋅t_j⋅⎝tₐ + 3⋅tₐ⋅t_j + 2⋅t_j + 2⋅tᵥ⋅(tₐ + t_j)⎠\n",
|
||||
"────────────────────────────────────────────────────\n",
|
||||
" 2 "
|
||||
]
|
||||
},
|
||||
"execution_count": 12,
|
||||
"execution_count": 24,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"p1s4"
|
||||
"p1s4['pe']"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -488,7 +488,7 @@
|
||||
" MP_FRAC = 8 # 8 fractional bits\n",
|
||||
" MP_TICK_PER_SEC = 5000\n",
|
||||
" MP_MM_PER_STEP = 0.000\n",
|
||||
" MP_AMAX = 1\n",
|
||||
" MP_AMAX = 0\n",
|
||||
" "
|
||||
]
|
||||
},
|
||||
@@ -512,7 +512,51 @@
|
||||
"\n",
|
||||
"A small bit of thought is sufficient to show that, assuming that $t$ is always integral, $a$ is always an integral multiple of $j$; $v$ is an integral multiple of $\\frac{j}{2}$, and $p$ is always an integral multiple of $\\frac{j}{6}$\n",
|
||||
"\n",
|
||||
"Thus, our fundamental distance unit is that such that $j_{max} = 6$"
|
||||
"Thus, our fundamental distance unit is that such that $j_{max} = 6$\n",
|
||||
"\n",
|
||||
"Given a $j_{max}$ in $\\frac{mm}{s^3}$, a step size of $S$ mm, and a step frequency of $f$ Hz, we can perform the translations into integral units as follows:\n",
|
||||
"\n",
|
||||
"First, define our distance unit:\n",
|
||||
"$$\\delta = {j_{max} \\over 6 f^3} \\mathrm{mm}$$\n",
|
||||
"\n",
|
||||
"Then we can simply compute the 3 maximums:\n",
|
||||
"\n",
|
||||
"$$\n",
|
||||
"\\begin{aligned}\n",
|
||||
"j^{~\\prime} &= \\frac{j}{\\delta f^3} = 6 \\\\\n",
|
||||
"a^\\prime &= \\frac{a}{\\delta f^2} = \\frac{6af}{j} \\\\\n",
|
||||
"v^\\prime &= \\frac{v}{\\delta f} = \\frac{6vf^2}{j} \\\\\n",
|
||||
"S^\\prime &= \\frac{S}{\\delta} = \\frac{6Sf^3}{j}\n",
|
||||
"\\end{aligned}\n",
|
||||
"$$\n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 32,
|
||||
"id": "db92a1af-fe6d-46e3-ae5f-7944113516c2",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/latex": [
|
||||
"$\\displaystyle \\frac{6 a_{max} f}{j_{max}}$"
|
||||
],
|
||||
"text/plain": [
|
||||
"6⋅aₘₐₓ⋅f\n",
|
||||
"────────\n",
|
||||
" jₘₐₓ "
|
||||
]
|
||||
},
|
||||
"execution_count": 32,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"f, delta = sympy.symbols('f,delta')\n",
|
||||
"(a_max / (f**2 * delta)).subs(delta, j_max / 6 / f**3)"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -530,7 +574,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 21,
|
||||
"execution_count": 23,
|
||||
"id": "f8c41a01-fe9c-495c-8644-600ce88ee2e8",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -545,7 +589,7 @@
|
||||
"⎩ 2 6 ⎭"
|
||||
]
|
||||
},
|
||||
"execution_count": 21,
|
||||
"execution_count": 23,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
@@ -569,7 +613,15 @@
|
||||
"source": [
|
||||
"## Resulting inaccuracy\n",
|
||||
"\n",
|
||||
"Obviously, the step size and optimal segment times calculated above will not be integral. This means that some fudging is necessary to move the correct amount, and some more fudging might be necessary to actually reach the maximum velocity. As a first approximation of this fudging, it is simple to calculate how much "
|
||||
"Obviously, the step size and optimal segment times calculated above will not be integral. This means that some fudging is necessary to move the correct amount, and some more fudging might be necessary to actually reach the maximum velocity.\n",
|
||||
"\n",
|
||||
"This can be done fairly easily by rounding each of the $t_*$ values caclulated using the above formulas down from their exact values. We then have exact values for the position at the end of each segment. By summing those, we can calculate how far the puck would move in each segment, and therefore the total distance moved.\n",
|
||||
"\n",
|
||||
"Now we have only to increase each as appropriate. We can't increase $t_j$ because rounding $t_j$ up would result in accellerating faster than $a_{max}$.\n",
|
||||
"\n",
|
||||
"$t_a$ is definitely underestimated, though, because it assumes that we've actually reached the full accelleration. $\\delta v_3$ remains constant no matter the value of $t_a$, so we can simply calculate $$t_a^\\prime = t_a + {v_{max}-v_4 \\over a_3}$$\n",
|
||||
"\n",
|
||||
"This obviously increases $v_4$ to something closer to the target speed; we'll call the new value $v_4^\\prime$. We then calculate $t_v$"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user