Pre-disclaimer - I only have education up to Calculus II, involving single-variable integration and integration methods such as trig sub, PFD, etc. I have some research under my belt in multi-variable calculus for this project, but it won't take much to overwhelm me, so please be descriptive and explanatory in your answers. Thanks :)
Background: For this problem, I am starting with a function. Let's use f(x) = x^2 for the purposes of this post. However, it could be any function.
The goal is to transform this function into functions of the left and right velocities on a vehicle. I have this completed for the most part in terms of X, using a derivation of the osculating circle formula. I use the osculating circle at any point X to retrieve the radii of two other circles with the osculating circle radius plus or minus half the vehicle width. This creates two circles that represent the instantaneous path of the left and right wheels, given that the current angular velocity remained constant. One we have the circles, given a base target velocity, a simple ratio can be used to calculate the wheel velocities.
This model works in terms of X and can be viewed at https://www.desmos.com/calculator/annwyzwaxm (Under "Robot Properties", modify P to animate the graph. P represents the X coordinate of the robot)
The Question:
This is all fine and dandy, but this model only works in terms of X. On the actual vehicle in question, the only available measures are velocities of each wheel and distance traveled. Distance traveled is synonymous with the arc length between a starting X of 0 and the current X value. In order to make this work, I need a way of solving the arc length integration formula for a function of the unique X value at any given arc length.
Some Things I have Tried/Thought About
Finding the antiderivative of the arc length formula resulted in an expression I could never hope to solve for X with my understanding.
I also attempted approaching from the circular perspective and modeled a differential equation from properties of the osculating circle. Given instantaneous arc travel along the circle, dS, instantaneous change in angle of the arc circle, dtheta, and a dersired derivative of dx/dS so I could integrate for X, I followed this process:
dS/2πR = dθ/2π --- A ratio where R is the radius of the osc. circle.
dθ = dS/R
dx = Rcosdθ --- Standard parametric equation of X in a circle, however this is incorrect because the circle is not always orientated such that θ = 0 is the starting point.
However, the idea was that you could theoretically integrate all of the changes in X due to travel along the varying osculating circles along the function. I am not sure how to carry this idea through though.
Lastly, a friend recommended I do some work with parametric equations to make this easier, but since I have only ever worked with parametrics on circles, I don't know where to begin with this. He didn't either.
Any help would be greatly appreciated!
The idea of using parametric equations is a good one. When you say $y=x^2$ that is the path you want to follow but it doesn't give any information on how fast you want to traverse it. If you say $x=t, y=t^2$ that says you want constant velocity in the $x$ direction and will let the $y$ velocity be whatever it needs to be to follow the path. Now you have the information you need to calculate wheel velocities. A second advantage is you don't have any problem when you travel in exactly the $y$ direction, while with $y=f(x)$ things can break down.
The other change in your approach I would suggest is to think locally instead of globally. Define your desired path parametrically. Then at each time compute where you are and where you should be one or a few time steps ahead. Now you don't need a global solution for the $x$ that corresponds to a certain arc length. You just need to know how much to turn the wheels for the next second or whatever time step makes sense for you. See where you are, where you are pointing now, where you want to be in one second, compute how fast to rotate the wheels to do that, and worry about the next second when you get to it.