Robotics is a broad field.
My experience with robotics is that you can do a huge amount with:
- Trigonometry
- 2x2, 3x3, 4x4 Matrices
- A pinch of calculus
Let's look at some fun things!
- Kinematics
- Inverse Kinematics
- Position Controller
- Machine Learning with Hexapawn
- Computer Vision with MNIST
Forward Kinematics
Given the joint angles,
find the position of the end effector.
Forward Kinematics - 1 Link
Forward Kinematics - 2 Link
Forward Kinematics - n Link
There is too much great math you can explore with kinematics!
\[ \]
Inverse Kinematics
Given a target position,
find the joint angles to move the end effector there.
Inverse Kinematics
IK solutions are typically not unique.
Position Controller
Consider a simple robot arm which we want to move from position \(\theta_{1}\) to position \(\theta_{2}\) beginning at time \(t_{1}\) and ending at time \(t_{2}\).
Position Controller
We can think about the angle changing over time,
and what a function \(\theta(t)\) might look like.
Position Controller - Linear
A linear function \(\theta(t)\) is a line that connects \(\left( t_{1}, \theta_{1} \right)\) to \(\left( t_{2}, \theta_{2} \right)\)
Position Controller - Linear
Find
\[ \theta(t) = a_0 + a_1 t \]
Given
\[ \theta(t_{1}) = \theta_{1} \]
\[ \theta(t_{2}) = \theta_{2} \]
Position Controller - Linear
Find
\[ \theta(t) = a_0 + a_1 t \]
Given
\[ \theta(t_{1}) = \theta_{1} \]
\[ \theta(t_{2}) = \theta_{2} \]
Let's use our example values of changing the position from \(\theta_{1}=1\) to \(\theta_{2}=3\) from time \(t_{1}=2\) to \(t_{2}=8\)
\[ a_0 + a_1 (2) = 1 \]
\[ a_0 + a_1 (8) = 3 \]
Position Controller - Linear
\[ \theta(t) = \frac{1}{3} + \frac{1}{3} t \]
Position Controller - Linear
\[ \theta(t) = \frac{1}{3} + \frac{1}{3} t \]
Position Controller - Quadratic
Find
\[ \theta(t) = a_0 + a_1 t + a_2 t^2 \]
Given
\[ \theta(t_{1}) = \theta_{1} \]
\[ \theta(t_{2}) = \theta_{2} \]
\[ \theta'(t_{1}) = 0 \]
Position Controller - Quadratic
Find
\[ \theta(t) = a_0 + a_1 t + a_2 t^2 \]
Given
\[ \theta(t_{1}) = \theta_{1} \]
\[ \theta(t_{2}) = \theta_{2} \]
\[ \theta'(t_{1}) = 0 \]
Note that
\[ \theta'(t) = \frac{d}{dt} \theta(t) = a_1 + 2 a_2 t \]
Position Controller - Quadratic
Let's use our example values of changing the position from \(\theta_{1}=1\) to \(\theta_{2}=3\) from time \(t_{1}=2\) to \(t_{2}=8\):
\[ a_0 + a_1 (2) + a_2 (2)^2 = 1 \]
\[ a_0 + a_1 (8) + a_2 (8)^2 = 3 \]
\[ a_1 + 2 a_2 (2) = 0 \]
which we solve to get
\[ \theta(t) = \frac{11}{9} + \frac{-2}{9} t + \frac{1}{18} t^2 \]
Position Controller - Quadratic
\[ \theta(t) = \frac{11}{9} + \frac{-2}{9} t + \frac{1}{18} t^2 \]
Position Controller - Cubic
Find
\[ \theta(t) = a_0 + a_1 t + a_2 t^2 + a_3 t^3 \]
Given
\[ \theta(t_{1}) = \theta_{1} \]
\[ \theta(t_{2}) = \theta_{2} \]
\[ \theta'(t_{1}) = 0 \]
\[ \theta'(t_{2}) = 0 \]
Position Controller - Cubic
Find
\[ \theta(t) = a_0 + a_1 t + a_2 t^2 + a_3 t^3 \]
Given
\[ \theta(t_{1}) = \theta_{1} \]
\[ \theta(t_{2}) = \theta_{2} \]
\[ \theta'(t_{1}) = 0 \]
\[ \theta'(t_{2}) = 0 \]
Note now that
\[ \theta'(t) = a_1 + 2 a_2 t + 3 a_3 t^2 \]
Position Controller - Cubic
Let's use our example values of changing the position from \(\theta_{1}=1\) to \(\theta_{2}=3\) from time \(t_{1}=2\) to \(t_{2}=8\):
\[ a_0 + a_1 (2) + a_2(2)^2 + a_3 (2)^3 = 1 \]
\[ a_0 + a_1 (8) + a_2(8)^2 + a_3 (8)^3 = 3 \]
\[ a_1 + 2 a_2 (2) + 3 a_3 (2)^2 = 0 \]
\[ a_1 + 2 a_2 (8) + 3 a_3 (8)^2 = 0 \]
Position Controller - Cubic
\[ \theta(t) = \frac{49}{27} + \frac{-8}{9} t + \frac{5}{18}t^2 + \frac{-1}{54} t^3 \]
Computer Vision Example