For starters, my knowledge of control theory in general is very much limited. Additionally this is a purely conceptual discussion, I don’t plan on implementing MPC (I also haven’t seen any implementations in Java) as I simply don’t have the time to implement it this season, and for some other reasons I’ll mention below.

To my understanding, Model Predictive Control (MPC) will iteratively solve for a reference based on the past states, and future states up to a horizon. So could we apply this to solving the necessary initial firing velocity v, and initial firing angle, θ, for this year for reaching an objective point (speaker or amp). Another important point is that because this calculation is iterative (I’m assuming it starts from an initial state and predicts upon each predecessor) in the first place, we could possibly account accurately for the force of drag upon the note?

One immediate caveat I saw with this plan from my initial planning of my team’s math in Desmos is that one: it was impossible to predict because a function cannot be based on values of itself because we need to solve for acceleration, which is based on drag, which in an axis is going to be based on the current θ of the projectile because we need to solve for surface area. Second: this isn’t realistic, nor time efficient if actually implemented. Even if we decide (because recursion is possible programmatically), that we want to simply base our state of the function itself with an input value subtracted by some constant (dt). We would still need to then do this for each and every point along the line (scales badly).

1. Does anybody know if this problem (accounting for both drag and theta while solving) is possible in Desmos?

2. How do your teams plan on optimizing for shooting while moving?

Our current strategy (to answer 2) is to shoot fast and pretend drag doesn’t exist. However, shooting-while-moving is low on our priority list, so we’re not thinking too hard about it.

Right off the bat, something like this would be pretty computation-heavy, given that MPC is re-optimizing an entire cost function at every iteration. For an implementation, you’d probably be writing this in something other than Java that runs on a separate bulky coprocessor.

Honestly, I’ve read your post a few times, and I’m having trouble making sense of it. I don’t understand how MPC is relevant to figuring out which angle/speed to shoot at. Shooting is a physics problem, you want to determine how the ring moves when fired with a given velocity and angular velocity. You could probably do this with simulation, but the way most teams will do it is probably to take a bunch of shots and figure out parameters experimentally. I don’t understand how control methods would be relevant to this. If you have accurate physics model you can simply use it to figure how the piece would fly for a given velocity and angle, and then use search methods to find the proper velocity/angle for a given distance.

The second paragraph is confusing because I’m not sure exactly what you’re trying to solve with desmos. If you are trying to calculate the trajectory of the ring, desmos seems inadequate as a tool to me. The typical physics approach would be to draw a free body diagram of your problem at a given point in time, then write out a differential equation based on the forces in the free body diagram. Then you could get the flight path by analytically solving the differential equation, or using more likely in this case using numerical methods to get a solution for a initial condition. There’s probably Python and C++ libraries that numerical solve diff eqs.

The more practical approach for FRC though is to just experiment and maybe fit a curve to the results.

I was saying that because MPC will solve iteratively for a reference trajectory, we can also simulate the forces upon an object somewhat efficiently by using the previous results to define the new acceleration of an object. But really the purpose of using MPC here was to optimize the velocity and angle we need. Creating a model experimentally is of course easy to find, but the bigger question for me was finding the necessary parameters for that model to predict a trajectory.