tervay / recalc

A collaboration focused mechanical design calculator, primarily for FRC
https://reca.lc/
MIT License
20 stars 14 forks source link

Flywheel calculations do not match cited math and might be wrong #842

Open brettle opened 1 year ago

brettle commented 1 year ago

If all slipping has stopped by the time the projectile exits, the projectile speed should be 1/2 of the shooter wheel surface speed. However, that is not what is calculated by https://www.reca.lc/flywheel. The calculations document that is cited on the page seems to assume no slippage, so it isn't clear where the formula that is being used is coming from. From the code, it looks like it might be coming from @juliaschatz's spreadsheet, but that spreadsheet references the same calculation document. Either the formula used or the citation should be updated to make it clear why the formula is correct.

juliaschatz commented 1 year ago

The wheel loses momentum as it's transferred to the projectile. The launch speed is not going to be half of the linear free speed but of the final linear speed.

brettle commented 1 year ago

Agreed, but that's not what the calculator shows.

brettle commented 1 year ago

Specifically, with the default settings it shows a very small difference between the Target Wheel Speed (11000 rpm) and the Estimated Speed After Shot (10564 rpm), but a much larger than expected difference between the Shooter Wheel Surface Speed (287.98 ft/s) and Estimated Projectile Speed (27.69 ft/s).

tervay commented 1 year ago

image

Just pushed some new formulas to the flywheel readme, will be live in a few minutes. The speed transfer percentage has to do with the MOI of the system, but admittedly I'm struggling to remember the derivation. It's the same in Julia's calc.

The default settings have a very stupid 5 pound projectile. Only so much energy can be transferred from the shooter to the projectile. With a constant amount of energy, if mass goes up, velocity must go down. If you decrease projectile weight, you'll see projectile speed go up.

brettle commented 1 year ago

After looking into this some more, the problem appears to be that both @juliaschatz's spreadsheet and the online calculator calculate the final flywheel speed from the final flywheel energy and they calculate the final flywheel energy by subtracting the projectile's energy from the initial flywheel energy. However, that is not the only place the flywheel's energy can go. A lot of energy can be lost to friction, for example. Since the calculations document that all of this is based on assumes that the projectile speed is 1/2 the final wheel surface speed, I recommend changing the spreadsheet and the calculator to calculate the final wheel speed from the calculated projectile speed and wheel radius. In addition, the spreadsheet cell calculating "Energy Lost per Shot" should probably be changed to include all energy lost instead of just the energy imparted to the projectile.

I'll take a shot at a PR for the above change to the calculator, but I think only @juliaschatz can change the spreadsheet.

Side note: @tervay the formula you posted in your last comment and added to the calculator docs isn't quite right. Where you have $r_w/2$, you should have $2 r_w$. The code for the calculator has $2 r_w$ and that also matches (with some manipulation) the formula in the calculations document. I'll try to fix that in my PR as well.