Determining Optimal Flywheel RPM if Distance is Known

What up. So I’m wondering, if we know the distance from a target (the middle/inner port of the power port) using a limelight, how can we figure out from there what RPM we need to spin a flywheel to shoot a power cell into the middle port? I’m imaging some kind of equation that takes in distance and maybe angle as input, and spits out an RPM as output. Sorry if this question has already been asked before.

Pretty much. Determine the correct speed experimentally at several distances, then go from there.

2 Likes

Look up projectile motion equations for starters. You’ll need to go slightly faster than most equations calculate, because they don’t account for drag.

2 Likes

It’s going to depend a great deal on how efficiently your shooter system transfers flywheel rpm to ball linear velocity. So while yes, there’s math that can help you do this, you probably need some test shots to inform that math.

What @Billfred said is the best approach - equations are great, but there will be variables that can’t easily be accounted for that’ll definitely screw you up.

For example, if you know the release angle and distance to the goal, the target speed for the ball is rather easy to find - any high school physics teacher can walk you through the equations and how to solve them. But those don’t really take drag or spin into account - a ball with backspin versus a ball with topspin behave very differently, and air resistance does impact the shot a little from the ideal the equations give you.

But how to you get the ball to that speed? A 1-wheel shooter is going to have a different diameter than the ball, which needs to be taken into account. The ball isn’t going to accelerate instantaneously - there will be some “slip”, so the ball is likely to be going slower than the ideal you calculate. Further, the mass of the ball is going to slow down the shooter as it shoots, so the final speed of the wheel when the ball leaves the shooter won’t be the same as when it started (PID loops can try to help with this, but it isn’t always possible…).

Personally, I prefer to start with the math to get an idea of what we need to target for (helps with selection of the motor and gearbox), and then double that for my requirements. If I want to hit 2000 RPM on my shooter, then I want it capable of at least 4000. Then experiment!

If you create an experimental table of distances and successful speeds, you can find a relationship between those (a line of best fit) that’ll give you an equation you can use!

1 Like

This is more complicated than you might think, but we can quickly get some solution the problem ignoring air resistance and spin (in reality, these will probably be significant) and assuming the shooter shoots at a fixed angle, a. We can treat horizontal and vertical speeds separately. Call v the balls initial velocity in ft/s. Then we have initial speeds:

v_{x0} = v * \cos a \\ v_{y0} = v * \sin a

Call the distance between the robot and the goal d, and difference in height between the robot and the goal h. If t_1 is the time when the ball reaches the goal, and y(t) = -16t^2 + v_{y0} * t and x(t) = v_{x0} * t are the balls height and distance with respect to time, then

h = y(t_1) = -16(t_1^2) + v_{y0} * t_1 \\ d = x(t_1) = v_{x0} * t_1

Then, we can solve for t_1 and afterwards v.

t_1 = \frac{d}{v_{x0}} \\ h = \frac{-16 * d^2}{ v_{x0}^2} + \frac{d * v_{y0}}{v_{x0}} \\ h * v^2 (\cos a)^2 = -16 * d^2 + d * v^2 \sin (a) \cos(a) \\ v^2 (h * (\cos a)^2 - d * \cos(a) * \sin(a)) = -16 * d^2 \\ v = \sqrt{\frac{16 * d^2}{d * \cos(a) * \sin(a) - h * (\cos a)^2}}

I did this really quick so it might be wrong (but this desmos graph makes me think I didn’t make any mistakes: https://www.desmos.com/calculator/8hgfjfw3k0). That gives you initial velocity. There’s some discussion of how RPM relates to initial speed in this thread: How to add range One option may be to look at the ball with a high speed camera.

It quickly gets more complicated.

I would instead suggest an experimental method. Take a bunch of measurements of how far the ball travels at different speeds. You may even be able to fit a curve to it. You can use the info from the equations or by thinking about the physics a little to inform your curve. Namely, you can use the fact that v^2 is approximately proportional to d.

Some more mathematical approaches to this basic problem can be found here: Infinite Recharge Ballistics

A good thing to do would be to get a physics teacher to come to one of your meetings and help you out.

As an aside, can I do LaTeX on CD?

2 Likes
3 Likes

As an alternate, you might want to keep it simple and build a shooter that works at a single speed at several reasonable distances to play the game. Then come back and see if automating other distances helps the drive team.

For example, our prototype works at two speeds for every shot we’ve selected in the 2 point goal with some shots hitting the 3. I believe our fine tuning will come in with the 3 point goal.

David

When we took a cut at the mathematics it didn’t align well. On our to do list is to try and measure at various speeds and use test results. I am concerned about the power cell variation somewhat with this approach.

The ‘spinning’ diameter is quite different depending on your flywheel design.

We had a mentor make a program in MatLab. It’s a six degree polynomial for the curve fit and the shape is right. It does look like it needs a fudge factor, though.

We tried the same thing and got a 4th order polynomial. Seems like overfitting to me. Just looking at the data it’s possible that it might be piecewise.

Probably. It was just hashed out to get something. In fact , we haven’t even used it for anything meaningful yet.