An interactive tool to simulate balancing the generator switch with your alliance

Look, we all know that every event is going to have exactly one generator switch on the practice field. We know that every alliance is going to want to test their particular robots on it so they know where to climb so that the switch is balanced. Want to skip the line? Just use this tool to simulate climbing with your partners–I built it yesterday, so it’s in a preliminary stage, but all baseline functionality is implemented. Let me know what features you’d like to see! Here’s the link:

http://www.samcfuchs.com/ClimbingSimulator/

30 Likes

This is cool. Can you add a few vertical distance to the floor and have that change as the switch is moved?

2 Likes

This calculator assumes that the robot is swinging and not rigidly attached to the bar so that the robot CG is a fixed point in space relative to the pivot point. Would be really useful to see how that changes things.

1 Like

Could you explain the physics math behind your model? What equations are you using to calculate the angle?

This is true! I chose to model it this way because a given robot’s center of gravity relative to its attachment point is often unknown and variable. Naturally, this increases the complexity of the system considerably. I may implement this later on if people are interested.

This is the formula I derived:

where
mi is the mass of robot i,
di is the distance of that robot from the center of the rung,
h is the vertical distance from the pivot to the rung,
M is the mass of the assembly, and
H is the vertical distance from the pivot to the center of mass of the assembly.

The derivation is a matter of straightforward trigonometry, but if you’d like a proof I can probably draw something up.

1 Like

Here’s another interactive tool that allows drag-and-drop for the robots (and has a couple other nice features): https://www.geogebra.org/m/aapcdzvf

2 Likes

A proof would be awesome. Thanks!

Ya, I just wanted to estimate position of expected robot CG and play with how it behaves. Just needs a height offset to point of CG and robot mass.

1 Like

My team and I have made a python script that uses heights from the ground and assumes the robots stay perpendicular to the rung. This gives a surprising amount more safety in terms of how far away robots can be and the weight difference. I would love to confirm our math with other people, as our math shows just about anything you put up there will balance. (within reason) Here is our python script. It doesn’t have any of the nice graphics and only works for two robots, but hopefully the math makes up for it =D

1 Like

It seems like you’ve taken a more complex approach to the problem than you needed to. If the robots remain fixed relative to the bar, they can be treated as a part of the bar system. Therefore, this procedure will give you an absolute solution:

  1. find the center of mass of the three masses (rung, robots 1 and 2). This will be a point relative the the rung.
  2. find the angle theta of the bar such that that point is directly under the pivot (since this is intuitively the equilibrium).

This way, it’s all just a matter of trigonometry, and it’s actually a simpler problem than the one I solved to make the simulator! This isn’t to discount your solution, which may very well work, I’m just not eager to try to derive the solution to that problem backwards from a python script.

2 Likes

Ah that would have probably been an easier way of doing it. but wasnt what came to me first haha. Thanks for the suggestion, I’ll try a derivation using that approach.

@SamcFuchs Should CENTER_OF_MASS_OFFSET_FT be 2 + 2/12? I know it won’t make that much of a difference in the results but might as well use the number given in the rules

You’re right, I’ve pushed a fix.

1 Like

Your code was pretty readable, so I added a rigid CG offset function (requested by @RoboChair) and sent you a PR on github.

Code is here if folks want to test it offline: GitHub - samneff72/ClimbingSimulator: A one-day D3 project to simulate climbing in FIRST Infinite Recharge

Thanks for your help! The update is live with rigid climber support now.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.