When my team was thinking about how best to design our flywheel, we wanted to be able to see how changes to our design would affect the maximum and minimum distance we could shoot from. To do this, we created a tool that uses your robot’s launch height and angle to determine the slowest speed you can launch at and make it into the goal at any position.
Here it is:
You can access this tool here, and look at its code on GitHub here.
You can change your launcher’s angle and height, as well as change where in the goal you want to target. I would suggest targetting the middle as it would be most likely to actually get in the goal. The window in the bottom left shows a simulated trajectory of the disk from any point you click on in the field, as well as gives you the raw numbers for distance and speed, which update based on your mouse’s position.
This tool is using purely kinematic modelling and doesn’t account for drag. This means that the numbers will not perfectly reflect reality but if anyone wants to add the math for it, feel free to make a pull request that adds it in.
The Formula
The equation I used is:
Where Dx and Dy are the horizontal and vertical distances, θ is the launch angle, and g is gravity (9.81).
This equation solves for v, or the needed velocity to launch.
When using Dy, be sure to calculate it based on the height of the goal subtracted by the height you launch the disk from.
Please let me know if you have any questions about the tool, I’ll try to show how I got to that formula later, but it’s a bit complicated and will take a little while to write it out.