KentridgeRobotics / 2021Robot

Other
0 stars 7 forks source link

Testing RPM of the Flywheel #19

Closed adriiennelii closed 3 years ago

adriiennelii commented 3 years ago

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:

  1. Measure a short distance away between the front bumper of the robot and target (ex. 45 inches) and make sure the robot is aligned with the target.
  2. Set hood angle at a constant angle (around 45 degrees) to minimize the amount of differing factors. This is to also make as straight of a curve/arc as possible (hopefully to resemble a linear-ish line to reduce amount of power and time it takes.
  3. Place the backdrop is close as possible behind the robot and target. The backdrop may be made of different colored sheets of paper (maybe 6-12 inch squares for a 30 fps camera? May need to have smaller squares if camera is 60 fps) glued to a large piece of cardboard to be held up. Backdrop should be tall and wide enough so it will cover the distance from the robot to target and height from shooter of robot to target.
  4. Record the ball travelling from the robot shooter to the target, making sure not to zoom in too much. Write a description recording the distance away, and rpm the ball is thrown at.
skallaher commented 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.

skallaher commented 3 years ago

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).

cpdupuis commented 3 years ago

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.