Closed adriiennelii closed 3 years ago
I would take a closer look at what it is that you actually need here.
In the end, what you want to know is the relation between the motor input (-1 to 1) and the velocity of the ball. This is a rather complex relationship since there's friction and air resistance involved.
For now, let's assume that you can achieve whatever angular velocity on the wheel that you like at any given time. This, unfortunately, doesn't directly translate to the speed of the ball as it leaves the shooter. The simplest way to correlate these two is by testing a few different speeds of the wheel and then measuring the speed of the ball. From there, you can approximate the values in between using a best fit.
Extending this further, you can test different inputs to the motor (from 0 to 1, backwards probably isn't a great idea with the shooter) and measure the output velocity to get a general relationship between the two.
If you take this approach, the question is: How do you measure the output velocity of the shooter?
Note: There are probably a few ways to calculate a good enough estimate for this, but a test on the physical robot will usually be more reliable.
After your update, that sounds pretty good, however, your variable other than motor speed is the ball velocity, not distance since distance varies more widely based upon the angle at which the ball is fired. With that, how would you propose to measure the velocity of the ball? (You don't need to figure this out on your own, get help from others if you need it).
Logger Pro is a software package that is available on school laptops, and it has a feature that lets you load a video and determine how fast something in the video is moving. Nicholas suggests that Mr. Simonson would be a good teacher to talk to if you have questions about how it works.
The process I suggest is to check the speed of the ball when the rpm setting is at some maximum value (I think 5000 rpm is the highest we tested last year), then at 3/4 that speed, 1/2 that speed, and at 1/4 that speed. (And note that the speed is 0 when the rpm setting is 0.) This should let you draw a graph showing the relationship between rpm and speed.
We want to be able to translate the speed of the motor into the rpm of the flywheel over a certain distance.
To do that, we want to test different speeds of the motor from 0-1 and record the distances the ball travelled due to its velocity. Since some balls may be flatter or harder than others, there'll probably have to be multiple tests for each distance, just to get an idea of the average ball velocity.
This way, we can make a line of best fit depending on the data collected and create an equation, using the ball velocity as "y" and motor speed as "x." Solving the equation for y, we'll be able to use the motor speed (x) to solve for the ball velocity (y), and write a method in the Shooter Subsystem.
Additional testing steps: