diff --git a/docs/coralator-tuning.md b/docs/coralator-tuning.md new file mode 100644 index 0000000..c7175a0 --- /dev/null +++ b/docs/coralator-tuning.md @@ -0,0 +1,43 @@ +# Coralator Tuning + +The coralator essentially has three degrees of freedom. +Those are height (from the elevator), arm angle, and wrist angle. +Not all of these can be adjusted independently - certain configurations can result in the robot colliding with itself. +We can model the various valid configurations to create what's called a configuration space. +To move our end effector from one position to another, we must ensure that we stay within the confines of the configuration space. + +To define this configuration space, we must consider the bounds of each mechanism. +We'll start with the individual components - the arm and the wrist. +Let's say the arm has a lower limit of -10 degrees and an upper limit of 90 degrees, while the wrist can rotate a full 360 degrees. +The arm is constrained by the drivetran and the elevator, while the wrist isn't constrained. +However, the wrist does have a constraint, but it's dependent on the arms position. +We can use the following diagram to determine the relative angle bettween the arm and the wrist: + +![angle diagram](./imgs/angle-diagram.jpg) + +Doing some trig, we find that the wrist's relative angle to the arm can be found with the following equation: + +$$ +\theta_r = 180-\theta_a-\theta_w +$$ + +Let's say this angle, $\theta_r$, is constrained to the bound \[-120,160\] degrees. +If we graph all of these constraints, this is the result: + +![configuration space](./imgs/configuration-space.png) + +In this graph, the x-axis represents the wrist angle while the y-axis represents the arm angle. +The white space represents all possible valid configurations. +When performing path planning for the coralator, we must ensure that it's path never drifts outside of this configuration space. + +For more details on condiguration spaces and motion planning, check out chapter 16 of [Controls Engineering in FRC](https://file.tavsys.net/control/controls-engineering-in-frc.pdf). + +## Appendix + +**Wrist Angle Diagram:** + +![wrist angle diagram](./imgs/wrist-diagram.jpg) + +**Arm Angle Diagram:** + +![arm angle diagram](./imgs/arm-diagram.jpg) diff --git a/docs/imgs/angle-diagram.jpg b/docs/imgs/angle-diagram.jpg new file mode 100644 index 0000000..3a2485c Binary files /dev/null and b/docs/imgs/angle-diagram.jpg differ diff --git a/docs/imgs/arm-diagram.jpg b/docs/imgs/arm-diagram.jpg new file mode 100644 index 0000000..dd20dc1 Binary files /dev/null and b/docs/imgs/arm-diagram.jpg differ diff --git a/docs/imgs/configuration-space.png b/docs/imgs/configuration-space.png new file mode 100644 index 0000000..1995f03 Binary files /dev/null and b/docs/imgs/configuration-space.png differ diff --git a/docs/imgs/wrist-diagram.jpg b/docs/imgs/wrist-diagram.jpg new file mode 100644 index 0000000..b66debf Binary files /dev/null and b/docs/imgs/wrist-diagram.jpg differ